Skip to content

C# implementation of grun, the ANTLR grammar test rig.

License

Notifications You must be signed in to change notification settings

Eternal21/grunsharp

This branch is 3 commits behind craigmjohnston/grunsharp:master.

Folders and files

NameName
Last commit message
Last commit date
Apr 30, 2018
Apr 30, 2018
Apr 30, 2018
Apr 30, 2018
Apr 30, 2018
Apr 30, 2018
Apr 30, 2018
Apr 30, 2018
Apr 28, 2018
Apr 30, 2018
Apr 30, 2018
Apr 30, 2018
Apr 30, 2018
Apr 30, 2018
Apr 30, 2018
Apr 30, 2018

Repository files navigation

grunsharp

A C#/WPF implementation of grun, the ANTLR grammar test rig.

As it stands, this is a very basic/rough implementation, but it's enough to run the C# parser/lexer files generated by the ANTLR tool, meaning you can write your additional grammar logic in C# from beginning to end without losing out on being able to use the test rig.

Usage

GrunCS.exe <grammar name> <start rule> <input files>... [--gui] [--tokens] [--config=<path>]

Run from the working directory (containing your generated .cs parser/lexer files).

Config

Optionally, a gruncs.json file can be placed in the working directory (or at a path supplied through the --config option).

An example config file:

{
    "References": [
        "System.Core",
        "System.Text.RegularExpressions"
    ],
    "Include": [
        "AdditionalLogic.extra.cs"
    ]
}
  • References: A list of assemblies to reference, in 3 possible formats:
  • Include: Any additional files (relative paths) to be compiled before the parser is run

Feature coverage

Based on: https://github.com/antlr/antlr4/blob/master/tool/src/org/antlr/v4/gui/TestRig.java

Implemented:

  • --gui
  • --tokens

Might work:

  • --tree

Not implemented:

  • --ps
  • --trace
  • --diagnostics
  • --SLL

About

C# implementation of grun, the ANTLR grammar test rig.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%