[antlr-interest] utility methods in Lexer.

Terence Parr parrt at jguru.com
Fri Oct 25 16:17:08 PDT 2002

On Friday, October 25, 2002, at 01:26  PM, praveen_c wrote:

> How can I create java methods in Lexer? I need a method such as
> isTypeName(). This method will help me reduce the amount of code I
> have to write in a semantic predicate.
> I created a class 'X' that extends antlr.CharScanner, coded the
> method in class 'X' and made my Lexer inherit from
> class 'X'. But when I try to run the grammar through antlr I get the
> following error:

Hi.  Have you checked the examples?  Surely there is an example that 
has a code fragment in the class.  Try

class P extends Parser

public boolean isTypeName() {...}

rule : R ;

Hope this helps,


Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 

More information about the antlr-interest mailing list