mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-06 07:51:47 +00:00
pyparsing: fix using deprecated aliases
Deprecated since pyparsing 3.0 and produce runtime warnings. New function work exactly the same, except their name is pep8 compatible.
This commit is contained in:
@@ -94,15 +94,15 @@ PERIOD = Suppress(".")
|
|||||||
HASH = Suppress("#")
|
HASH = Suppress("#")
|
||||||
|
|
||||||
identifier = Word(alphanums + "_")
|
identifier = Word(alphanums + "_")
|
||||||
keyword = Word(alphanums + "_").setParseAction(Keyword)
|
keyword = Word(alphanums + "_").set_parse_action(Keyword)
|
||||||
expression = Forward()
|
expression = Forward()
|
||||||
optional = Group(LBRACK + expression + RBRACK).setParseAction(Optional)
|
optional = Group(LBRACK + expression + RBRACK).set_parse_action(Optional)
|
||||||
repeated = Group(LBRACE + expression + RBRACE).setParseAction(Repeated)
|
repeated = Group(LBRACE + expression + RBRACE).set_parse_action(Repeated)
|
||||||
terminal = quotedString.setParseAction(Terminal)
|
terminal = quotedString.set_parse_action(Terminal)
|
||||||
term = (keyword | terminal | optional | repeated | (LPAREN + expression + RPAREN)).setParseAction(Term)
|
term = (keyword | terminal | optional | repeated | (LPAREN + expression + RPAREN)).set_parse_action(Term)
|
||||||
concat = Group(term + OneOrMore(term)).setParseAction(Concat)
|
concat = Group(term + OneOrMore(term)).set_parse_action(Concat)
|
||||||
factor = concat | term
|
factor = concat | term
|
||||||
union = Group(factor + OneOrMore(VBAR + factor)).setParseAction(Union)
|
union = Group(factor + OneOrMore(VBAR + factor)).set_parse_action(Union)
|
||||||
rule = identifier + EQUALS + expression + PERIOD
|
rule = identifier + EQUALS + expression + PERIOD
|
||||||
|
|
||||||
expression << (union | factor)
|
expression << (union | factor)
|
||||||
@@ -110,7 +110,7 @@ expression << (union | factor)
|
|||||||
grammar = OneOrMore(Group(rule))
|
grammar = OneOrMore(Group(rule))
|
||||||
grammar.ignore(HASH + restOfLine)
|
grammar.ignore(HASH + restOfLine)
|
||||||
|
|
||||||
express = grammar.parseFile(os.path.join(os.path.dirname(__file__), "express.bnf"))
|
express = grammar.parse_file(os.path.join(os.path.dirname(__file__), "express.bnf"))
|
||||||
|
|
||||||
|
|
||||||
def find_bytype(expr, ty, li=None):
|
def find_bytype(expr, ty, li=None):
|
||||||
@@ -184,14 +184,14 @@ while True:
|
|||||||
emitted.add(id)
|
emitted.add(id)
|
||||||
stmt = "(%s)" % expr
|
stmt = "(%s)" % expr
|
||||||
if id in to_combine:
|
if id in to_combine:
|
||||||
stmt = " + ".join(itertools.chain(negated_keywords, ("originalTextFor(Combine%s)" % stmt,)))
|
stmt = " + ".join(itertools.chain(negated_keywords, ("original_text_for(Combine%s)" % stmt,)))
|
||||||
elif id in to_original_text:
|
elif id in to_original_text:
|
||||||
# We use lower() because it better matches the previous default of the CaselessLiterals for individual lexemes and express dictates case-insensitive comparisons anyway
|
# We use lower() because it better matches the previous default of the CaselessLiterals for individual lexemes and express dictates case-insensitive comparisons anyway
|
||||||
stmt = "(originalTextFor%s).addParseAction(tokenMap(str.lower))" % stmt
|
stmt = "(original_text_for%s).add_parse_action(token_map(str.lower))" % stmt
|
||||||
if id not in no_action and not isinstance(expr.contents, Keyword) and not id in to_combine:
|
if id not in no_action and not isinstance(expr.contents, Keyword) and not id in to_combine:
|
||||||
node_type = "ListNode" if "ZeroOrMore" in stmt else "Node"
|
node_type = "ListNode" if "ZeroOrMore" in stmt else "Node"
|
||||||
action = actions.get(id, 'lambda s, loc, t: %s(s, loc, t, rule="%s")' % (node_type, id))
|
action = actions.get(id, 'lambda s, loc, t: %s(s, loc, t, rule="%s")' % (node_type, id))
|
||||||
stmt = "%s.setParseAction(%s)" % (stmt, action)
|
stmt = "%s.set_parse_action(%s)" % (stmt, action)
|
||||||
statements.append('%s = %s("%s")' % (id, stmt, id))
|
statements.append('%s = %s("%s")' % (id, stmt, id))
|
||||||
to_emit -= emitted_in_loop
|
to_emit -= emitted_in_loop
|
||||||
if not emitted_in_loop:
|
if not emitted_in_loop:
|
||||||
@@ -206,14 +206,14 @@ for id in sorted(to_emit):
|
|||||||
if id in to_combine:
|
if id in to_combine:
|
||||||
stmt = "Suppress%s" % stmt
|
stmt = "Suppress%s" % stmt
|
||||||
elif id in to_original_text:
|
elif id in to_original_text:
|
||||||
stmt = "(originalTextFor%s).addParseAction(tokenMap(str.lower))" % stmt
|
stmt = "(original_text_for%s).add_parse_action(token_map(str.lower))" % stmt
|
||||||
if id not in no_action and not isinstance(expr.contents, Keyword):
|
if id not in no_action and not isinstance(expr.contents, Keyword):
|
||||||
children = list(
|
children = list(
|
||||||
map(operator.attrgetter("contents"), reduce(lambda x, y: x | y, (find_bytype(e, Keyword) for e in [expr])))
|
map(operator.attrgetter("contents"), reduce(lambda x, y: x | y, (find_bytype(e, Keyword) for e in [expr])))
|
||||||
)
|
)
|
||||||
has_duplicates = len(children) > len(set(children))
|
has_duplicates = len(children) > len(set(children))
|
||||||
node_type = "ListNode" if ("ZeroOrMore" in stmt or has_duplicates) else "Node"
|
node_type = "ListNode" if ("ZeroOrMore" in stmt or has_duplicates) else "Node"
|
||||||
action = ".setParseAction(%s)" % (
|
action = ".set_parse_action(%s)" % (
|
||||||
actions[id] if id in actions else 'lambda s, loc, t: %s(s, loc, t, rule="%s")' % (node_type, id)
|
actions[id] if id in actions else 'lambda s, loc, t: %s(s, loc, t, rule="%s")' % (node_type, id)
|
||||||
)
|
)
|
||||||
stmt = "(%s)%s" % (stmt, action)
|
stmt = "(%s)%s" % (stmt, action)
|
||||||
@@ -244,7 +244,7 @@ def parse(fn: str) -> mapping.Mapping:
|
|||||||
|
|
||||||
syntax.ignore("--" + restOfLine)
|
syntax.ignore("--" + restOfLine)
|
||||||
syntax.ignore(Regex(r"\((?:\*(?:[^*]*\*+)+?\))"))
|
syntax.ignore(Regex(r"\((?:\*(?:[^*]*\*+)+?\))"))
|
||||||
ast = syntax.parseFile(fn)
|
ast = syntax.parse_file(fn)
|
||||||
s = schema.Schema(ast)
|
s = schema.Schema(ast)
|
||||||
m = mapping.Mapping(s)
|
m = mapping.Mapping(s)
|
||||||
|
|
||||||
|
|||||||
@@ -18,183 +18,183 @@ def parse(fn: str) -> mapping.Mapping:
|
|||||||
with open(cache_file, "rb") as f:
|
with open(cache_file, "rb") as f:
|
||||||
m = pickle.load(f)
|
m = pickle.load(f)
|
||||||
else:
|
else:
|
||||||
ABS = (CaselessKeyword("abs")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ABS"))("ABS")
|
ABS = (CaselessKeyword("abs")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="ABS"))("ABS")
|
||||||
ABSTRACT = (CaselessKeyword("abstract")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ABSTRACT"))("ABSTRACT")
|
ABSTRACT = (CaselessKeyword("abstract")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="ABSTRACT"))("ABSTRACT")
|
||||||
ACOS = (CaselessKeyword("acos")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ACOS"))("ACOS")
|
ACOS = (CaselessKeyword("acos")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="ACOS"))("ACOS")
|
||||||
AGGREGATE = (CaselessKeyword("aggregate")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="AGGREGATE"))("AGGREGATE")
|
AGGREGATE = (CaselessKeyword("aggregate")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="AGGREGATE"))("AGGREGATE")
|
||||||
ALIAS = (CaselessKeyword("alias")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ALIAS"))("ALIAS")
|
ALIAS = (CaselessKeyword("alias")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="ALIAS"))("ALIAS")
|
||||||
AND = (CaselessKeyword("and")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="AND"))("AND")
|
AND = (CaselessKeyword("and")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="AND"))("AND")
|
||||||
ANDOR = (CaselessKeyword("andor")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ANDOR"))("ANDOR")
|
ANDOR = (CaselessKeyword("andor")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="ANDOR"))("ANDOR")
|
||||||
ARRAY = (CaselessKeyword("array")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ARRAY"))("ARRAY")
|
ARRAY = (CaselessKeyword("array")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="ARRAY"))("ARRAY")
|
||||||
AS = (CaselessKeyword("as")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="AS"))("AS")
|
AS = (CaselessKeyword("as")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="AS"))("AS")
|
||||||
ASIN = (CaselessKeyword("asin")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ASIN"))("ASIN")
|
ASIN = (CaselessKeyword("asin")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="ASIN"))("ASIN")
|
||||||
ATAN = (CaselessKeyword("atan")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ATAN"))("ATAN")
|
ATAN = (CaselessKeyword("atan")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="ATAN"))("ATAN")
|
||||||
BAG = (CaselessKeyword("bag")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="BAG"))("BAG")
|
BAG = (CaselessKeyword("bag")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="BAG"))("BAG")
|
||||||
BASED_ON = (CaselessKeyword("based_on")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="BASED_ON"))("BASED_ON")
|
BASED_ON = (CaselessKeyword("based_on")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="BASED_ON"))("BASED_ON")
|
||||||
BEGIN = (CaselessKeyword("begin")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="BEGIN"))("BEGIN")
|
BEGIN = (CaselessKeyword("begin")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="BEGIN"))("BEGIN")
|
||||||
BINARY = (CaselessKeyword("binary")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="BINARY"))("BINARY")
|
BINARY = (CaselessKeyword("binary")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="BINARY"))("BINARY")
|
||||||
BLENGTH = (CaselessKeyword("blength")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="BLENGTH"))("BLENGTH")
|
BLENGTH = (CaselessKeyword("blength")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="BLENGTH"))("BLENGTH")
|
||||||
BOOLEAN = (CaselessKeyword("boolean")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="BOOLEAN"))("BOOLEAN")
|
BOOLEAN = (CaselessKeyword("boolean")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="BOOLEAN"))("BOOLEAN")
|
||||||
BY = (CaselessKeyword("by")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="BY"))("BY")
|
BY = (CaselessKeyword("by")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="BY"))("BY")
|
||||||
CASE = (CaselessKeyword("case")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="CASE"))("CASE")
|
CASE = (CaselessKeyword("case")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="CASE"))("CASE")
|
||||||
CONSTANT = (CaselessKeyword("constant")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="CONSTANT"))("CONSTANT")
|
CONSTANT = (CaselessKeyword("constant")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="CONSTANT"))("CONSTANT")
|
||||||
CONST_E = (CaselessKeyword("const_e")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="CONST_E"))("CONST_E")
|
CONST_E = (CaselessKeyword("const_e")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="CONST_E"))("CONST_E")
|
||||||
COS = (CaselessKeyword("cos")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="COS"))("COS")
|
COS = (CaselessKeyword("cos")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="COS"))("COS")
|
||||||
DERIVE = (CaselessKeyword("derive")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="DERIVE"))("DERIVE")
|
DERIVE = (CaselessKeyword("derive")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="DERIVE"))("DERIVE")
|
||||||
DIV = (CaselessKeyword("div")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="DIV"))("DIV")
|
DIV = (CaselessKeyword("div")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="DIV"))("DIV")
|
||||||
ELSE = (CaselessKeyword("else")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ELSE"))("ELSE")
|
ELSE = (CaselessKeyword("else")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="ELSE"))("ELSE")
|
||||||
END = (CaselessKeyword("end")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="END"))("END")
|
END = (CaselessKeyword("end")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="END"))("END")
|
||||||
END_ALIAS = (CaselessKeyword("end_alias")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="END_ALIAS"))("END_ALIAS")
|
END_ALIAS = (CaselessKeyword("end_alias")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="END_ALIAS"))("END_ALIAS")
|
||||||
END_CASE = (CaselessKeyword("end_case")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="END_CASE"))("END_CASE")
|
END_CASE = (CaselessKeyword("end_case")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="END_CASE"))("END_CASE")
|
||||||
END_CONSTANT = (CaselessKeyword("end_constant")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="END_CONSTANT"))("END_CONSTANT")
|
END_CONSTANT = (CaselessKeyword("end_constant")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="END_CONSTANT"))("END_CONSTANT")
|
||||||
END_ENTITY = (CaselessKeyword("end_entity")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="END_ENTITY"))("END_ENTITY")
|
END_ENTITY = (CaselessKeyword("end_entity")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="END_ENTITY"))("END_ENTITY")
|
||||||
END_FUNCTION = (CaselessKeyword("end_function")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="END_FUNCTION"))("END_FUNCTION")
|
END_FUNCTION = (CaselessKeyword("end_function")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="END_FUNCTION"))("END_FUNCTION")
|
||||||
END_IF = (CaselessKeyword("end_if")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="END_IF"))("END_IF")
|
END_IF = (CaselessKeyword("end_if")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="END_IF"))("END_IF")
|
||||||
END_LOCAL = (CaselessKeyword("end_local")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="END_LOCAL"))("END_LOCAL")
|
END_LOCAL = (CaselessKeyword("end_local")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="END_LOCAL"))("END_LOCAL")
|
||||||
END_PROCEDURE = (CaselessKeyword("end_procedure")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="END_PROCEDURE"))("END_PROCEDURE")
|
END_PROCEDURE = (CaselessKeyword("end_procedure")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="END_PROCEDURE"))("END_PROCEDURE")
|
||||||
END_REPEAT = (CaselessKeyword("end_repeat")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="END_REPEAT"))("END_REPEAT")
|
END_REPEAT = (CaselessKeyword("end_repeat")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="END_REPEAT"))("END_REPEAT")
|
||||||
END_RULE = (CaselessKeyword("end_rule")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="END_RULE"))("END_RULE")
|
END_RULE = (CaselessKeyword("end_rule")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="END_RULE"))("END_RULE")
|
||||||
END_SCHEMA = (CaselessKeyword("end_schema")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="END_SCHEMA"))("END_SCHEMA")
|
END_SCHEMA = (CaselessKeyword("end_schema")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="END_SCHEMA"))("END_SCHEMA")
|
||||||
END_SUBTYPE_CONSTRAINT = (CaselessKeyword("end_subtype_constraint")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="END_SUBTYPE_CONSTRAINT"))("END_SUBTYPE_CONSTRAINT")
|
END_SUBTYPE_CONSTRAINT = (CaselessKeyword("end_subtype_constraint")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="END_SUBTYPE_CONSTRAINT"))("END_SUBTYPE_CONSTRAINT")
|
||||||
END_TYPE = (CaselessKeyword("end_type")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="END_TYPE"))("END_TYPE")
|
END_TYPE = (CaselessKeyword("end_type")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="END_TYPE"))("END_TYPE")
|
||||||
ENTITY = (CaselessKeyword("entity")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ENTITY"))("ENTITY")
|
ENTITY = (CaselessKeyword("entity")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="ENTITY"))("ENTITY")
|
||||||
ENUMERATION = (CaselessKeyword("enumeration")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ENUMERATION"))("ENUMERATION")
|
ENUMERATION = (CaselessKeyword("enumeration")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="ENUMERATION"))("ENUMERATION")
|
||||||
ESCAPE = (CaselessKeyword("escape")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ESCAPE"))("ESCAPE")
|
ESCAPE = (CaselessKeyword("escape")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="ESCAPE"))("ESCAPE")
|
||||||
EXISTS = (CaselessKeyword("exists")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="EXISTS"))("EXISTS")
|
EXISTS = (CaselessKeyword("exists")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="EXISTS"))("EXISTS")
|
||||||
EXTENSIBLE = (CaselessKeyword("extensible")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="EXTENSIBLE"))("EXTENSIBLE")
|
EXTENSIBLE = (CaselessKeyword("extensible")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="EXTENSIBLE"))("EXTENSIBLE")
|
||||||
EXP = (CaselessKeyword("exp")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="EXP"))("EXP")
|
EXP = (CaselessKeyword("exp")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="EXP"))("EXP")
|
||||||
FALSE = (CaselessKeyword("false")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="FALSE"))("FALSE")
|
FALSE = (CaselessKeyword("false")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="FALSE"))("FALSE")
|
||||||
FIXED = (CaselessKeyword("fixed")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="FIXED"))("FIXED")
|
FIXED = (CaselessKeyword("fixed")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="FIXED"))("FIXED")
|
||||||
FOR = (CaselessKeyword("for")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="FOR"))("FOR")
|
FOR = (CaselessKeyword("for")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="FOR"))("FOR")
|
||||||
FORMAT = (CaselessKeyword("format")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="FORMAT"))("FORMAT")
|
FORMAT = (CaselessKeyword("format")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="FORMAT"))("FORMAT")
|
||||||
FROM = (CaselessKeyword("from")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="FROM"))("FROM")
|
FROM = (CaselessKeyword("from")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="FROM"))("FROM")
|
||||||
FUNCTION = (CaselessKeyword("function")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="FUNCTION"))("FUNCTION")
|
FUNCTION = (CaselessKeyword("function")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="FUNCTION"))("FUNCTION")
|
||||||
GENERIC = (CaselessKeyword("generic")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="GENERIC"))("GENERIC")
|
GENERIC = (CaselessKeyword("generic")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="GENERIC"))("GENERIC")
|
||||||
GENERIC_ENTITY = (CaselessKeyword("generic_entity")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="GENERIC_ENTITY"))("GENERIC_ENTITY")
|
GENERIC_ENTITY = (CaselessKeyword("generic_entity")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="GENERIC_ENTITY"))("GENERIC_ENTITY")
|
||||||
HIBOUND = (CaselessKeyword("hibound")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="HIBOUND"))("HIBOUND")
|
HIBOUND = (CaselessKeyword("hibound")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="HIBOUND"))("HIBOUND")
|
||||||
HIINDEX = (CaselessKeyword("hiindex")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="HIINDEX"))("HIINDEX")
|
HIINDEX = (CaselessKeyword("hiindex")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="HIINDEX"))("HIINDEX")
|
||||||
IF = (CaselessKeyword("if")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="IF"))("IF")
|
IF = (CaselessKeyword("if")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="IF"))("IF")
|
||||||
IN = (CaselessKeyword("in")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="IN"))("IN")
|
IN = (CaselessKeyword("in")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="IN"))("IN")
|
||||||
INSERT = (CaselessKeyword("insert")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="INSERT"))("INSERT")
|
INSERT = (CaselessKeyword("insert")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="INSERT"))("INSERT")
|
||||||
INTEGER = (CaselessKeyword("integer")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="INTEGER"))("INTEGER")
|
INTEGER = (CaselessKeyword("integer")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="INTEGER"))("INTEGER")
|
||||||
INVERSE = (CaselessKeyword("inverse")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="INVERSE"))("INVERSE")
|
INVERSE = (CaselessKeyword("inverse")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="INVERSE"))("INVERSE")
|
||||||
LENGTH = (CaselessKeyword("length")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="LENGTH"))("LENGTH")
|
LENGTH = (CaselessKeyword("length")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="LENGTH"))("LENGTH")
|
||||||
LIKE = (CaselessKeyword("like")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="LIKE"))("LIKE")
|
LIKE = (CaselessKeyword("like")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="LIKE"))("LIKE")
|
||||||
LIST = (CaselessKeyword("list")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="LIST"))("LIST")
|
LIST = (CaselessKeyword("list")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="LIST"))("LIST")
|
||||||
LOBOUND = (CaselessKeyword("lobound")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="LOBOUND"))("LOBOUND")
|
LOBOUND = (CaselessKeyword("lobound")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="LOBOUND"))("LOBOUND")
|
||||||
LOCAL = (CaselessKeyword("local")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="LOCAL"))("LOCAL")
|
LOCAL = (CaselessKeyword("local")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="LOCAL"))("LOCAL")
|
||||||
LOG = (CaselessKeyword("log")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="LOG"))("LOG")
|
LOG = (CaselessKeyword("log")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="LOG"))("LOG")
|
||||||
LOG10 = (CaselessKeyword("log10")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="LOG10"))("LOG10")
|
LOG10 = (CaselessKeyword("log10")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="LOG10"))("LOG10")
|
||||||
LOG2 = (CaselessKeyword("log2")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="LOG2"))("LOG2")
|
LOG2 = (CaselessKeyword("log2")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="LOG2"))("LOG2")
|
||||||
LOGICAL = (CaselessKeyword("logical")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="LOGICAL"))("LOGICAL")
|
LOGICAL = (CaselessKeyword("logical")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="LOGICAL"))("LOGICAL")
|
||||||
LOINDEX = (CaselessKeyword("loindex")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="LOINDEX"))("LOINDEX")
|
LOINDEX = (CaselessKeyword("loindex")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="LOINDEX"))("LOINDEX")
|
||||||
MOD = (CaselessKeyword("mod")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="MOD"))("MOD")
|
MOD = (CaselessKeyword("mod")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="MOD"))("MOD")
|
||||||
NOT = (CaselessKeyword("not")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="NOT"))("NOT")
|
NOT = (CaselessKeyword("not")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="NOT"))("NOT")
|
||||||
NUMBER = (CaselessKeyword("number")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="NUMBER"))("NUMBER")
|
NUMBER = (CaselessKeyword("number")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="NUMBER"))("NUMBER")
|
||||||
NVL = (CaselessKeyword("nvl")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="NVL"))("NVL")
|
NVL = (CaselessKeyword("nvl")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="NVL"))("NVL")
|
||||||
ODD = (CaselessKeyword("odd")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ODD"))("ODD")
|
ODD = (CaselessKeyword("odd")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="ODD"))("ODD")
|
||||||
OF = (CaselessKeyword("of")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="OF"))("OF")
|
OF = (CaselessKeyword("of")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="OF"))("OF")
|
||||||
ONEOF = (CaselessKeyword("oneof")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ONEOF"))("ONEOF")
|
ONEOF = (CaselessKeyword("oneof")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="ONEOF"))("ONEOF")
|
||||||
OPTIONAL = (CaselessKeyword("optional")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="OPTIONAL"))("OPTIONAL")
|
OPTIONAL = (CaselessKeyword("optional")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="OPTIONAL"))("OPTIONAL")
|
||||||
OR = (CaselessKeyword("or")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="OR"))("OR")
|
OR = (CaselessKeyword("or")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="OR"))("OR")
|
||||||
OTHERWISE = (CaselessKeyword("otherwise")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="OTHERWISE"))("OTHERWISE")
|
OTHERWISE = (CaselessKeyword("otherwise")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="OTHERWISE"))("OTHERWISE")
|
||||||
PI = (CaselessKeyword("pi")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="PI"))("PI")
|
PI = (CaselessKeyword("pi")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="PI"))("PI")
|
||||||
PROCEDURE = (CaselessKeyword("procedure")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="PROCEDURE"))("PROCEDURE")
|
PROCEDURE = (CaselessKeyword("procedure")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="PROCEDURE"))("PROCEDURE")
|
||||||
QUERY = (CaselessKeyword("query")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="QUERY"))("QUERY")
|
QUERY = (CaselessKeyword("query")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="QUERY"))("QUERY")
|
||||||
REAL = (CaselessKeyword("real")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="REAL"))("REAL")
|
REAL = (CaselessKeyword("real")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="REAL"))("REAL")
|
||||||
REFERENCE = (CaselessKeyword("reference")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="REFERENCE"))("REFERENCE")
|
REFERENCE = (CaselessKeyword("reference")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="REFERENCE"))("REFERENCE")
|
||||||
REMOVE = (CaselessKeyword("remove")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="REMOVE"))("REMOVE")
|
REMOVE = (CaselessKeyword("remove")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="REMOVE"))("REMOVE")
|
||||||
RENAMED = (CaselessKeyword("renamed")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="RENAMED"))("RENAMED")
|
RENAMED = (CaselessKeyword("renamed")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="RENAMED"))("RENAMED")
|
||||||
REPEAT = (CaselessKeyword("repeat")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="REPEAT"))("REPEAT")
|
REPEAT = (CaselessKeyword("repeat")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="REPEAT"))("REPEAT")
|
||||||
RETURN = (CaselessKeyword("return")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="RETURN"))("RETURN")
|
RETURN = (CaselessKeyword("return")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="RETURN"))("RETURN")
|
||||||
ROLESOF = (CaselessKeyword("rolesof")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ROLESOF"))("ROLESOF")
|
ROLESOF = (CaselessKeyword("rolesof")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="ROLESOF"))("ROLESOF")
|
||||||
RULE = (CaselessKeyword("rule")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="RULE"))("RULE")
|
RULE = (CaselessKeyword("rule")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="RULE"))("RULE")
|
||||||
SCHEMA = (CaselessKeyword("schema")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="SCHEMA"))("SCHEMA")
|
SCHEMA = (CaselessKeyword("schema")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="SCHEMA"))("SCHEMA")
|
||||||
SELECT = (CaselessKeyword("select")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="SELECT"))("SELECT")
|
SELECT = (CaselessKeyword("select")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="SELECT"))("SELECT")
|
||||||
SELF = (CaselessKeyword("self")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="SELF"))("SELF")
|
SELF = (CaselessKeyword("self")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="SELF"))("SELF")
|
||||||
SET = (CaselessKeyword("set")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="SET"))("SET")
|
SET = (CaselessKeyword("set")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="SET"))("SET")
|
||||||
SIN = (CaselessKeyword("sin")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="SIN"))("SIN")
|
SIN = (CaselessKeyword("sin")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="SIN"))("SIN")
|
||||||
SIZEOF = (CaselessKeyword("sizeof")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="SIZEOF"))("SIZEOF")
|
SIZEOF = (CaselessKeyword("sizeof")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="SIZEOF"))("SIZEOF")
|
||||||
SKIP = (CaselessKeyword("skip")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="SKIP"))("SKIP")
|
SKIP = (CaselessKeyword("skip")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="SKIP"))("SKIP")
|
||||||
SQRT = (CaselessKeyword("sqrt")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="SQRT"))("SQRT")
|
SQRT = (CaselessKeyword("sqrt")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="SQRT"))("SQRT")
|
||||||
STRING = (CaselessKeyword("string")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="STRING"))("STRING")
|
STRING = (CaselessKeyword("string")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="STRING"))("STRING")
|
||||||
SUBTYPE = (CaselessKeyword("subtype")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="SUBTYPE"))("SUBTYPE")
|
SUBTYPE = (CaselessKeyword("subtype")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="SUBTYPE"))("SUBTYPE")
|
||||||
SUBTYPE_CONSTRAINT = (CaselessKeyword("subtype_constraint")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="SUBTYPE_CONSTRAINT"))("SUBTYPE_CONSTRAINT")
|
SUBTYPE_CONSTRAINT = (CaselessKeyword("subtype_constraint")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="SUBTYPE_CONSTRAINT"))("SUBTYPE_CONSTRAINT")
|
||||||
SUPERTYPE = (CaselessKeyword("supertype")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="SUPERTYPE"))("SUPERTYPE")
|
SUPERTYPE = (CaselessKeyword("supertype")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="SUPERTYPE"))("SUPERTYPE")
|
||||||
TAN = (CaselessKeyword("tan")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="TAN"))("TAN")
|
TAN = (CaselessKeyword("tan")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="TAN"))("TAN")
|
||||||
THEN = (CaselessKeyword("then")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="THEN"))("THEN")
|
THEN = (CaselessKeyword("then")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="THEN"))("THEN")
|
||||||
TO = (CaselessKeyword("to")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="TO"))("TO")
|
TO = (CaselessKeyword("to")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="TO"))("TO")
|
||||||
TOTAL_OVER = (CaselessKeyword("total_over")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="TOTAL_OVER"))("TOTAL_OVER")
|
TOTAL_OVER = (CaselessKeyword("total_over")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="TOTAL_OVER"))("TOTAL_OVER")
|
||||||
TRUE = (CaselessKeyword("true")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="TRUE"))("TRUE")
|
TRUE = (CaselessKeyword("true")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="TRUE"))("TRUE")
|
||||||
TYPE = (CaselessKeyword("type")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="TYPE"))("TYPE")
|
TYPE = (CaselessKeyword("type")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="TYPE"))("TYPE")
|
||||||
TYPEOF = (CaselessKeyword("typeof")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="TYPEOF"))("TYPEOF")
|
TYPEOF = (CaselessKeyword("typeof")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="TYPEOF"))("TYPEOF")
|
||||||
UNIQUE = (CaselessKeyword("unique")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="UNIQUE"))("UNIQUE")
|
UNIQUE = (CaselessKeyword("unique")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="UNIQUE"))("UNIQUE")
|
||||||
UNKNOWN = (CaselessKeyword("unknown")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="UNKNOWN"))("UNKNOWN")
|
UNKNOWN = (CaselessKeyword("unknown")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="UNKNOWN"))("UNKNOWN")
|
||||||
UNTIL = (CaselessKeyword("until")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="UNTIL"))("UNTIL")
|
UNTIL = (CaselessKeyword("until")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="UNTIL"))("UNTIL")
|
||||||
USE = (CaselessKeyword("use")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="USE"))("USE")
|
USE = (CaselessKeyword("use")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="USE"))("USE")
|
||||||
USEDIN = (CaselessKeyword("usedin")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="USEDIN"))("USEDIN")
|
USEDIN = (CaselessKeyword("usedin")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="USEDIN"))("USEDIN")
|
||||||
VALUE = (CaselessKeyword("value")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="VALUE"))("VALUE")
|
VALUE = (CaselessKeyword("value")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="VALUE"))("VALUE")
|
||||||
VALUE_IN = (CaselessKeyword("value_in")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="VALUE_IN"))("VALUE_IN")
|
VALUE_IN = (CaselessKeyword("value_in")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="VALUE_IN"))("VALUE_IN")
|
||||||
VALUE_UNIQUE = (CaselessKeyword("value_unique")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="VALUE_UNIQUE"))("VALUE_UNIQUE")
|
VALUE_UNIQUE = (CaselessKeyword("value_unique")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="VALUE_UNIQUE"))("VALUE_UNIQUE")
|
||||||
VAR = (CaselessKeyword("var")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="VAR"))("VAR")
|
VAR = (CaselessKeyword("var")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="VAR"))("VAR")
|
||||||
WHERE = (CaselessKeyword("where")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="WHERE"))("WHERE")
|
WHERE = (CaselessKeyword("where")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="WHERE"))("WHERE")
|
||||||
WHILE = (CaselessKeyword("while")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="WHILE"))("WHILE")
|
WHILE = (CaselessKeyword("while")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="WHILE"))("WHILE")
|
||||||
WITH = (CaselessKeyword("with")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="WITH"))("WITH")
|
WITH = (CaselessKeyword("with")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="WITH"))("WITH")
|
||||||
XOR = (CaselessKeyword("xor")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="XOR"))("XOR")
|
XOR = (CaselessKeyword("xor")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="XOR"))("XOR")
|
||||||
bit = ((CaselessLiteral("0") | CaselessLiteral("1"))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="bit"))("bit")
|
bit = ((CaselessLiteral("0") | CaselessLiteral("1"))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="bit"))("bit")
|
||||||
digit = ((CaselessLiteral("0") | CaselessLiteral("1") | CaselessLiteral("2") | CaselessLiteral("3") | CaselessLiteral("4") | CaselessLiteral("5") | CaselessLiteral("6") | CaselessLiteral("7") | CaselessLiteral("8") | CaselessLiteral("9")))("digit")
|
digit = ((CaselessLiteral("0") | CaselessLiteral("1") | CaselessLiteral("2") | CaselessLiteral("3") | CaselessLiteral("4") | CaselessLiteral("5") | CaselessLiteral("6") | CaselessLiteral("7") | CaselessLiteral("8") | CaselessLiteral("9")))("digit")
|
||||||
digits = ((digit + ZeroOrMore(digit)))("digits")
|
digits = ((digit + ZeroOrMore(digit)))("digits")
|
||||||
hex_digit = ((digit | CaselessLiteral("a") | CaselessLiteral("b") | CaselessLiteral("c") | CaselessLiteral("d") | CaselessLiteral("e") | CaselessLiteral("f"))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="hex_digit"))("hex_digit")
|
hex_digit = ((digit | CaselessLiteral("a") | CaselessLiteral("b") | CaselessLiteral("c") | CaselessLiteral("d") | CaselessLiteral("e") | CaselessLiteral("f"))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="hex_digit"))("hex_digit")
|
||||||
letter = ((CaselessLiteral("a") | CaselessLiteral("b") | CaselessLiteral("c") | CaselessLiteral("d") | CaselessLiteral("e") | CaselessLiteral("f") | CaselessLiteral("g") | CaselessLiteral("h") | CaselessLiteral("i") | CaselessLiteral("j") | CaselessLiteral("k") | CaselessLiteral("l") | CaselessLiteral("m") | CaselessLiteral("n") | CaselessLiteral("o") | CaselessLiteral("p") | CaselessLiteral("q") | CaselessLiteral("r") | CaselessLiteral("s") | CaselessLiteral("t") | CaselessLiteral("u") | CaselessLiteral("v") | CaselessLiteral("w") | CaselessLiteral("x") | CaselessLiteral("y") | CaselessLiteral("z")))("letter")
|
letter = ((CaselessLiteral("a") | CaselessLiteral("b") | CaselessLiteral("c") | CaselessLiteral("d") | CaselessLiteral("e") | CaselessLiteral("f") | CaselessLiteral("g") | CaselessLiteral("h") | CaselessLiteral("i") | CaselessLiteral("j") | CaselessLiteral("k") | CaselessLiteral("l") | CaselessLiteral("m") | CaselessLiteral("n") | CaselessLiteral("o") | CaselessLiteral("p") | CaselessLiteral("q") | CaselessLiteral("r") | CaselessLiteral("s") | CaselessLiteral("t") | CaselessLiteral("u") | CaselessLiteral("v") | CaselessLiteral("w") | CaselessLiteral("x") | CaselessLiteral("y") | CaselessLiteral("z")))("letter")
|
||||||
not_paren_star_quote_special = ((CaselessLiteral("!") | CaselessLiteral("#") | CaselessLiteral("$") | CaselessLiteral("%") | CaselessLiteral("&") | CaselessLiteral("+") | CaselessLiteral(",") | CaselessLiteral("-") | CaselessLiteral(".") | CaselessLiteral("/") | CaselessLiteral(":") | CaselessLiteral(";") | CaselessLiteral("<") | CaselessLiteral("=") | CaselessLiteral(">") | CaselessLiteral("?") | CaselessLiteral("@") | CaselessLiteral("[") | CaselessLiteral("\\") | CaselessLiteral("]") | CaselessLiteral("^") | CaselessLiteral("_") | CaselessLiteral("{") | CaselessLiteral("|") | CaselessLiteral("}") | CaselessLiteral("~")))("not_paren_star_quote_special")
|
not_paren_star_quote_special = ((CaselessLiteral("!") | CaselessLiteral("#") | CaselessLiteral("$") | CaselessLiteral("%") | CaselessLiteral("&") | CaselessLiteral("+") | CaselessLiteral(",") | CaselessLiteral("-") | CaselessLiteral(".") | CaselessLiteral("/") | CaselessLiteral(":") | CaselessLiteral(";") | CaselessLiteral("<") | CaselessLiteral("=") | CaselessLiteral(">") | CaselessLiteral("?") | CaselessLiteral("@") | CaselessLiteral("[") | CaselessLiteral("\\") | CaselessLiteral("]") | CaselessLiteral("^") | CaselessLiteral("_") | CaselessLiteral("{") | CaselessLiteral("|") | CaselessLiteral("}") | CaselessLiteral("~")))("not_paren_star_quote_special")
|
||||||
not_paren_star_special = ((not_paren_star_quote_special | CaselessLiteral("\"\""))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="not_paren_star_special"))("not_paren_star_special")
|
not_paren_star_special = ((not_paren_star_quote_special | CaselessLiteral("\"\""))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="not_paren_star_special"))("not_paren_star_special")
|
||||||
not_quote = ((not_paren_star_quote_special | letter | digit | CaselessLiteral("(") | CaselessLiteral(")") | CaselessLiteral("*")))("not_quote")
|
not_quote = ((not_paren_star_quote_special | letter | digit | CaselessLiteral("(") | CaselessLiteral(")") | CaselessLiteral("*")))("not_quote")
|
||||||
octet = ((hex_digit + hex_digit)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="octet"))("octet")
|
octet = ((hex_digit + hex_digit)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="octet"))("octet")
|
||||||
special = ((not_paren_star_quote_special | CaselessLiteral("(") | CaselessLiteral(")") | CaselessLiteral("*") | CaselessLiteral("\"\""))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="special"))("special")
|
special = ((not_paren_star_quote_special | CaselessLiteral("(") | CaselessLiteral(")") | CaselessLiteral("*") | CaselessLiteral("\"\""))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="special"))("special")
|
||||||
binary_literal = ((CaselessLiteral("%") + bit + ZeroOrMore(bit))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="binary_literal"))("binary_literal")
|
binary_literal = ((CaselessLiteral("%") + bit + ZeroOrMore(bit))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="binary_literal"))("binary_literal")
|
||||||
integer_literal = (digits)("integer_literal")
|
integer_literal = (digits)("integer_literal")
|
||||||
simple_id = ~CaselessKeyword("abs") + ~CaselessKeyword("abstract") + ~CaselessKeyword("acos") + ~CaselessKeyword("aggregate") + ~CaselessKeyword("alias") + ~CaselessKeyword("and") + ~CaselessKeyword("andor") + ~CaselessKeyword("array") + ~CaselessKeyword("as") + ~CaselessKeyword("asin") + ~CaselessKeyword("atan") + ~CaselessKeyword("bag") + ~CaselessKeyword("based_on") + ~CaselessKeyword("begin") + ~CaselessKeyword("binary") + ~CaselessKeyword("blength") + ~CaselessKeyword("boolean") + ~CaselessKeyword("by") + ~CaselessKeyword("case") + ~CaselessKeyword("const_e") + ~CaselessKeyword("constant") + ~CaselessKeyword("cos") + ~CaselessKeyword("derive") + ~CaselessKeyword("div") + ~CaselessKeyword("else") + ~CaselessKeyword("end") + ~CaselessKeyword("end_alias") + ~CaselessKeyword("end_case") + ~CaselessKeyword("end_constant") + ~CaselessKeyword("end_entity") + ~CaselessKeyword("end_function") + ~CaselessKeyword("end_if") + ~CaselessKeyword("end_local") + ~CaselessKeyword("end_procedure") + ~CaselessKeyword("end_repeat") + ~CaselessKeyword("end_rule") + ~CaselessKeyword("end_schema") + ~CaselessKeyword("end_subtype_constraint") + ~CaselessKeyword("end_type") + ~CaselessKeyword("entity") + ~CaselessKeyword("enumeration") + ~CaselessKeyword("escape") + ~CaselessKeyword("exists") + ~CaselessKeyword("exp") + ~CaselessKeyword("extensible") + ~CaselessKeyword("false") + ~CaselessKeyword("fixed") + ~CaselessKeyword("for") + ~CaselessKeyword("format") + ~CaselessKeyword("from") + ~CaselessKeyword("function") + ~CaselessKeyword("generic") + ~CaselessKeyword("generic_entity") + ~CaselessKeyword("hibound") + ~CaselessKeyword("hiindex") + ~CaselessKeyword("if") + ~CaselessKeyword("in") + ~CaselessKeyword("insert") + ~CaselessKeyword("integer") + ~CaselessKeyword("inverse") + ~CaselessKeyword("length") + ~CaselessKeyword("like") + ~CaselessKeyword("list") + ~CaselessKeyword("lobound") + ~CaselessKeyword("local") + ~CaselessKeyword("log") + ~CaselessKeyword("log10") + ~CaselessKeyword("log2") + ~CaselessKeyword("logical") + ~CaselessKeyword("loindex") + ~CaselessKeyword("mod") + ~CaselessKeyword("not") + ~CaselessKeyword("number") + ~CaselessKeyword("nvl") + ~CaselessKeyword("odd") + ~CaselessKeyword("of") + ~CaselessKeyword("oneof") + ~CaselessKeyword("optional") + ~CaselessKeyword("or") + ~CaselessKeyword("otherwise") + ~CaselessKeyword("pi") + ~CaselessKeyword("procedure") + ~CaselessKeyword("query") + ~CaselessKeyword("real") + ~CaselessKeyword("reference") + ~CaselessKeyword("remove") + ~CaselessKeyword("renamed") + ~CaselessKeyword("repeat") + ~CaselessKeyword("return") + ~CaselessKeyword("rolesof") + ~CaselessKeyword("rule") + ~CaselessKeyword("schema") + ~CaselessKeyword("select") + ~CaselessKeyword("self") + ~CaselessKeyword("set") + ~CaselessKeyword("sin") + ~CaselessKeyword("sizeof") + ~CaselessKeyword("skip") + ~CaselessKeyword("sqrt") + ~CaselessKeyword("string") + ~CaselessKeyword("subtype") + ~CaselessKeyword("subtype_constraint") + ~CaselessKeyword("supertype") + ~CaselessKeyword("tan") + ~CaselessKeyword("then") + ~CaselessKeyword("to") + ~CaselessKeyword("total_over") + ~CaselessKeyword("true") + ~CaselessKeyword("type") + ~CaselessKeyword("typeof") + ~CaselessKeyword("unique") + ~CaselessKeyword("unknown") + ~CaselessKeyword("until") + ~CaselessKeyword("use") + ~CaselessKeyword("usedin") + ~CaselessKeyword("value") + ~CaselessKeyword("value_in") + ~CaselessKeyword("value_unique") + ~CaselessKeyword("var") + ~CaselessKeyword("where") + ~CaselessKeyword("while") + ~CaselessKeyword("with") + ~CaselessKeyword("xor") + originalTextFor(Combine((letter + ZeroOrMore((letter | digit | CaselessLiteral("_"))))))("simple_id")
|
simple_id = ~CaselessKeyword("abs") + ~CaselessKeyword("abstract") + ~CaselessKeyword("acos") + ~CaselessKeyword("aggregate") + ~CaselessKeyword("alias") + ~CaselessKeyword("and") + ~CaselessKeyword("andor") + ~CaselessKeyword("array") + ~CaselessKeyword("as") + ~CaselessKeyword("asin") + ~CaselessKeyword("atan") + ~CaselessKeyword("bag") + ~CaselessKeyword("based_on") + ~CaselessKeyword("begin") + ~CaselessKeyword("binary") + ~CaselessKeyword("blength") + ~CaselessKeyword("boolean") + ~CaselessKeyword("by") + ~CaselessKeyword("case") + ~CaselessKeyword("const_e") + ~CaselessKeyword("constant") + ~CaselessKeyword("cos") + ~CaselessKeyword("derive") + ~CaselessKeyword("div") + ~CaselessKeyword("else") + ~CaselessKeyword("end") + ~CaselessKeyword("end_alias") + ~CaselessKeyword("end_case") + ~CaselessKeyword("end_constant") + ~CaselessKeyword("end_entity") + ~CaselessKeyword("end_function") + ~CaselessKeyword("end_if") + ~CaselessKeyword("end_local") + ~CaselessKeyword("end_procedure") + ~CaselessKeyword("end_repeat") + ~CaselessKeyword("end_rule") + ~CaselessKeyword("end_schema") + ~CaselessKeyword("end_subtype_constraint") + ~CaselessKeyword("end_type") + ~CaselessKeyword("entity") + ~CaselessKeyword("enumeration") + ~CaselessKeyword("escape") + ~CaselessKeyword("exists") + ~CaselessKeyword("exp") + ~CaselessKeyword("extensible") + ~CaselessKeyword("false") + ~CaselessKeyword("fixed") + ~CaselessKeyword("for") + ~CaselessKeyword("format") + ~CaselessKeyword("from") + ~CaselessKeyword("function") + ~CaselessKeyword("generic") + ~CaselessKeyword("generic_entity") + ~CaselessKeyword("hibound") + ~CaselessKeyword("hiindex") + ~CaselessKeyword("if") + ~CaselessKeyword("in") + ~CaselessKeyword("insert") + ~CaselessKeyword("integer") + ~CaselessKeyword("inverse") + ~CaselessKeyword("length") + ~CaselessKeyword("like") + ~CaselessKeyword("list") + ~CaselessKeyword("lobound") + ~CaselessKeyword("local") + ~CaselessKeyword("log") + ~CaselessKeyword("log10") + ~CaselessKeyword("log2") + ~CaselessKeyword("logical") + ~CaselessKeyword("loindex") + ~CaselessKeyword("mod") + ~CaselessKeyword("not") + ~CaselessKeyword("number") + ~CaselessKeyword("nvl") + ~CaselessKeyword("odd") + ~CaselessKeyword("of") + ~CaselessKeyword("oneof") + ~CaselessKeyword("optional") + ~CaselessKeyword("or") + ~CaselessKeyword("otherwise") + ~CaselessKeyword("pi") + ~CaselessKeyword("procedure") + ~CaselessKeyword("query") + ~CaselessKeyword("real") + ~CaselessKeyword("reference") + ~CaselessKeyword("remove") + ~CaselessKeyword("renamed") + ~CaselessKeyword("repeat") + ~CaselessKeyword("return") + ~CaselessKeyword("rolesof") + ~CaselessKeyword("rule") + ~CaselessKeyword("schema") + ~CaselessKeyword("select") + ~CaselessKeyword("self") + ~CaselessKeyword("set") + ~CaselessKeyword("sin") + ~CaselessKeyword("sizeof") + ~CaselessKeyword("skip") + ~CaselessKeyword("sqrt") + ~CaselessKeyword("string") + ~CaselessKeyword("subtype") + ~CaselessKeyword("subtype_constraint") + ~CaselessKeyword("supertype") + ~CaselessKeyword("tan") + ~CaselessKeyword("then") + ~CaselessKeyword("to") + ~CaselessKeyword("total_over") + ~CaselessKeyword("true") + ~CaselessKeyword("type") + ~CaselessKeyword("typeof") + ~CaselessKeyword("unique") + ~CaselessKeyword("unknown") + ~CaselessKeyword("until") + ~CaselessKeyword("use") + ~CaselessKeyword("usedin") + ~CaselessKeyword("value") + ~CaselessKeyword("value_in") + ~CaselessKeyword("value_unique") + ~CaselessKeyword("var") + ~CaselessKeyword("where") + ~CaselessKeyword("while") + ~CaselessKeyword("with") + ~CaselessKeyword("xor") + original_text_for(Combine((letter + ZeroOrMore((letter | digit | CaselessLiteral("_"))))))("simple_id")
|
||||||
simple_string_literal = (originalTextFor((CaselessLiteral("'") + ZeroOrMore(((CaselessLiteral("'") + CaselessLiteral("'")) | not_quote)) + CaselessLiteral("'")))).addParseAction(tokenMap(str.lower))("simple_string_literal")
|
simple_string_literal = (original_text_for((CaselessLiteral("'") + ZeroOrMore(((CaselessLiteral("'") + CaselessLiteral("'")) | not_quote)) + CaselessLiteral("'")))).add_parse_action(token_map(str.lower))("simple_string_literal")
|
||||||
abstract_entity_declaration = (ABSTRACT)("abstract_entity_declaration")
|
abstract_entity_declaration = (ABSTRACT)("abstract_entity_declaration")
|
||||||
abstract_supertype = ((ABSTRACT + SUPERTYPE + CaselessLiteral(";"))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="abstract_supertype"))("abstract_supertype")
|
abstract_supertype = ((ABSTRACT + SUPERTYPE + CaselessLiteral(";"))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="abstract_supertype"))("abstract_supertype")
|
||||||
add_like_op = ((CaselessLiteral("+") | CaselessLiteral("-") | OR | XOR)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="add_like_op"))("add_like_op")
|
add_like_op = ((CaselessLiteral("+") | CaselessLiteral("-") | OR | XOR)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="add_like_op"))("add_like_op")
|
||||||
attribute_id = (simple_id)("attribute_id")
|
attribute_id = (simple_id)("attribute_id")
|
||||||
boolean_type = (BOOLEAN)("boolean_type")
|
boolean_type = (BOOLEAN)("boolean_type")
|
||||||
built_in_constant = ((CONST_E | PI | SELF | CaselessLiteral("?"))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="built_in_constant"))("built_in_constant")
|
built_in_constant = ((CONST_E | PI | SELF | CaselessLiteral("?"))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="built_in_constant"))("built_in_constant")
|
||||||
built_in_function = ((ABS | ACOS | ASIN | ATAN | BLENGTH | COS | EXISTS | EXP | FORMAT | HIBOUND | HIINDEX | LENGTH | LOBOUND | LOINDEX | LOG | LOG2 | LOG10 | NVL | ODD | ROLESOF | SIN | SIZEOF | SQRT | TAN | TYPEOF | USEDIN | VALUE | VALUE_IN | VALUE_UNIQUE)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="built_in_function"))("built_in_function")
|
built_in_function = ((ABS | ACOS | ASIN | ATAN | BLENGTH | COS | EXISTS | EXP | FORMAT | HIBOUND | HIINDEX | LENGTH | LOBOUND | LOINDEX | LOG | LOG2 | LOG10 | NVL | ODD | ROLESOF | SIN | SIZEOF | SQRT | TAN | TYPEOF | USEDIN | VALUE | VALUE_IN | VALUE_UNIQUE)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="built_in_function"))("built_in_function")
|
||||||
built_in_procedure = ((INSERT | REMOVE)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="built_in_procedure"))("built_in_procedure")
|
built_in_procedure = ((INSERT | REMOVE)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="built_in_procedure"))("built_in_procedure")
|
||||||
constant_id = (simple_id)("constant_id")
|
constant_id = (simple_id)("constant_id")
|
||||||
entity_id = (simple_id)("entity_id")
|
entity_id = (simple_id)("entity_id")
|
||||||
enumeration_id = (simple_id)("enumeration_id")
|
enumeration_id = (simple_id)("enumeration_id")
|
||||||
enumeration_items = ((CaselessLiteral("(") + enumeration_id + ZeroOrMore((CaselessLiteral(",") + enumeration_id)) + CaselessLiteral(")"))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="enumeration_items"))("enumeration_items")
|
enumeration_items = ((CaselessLiteral("(") + enumeration_id + ZeroOrMore((CaselessLiteral(",") + enumeration_id)) + CaselessLiteral(")"))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="enumeration_items"))("enumeration_items")
|
||||||
escape_stmt = ((ESCAPE + CaselessLiteral(";"))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="escape_stmt"))("escape_stmt")
|
escape_stmt = ((ESCAPE + CaselessLiteral(";"))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="escape_stmt"))("escape_stmt")
|
||||||
function_id = (simple_id)("function_id")
|
function_id = (simple_id)("function_id")
|
||||||
integer_type = (INTEGER)("integer_type")
|
integer_type = (INTEGER)("integer_type")
|
||||||
interval_op = ((CaselessLiteral("<=") | CaselessLiteral("<"))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="interval_op"))("interval_op")
|
interval_op = ((CaselessLiteral("<=") | CaselessLiteral("<"))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="interval_op"))("interval_op")
|
||||||
logical_literal = ((FALSE | TRUE | UNKNOWN)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="logical_literal"))("logical_literal")
|
logical_literal = ((FALSE | TRUE | UNKNOWN)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="logical_literal"))("logical_literal")
|
||||||
logical_type = (LOGICAL)("logical_type")
|
logical_type = (LOGICAL)("logical_type")
|
||||||
multiplication_like_op = ((CaselessLiteral("*") | CaselessLiteral("/") | DIV | MOD | AND | CaselessLiteral("||"))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="multiplication_like_op"))("multiplication_like_op")
|
multiplication_like_op = ((CaselessLiteral("*") | CaselessLiteral("/") | DIV | MOD | AND | CaselessLiteral("||"))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="multiplication_like_op"))("multiplication_like_op")
|
||||||
null_stmt = (CaselessLiteral(";")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="null_stmt"))("null_stmt")
|
null_stmt = (CaselessLiteral(";")).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="null_stmt"))("null_stmt")
|
||||||
number_type = (NUMBER)("number_type")
|
number_type = (NUMBER)("number_type")
|
||||||
parameter_id = (simple_id)("parameter_id")
|
parameter_id = (simple_id)("parameter_id")
|
||||||
procedure_id = (simple_id)("procedure_id")
|
procedure_id = (simple_id)("procedure_id")
|
||||||
rel_op = ((CaselessLiteral("<=") | CaselessLiteral(">=") | CaselessLiteral("<>") | CaselessLiteral("=") | CaselessLiteral(":<>:") | CaselessLiteral(":=:") | CaselessLiteral("<") | CaselessLiteral(">"))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="rel_op"))("rel_op")
|
rel_op = ((CaselessLiteral("<=") | CaselessLiteral(">=") | CaselessLiteral("<>") | CaselessLiteral("=") | CaselessLiteral(":<>:") | CaselessLiteral(":=:") | CaselessLiteral("<") | CaselessLiteral(">"))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="rel_op"))("rel_op")
|
||||||
rel_op_extended = ((rel_op | IN | LIKE)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="rel_op_extended"))("rel_op_extended")
|
rel_op_extended = ((rel_op | IN | LIKE)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="rel_op_extended"))("rel_op_extended")
|
||||||
rule_id = (simple_id)("rule_id")
|
rule_id = (simple_id)("rule_id")
|
||||||
rule_label_id = (simple_id)("rule_label_id")
|
rule_label_id = (simple_id)("rule_label_id")
|
||||||
schema_id = (simple_id)("schema_id")
|
schema_id = (simple_id)("schema_id")
|
||||||
sign = ((CaselessLiteral("+") | CaselessLiteral("-"))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="sign"))("sign")
|
sign = ((CaselessLiteral("+") | CaselessLiteral("-"))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="sign"))("sign")
|
||||||
skip_stmt = ((SKIP + CaselessLiteral(";"))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="skip_stmt"))("skip_stmt")
|
skip_stmt = ((SKIP + CaselessLiteral(";"))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="skip_stmt"))("skip_stmt")
|
||||||
subtype_constraint_id = (simple_id)("subtype_constraint_id")
|
subtype_constraint_id = (simple_id)("subtype_constraint_id")
|
||||||
type_id = (simple_id)("type_id")
|
type_id = (simple_id)("type_id")
|
||||||
type_label_id = (simple_id)("type_label_id")
|
type_label_id = (simple_id)("type_label_id")
|
||||||
unary_op = ((CaselessLiteral("+") | CaselessLiteral("-") | NOT)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="unary_op"))("unary_op")
|
unary_op = ((CaselessLiteral("+") | CaselessLiteral("-") | NOT)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="unary_op"))("unary_op")
|
||||||
variable_id = (simple_id)("variable_id")
|
variable_id = (simple_id)("variable_id")
|
||||||
encoded_character = ((octet + octet + octet + octet)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="encoded_character"))("encoded_character")
|
encoded_character = ((octet + octet + octet + octet)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="encoded_character"))("encoded_character")
|
||||||
not_paren_star = ((letter | digit | not_paren_star_special)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="not_paren_star"))("not_paren_star")
|
not_paren_star = ((letter | digit | not_paren_star_special)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="not_paren_star"))("not_paren_star")
|
||||||
not_rparen_star = ((not_paren_star | CaselessLiteral("("))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="not_rparen_star"))("not_rparen_star")
|
not_rparen_star = ((not_paren_star | CaselessLiteral("("))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="not_rparen_star"))("not_rparen_star")
|
||||||
not_rparen_star_then_rparen = ((not_rparen_star + ZeroOrMore(not_rparen_star) + CaselessLiteral(")") + ZeroOrMore(CaselessLiteral(")")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="not_rparen_star_then_rparen"))("not_rparen_star_then_rparen")
|
not_rparen_star_then_rparen = ((not_rparen_star + ZeroOrMore(not_rparen_star) + CaselessLiteral(")") + ZeroOrMore(CaselessLiteral(")")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="not_rparen_star_then_rparen"))("not_rparen_star_then_rparen")
|
||||||
encoded_string_literal = ((CaselessLiteral("\"") + encoded_character + ZeroOrMore(encoded_character) + CaselessLiteral("\""))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="encoded_string_literal"))("encoded_string_literal")
|
encoded_string_literal = ((CaselessLiteral("\"") + encoded_character + ZeroOrMore(encoded_character) + CaselessLiteral("\""))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="encoded_string_literal"))("encoded_string_literal")
|
||||||
real_literal = (((digits + CaselessLiteral(".") + Optional(digits) + Optional((CaselessLiteral("e") + Optional(sign) + digits))) | integer_literal))("real_literal")
|
real_literal = (((digits + CaselessLiteral(".") + Optional(digits) + Optional((CaselessLiteral("e") + Optional(sign) + digits))) | integer_literal))("real_literal")
|
||||||
attribute_ref = (attribute_id)("attribute_ref")
|
attribute_ref = (attribute_id)("attribute_ref")
|
||||||
constant_ref = (constant_id)("constant_ref")
|
constant_ref = (constant_id)("constant_ref")
|
||||||
@@ -210,47 +210,47 @@ def parse(fn: str) -> mapping.Mapping:
|
|||||||
type_label_ref = (type_label_id)("type_label_ref")
|
type_label_ref = (type_label_id)("type_label_ref")
|
||||||
type_ref = (type_id)("type_ref")
|
type_ref = (type_id)("type_ref")
|
||||||
variable_ref = (variable_id)("variable_ref")
|
variable_ref = (variable_id)("variable_ref")
|
||||||
attribute_qualifier = ((CaselessLiteral(".") + attribute_ref)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="attribute_qualifier"))("attribute_qualifier")
|
attribute_qualifier = ((CaselessLiteral(".") + attribute_ref)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="attribute_qualifier"))("attribute_qualifier")
|
||||||
constant_factor = ((built_in_constant | constant_ref)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="constant_factor"))("constant_factor")
|
constant_factor = ((built_in_constant | constant_ref)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="constant_factor"))("constant_factor")
|
||||||
enumeration_extension = ((BASED_ON + type_ref + Optional((WITH + enumeration_items)))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="enumeration_extension"))("enumeration_extension")
|
enumeration_extension = ((BASED_ON + type_ref + Optional((WITH + enumeration_items)))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="enumeration_extension"))("enumeration_extension")
|
||||||
enumeration_reference = ((Optional((type_ref + CaselessLiteral("."))) + enumeration_ref)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="enumeration_reference"))("enumeration_reference")
|
enumeration_reference = ((Optional((type_ref + CaselessLiteral("."))) + enumeration_ref)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="enumeration_reference"))("enumeration_reference")
|
||||||
enumeration_type = ((Optional(EXTENSIBLE) + ENUMERATION + Optional(((OF + enumeration_items) | enumeration_extension)))).setParseAction(EnumerationType)("enumeration_type")
|
enumeration_type = ((Optional(EXTENSIBLE) + ENUMERATION + Optional(((OF + enumeration_items) | enumeration_extension)))).set_parse_action(EnumerationType)("enumeration_type")
|
||||||
general_ref = ((parameter_ref | variable_ref)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="general_ref"))("general_ref")
|
general_ref = ((parameter_ref | variable_ref)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="general_ref"))("general_ref")
|
||||||
group_qualifier = ((CaselessLiteral("\\") + entity_ref)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="group_qualifier"))("group_qualifier")
|
group_qualifier = ((CaselessLiteral("\\") + entity_ref)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="group_qualifier"))("group_qualifier")
|
||||||
named_types = ((entity_ref | type_ref)).setParseAction(NamedType)("named_types")
|
named_types = ((entity_ref | type_ref)).set_parse_action(NamedType)("named_types")
|
||||||
named_type_or_rename = ((named_types + Optional((AS + (entity_id | type_id))))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="named_type_or_rename"))("named_type_or_rename")
|
named_type_or_rename = ((named_types + Optional((AS + (entity_id | type_id))))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="named_type_or_rename"))("named_type_or_rename")
|
||||||
population = (entity_ref)("population")
|
population = (entity_ref)("population")
|
||||||
qualified_attribute = ((SELF + group_qualifier + attribute_qualifier)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="qualified_attribute"))("qualified_attribute")
|
qualified_attribute = ((SELF + group_qualifier + attribute_qualifier)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="qualified_attribute"))("qualified_attribute")
|
||||||
redeclared_attribute = ((qualified_attribute + Optional((RENAMED + attribute_id)))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="redeclared_attribute"))("redeclared_attribute")
|
redeclared_attribute = ((qualified_attribute + Optional((RENAMED + attribute_id)))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="redeclared_attribute"))("redeclared_attribute")
|
||||||
referenced_attribute = ((attribute_ref | qualified_attribute)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="referenced_attribute"))("referenced_attribute")
|
referenced_attribute = ((attribute_ref | qualified_attribute)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="referenced_attribute"))("referenced_attribute")
|
||||||
rename_id = ((constant_id | entity_id | function_id | procedure_id | type_id)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="rename_id"))("rename_id")
|
rename_id = ((constant_id | entity_id | function_id | procedure_id | type_id)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="rename_id"))("rename_id")
|
||||||
resource_ref = ((constant_ref | entity_ref | function_ref | procedure_ref | type_ref)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="resource_ref"))("resource_ref")
|
resource_ref = ((constant_ref | entity_ref | function_ref | procedure_ref | type_ref)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="resource_ref"))("resource_ref")
|
||||||
rule_head = ((RULE + rule_id + FOR + CaselessLiteral("(") + entity_ref + ZeroOrMore((CaselessLiteral(",") + entity_ref)) + CaselessLiteral(")") + CaselessLiteral(";"))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="rule_head"))("rule_head")
|
rule_head = ((RULE + rule_id + FOR + CaselessLiteral("(") + entity_ref + ZeroOrMore((CaselessLiteral(",") + entity_ref)) + CaselessLiteral(")") + CaselessLiteral(";"))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="rule_head"))("rule_head")
|
||||||
select_list = ((CaselessLiteral("(") + named_types + ZeroOrMore((CaselessLiteral(",") + named_types)) + CaselessLiteral(")"))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="select_list"))("select_list")
|
select_list = ((CaselessLiteral("(") + named_types + ZeroOrMore((CaselessLiteral(",") + named_types)) + CaselessLiteral(")"))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="select_list"))("select_list")
|
||||||
string_literal = ((simple_string_literal | encoded_string_literal))("string_literal")
|
string_literal = ((simple_string_literal | encoded_string_literal))("string_literal")
|
||||||
subtype_constraint_head = ((SUBTYPE_CONSTRAINT + subtype_constraint_id + FOR + entity_ref + CaselessLiteral(";"))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="subtype_constraint_head"))("subtype_constraint_head")
|
subtype_constraint_head = ((SUBTYPE_CONSTRAINT + subtype_constraint_id + FOR + entity_ref + CaselessLiteral(";"))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="subtype_constraint_head"))("subtype_constraint_head")
|
||||||
subtype_declaration = ((SUBTYPE + OF + CaselessLiteral("(") + entity_ref + ZeroOrMore((CaselessLiteral(",") + entity_ref)) + CaselessLiteral(")"))).setParseAction(SubTypeExpression)("subtype_declaration")
|
subtype_declaration = ((SUBTYPE + OF + CaselessLiteral("(") + entity_ref + ZeroOrMore((CaselessLiteral(",") + entity_ref)) + CaselessLiteral(")"))).set_parse_action(SubTypeExpression)("subtype_declaration")
|
||||||
total_over = ((TOTAL_OVER + CaselessLiteral("(") + entity_ref + ZeroOrMore((CaselessLiteral(",") + entity_ref)) + CaselessLiteral(")") + CaselessLiteral(";"))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="total_over"))("total_over")
|
total_over = ((TOTAL_OVER + CaselessLiteral("(") + entity_ref + ZeroOrMore((CaselessLiteral(",") + entity_ref)) + CaselessLiteral(")") + CaselessLiteral(";"))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="total_over"))("total_over")
|
||||||
type_label = ((type_label_id | type_label_ref)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="type_label"))("type_label")
|
type_label = ((type_label_id | type_label_ref)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="type_label"))("type_label")
|
||||||
unique_rule = ((Optional((rule_label_id + CaselessLiteral(":"))) + referenced_attribute + ZeroOrMore((CaselessLiteral(",") + referenced_attribute)))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="unique_rule"))("unique_rule")
|
unique_rule = ((Optional((rule_label_id + CaselessLiteral(":"))) + referenced_attribute + ZeroOrMore((CaselessLiteral(",") + referenced_attribute)))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="unique_rule"))("unique_rule")
|
||||||
use_clause = ((USE + FROM + schema_ref + Optional((CaselessLiteral("(") + named_type_or_rename + ZeroOrMore((CaselessLiteral(",") + named_type_or_rename)) + CaselessLiteral(")"))) + CaselessLiteral(";"))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="use_clause"))("use_clause")
|
use_clause = ((USE + FROM + schema_ref + Optional((CaselessLiteral("(") + named_type_or_rename + ZeroOrMore((CaselessLiteral(",") + named_type_or_rename)) + CaselessLiteral(")"))) + CaselessLiteral(";"))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="use_clause"))("use_clause")
|
||||||
not_lparen_star = ((not_paren_star | CaselessLiteral(")"))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="not_lparen_star"))("not_lparen_star")
|
not_lparen_star = ((not_paren_star | CaselessLiteral(")"))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="not_lparen_star"))("not_lparen_star")
|
||||||
remark_ref = ((attribute_ref | constant_ref | entity_ref | enumeration_ref | function_ref | parameter_ref | procedure_ref | rule_label_ref | rule_ref | schema_ref | subtype_constraint_ref | type_label_ref | type_ref | variable_ref)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="remark_ref"))("remark_ref")
|
remark_ref = ((attribute_ref | constant_ref | entity_ref | enumeration_ref | function_ref | parameter_ref | procedure_ref | rule_label_ref | rule_ref | schema_ref | subtype_constraint_ref | type_label_ref | type_ref | variable_ref)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="remark_ref"))("remark_ref")
|
||||||
attribute_decl = ((redeclared_attribute | attribute_id)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="attribute_decl"))("attribute_decl")
|
attribute_decl = ((redeclared_attribute | attribute_id)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="attribute_decl"))("attribute_decl")
|
||||||
generic_entity_type = ((GENERIC_ENTITY + Optional((CaselessLiteral(":") + type_label)))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="generic_entity_type"))("generic_entity_type")
|
generic_entity_type = ((GENERIC_ENTITY + Optional((CaselessLiteral(":") + type_label)))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="generic_entity_type"))("generic_entity_type")
|
||||||
generic_type = ((GENERIC + Optional((CaselessLiteral(":") + type_label)))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="generic_type"))("generic_type")
|
generic_type = ((GENERIC + Optional((CaselessLiteral(":") + type_label)))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="generic_type"))("generic_type")
|
||||||
literal = ((binary_literal | logical_literal | real_literal | string_literal)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="literal"))("literal")
|
literal = ((binary_literal | logical_literal | real_literal | string_literal)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="literal"))("literal")
|
||||||
resource_or_rename = ((resource_ref + Optional((AS + rename_id)))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="resource_or_rename"))("resource_or_rename")
|
resource_or_rename = ((resource_ref + Optional((AS + rename_id)))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="resource_or_rename"))("resource_or_rename")
|
||||||
schema_version_id = (string_literal)("schema_version_id")
|
schema_version_id = (string_literal)("schema_version_id")
|
||||||
select_extension = ((BASED_ON + type_ref + Optional((WITH + select_list)))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="select_extension"))("select_extension")
|
select_extension = ((BASED_ON + type_ref + Optional((WITH + select_list)))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="select_extension"))("select_extension")
|
||||||
select_type = ((Optional((EXTENSIBLE + Optional(GENERIC_ENTITY))) + SELECT + Optional((select_list | select_extension)))).setParseAction(SelectType)("select_type")
|
select_type = ((Optional((EXTENSIBLE + Optional(GENERIC_ENTITY))) + SELECT + Optional((select_list | select_extension)))).set_parse_action(SelectType)("select_type")
|
||||||
unique_clause = ((UNIQUE + unique_rule + CaselessLiteral(";") + ZeroOrMore((unique_rule + CaselessLiteral(";"))))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="unique_clause"))("unique_clause")
|
unique_clause = ((UNIQUE + unique_rule + CaselessLiteral(";") + ZeroOrMore((unique_rule + CaselessLiteral(";"))))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="unique_clause"))("unique_clause")
|
||||||
lparen_then_not_lparen_star = ((CaselessLiteral("(") + ZeroOrMore(CaselessLiteral("(")) + not_lparen_star + ZeroOrMore(not_lparen_star))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="lparen_then_not_lparen_star"))("lparen_then_not_lparen_star")
|
lparen_then_not_lparen_star = ((CaselessLiteral("(") + ZeroOrMore(CaselessLiteral("(")) + not_lparen_star + ZeroOrMore(not_lparen_star))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="lparen_then_not_lparen_star"))("lparen_then_not_lparen_star")
|
||||||
remark_tag = ((CaselessLiteral("\"") + remark_ref + ZeroOrMore((CaselessLiteral(".") + remark_ref)) + CaselessLiteral("\""))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="remark_tag"))("remark_tag")
|
remark_tag = ((CaselessLiteral("\"") + remark_ref + ZeroOrMore((CaselessLiteral(".") + remark_ref)) + CaselessLiteral("\""))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="remark_tag"))("remark_tag")
|
||||||
tail_remark = ((CaselessLiteral("--") + Optional(remark_tag))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="tail_remark"))("tail_remark")
|
tail_remark = ((CaselessLiteral("--") + Optional(remark_tag))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="tail_remark"))("tail_remark")
|
||||||
constructed_types = ((enumeration_type | select_type)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="constructed_types"))("constructed_types")
|
constructed_types = ((enumeration_type | select_type)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="constructed_types"))("constructed_types")
|
||||||
reference_clause = ((REFERENCE + FROM + schema_ref + Optional((CaselessLiteral("(") + resource_or_rename + ZeroOrMore((CaselessLiteral(",") + resource_or_rename)) + CaselessLiteral(")"))) + CaselessLiteral(";"))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="reference_clause"))("reference_clause")
|
reference_clause = ((REFERENCE + FROM + schema_ref + Optional((CaselessLiteral("(") + resource_or_rename + ZeroOrMore((CaselessLiteral(",") + resource_or_rename)) + CaselessLiteral(")"))) + CaselessLiteral(";"))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="reference_clause"))("reference_clause")
|
||||||
interface_specification = ((reference_clause | use_clause)).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="interface_specification"))("interface_specification")
|
interface_specification = ((reference_clause | use_clause)).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="interface_specification"))("interface_specification")
|
||||||
abstract_supertype_declaration = Forward()("abstract_supertype_declaration")
|
abstract_supertype_declaration = Forward()("abstract_supertype_declaration")
|
||||||
actual_parameter_list = Forward()("actual_parameter_list")
|
actual_parameter_list = Forward()("actual_parameter_list")
|
||||||
aggregate_initializer = Forward()("aggregate_initializer")
|
aggregate_initializer = Forward()("aggregate_initializer")
|
||||||
@@ -360,119 +360,119 @@ def parse(fn: str) -> mapping.Mapping:
|
|||||||
while_control = Forward()("while_control")
|
while_control = Forward()("while_control")
|
||||||
width = Forward()("width")
|
width = Forward()("width")
|
||||||
width_spec = Forward()("width_spec")
|
width_spec = Forward()("width_spec")
|
||||||
abstract_supertype_declaration << (((ABSTRACT + SUPERTYPE + Optional(subtype_constraint)))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="abstract_supertype_declaration"))
|
abstract_supertype_declaration << (((ABSTRACT + SUPERTYPE + Optional(subtype_constraint)))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="abstract_supertype_declaration"))
|
||||||
actual_parameter_list << (((CaselessLiteral("(") + Optional(parameter) + ZeroOrMore((CaselessLiteral(",") + parameter)) + CaselessLiteral(")")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="actual_parameter_list"))
|
actual_parameter_list << (((CaselessLiteral("(") + Optional(parameter) + ZeroOrMore((CaselessLiteral(",") + parameter)) + CaselessLiteral(")")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="actual_parameter_list"))
|
||||||
aggregate_initializer << (((CaselessLiteral("[") + Optional((element + ZeroOrMore((CaselessLiteral(",") + element)))) + CaselessLiteral("]")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="aggregate_initializer"))
|
aggregate_initializer << (((CaselessLiteral("[") + Optional((element + ZeroOrMore((CaselessLiteral(",") + element)))) + CaselessLiteral("]")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="aggregate_initializer"))
|
||||||
aggregate_source << (simple_expression)
|
aggregate_source << (simple_expression)
|
||||||
aggregate_type << (((AGGREGATE + Optional((CaselessLiteral(":") + type_label)) + OF + parameter_type))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="aggregate_type"))
|
aggregate_type << (((AGGREGATE + Optional((CaselessLiteral(":") + type_label)) + OF + parameter_type))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="aggregate_type"))
|
||||||
aggregation_types << (((array_type | bag_type | list_type | set_type))).setParseAction(AggregationType)
|
aggregation_types << (((array_type | bag_type | list_type | set_type))).set_parse_action(AggregationType)
|
||||||
algorithm_head << (((ZeroOrMore(declaration) + Optional(constant_decl) + Optional(local_decl)))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="algorithm_head"))
|
algorithm_head << (((ZeroOrMore(declaration) + Optional(constant_decl) + Optional(local_decl)))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="algorithm_head"))
|
||||||
alias_stmt << (((ALIAS + variable_id + FOR + general_ref + ZeroOrMore(qualifier) + CaselessLiteral(";") + stmt + ZeroOrMore(stmt) + END_ALIAS + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="alias_stmt"))
|
alias_stmt << (((ALIAS + variable_id + FOR + general_ref + ZeroOrMore(qualifier) + CaselessLiteral(";") + stmt + ZeroOrMore(stmt) + END_ALIAS + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="alias_stmt"))
|
||||||
array_type << (((ARRAY + bound_spec + OF + Optional(OPTIONAL) + Optional(UNIQUE) + instantiable_type))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="array_type"))
|
array_type << (((ARRAY + bound_spec + OF + Optional(OPTIONAL) + Optional(UNIQUE) + instantiable_type))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="array_type"))
|
||||||
assignment_stmt << (((general_ref + ZeroOrMore(qualifier) + CaselessLiteral(":=") + expression + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="assignment_stmt"))
|
assignment_stmt << (((general_ref + ZeroOrMore(qualifier) + CaselessLiteral(":=") + expression + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="assignment_stmt"))
|
||||||
bag_type << (((BAG + Optional(bound_spec) + OF + instantiable_type))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="bag_type"))
|
bag_type << (((BAG + Optional(bound_spec) + OF + instantiable_type))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="bag_type"))
|
||||||
binary_type << (((BINARY + Optional(width_spec)))).setParseAction(BinaryType)
|
binary_type << (((BINARY + Optional(width_spec)))).set_parse_action(BinaryType)
|
||||||
bound_1 << (numeric_expression)
|
bound_1 << (numeric_expression)
|
||||||
bound_2 << (numeric_expression)
|
bound_2 << (numeric_expression)
|
||||||
bound_spec << (((CaselessLiteral("[") + bound_1 + CaselessLiteral(":") + bound_2 + CaselessLiteral("]")))).setParseAction(BoundSpecification)
|
bound_spec << (((CaselessLiteral("[") + bound_1 + CaselessLiteral(":") + bound_2 + CaselessLiteral("]")))).set_parse_action(BoundSpecification)
|
||||||
case_action << (((case_label + ZeroOrMore((CaselessLiteral(",") + case_label)) + CaselessLiteral(":") + stmt))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="case_action"))
|
case_action << (((case_label + ZeroOrMore((CaselessLiteral(",") + case_label)) + CaselessLiteral(":") + stmt))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="case_action"))
|
||||||
case_label << (expression)
|
case_label << (expression)
|
||||||
case_stmt << (((CASE + selector + OF + ZeroOrMore(case_action) + Optional((OTHERWISE + CaselessLiteral(":") + stmt)) + END_CASE + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="case_stmt"))
|
case_stmt << (((CASE + selector + OF + ZeroOrMore(case_action) + Optional((OTHERWISE + CaselessLiteral(":") + stmt)) + END_CASE + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="case_stmt"))
|
||||||
compound_stmt << (((BEGIN + stmt + ZeroOrMore(stmt) + END + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="compound_stmt"))
|
compound_stmt << (((BEGIN + stmt + ZeroOrMore(stmt) + END + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="compound_stmt"))
|
||||||
concrete_types << (((aggregation_types | simple_types | type_ref))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="concrete_types"))
|
concrete_types << (((aggregation_types | simple_types | type_ref))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="concrete_types"))
|
||||||
constant_body << (((constant_id + CaselessLiteral(":") + instantiable_type + CaselessLiteral(":=") + expression + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="constant_body"))
|
constant_body << (((constant_id + CaselessLiteral(":") + instantiable_type + CaselessLiteral(":=") + expression + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="constant_body"))
|
||||||
constant_decl << (((CONSTANT + constant_body + ZeroOrMore(constant_body) + END_CONSTANT + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="constant_decl"))
|
constant_decl << (((CONSTANT + constant_body + ZeroOrMore(constant_body) + END_CONSTANT + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="constant_decl"))
|
||||||
declaration << (((entity_decl | function_decl | procedure_decl | subtype_constraint_decl | type_decl))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="declaration"))
|
declaration << (((entity_decl | function_decl | procedure_decl | subtype_constraint_decl | type_decl))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="declaration"))
|
||||||
derive_clause << (((DERIVE + derived_attr + ZeroOrMore(derived_attr)))).setParseAction(AttributeList)
|
derive_clause << (((DERIVE + derived_attr + ZeroOrMore(derived_attr)))).set_parse_action(AttributeList)
|
||||||
derived_attr << (((attribute_decl + CaselessLiteral(":") + parameter_type + CaselessLiteral(":=") + expression + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="derived_attr"))
|
derived_attr << (((attribute_decl + CaselessLiteral(":") + parameter_type + CaselessLiteral(":=") + expression + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="derived_attr"))
|
||||||
domain_rule << (((Optional((rule_label_id + CaselessLiteral(":"))) + expression))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="domain_rule"))
|
domain_rule << (((Optional((rule_label_id + CaselessLiteral(":"))) + expression))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="domain_rule"))
|
||||||
element << (((expression + Optional((CaselessLiteral(":") + repetition))))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="element"))
|
element << (((expression + Optional((CaselessLiteral(":") + repetition))))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="element"))
|
||||||
embedded_remark << (((CaselessLiteral("(*") + Optional(remark_tag) + ZeroOrMore(((not_paren_star + ZeroOrMore(not_paren_star)) | lparen_then_not_lparen_star | (CaselessLiteral("*") + ZeroOrMore(CaselessLiteral("*"))) | not_rparen_star_then_rparen | embedded_remark)) + CaselessLiteral("*)")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="embedded_remark"))
|
embedded_remark << (((CaselessLiteral("(*") + Optional(remark_tag) + ZeroOrMore(((not_paren_star + ZeroOrMore(not_paren_star)) | lparen_then_not_lparen_star | (CaselessLiteral("*") + ZeroOrMore(CaselessLiteral("*"))) | not_rparen_star_then_rparen | embedded_remark)) + CaselessLiteral("*)")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="embedded_remark"))
|
||||||
entity_body << (((ZeroOrMore(explicit_attr) + Optional(derive_clause) + Optional(inverse_clause) + Optional(unique_clause) + Optional(where_clause)))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="entity_body"))
|
entity_body << (((ZeroOrMore(explicit_attr) + Optional(derive_clause) + Optional(inverse_clause) + Optional(unique_clause) + Optional(where_clause)))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="entity_body"))
|
||||||
entity_constructor << (((entity_ref + CaselessLiteral("(") + Optional((expression + ZeroOrMore((CaselessLiteral(",") + expression)))) + CaselessLiteral(")")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="entity_constructor"))
|
entity_constructor << (((entity_ref + CaselessLiteral("(") + Optional((expression + ZeroOrMore((CaselessLiteral(",") + expression)))) + CaselessLiteral(")")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="entity_constructor"))
|
||||||
entity_decl << (((entity_head + entity_body + END_ENTITY + CaselessLiteral(";")))).setParseAction(EntityDeclaration)
|
entity_decl << (((entity_head + entity_body + END_ENTITY + CaselessLiteral(";")))).set_parse_action(EntityDeclaration)
|
||||||
entity_head << (((ENTITY + entity_id + subsuper + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="entity_head"))
|
entity_head << (((ENTITY + entity_id + subsuper + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="entity_head"))
|
||||||
explicit_attr << (((attribute_decl + ZeroOrMore((CaselessLiteral(",") + attribute_decl)) + CaselessLiteral(":") + Optional(OPTIONAL) + parameter_type + CaselessLiteral(";")))).setParseAction(ExplicitAttribute)
|
explicit_attr << (((attribute_decl + ZeroOrMore((CaselessLiteral(",") + attribute_decl)) + CaselessLiteral(":") + Optional(OPTIONAL) + parameter_type + CaselessLiteral(";")))).set_parse_action(ExplicitAttribute)
|
||||||
expression << (((simple_expression + Optional((rel_op_extended + simple_expression))))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="expression"))
|
expression << (((simple_expression + Optional((rel_op_extended + simple_expression))))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="expression"))
|
||||||
factor << (((simple_factor + Optional((CaselessLiteral("**") + simple_factor))))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="factor"))
|
factor << (((simple_factor + Optional((CaselessLiteral("**") + simple_factor))))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="factor"))
|
||||||
formal_parameter << (((parameter_id + ZeroOrMore((CaselessLiteral(",") + parameter_id)) + CaselessLiteral(":") + parameter_type))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="formal_parameter"))
|
formal_parameter << (((parameter_id + ZeroOrMore((CaselessLiteral(",") + parameter_id)) + CaselessLiteral(":") + parameter_type))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="formal_parameter"))
|
||||||
function_call << ((((built_in_function | function_ref) + actual_parameter_list))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="function_call"))
|
function_call << ((((built_in_function | function_ref) + actual_parameter_list))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="function_call"))
|
||||||
function_decl << (((function_head + algorithm_head + stmt + ZeroOrMore(stmt) + END_FUNCTION + CaselessLiteral(";")))).setParseAction(FunctionDeclaration)
|
function_decl << (((function_head + algorithm_head + stmt + ZeroOrMore(stmt) + END_FUNCTION + CaselessLiteral(";")))).set_parse_action(FunctionDeclaration)
|
||||||
function_head << (((FUNCTION + function_id + Optional((CaselessLiteral("(") + formal_parameter + ZeroOrMore((CaselessLiteral(";") + formal_parameter)) + CaselessLiteral(")"))) + CaselessLiteral(":") + parameter_type + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="function_head"))
|
function_head << (((FUNCTION + function_id + Optional((CaselessLiteral("(") + formal_parameter + ZeroOrMore((CaselessLiteral(";") + formal_parameter)) + CaselessLiteral(")"))) + CaselessLiteral(":") + parameter_type + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="function_head"))
|
||||||
general_aggregation_types << (((general_array_type | general_bag_type | general_list_type | general_set_type))).setParseAction(AggregationType)
|
general_aggregation_types << (((general_array_type | general_bag_type | general_list_type | general_set_type))).set_parse_action(AggregationType)
|
||||||
general_array_type << (((ARRAY + Optional(bound_spec) + OF + Optional(OPTIONAL) + Optional(UNIQUE) + parameter_type))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="general_array_type"))
|
general_array_type << (((ARRAY + Optional(bound_spec) + OF + Optional(OPTIONAL) + Optional(UNIQUE) + parameter_type))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="general_array_type"))
|
||||||
general_bag_type << (((BAG + Optional(bound_spec) + OF + parameter_type))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="general_bag_type"))
|
general_bag_type << (((BAG + Optional(bound_spec) + OF + parameter_type))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="general_bag_type"))
|
||||||
general_list_type << (((LIST + Optional(bound_spec) + OF + Optional(UNIQUE) + parameter_type))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="general_list_type"))
|
general_list_type << (((LIST + Optional(bound_spec) + OF + Optional(UNIQUE) + parameter_type))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="general_list_type"))
|
||||||
general_set_type << (((SET + Optional(bound_spec) + OF + parameter_type))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="general_set_type"))
|
general_set_type << (((SET + Optional(bound_spec) + OF + parameter_type))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="general_set_type"))
|
||||||
generalized_types << (((aggregate_type | general_aggregation_types | generic_entity_type | generic_type))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="generalized_types"))
|
generalized_types << (((aggregate_type | general_aggregation_types | generic_entity_type | generic_type))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="generalized_types"))
|
||||||
if_stmt << (((IF + logical_expression + THEN + stmt + ZeroOrMore(stmt) + Optional((ELSE + stmt + ZeroOrMore(stmt))) + END_IF + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="if_stmt"))
|
if_stmt << (((IF + logical_expression + THEN + stmt + ZeroOrMore(stmt) + Optional((ELSE + stmt + ZeroOrMore(stmt))) + END_IF + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="if_stmt"))
|
||||||
increment << (numeric_expression)
|
increment << (numeric_expression)
|
||||||
increment_control << (((variable_id + CaselessLiteral(":=") + bound_1 + TO + bound_2 + Optional((BY + increment))))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="increment_control"))
|
increment_control << (((variable_id + CaselessLiteral(":=") + bound_1 + TO + bound_2 + Optional((BY + increment))))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="increment_control"))
|
||||||
index << (numeric_expression)
|
index << (numeric_expression)
|
||||||
index_1 << (index)
|
index_1 << (index)
|
||||||
index_2 << (index)
|
index_2 << (index)
|
||||||
index_qualifier << (((CaselessLiteral("[") + index_1 + Optional((CaselessLiteral(":") + index_2)) + CaselessLiteral("]")))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="index_qualifier"))
|
index_qualifier << (((CaselessLiteral("[") + index_1 + Optional((CaselessLiteral(":") + index_2)) + CaselessLiteral("]")))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="index_qualifier"))
|
||||||
instantiable_type << (((concrete_types | entity_ref))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="instantiable_type"))
|
instantiable_type << (((concrete_types | entity_ref))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="instantiable_type"))
|
||||||
interval << (((CaselessLiteral("{") + interval_low + interval_op + interval_item + interval_op + interval_high + CaselessLiteral("}")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="interval"))
|
interval << (((CaselessLiteral("{") + interval_low + interval_op + interval_item + interval_op + interval_high + CaselessLiteral("}")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="interval"))
|
||||||
interval_high << (simple_expression)
|
interval_high << (simple_expression)
|
||||||
interval_item << (simple_expression)
|
interval_item << (simple_expression)
|
||||||
interval_low << (simple_expression)
|
interval_low << (simple_expression)
|
||||||
inverse_attr << (((attribute_decl + CaselessLiteral(":") + Optional(((SET | BAG) + Optional(bound_spec) + OF)) + entity_ref + FOR + Optional((entity_ref + CaselessLiteral("."))) + attribute_ref + CaselessLiteral(";")))).setParseAction(InverseAttribute)
|
inverse_attr << (((attribute_decl + CaselessLiteral(":") + Optional(((SET | BAG) + Optional(bound_spec) + OF)) + entity_ref + FOR + Optional((entity_ref + CaselessLiteral("."))) + attribute_ref + CaselessLiteral(";")))).set_parse_action(InverseAttribute)
|
||||||
inverse_clause << (((INVERSE + inverse_attr + ZeroOrMore(inverse_attr)))).setParseAction(AttributeList)
|
inverse_clause << (((INVERSE + inverse_attr + ZeroOrMore(inverse_attr)))).set_parse_action(AttributeList)
|
||||||
list_type << (((LIST + Optional(bound_spec) + OF + Optional(UNIQUE) + instantiable_type))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="list_type"))
|
list_type << (((LIST + Optional(bound_spec) + OF + Optional(UNIQUE) + instantiable_type))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="list_type"))
|
||||||
local_decl << (((LOCAL + local_variable + ZeroOrMore(local_variable) + END_LOCAL + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="local_decl"))
|
local_decl << (((LOCAL + local_variable + ZeroOrMore(local_variable) + END_LOCAL + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="local_decl"))
|
||||||
local_variable << (((variable_id + ZeroOrMore((CaselessLiteral(",") + variable_id)) + CaselessLiteral(":") + parameter_type + Optional((CaselessLiteral(":=") + expression)) + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="local_variable"))
|
local_variable << (((variable_id + ZeroOrMore((CaselessLiteral(",") + variable_id)) + CaselessLiteral(":") + parameter_type + Optional((CaselessLiteral(":=") + expression)) + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="local_variable"))
|
||||||
logical_expression << (expression)
|
logical_expression << (expression)
|
||||||
numeric_expression << (simple_expression)
|
numeric_expression << (simple_expression)
|
||||||
one_of << (((ONEOF + CaselessLiteral("(") + supertype_expression + ZeroOrMore((CaselessLiteral(",") + supertype_expression)) + CaselessLiteral(")")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="one_of"))
|
one_of << (((ONEOF + CaselessLiteral("(") + supertype_expression + ZeroOrMore((CaselessLiteral(",") + supertype_expression)) + CaselessLiteral(")")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="one_of"))
|
||||||
parameter << (expression)
|
parameter << (expression)
|
||||||
parameter_type << (((generalized_types | simple_types | named_types))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="parameter_type"))
|
parameter_type << (((generalized_types | simple_types | named_types))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="parameter_type"))
|
||||||
precision_spec << (numeric_expression)
|
precision_spec << (numeric_expression)
|
||||||
primary << (((literal | (qualifiable_factor + ZeroOrMore(qualifier))))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="primary"))
|
primary << (((literal | (qualifiable_factor + ZeroOrMore(qualifier))))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="primary"))
|
||||||
procedure_call_stmt << ((((built_in_procedure | procedure_ref) + actual_parameter_list + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="procedure_call_stmt"))
|
procedure_call_stmt << ((((built_in_procedure | procedure_ref) + actual_parameter_list + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="procedure_call_stmt"))
|
||||||
procedure_decl << (((procedure_head + algorithm_head + ZeroOrMore(stmt) + END_PROCEDURE + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="procedure_decl"))
|
procedure_decl << (((procedure_head + algorithm_head + ZeroOrMore(stmt) + END_PROCEDURE + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="procedure_decl"))
|
||||||
procedure_head << (((PROCEDURE + procedure_id + Optional((CaselessLiteral("(") + Optional(VAR) + formal_parameter + ZeroOrMore((CaselessLiteral(";") + Optional(VAR) + formal_parameter)) + CaselessLiteral(")"))) + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="procedure_head"))
|
procedure_head << (((PROCEDURE + procedure_id + Optional((CaselessLiteral("(") + Optional(VAR) + formal_parameter + ZeroOrMore((CaselessLiteral(";") + Optional(VAR) + formal_parameter)) + CaselessLiteral(")"))) + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="procedure_head"))
|
||||||
qualifiable_factor << (((function_call | attribute_ref | constant_factor | general_ref | population))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="qualifiable_factor"))
|
qualifiable_factor << (((function_call | attribute_ref | constant_factor | general_ref | population))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="qualifiable_factor"))
|
||||||
qualifier << (((attribute_qualifier | group_qualifier | index_qualifier))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="qualifier"))
|
qualifier << (((attribute_qualifier | group_qualifier | index_qualifier))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="qualifier"))
|
||||||
query_expression << (((QUERY + CaselessLiteral("(") + variable_id + CaselessLiteral("<*") + aggregate_source + CaselessLiteral("|") + logical_expression + CaselessLiteral(")")))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="query_expression"))
|
query_expression << (((QUERY + CaselessLiteral("(") + variable_id + CaselessLiteral("<*") + aggregate_source + CaselessLiteral("|") + logical_expression + CaselessLiteral(")")))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="query_expression"))
|
||||||
real_type << (((REAL + Optional((CaselessLiteral("(") + precision_spec + CaselessLiteral(")")))))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="real_type"))
|
real_type << (((REAL + Optional((CaselessLiteral("(") + precision_spec + CaselessLiteral(")")))))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="real_type"))
|
||||||
remark << (((embedded_remark | tail_remark))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="remark"))
|
remark << (((embedded_remark | tail_remark))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="remark"))
|
||||||
repeat_control << (((Optional(increment_control) + Optional(while_control) + Optional(until_control)))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="repeat_control"))
|
repeat_control << (((Optional(increment_control) + Optional(while_control) + Optional(until_control)))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="repeat_control"))
|
||||||
repeat_stmt << (((REPEAT + repeat_control + CaselessLiteral(";") + stmt + ZeroOrMore(stmt) + END_REPEAT + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="repeat_stmt"))
|
repeat_stmt << (((REPEAT + repeat_control + CaselessLiteral(";") + stmt + ZeroOrMore(stmt) + END_REPEAT + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="repeat_stmt"))
|
||||||
repetition << (numeric_expression)
|
repetition << (numeric_expression)
|
||||||
return_stmt << (((RETURN + Optional((CaselessLiteral("(") + expression + CaselessLiteral(")"))) + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="return_stmt"))
|
return_stmt << (((RETURN + Optional((CaselessLiteral("(") + expression + CaselessLiteral(")"))) + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="return_stmt"))
|
||||||
rule_decl << (((rule_head + algorithm_head + ZeroOrMore(stmt) + where_clause + END_RULE + CaselessLiteral(";")))).setParseAction(RuleDeclaration)
|
rule_decl << (((rule_head + algorithm_head + ZeroOrMore(stmt) + where_clause + END_RULE + CaselessLiteral(";")))).set_parse_action(RuleDeclaration)
|
||||||
schema_body << (((ZeroOrMore(interface_specification) + Optional(constant_decl) + ZeroOrMore((declaration | rule_decl))))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="schema_body"))
|
schema_body << (((ZeroOrMore(interface_specification) + Optional(constant_decl) + ZeroOrMore((declaration | rule_decl))))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="schema_body"))
|
||||||
schema_decl << (((SCHEMA + schema_id + Optional(schema_version_id) + CaselessLiteral(";") + schema_body + END_SCHEMA + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="schema_decl"))
|
schema_decl << (((SCHEMA + schema_id + Optional(schema_version_id) + CaselessLiteral(";") + schema_body + END_SCHEMA + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="schema_decl"))
|
||||||
selector << (expression)
|
selector << (expression)
|
||||||
set_type << (((SET + Optional(bound_spec) + OF + instantiable_type))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="set_type"))
|
set_type << (((SET + Optional(bound_spec) + OF + instantiable_type))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="set_type"))
|
||||||
simple_expression << (((term + ZeroOrMore((add_like_op + term))))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="simple_expression"))
|
simple_expression << (((term + ZeroOrMore((add_like_op + term))))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="simple_expression"))
|
||||||
simple_factor << (((aggregate_initializer | interval | query_expression | (Optional(unary_op) + ((CaselessLiteral("(") + expression + CaselessLiteral(")")) | primary)) | entity_constructor | enumeration_reference))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="simple_factor"))
|
simple_factor << (((aggregate_initializer | interval | query_expression | (Optional(unary_op) + ((CaselessLiteral("(") + expression + CaselessLiteral(")")) | primary)) | entity_constructor | enumeration_reference))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="simple_factor"))
|
||||||
simple_types << (((binary_type | boolean_type | integer_type | logical_type | number_type | real_type | string_type))).setParseAction(SimpleType)
|
simple_types << (((binary_type | boolean_type | integer_type | logical_type | number_type | real_type | string_type))).set_parse_action(SimpleType)
|
||||||
stmt << (((alias_stmt | assignment_stmt | case_stmt | compound_stmt | escape_stmt | if_stmt | null_stmt | procedure_call_stmt | repeat_stmt | return_stmt | skip_stmt))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="stmt"))
|
stmt << (((alias_stmt | assignment_stmt | case_stmt | compound_stmt | escape_stmt | if_stmt | null_stmt | procedure_call_stmt | repeat_stmt | return_stmt | skip_stmt))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="stmt"))
|
||||||
string_type << (((STRING + Optional(width_spec)))).setParseAction(StringType)
|
string_type << (((STRING + Optional(width_spec)))).set_parse_action(StringType)
|
||||||
subsuper << (((Optional(supertype_constraint) + Optional(subtype_declaration)))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="subsuper"))
|
subsuper << (((Optional(supertype_constraint) + Optional(subtype_declaration)))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="subsuper"))
|
||||||
subtype_constraint << (((OF + CaselessLiteral("(") + supertype_expression + CaselessLiteral(")")))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="subtype_constraint"))
|
subtype_constraint << (((OF + CaselessLiteral("(") + supertype_expression + CaselessLiteral(")")))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="subtype_constraint"))
|
||||||
subtype_constraint_body << (((Optional(abstract_supertype) + Optional(total_over) + Optional((supertype_expression + CaselessLiteral(";")))))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="subtype_constraint_body"))
|
subtype_constraint_body << (((Optional(abstract_supertype) + Optional(total_over) + Optional((supertype_expression + CaselessLiteral(";")))))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="subtype_constraint_body"))
|
||||||
subtype_constraint_decl << (((subtype_constraint_head + subtype_constraint_body + END_SUBTYPE_CONSTRAINT + CaselessLiteral(";")))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="subtype_constraint_decl"))
|
subtype_constraint_decl << (((subtype_constraint_head + subtype_constraint_body + END_SUBTYPE_CONSTRAINT + CaselessLiteral(";")))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="subtype_constraint_decl"))
|
||||||
supertype_constraint << (((abstract_supertype_declaration | abstract_entity_declaration | supertype_rule))).setParseAction(SuperTypeExpression)
|
supertype_constraint << (((abstract_supertype_declaration | abstract_entity_declaration | supertype_rule))).set_parse_action(SuperTypeExpression)
|
||||||
supertype_expression << (((supertype_factor + ZeroOrMore((ANDOR + supertype_factor))))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="supertype_expression"))
|
supertype_expression << (((supertype_factor + ZeroOrMore((ANDOR + supertype_factor))))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="supertype_expression"))
|
||||||
supertype_factor << (((supertype_term + ZeroOrMore((AND + supertype_term))))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="supertype_factor"))
|
supertype_factor << (((supertype_term + ZeroOrMore((AND + supertype_term))))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="supertype_factor"))
|
||||||
supertype_rule << (((SUPERTYPE + subtype_constraint))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="supertype_rule"))
|
supertype_rule << (((SUPERTYPE + subtype_constraint))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="supertype_rule"))
|
||||||
supertype_term << (((one_of | (CaselessLiteral("(") + supertype_expression + CaselessLiteral(")")) | entity_ref))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="supertype_term"))
|
supertype_term << (((one_of | (CaselessLiteral("(") + supertype_expression + CaselessLiteral(")")) | entity_ref))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="supertype_term"))
|
||||||
syntax << (((schema_decl + ZeroOrMore(schema_decl)))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="syntax"))
|
syntax << (((schema_decl + ZeroOrMore(schema_decl)))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="syntax"))
|
||||||
term << (((factor + ZeroOrMore((multiplication_like_op + factor))))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="term"))
|
term << (((factor + ZeroOrMore((multiplication_like_op + factor))))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="term"))
|
||||||
type_decl << (((TYPE + type_id + CaselessLiteral("=") + underlying_type + CaselessLiteral(";") + Optional(where_clause) + END_TYPE + CaselessLiteral(";")))).setParseAction(TypeDeclaration)
|
type_decl << (((TYPE + type_id + CaselessLiteral("=") + underlying_type + CaselessLiteral(";") + Optional(where_clause) + END_TYPE + CaselessLiteral(";")))).set_parse_action(TypeDeclaration)
|
||||||
underlying_type << (((constructed_types | concrete_types))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="underlying_type"))
|
underlying_type << (((constructed_types | concrete_types))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="underlying_type"))
|
||||||
until_control << (((UNTIL + logical_expression))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="until_control"))
|
until_control << (((UNTIL + logical_expression))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="until_control"))
|
||||||
where_clause << (((WHERE + domain_rule + CaselessLiteral(";") + ZeroOrMore((domain_rule + CaselessLiteral(";")))))).setParseAction(lambda s, loc, t: ListNode(s, loc, t, rule="where_clause"))
|
where_clause << (((WHERE + domain_rule + CaselessLiteral(";") + ZeroOrMore((domain_rule + CaselessLiteral(";")))))).set_parse_action(lambda s, loc, t: ListNode(s, loc, t, rule="where_clause"))
|
||||||
while_control << (((WHILE + logical_expression))).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="while_control"))
|
while_control << (((WHILE + logical_expression))).set_parse_action(lambda s, loc, t: Node(s, loc, t, rule="while_control"))
|
||||||
width << (numeric_expression)
|
width << (numeric_expression)
|
||||||
width_spec << (((CaselessLiteral("(") + width + CaselessLiteral(")") + Optional(FIXED)))).setParseAction(WidthSpec)
|
width_spec << (((CaselessLiteral("(") + width + CaselessLiteral(")") + Optional(FIXED)))).set_parse_action(WidthSpec)
|
||||||
|
|
||||||
syntax.ignore("--" + restOfLine)
|
syntax.ignore("--" + restOfLine)
|
||||||
syntax.ignore(Regex(r"\((?:\*(?:[^*]*\*+)+?\))"))
|
syntax.ignore(Regex(r"\((?:\*(?:[^*]*\*+)+?\))"))
|
||||||
ast = syntax.parseFile(fn)
|
ast = syntax.parse_file(fn)
|
||||||
s = schema.Schema(ast)
|
s = schema.Schema(ast)
|
||||||
m = mapping.Mapping(s)
|
m = mapping.Mapping(s)
|
||||||
|
|
||||||
|
|||||||
@@ -263,7 +263,7 @@ context_class = context
|
|||||||
|
|
||||||
class codegen_rule:
|
class codegen_rule:
|
||||||
def __init__(self, pattern, fn):
|
def __init__(self, pattern, fn):
|
||||||
self.pattern = tuple(rule.parseString(pattern))
|
self.pattern = tuple(rule.parse_string(pattern))
|
||||||
self.fn = fn
|
self.fn = fn
|
||||||
if not hasattr(codegen_rule, "all_rules"):
|
if not hasattr(codegen_rule, "all_rules"):
|
||||||
codegen_rule.all_rules = []
|
codegen_rule.all_rules = []
|
||||||
|
|||||||
Reference in New Issue
Block a user