[antlr-interest] C Runtime and Strings

Jim Idle jimi at temporal-wave.com
Sat Aug 25 10:38:15 PDT 2007


This is just:

I1=IDENTIFIER
{
  //here $I1.text returns the string for it as ANTLR3_STRING
 //      $I1.text->chars is the actual pointer

> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of dev.null.nix at gmail.com
> Sent: Friday, August 24, 2007 5:33 AM
> To: antlr-interest at antlr.org
> Subject: [antlr-interest] C Runtime and Strings
> 
> Hi,
> 
> I have a rule like this in a C target language grammar:
> 
> scoped_identifier : NAMESPACE_COLON? (IDENTIFIER NAMESPACE_COLON)*
> IDENTIFIER;
> 
> I would like to return the string representing scoped_identifier.
> 
> Is there any way to access the buffer location of a token in the input
> buffer (like storing a pointer to the first and the last char).
> 
> And if there is a way, is the input buffer read into one big buffer so
> that it is valid for the whole parser?
> 
> Thanks,
> Stefan


More information about the antlr-interest mailing list