RE: Autotree and repeated expressions

[email protected] ("Orton, Yves")
Newsgroups perl.recdescent
Message-ID <71B318898201D311845C0008C75DAD1C06F1E42B@defra1ex2>
> In simple terms, if I am using autotree to build an OO parse 
> tree and I have
> a rule of the form
> 
> func: 'concat' '(' rvalue ',' rvalue ')'
> 
> how do I access the second rvalue from the blessed object. I 
> can only see one in there.

I _think_ the way to do this is to rework your grammer

func: 'concat' '(' firstval ',' secondval ')'
firstval :rvalue
secondval:rvalue

Usually though when I use autotrees i tend to end up having my terminals
stubbed like:

firstval :rvalue {$return=$item[1]; 1}
secondval:rvalue {$return=$item[1]; 1}

ANyway, just my $.02

Yves
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.