[antlr-interest] How can I emit multiple tokens in a lexer rule, using the C target?

Jim Idle jimi at temporal-wave.com
Wed Jul 21 20:56:56 PDT 2010


A) Yes there are, you just install your own pointer;
B) Yes there is, you just wrap the existing structure in your own,but ther are user definable fields which make things easier than trying to sub class;
C) Yes there is:

 lexer->emit(lexer);					/* Assemble the token and emit it to the stream */

Jim

> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of Billy O'Neal
> Sent: Wednesday, July 21, 2010 7:05 PM
> To: antlr-interest at antlr.org
> Subject: [antlr-interest] How can I emit multiple tokens in a lexer
> rule, using the C target?
> 
> There only seems to be documentation on how to do this using targets
> with object oriented languages, which merely subclass the `emit`
> method and wrap a buffer around it. This becomes a problem for the C
> target of course because A. there are no virtual methods, and B. there
> is no subclassing, and C. there is no (at least that I can find)
> `emit` method.
> 
> Is there a way of accomplishing this with the C target?
> 
> Billy3
> --------------------------------------------------------------
> Intern - PreEmptive Solutions, LLC
> Malware Response Instructor - BleepingComputer.com
> Analyst, Security Team - TechSupportForum.com
> 
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-
> email-address





More information about the antlr-interest mailing list