gzdoom/tools/re2c/parser.h
Randy Heit ec17f5a5b9 - Undid some of the changes from lempar.c v1.30->v1.31, because it broke
error handling.
- Fixed: dehsupp/scanner.re defined "}" as the token RPAREN. dehsupp/parse.y
  also defined action_list_def as needing a RBARCE. I'm surprised it worked
  at all before. I guess Lemon really was too accepting.
- Changed the way that xlatcc handles include statements so that I don't need
  to modify the logic of lempar.c. I also discovered that the grammar was
  improperly defined and only accepted the first statement. It worked before
  because Lemon used to accept multiple times before reaching the EOF token.
  I have also verified that it is still generating the proper lumps.
- Removed some unused wadsrc files from the repository.
- Fixed my re2c upgrade.
- Updated lemon.c to v1.53.

SVN r711 (trunk)
2008-01-26 04:33:34 +00:00

56 lines
716 B
C++

/* $Id: parser.h 565 2006-06-05 22:07:13Z helly $ */
#ifndef _parser_h
#define _parser_h
#include "scanner.h"
#include "re.h"
#include <iosfwd>
#include <map>
namespace re2c
{
class Symbol
{
public:
RegExp* re;
static Symbol *find(const SubStr&);
static void ClearTable();
typedef std::map<std::string, Symbol*> SymbolTable;
protected:
Symbol(const SubStr& str)
: re(NULL)
, name(str)
{
}
private:
static SymbolTable symbol_table;
Str name;
#if PEDANTIC
Symbol(const Symbol& oth)
: re(oth.re)
, name(oth.name)
{
}
Symbol& operator = (const Symbol& oth)
{
new(this) Symbol(oth);
return *this;
}
#endif
};
void parse(Scanner&, std::ostream&);
} // end namespace re2c
#endif