Reference: the ANTLR-like syntax mode

30 May 2016

As of LLLPG 1.7.4, an ANTLR-like syntax mode has been added that makes it easier to port grammars between ANTLR and LLLPG. This mode is used by writing code like

class MyParser : BaseParserForList {
    [/* general options (as usual) */]
    LLLPG (/* code generation options (as usual) */) @{
        /* ANTLR-style rules (that's the new part) */
        myRule [ArgType argument] returns [ReturnType result] : grammar ;
    };
}

In this mode, the LLLPG block can only contain rules (not ordinary C# methods and fields).

Although the outline of each rule uses an ANTLR-like syntax, there are still substantial differences:

Also note: