[antlr-interest] Problem with "Unexpected char" (Antlr 2.7.5)

Jose Ventura jose.ventura.roda at gmail.com
Thu Nov 23 04:08:26 PST 2006


Thank's Dominik for your response.

I think the character '|' is \u007c. I don't know what I'm doing wrong.

Any help?


2006/11/23, Dominik Holenstein <dhantlr at googlemail.com>:
>
> Hi Jose,
>
> Just a thought:
> Perhaps the '|' is not in the range of your charVocabulary definition:
> charVocabulary = '\u0000'..'\uFFEE';
>
>
> Dominik
>
>
>
>
> 2006/11/23, Jose Ventura <jose.ventura.roda at gmail.com>:
> >
> > Antlr 2.7.5
> >
> > Hi, I don't know how to do to recognize the character '|' in the lexer.
> >
> > In the lexer I have:
> >
> >
> > class CobolLex extends Lexer;
> > options
> > {
> > k=1;
> > charVocabulary = '\u0000'..'\uFFEE';
> > caseSensitive=false;
> > caseSensitiveLiterals=false;
> > testLiterals=false;
> > exportVocab=CobolLexVocab;
> > }
> >
> >
> > The error:
> >
> >
> > :\Documents and
> > Settings\JVR3651A\Desktop\call\fuentes\EDO4007.NEW:1313:58: unexpected char:
> > '|'
> > at parser.cobol.CobolLex.nextToken(CobolLex.java:674)
> > at antlr.TokenBuffer.fill (TokenBuffer.java:69)
> > at antlr.TokenBuffer.LA(TokenBuffer.java:80)
> > at antlr.LLkParser.LA(LLkParser.java:52)
> > at parser.cobol.CobolParser.comando_sql(CobolParser.java:14898)
> > at parser.cobol.CobolParser.comando_exec (CobolParser.java:3704)
> > at parser.cobol.CobolParser.comando(CobolParser.java:5582)
> > at parser.cobol.CobolParser.sentencia(CobolParser.java:5490)
> > at parser.cobol.CobolParser.lista_sentencias(CobolParser.java:5356)
> > at parser.cobol.CobolParser.dec_apartado(CobolParser.java:5450)
> > at parser.cobol.CobolParser.parrafos(CobolParser.java:5322)
> > at parser.cobol.CobolParser.procedure_division(CobolParser.java:505)
> > at parser.cobol.CobolParser.source_cobol (CobolParser.java:184)
> > at parser.cobol.CobolParser.programa(CobolParser.java:103)
> > at parser.cobol.ASTCobol.construirAST(ASTCobol.java:82)
> > at parser.cobol.ASTCobol.<init>(ASTCobol.java:49)
> > at bpe.Modulos.main (Modulos.java:98)
> >
> >
> > Know anyone what's the problem?.
> >
> > Thank's in advance.
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20061123/c30845e1/attachment.html 


More information about the antlr-interest mailing list