Thread View: comp.sys.next.programmer
2 messages
2 total messages
Started by Paul Burchard
Tue, 28 Jul 1992 10:19
dynamic parsers?
Author: Paul Burchard
Date: Tue, 28 Jul 1992 10:19
Date: Tue, 28 Jul 1992 10:19
18 lines
1395 bytes
1395 bytes
Anyone know of any decent dynamic parsers out there on the net? (By "dynamic" I mean that grammar rules can be added while the parser is running.) It seems that the bison source could be hacked up to do this, but that's a hefty wheel to reinvent and I'm hoping it's already been done... The story behind this is that I'm in need of a decent Parser object, and stuff like yacc just doesn't lend itself well to OOP. Yacc is really annoying in this regard. With bison, you can at least subclass your Parser to use a different language spec (since there's a flag to alter the names of all those annoying global yyvariables). But you can't incrementally add new rules in your subclasses; you have to start the subclass grammar from scratch. -- -------------------------------------------------------------------- Paul Burchard <burchard@math.utah.edu> ``I'm still learning how to count backwards from infinity...'' --------------------------------------------------------------------
Re: dynamic parsers?
Author: Ulrich Grepel
Date: Tue, 28 Jul 1992 12:25
Date: Tue, 28 Jul 1992 12:25
22 lines
1689 bytes
1689 bytes
In article <1992Jul28.101919.15524@fcom.cc.utah.edu>, burchard@horizon.math.utah.edu (Paul Burchard) writes: |> Anyone know of any decent dynamic parsers out there on the net? (By "dynamic" |> I mean that grammar rules can be added while the parser is running.) |> |> It seems that the bison source could be hacked up to do this, but that's a |> hefty wheel to reinvent and I'm hoping it's already been done... |> Oops! ( ;-) double meaning...) That would not be too easy, because normally you want to add actions to your new rules. If you do not want to write an interpreter, you will have to run the compiler anyway. I think it is not possible to add a rule without a complete rework on the tables. Another thing is that I just went along and 'objected' (or, better, C++-ified) Bison and Flex such that you have a 'main class' that has all the code that is used for all parsers/scanners and several sub-classes that consists of the tables and the special actions. If you have interest in these, e-mail me, but be warned that this code is really not-yet-ready (working at the moment, but not too-well tested...) Uli Grepel
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads