1 #ifndef MYLANG_SYNTAX_SPEC_HPP
2 #define MYLANG_SYNTAX_SPEC_HPP
14 template <
class TX =
void>
21 const Input &input, std::string &&value
23 static const std::set<std::string> keywords = {
24 "program",
"function",
"class",
25 "is",
"begin",
"end",
"in",
"out",
"fast",
26 "extends",
"encloses",
27 "type",
"var",
"const",
"static",
"return",
28 "if",
"then",
"for",
"do",
"foreach",
"while",
"elif",
"else",
32 "or",
"xor",
"div",
"mod",
"and",
"shl",
"shr",
"rol",
"ror",
"not"
35 ok = keywords.find(
getText()) == keywords.cend();
virtual bool accepted() const
Definition: mylang_syntax_spec.hpp:40
Definition: myparser_ast.hpp:229
MP_STR("id", 2) RuleId
Definition: mylang_syntax_spec.hpp:10
Definition: mylang_syntax_spec.hpp:15
bool ok
Definition: mylang_syntax_spec.hpp:17
Definition: myparser_ast.hpp:183
#define MP_STR(str, len)
Definition: myparser_str.hpp:9
Definition: myparser_ast.hpp:137
MP_STR("space", 5) BuiltinSpace
Definition: myparser_rule.hpp:10
Definition: myparser_ast.hpp:150
NodeId(const Input &input, std::string &&value)
Definition: mylang_syntax_spec.hpp:20
MP_STR("Illegal identifier", 18) ErrorId
Definition: mylang_syntax_spec.hpp:12
std::string::const_iterator Input
Definition: myparser_ast.hpp:8
Definition: myparser_ast.hpp:214
const std::string & getText() const
Definition: myparser_ast.hpp:177