|Writing a compiler compiler firstname.lastname@example.org (Vladimir Lushnikov) (2006-04-17)|
|Re: Writing a compiler compiler email@example.com (2006-04-17)|
|Re: Writing a compiler compiler firstname.lastname@example.org (Russ Cox) (2006-04-17)|
|RE: Writing a compiler compiler email@example.com (Quinn Tyler Jackson) (2006-04-17)|
|From:||"Vladimir Lushnikov" <firstname.lastname@example.org>|
|Date:||17 Apr 2006 01:36:56 -0400|
|Keywords:||parse, question, comment|
|Posted-Date:||17 Apr 2006 01:36:56 EDT|
Firstly, let it be known that I am quite new to the subject of parser
generators, and having written only simple parsers for frivoulous
grammars by hand have little experience.
My objective is thus - to create a parser generator that will
eventually generate a parser for a dynamic language. However, my
undestanding of different parser types and distinctions between is
minimal; but as the web is a good enough resourse please assume my
knowledge of those areas.
The target for this parser generator would be a language similar to
C#, and I have found Jay (a yacc clone to C# and Java). The initial
implementation language is to be C++.
So here goes my question - how do you start writing a parser generator?
I am probably considering a LALR parser, but what are the main
differences between the different types? Specifically, why is an LR
parser unable to parse Python or C++? [source: Wikipedia]
Thank you for your time,
[These topics are all covered in compiler textbooks, many of which are
listed in the FAQ. Assuming by "dyamic language" you mean that the
syntax can change on the fly, you should learn about Early and Tomita
parsers, and pay particular attention to the reasons that even though
they're technically perfectly sound, few people use them. As to why
an LR parser can't parse Python or C++, LR parsers only handle a
subset of BNF. In particular they can't handle the ambiguity of C++
Return to the
Search the comp.compilers archives again.