LexiYaccCircle

From: George Greer (greerga@circlemud.org)
Date: 10/21/01


or not.

For those of you who know what 'lex' (flex) and 'yacc' (bison) are, I've
started on a little gutting of db.c for fun.  So if you understand stuff
like:

parse_zone: KEY_ZON_START INTEGER NEWLINE { want_string = TRUE; }
            STRING                        { want_string = FALSE; }
            INTEGER INTEGER INTEGER INTEGER NEWLINE
            zone_command
            KEY_S NEWLINE

and:

<GRAB_LINE>[^\n]+    { yylval.cp_type = yytext; return LINE; }
<GRAB_LINE>{newline} { linenum++; yylval.cp_type = NULL; return NEWLINE; }
<BITV>{letter}+         { yylval.cp_type = yytext; return LETTERS; }
<BITV>{integer}         { yylval.i_type = atol(yytext); return INTEGER; }
<BITV>{whitespace}+     { /* ZZZzzzz */ }

then you'll see what I mean.  So far: parses (but does not actually load)
objects, mobiles, zones, and rooms.  In the future it'll do shops and help
files. Do -not- actually apply this patch to your MUD, besides the fact
it'll not apply cleanly becaused I based it off my current working set of
CircleMUD and not bpl19.

Just take a look at db_parse.y and db_parse.l.

        http://www.circlemud.org/~greerga/working/lexyacc.patch

The concept came from work I did for a senior project, located at:

        http://www.circlemud.org/~greerga/software/algol60-mu-compiler/

(for the fatally curious)

--
George Greer
greerga@circlemud.org

[ Maybe I should open a "My Software" section to keep
  up with the trend.  At least the license is right.
  Of course, then I'd actually need a web site and a
  photo to go with it. ]

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/06/01 PST