Re: Multiple identifiers for same terminal and rule

[email protected] ((Randal L. Schwartz)) 30 Aug 2003 08:34:11 -0700
Newsgroups perl.recdescent
Organization Stonehenge Consulting Services; Portland, Oregon, USA
Message-ID <[email protected]>
>>>>> "Colin" == Colin Kuskie <[email protected]> writes:

Colin> I often find myself giving identical productions different
Colin> identifiers to make my grammar clearer and to get around the limitation
Colin> of named access only giving the last match to an identifier, like
Colin> the following:

What I've done is define the details once, then just had a simple
rule that renamed it:

cell: cell_or_inst
inst: cell_or_inst
cell_or_inst: /\w+/

Oh, and leave off the { $item[1] } for those.  That's the default. :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[email protected]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!