mTokens is generated but you can install any function you like in its place by 
adding code in the initialization. You should see that the address of the 
static function is just stored in the lexer structures. Just replace the 
pointer with a pointer to your own function. Read through the source though to 
find out what you need to do in that function and the functions that it invokes.

That said, if you are trying to override this function, then you are really 
replacing the lexer. Perhaps you should tell us why you want to override that 
and what you are trying to achieve - maybe there is a better way.

Jim

-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of Fabien Antoine
Sent: Tuesday, March 02, 2010 6:23 AM
To: [email protected]
Subject: [antlr-interest] Extends the lexer in C target

Hi list,

I'm working on a lexer/parser with the C runtime but I need to override
the "mTokens" function in the lexer to create a system of preprocessor.
However, I can't find the way to overwrite it with a clean method...

The "mTokens" function is static so I can't access it and I don't want
to edit by hand the ANTLR's C library to keep it clean.
And it seems to be quite complicated and not progressive to recreate an
other lexer structure with my new functions...

Thanks,

Fabien

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address




List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

-- 
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.

Reply via email to