With the following code fragment, I realise I can access the array
containing the term values using the notation $item[2] as shown below:
SimpleExpression : term (AddOperator )(s?)
{
my $SimpleExpressionArray = $item[2];
my @SimpleExpression = @$SimpleExpressionArray;
}
However,
I am attempting to create a rule that will match any string apart from
those that are keywords in my language.
I have developed the following regular expression, which acheives this,
but, when trying to access a word that is accepted by the regular
expression, via $item[1], nothing is returned ( I
reserved_word: 'AND' | 'OR'
WORD: ...!reserved_word /[a-z0-9]+/i
Using the above grammar, rule WORD fails to match any token that start
with a reserved word (e.g. Andy). That is not what I expected since in
'demo_Cgrammar.pl', we have:
IDENTIFIER: ...!reserved_word /[a-z]\w*/i
I a
Karl Gaissmaier wrote:
> hmmm, I've overseen that the global skip pattern
> is qr/s*/, therefore ANDY is matched as a reserved
> word too, since the token prefix can be just nothing.
> To change the token prefix in the RESERVED rule
> to s+ (<-- see the + instead of *) should help:
Thank you ver
Hello,
Is there a way of supressing the __VALUE__ hash that is added via a single
terminal return in ? Right now I have to play silly little games
on the return values. I realize that I could add my own return handler but
is _so_ nice otherwise.
aa
I'm parsing a list of statements where names must be declared first before
being used. If I detect in an action that a statement uses a name that
hasn't been declared (because I have a hash of the declarations), how can
I cause PRD to report a meaningful error? I know I can return undef from
the a
I wrote:
> PS Please cc me. I'm not subscribed.
and apparently I didn't even manage to send an address! Doh.
Please use dhoworth at mrc-lmb.cam.ac.uk
FWIW, I'm sending via:
http://www.perldiscuss.com/post.php?type=reply&id=481&group=perl.recdescent
and I did fill in my name and address, but they