[antlr-interest] Cannot find symbol UP?

Stephan Opfer stephan.opfer at gmx.net
Fri May 11 01:08:13 PDT 2012


Hi,

so solve this issue, I had to rewrite the following alternatives of the
formula rule:

Alternative ^(NOT LPAREN f3=formula RPAREN) -> ^(NOT $f3)
transformed to NOT LPAREN f3=formula RPAREN -> ^(NOT $f3)

Alternative ^(FORALL VARIABLE formula)
transformed to FORALL VARIABLE formula -> ^(FORALL VARIABLE formula)

Alternative ^(EXISTS VARIABLE formula)
transformed to EXISTS VARIABLE formula -> ^(EXISTS VARIABLE formula)

Stephan

On 05/10/2012 04:39 PM, Stephan Opfer wrote:
> Hi,
> 
> today I tried to add implication and biimplication to my first order
> logic grammar. The code can be generated, but when I press "Debug",
> ANTLRWorks throws and error:
> 
> Test3Parser.java:1218: cannot find symbol
> symbol  : variable UP
> location: class Test3Parser
>                 else if ( (LA6_1==EOF||(LA6_1 >= UP && LA6_1 <=
> BIIMPLY)||LA6_1==IMPLY||LA6_1==OR||LA6_1==RPAREN) ) {
> 
> Do you have any Idea how to solve this problem? As far as I understand,
> it must have something to do with my parser rule "formula":
> 
> formula	:	f1=( ^(NOT atomic)
> 	|	atomic
> 	|	^(NOT LPAREN f3=formula RPAREN) -> ^(NOT $f3)
> 	|	LPAREN f3=formula RPAREN  -> $f3
> 	|	disjunction
> 	| 	^(FORALL VARIABLE formula)
> 	|	^(EXISTS VARIABLE formula)
> 	)	((IMPLY f2=formula -> ^(OR  ^(NOT $f1) $f2)) |	(BIIMPLY f2=formula ->
> ^(AND ^(OR  ^(NOT $f1) $f2) ^(OR  ^(NOT $f2) $f1))))?;
> 
> Please find the complete grammar attached.
> 
> Best Regards,
>   Stephan
> 
> 
> 
> 
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address



More information about the antlr-interest mailing list