[antlr-interest] small problem using antlr -- missing some charactor in generated java code

lin cyrix cyrixlin at yahoo.com
Tue Jan 9 17:56:19 PST 2007


Hello, everyone,

When I use antlr (2.7.5/2.7.7) to translate my calc.g
file into lexer and parser java code, I alwayse find
some letter or charactor losing in the generated java
code. For example :

generated code:(using antlr 2.7.7, ArithLexer.java,
line 616, missing 'I')
/////////////////////////////////////
		match('^');
		if ( _createToken && _token==null &&
_ttype!=Token.SKP ) {
			_token = makeToken(_ttype);
			_token.setText(new String(text.getBuffer(), _begin,
text.length()-_begin));
		}
		_returnToken = _token;
	}
/////////////////////////////////////
there is a missing 'I' in the Token.SKP. In fact, in
calc.g, there is a 'I' in calc.g as the follow:
/////////////
WS    : ( ' '
        | '\t'
        )
        {$setType(Token.SKIP);}
      ;    
//////////////

And there are several other missings in the lexer and
parser too. Can anyone tell me why ? and how to avoid
it ?

Thanys a lot in advance !

Cyrix Lin

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: calc.g
Url: http://www.antlr.org/pipermail/antlr-interest/attachments/20070109/968e774d/attachment.pl 


More information about the antlr-interest mailing list