Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Operator Precedence Parser

by Rhandom (Curate)
on Jun 09, 2006 at 20:29 UTC ( #554546=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
      a + b.c - 1.3 * 2 + 3
    
  2. or download this
      @tree = qw(a + b.c - 1.3 * 2 + 3);
    
  3. or download this
      %found = ('+' => 85, '-' => 85, '*' => 90)
    
  4. or download this
      ['*', ['+', 'a', ['-', 'b.c', 1.3]], ['+', 2, 3]]
    
  5. or download this
    =head1 VARIABLE PARSE TREE
    
    ...
    
        [% USE cet = CGI::Ex::Template %]
        [%~ cet.dump_parse('foo.bar + 2').replace('\s+', ' ') %]
    
  6. or download this
    $OPERATORS = [
        # type      precedence symbols              action (undef means pl
    +ay_operator will handle)
    ...
        ['infix',   45,        ['and', 'AND'],      undef                 
    +                      ],
        ['infix',   40,        ['or', 'OR'],        undef                 
    +                      ],
    ];
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (13)
As of 2015-07-30 14:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (271 votes), past polls