mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-02-11 07:40:41 +00:00
- updaterevision for automated revision string generation - re2c as a prerequisite to use sc_man in the future - zipdir to automatically generate an engine resource file.
55 lines
744 B
C++
55 lines
744 B
C++
#ifndef _RE2C_PARSE_SPEC_
|
|
#define _RE2C_PARSE_SPEC_
|
|
|
|
#include "src/ir/regexp/regexp_rule.h"
|
|
#include "src/parse/rules.h"
|
|
|
|
namespace re2c
|
|
{
|
|
|
|
struct Spec
|
|
{
|
|
RegExp * re;
|
|
rules_t rules;
|
|
|
|
Spec ()
|
|
: re (NULL)
|
|
, rules ()
|
|
{}
|
|
Spec (const Spec & spec)
|
|
: re (spec.re)
|
|
, rules (spec.rules)
|
|
{}
|
|
Spec & operator = (const Spec & spec)
|
|
{
|
|
re = spec.re;
|
|
rules = spec.rules;
|
|
return *this;
|
|
}
|
|
bool add_def (RuleOp * r)
|
|
{
|
|
if (rules.find (rule_rank_t::def ()) != rules.end ())
|
|
{
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
add (r);
|
|
return true;
|
|
}
|
|
}
|
|
void add (RuleOp * r)
|
|
{
|
|
rules[r->rank].line = r->loc.line;
|
|
re = mkAlt (re, r);
|
|
}
|
|
void clear ()
|
|
{
|
|
re = NULL;
|
|
rules.clear ();
|
|
}
|
|
};
|
|
|
|
} // namespace re2c
|
|
|
|
#endif // _RE2C_PARSE_SPEC_
|