[antlr-interest] 2 questions

Martin Probst mail at martin-probst.com
Tue Sep 13 15:45:27 PDT 2005


Hi,
you can have your Lexer return a token on line endings, e.g.
LINEENDING:
  '\n';
and then just match that token in your rule. Or you can of course use
regular expressions ... ;-)

Not necessarily about this, but I really have the impression that many
people who are asking questions on this list would probably be better
off with some regular expressions ...

Martin

Am Dienstag, den 13.09.2005, 15:11 -0700 schrieb Harsh Deshmane:
> Hi,
> 
> I have two questions:
> a. How do you search the archives of the mailing list ?
> b. for the grammar, I need to specifically capture patterns that start from 
> the first character of the line, how do I do that ?
> 
> for example, 
> 
> M43blah  xx yy zz
> 
> Here, the letter "M" in the first location is important.
> Similarly for other key"letters" 
> In regular expressions, it would be "^M" that I am looking for..
> 
> thanks for any help.
> -harsh
> 
> 



More information about the antlr-interest mailing list