[antlr-interest] lexer: display all rules matched

Edwards, Waverly Waverly.Edwards at genesys.com
Tue Aug 28 15:32:04 PDT 2007


I will look into it.
 
Thanks,
 
 
W.

________________________________

From: antlr-interest-bounces at antlr.org
[mailto:antlr-interest-bounces at antlr.org] On Behalf Of Gavin Lambert
Sent: Tuesday, August 28, 2007 5:28 PM
To: Edwards, Waverly; antlr
Subject: Re: [antlr-interest] lexer: display all rules matched


At 08:52 29/08/2007, Edwards, Waverly wrote:


	>> For the purposes of tests, just create an instance of the
lexer and ask it for all the tokens.
	 
	I'll have to more homework as I haven't seen an example of how
this is done.  The only way I've seen this done
	is by chaining together parser or lexical rules and setting an
action to it.  I have two problems with this.
	1.  The starting rule appears to be the type that gets returned
when you chain rules. 
	2.  There isn't a way to determine which lexical rule is being
used to match the text.


No, no parser at all.  You know the code snippet you put in your main
routine to create a lexer and parser, then call the entrypoint of your
parser?  Leave out the bit that creates the parser and calls its
entrypoint, and replace it with some code that reads from the lexer (or
lexer's token stream) directly. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070828/f7d81273/attachment-0001.html 


More information about the antlr-interest mailing list