in reply to Parsing and executing a psuedo-language

I recommend you give Parse::RecDescent a try, as long as parsing performance isn't likely to be a bottleneck (it's frickin' slow). If you're completely new to parsing you might pick up a copy of O'Reilly's lex & yacc. That was my source-book on a few parsing missions and it served me well.

-sam

  • Comment on Re: Parsing and executing a psuedo-language

Replies are listed 'Best First'.
Re^2: Parsing and executing a psuedo-language
by suaveant (Parson) on May 25, 2005 at 18:44 UTC
    how would one introduce order of operations? In the language definition, or somewhere else? No order of operations
    1+2*3 = 9

    Proper order of operations 1+2*3 = 7

    Others may call it order of precedence... I learned it as PEMDAS in school, parens, exponents, mult, div, add, subtract

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

      This is running in a FastCGI so if the module takes a little while to initiate, that is fine... the language rules could be loaded at initialization too, I assume... If it takes a second or so to parse after all that, that is fine...

      I think Parse::RecDescent should be fine then.

      how would one introduce order of operations? In the language definition, or somewhere else?

      I don't know what you mean by "order of operations".

      -sam