Simplified handling of named definitions in parser.
authorUlya Trofimovich <skvadrik@gmail.com>
Thu, 14 May 2015 11:25:24 +0000 (12:25 +0100)
committerUlya Trofimovich <skvadrik@gmail.com>
Thu, 14 May 2015 11:25:24 +0000 (12:25 +0100)
commit23d0e467828735f1844101e04876cd8a835eaa5e
tree308f3cdda8b8ed5e45c3ee595871cf7e3daedbb7
parent8322a21500836c2949c58eeb11153213a4eed605
Simplified handling of named definitions in parser.

Don't bother with named definitions in lexer, just pass them as
strings to parser. Parser will recognize named definitions, insert
them into symbol table and handle conflicts.

Use simple 'std::map' instead 're2c::Symbol' class (that hides
symbol table in class static member).

Use 'std::string' instead of 're2c::Str'. Due to bison limitations
we have to pass pointers to strings allocated on the heap and
carefully destroy them. The whole thing is quite error prone, so
maybe I'll make a small slab allocator for parser later on.
12 files changed:
re2c/Makefile.am
re2c/bootstrap/parser.cc
re2c/bootstrap/scanner_lex.cc
re2c/bootstrap/y.tab.h
re2c/src/parse/parser.h
re2c/src/parse/parser.ypp
re2c/src/parse/scanner.cc
re2c/src/parse/scanner.h
re2c/src/parse/scanner_lex.re
re2c/src/parse/symbol.cc [deleted file]
re2c/src/parse/symbol.h [deleted file]
re2c/src/parse/token.h