Semantics and error checking

parse trees

syntax

Code generation

Token type issues

analysis

Errors

Visitors/ event listeners

Options

Runtime

lexers

Misc

Raw Sam notes:

can you override rules in a mode?

A : 'x'; mode M; A : 'y';

omg lol

i guess i get what i asked for

i just saw the generated code from the lexer i'm experimenting with

I'm getting error 31 with the construct "x='.' {$x}"

*correction*

x=~'.' {$x}

"X : Y;" in lexer causes NPE in ParserATNFactory if Y doesn't exist

why not emit the serialized ATN as a file next to the .java file? embedded resources are standard practice in java

then the java file is even cleaner and you can't get loader errors

*compile errors

i'll toss in .atn as a potential file extension

tty tomorrow

for output=AST, an empty parser rule results in a compile error because _root0 is not defined.

actually that happens for any empty top-level alternative

so "x : y | ;" gives it

you should either make xContext final, or use a method Create_xContext to construct it

i think BlankGrammarListener should be GrammarListenerBase. among other things GrammarListener and GrammarListenerBase will appear side by side in autocomplete dropdowns

you'll get a small performance boost by allowing a null listener and including "if (listener != null)" in your enterRule and exitRule methods

no need to SuppressWarnings on the listener interface or blank implementation

You can also add @Override to the methods in the blank listener implementation and to the enterRule and exitRule methods in each rule context

something definitely needs to be done about the call to sync()

a minimum of a static LL(1) check for the set that keeps the recognizer in the loop

caching results won't be enough

obviously that's something that can come later

to make it clearer that 0 in enterRule(_localctx, 0) has particular meaning, you could instead generate it as enterRule(_localctx, RULE_x)

should consider making 'mode' and 'locals' context-sensitive keywords. already broke grammars for me and it's pretty easy to distinguish the usage when parsing.

should probably use a copy ctor instead of the copyFrom method

that's exactly what a copy ctor looks like