Dear Fellows,
i am merely a hobbyist so please dont mind my observations. but this is what i thought.
why cant that rule names be given multiple names to make grammer more readable for the maker.
specially for lexer rules.
for instance
when function names are similar to variable names
then for function signature rule of kind int fun1 ( int arg ) ;
i cannot write
functionSignature:
TypeName FunName '(' TypeName ArgName ')' ';'
i will have to write it
ID ID '(' ID ID ')';
since all of them have exactly same criteria of match [a-zA-Z_][0-9]
instead if ID could be defined like this
ID @alias{
TypeName, FunName, ArgName
}
: ([a-zA-Z_][0-9])+ ;
now antlr can see that i mean the same thing by different Names.
if such a thing already exist i apologise may i be pointed to that.
Thanks
Regards