ANTLR3.5: I have a NullPointerException on string " "

27 views
Skip to first unread message

Oleksiy Pylypenko

unread,
Mar 31, 2013, 6:31:22 PM3/31/13
to antlr-di...@googlegroups.com
Input string is " " i.e. one space.
I have such rule:
WhiteSpace
    : ('\t' | '\v' | '\f' | ' ' | '\u00A0')    {$channel=HIDDEN;}
    ;
Here is my tokens: [[@0,0:0=' ',<24>,channel=99,1:0], [@1,1:1='<EOF>',<-1>,1:1]]
And during parsing:
Caused by: java.lang.NullPointerException
    at org.antlr.runtime.Parser.getMissingSymbol(Parser.java:73)
    at org.antlr.runtime.BaseRecognizer.recoverFromMismatchedToken(BaseRecognizer.java:611)
    at org.antlr.runtime.BaseRecognizer.match(BaseRecognizer.java:115)

Terence Parr

unread,
Mar 31, 2013, 7:22:20 PM3/31/13
to antlr-di...@googlegroups.com
hi. the error is in the parser somewhere not the lexer. the fact that it provides the first token in your list indicates that the lexer had no problem with it.

T




--
You received this message because you are subscribed to the Google Groups "antlr-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to antlr-discussi...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Dictation in use. Please excuse homophones, malapropisms, and nonsense. 
Reply all
Reply to author
Forward
0 new messages