How to read an identifier?

Oct 29, 2010 at 12:32 PM

Hi,

I'm trying to read a collection of classes using your grammar. I'm adding some rules and I wonder if you could help me reading identifiers.

The code I wrote obviously doesn't work since "identifier" is not a token:

type_or_generic:
    (identifier   '<') => identifier   generic_argument_list
    | identifier
    {
        if( mCurrentClass != null )
        {
            mCurrentClass.Name = $identifier.Text;
        }
    };

$identifier.Text is not valid.

 

What should I do?

 

Thanks!

 

Coordinator
Nov 3, 2010 at 3:20 PM

You just need to use $identifier.text (lowercase t).

Sorry I took so long, I missed this post.

Nov 3, 2010 at 4:30 PM

Thanks!! :)

God! So easy! :)