I'm using antlr IDE for eclipse with antlr 3.4 and have created the following combined grammar to use on propositional logic
grammar Propositional;
options {
language = Java;
}
@header {
package antlr;
}
@lexer::header {
package antlr;
}
formula:expression;
term
: ATOM
| '(' expression ')'
;
negation
: ('~')* term
;
and
: negation (('^') negation)*
;
or
: and (('|') and)*
;
implies
: or (('>') or)*
;
expression
: implies (('#') implies)*
;
ATOM : 'a'..'z'+;
WS : (' ' | '\t')+ {$channel = HIDDEN;};
When I save it says build successful and the interpreter works exactly how I want however the lexer and parser which are generated have many problems such as missing throw statements or incorrect constructors.
Any help would be greatly appreciated, Thanks!