|Generalized parser without generation firstname.lastname@example.org (2004-02-01)|
|Re: Generalized parser without generation email@example.com (Joachim Durchholz) (2004-02-04)|
|Re: Generalized parser without generation derkgwen@HotPOP.com (Derk Gwen) (2004-02-04)|
|Re: Generalized parser without generation firstname.lastname@example.org (Jesse Jones) (2004-02-04)|
|Re: Generalized parser without generation email@example.com (Peter Restall) (2004-02-04)|
|Re: Generalized parser without generation cfc@shell01.TheWorld.com (Chris F Clark) (2004-02-04)|
|Re: Generalized parser without generation firstname.lastname@example.org (2004-02-04)|
|Re: Generalized parser without generation email@example.com (Ray Dillinger) (2004-02-08)|
|From:||firstname.lastname@example.org (Vidar Hokstad)|
|Date:||4 Feb 2004 21:56:48 -0500|
|Posted-Date:||04 Feb 2004 21:56:48 EST|
email@example.com (James Moughan) wrote
> A friend of mine has been given a final year project for which his
> supervisor wants the above; that is, a program which can read in a
> description of a grammar then parse a file using it directly. Users
> must be able to add new grammars at any time without compiling. ...
I can't point you to a specific publicly available tool, but having
written tools like this myself. It's a fairly straightforward thing to
do, as you are basically creating an interpreter that is specialized
for a very small set of operations.
Personally I've built configurable parsers that used an EBNF variation
to specify the parser. Instead of generating a parser all you have to
do is execute the corresponding actions on an input stream instead.
Recursive descent for instance is trivial to do this way, as you only
build a dictionary of productions, and build parse trees for each of
the productions, and then the recursive descent is basically a matter
of descending the parse tree for the grammar until you come across
terminals and match them against the input stream.
I used it for a tool that would take an arbitrary grammar and output
an XML document representing the parse tree for further
transformation. It was quite useful as a way of quickly prototyping
source code transformation tools.
Return to the
Search the comp.compilers archives again.