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

VAUCHER Laurent VAUCHER at fermat.eu
Thu Nov 23 04:34:21 PST 2006


Perhaps you simply don't have a rule that matches it.
 
Do you have a 'catch-all' rule of the style:
 
LOST_CHARACTER : . ;
 
at the end of all rules?

________________________________

De : antlr-interest-bounces at antlr.org [mailto:antlr-interest-bounces at antlr.org] De la part de Jose Ventura
Envoyé : 23 November 2006 13:08
À : ANTLR Interest
Cc : Dominik Holenstein
Objet : Re: [antlr-interest] Problem with "Unexpected char" (Antlr 2.7.5)


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/9419e8b4/attachment.html 


More information about the antlr-interest mailing list