i have in my grammar rules:
stmt :
| ident '=' lexp SEMI -> ^(SET ident lexp);
factor :
'-'? (NUMBER |ident )^
....
;
and
lexp : term (SIMOP^ lexp)?;
term : factor (OP^ term)?;
OP : '*' | '/' | '%';
SIMOP : '+' | '-';
and i tried it on different inputs
and for
ID = –5; , ID = 5+3; etc it works, and it build correct tree
bur if i’ll try
ID = 5-3;
i get error:
mismatched input '-' expecting SEMI
i’m using options:
options {
language = Java;
output = AST;
k = 3;
}
can anyone tell me what i should fix?
regards
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address
--
You received this message because you are subscribed to the Google Groups
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/il-antlr-interest?hl=en.