Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^3: Order of Precedence in Parse::RecDescent grammar

by ikegami (Patriarch)
on Jun 02, 2005 at 17:00 UTC ( [id://462969]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Order of Precedence in Parse::RecDescent grammar
in thread Order of Precedence in Parse::RecDescent grammar

You're giving % higher precedence than *. Are you sure that's correct? According to your grammar, 4*2%3 is equivalent to 4*(2%3) (8) rather than (4*2)%3 (0).

The words op and func are probably redundant. Do you really need to know that something is a op rather than specifically an addition, substratction, multiplication, etc.?

Does extract_quotelike remove the quotes? If so, you have a problem if someone create a string called op or func. That's why I had term in the tree. This is the only level you removed, and it hurts you.

Update: Oops, I'm mistaken on that last one. If it's a ref, it's an op or func. It's it's not, it's a number or string. It's not very orthogonal to flattern terms, but it works for this grammar.

Replies are listed 'Best First'.
Re^4: Order of Precedence in Parse::RecDescent grammar
by suaveant (Parson) on Jun 02, 2005 at 19:54 UTC
    Oh.. my bad... apparently they are equal in precedence... oops. Oh well... that wasn't the only problem, so it was still useful :)

                    - Ant
                    - Some of my best work - (1 2 3)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://462969]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (2)
As of 2024-04-26 03:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found