Berkeley CSUA MOTD:Entry 16105
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2025/07/09 [General] UID:1000 Activity:popular
7/9     

1999/7/11-14 [Computer/SW/Compilers] UID:16105 Activity:high
7/11    Since bison/yacc/(f)lex all act like state machines is there any way
        to implement a program with multiple context parsers (eg. a
        multithreaded network deamon that needs to parse an input)?
        \_ This problem is even worse in OpenGL that employ specialized
           rendering hardware since the GL libraries act on the state of
           the video card.  In other words, there's only one rendering
           pipeline and you can't have multiple GL renderers (except on SGIs).
           \_ that's just sorry-ass driver design. 2D drivers also act
              directly on hardware but have been abstracted to share between
              clients efficiently.
        \_ flex & bison both allow you to specify names for your parser/scanner
        \_ Fuck bison and yak and all that shit!  LINUX RULEZ!  Use Linux
           instead!
           so you can have multiple per program - read the docs.
           \_ name changing wouldn't work if you want to have multiple
              instances of the same parser.  too bad there's no OOP parser.
              \_ There is.  Search for PCCTS and ANTLR.  Current development
                 is in java, but the C++ version still exists.
        \_ search on bison++ and flex++ for generators to get
           C++ encapsulated parser and scanner objects.  these may be
           simple option flags to standard bison and flex these days...
           \_ -+ for flex
2025/07/09 [General] UID:1000 Activity:popular
7/9     

You may also be interested in these entries...
2005/2/18-20 [Computer/SW/Compilers] UID:36229 Activity:nil
2/18    When you need to parse something simple do you usually use (f)lex/yacc
        or just write a recursive-descent parser? I've done both in the past,
        but I can't seem to justify using one approach over the other.
        \_ the point of yacc is so that you can write a grammar for it so that
           when things change you don't have to spend a lot of time
           rewriting your hand-written C/Java recursive-descent parser. For
	...
2004/12/20-21 [Computer/SW/Languages/Java, Computer/SW/Compilers] UID:35368 Activity:kinda low
12/20   Has anyone used the parser generator JavaCC?  Is it just me, or is
        it completely awful?
        \_ what do you need it for? If you need to use the visitor and
           traverse the syntax tree, I recommend JTB, available here
           http://compilers.cs.ucla.edu/jtb  It is built on top of
           javacc and generates visitors that you can extend functionalities
	...