You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
443 B
24 lines
443 B
grammar SemanticPredicateReduction;
|
|
|
|
options {
|
|
language=CSharp3;
|
|
TokenLabelType=CommonToken;
|
|
}
|
|
|
|
@lexer::namespace{Antlr3.Runtime.Test}
|
|
@parser::namespace{Antlr3.Runtime.Test}
|
|
|
|
start : mainprog optional? EOF;
|
|
|
|
mainprog : '(' args ')';
|
|
args : ID ID*;
|
|
|
|
optional: ':' args element ':' args element2;
|
|
element : {true}?=>args2;
|
|
element2: {false}?=>args3;
|
|
args2 : ID ID*;
|
|
args3 : ID ID* ;
|
|
|
|
WS : (' '|'\t'|'\n'|'\r')+;
|
|
ID : ('a'..'z')+;
|