Am 05.03.2014 20:06, schrieb Aditya Shah:
And BTW, for the parser structure I intend to use "Compilers" by "Aho, Lam,
Sethi, Ullman" as a reference book(popularly known as "The Dragonbook").
Oh, that's *ancient*.
> If
anyone can suggest a better reference material please comment below.
Well, "Parsing Techniques - A Practical Guide", by Dick Grune and Ceriel
Jacobs, was mostly cited ten years ago (on comp.compilers anyway).
If you can read German, try Sönke Kannapinn's thesis "Eine
Rekonstruktion der LR-Theorie zur Elimination von Redundanz - mit
Anwendung auf den Bau von ELR-Parsern". If I were to implement a parser
generator, I'd use that - it's the most powerful LR technique where
error messages can be easily linked to grammar rules.
There's a big practial problem with most parser generators: You need to
adapt the grammar so the generator can work with it. Sometimes this
means that the published grammar must be rewritten from scratch. If the
language changes (because the language designer decides it would be nice
to have a new feature), you may have to rewrite the grammar again. This
can become very, very unmanageable.
The one exception is GLR (or "Earley") parsers. The parser generators
accept arbitrary context-free grammars.
The downside is that these parsers will not give you an easy way to
generate meaningful error messages. They'll simply give you zero, one,
or more parses for an input, and that's it. (Well, that was the status
ten, twenty years ago. Things might have improved.)
Finally, please consider what you actually want: Do you want to write a
parser generator, or do you want to write a parser?
The former is quite outside the scope of SymPy.
The latter means you want to *use* a parser generator, not *write* one.
So I'd google for
Python "parser generator"
and pick the one that looks like it's easiest to use.
Just my 2c, hope it helps.
Regards,
Jo
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/53178D90.80007%40durchholz.org.
For more options, visit https://groups.google.com/groups/opt_out.