help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Including the name of a rule in an action


From: Tom Stellard
Subject: Including the name of a rule in an action
Date: Sat, 30 Jan 2010 20:53:48 -0800

I am currently using: yytname[yyr1[yyn]] to access the name of the
rule that each action is associated with.  For example:

program:        classes { printf("rule: %s\n",yytname[yyr1[yyn]]);}
                ;

Is this the recommended way to do this, or is there a better way?
Thanks.

-Tom




reply via email to

[Prev in Thread] Current Thread [Next in Thread]