From e0246df26bf7d752d1af4368c559671a5633d6ac Mon Sep 17 00:00:00 2001 From: "Justin C. Miller" Date: Sun, 16 Jan 2022 15:11:58 -0800 Subject: [PATCH] [kernel] Add automatic verification to syscalls Since we have a DSL for specifying syscalls, we can create a verificaton method for each syscall that can cover most argument (and eventually capability) verification instead of doing it piecemeal in each syscall implementation, which can be more error-prone. Now a new _syscall_verify_* function exists for every syscall, which calls the real implementation. The syscall table for the syscall handler now maps to these verify functions. Other changes: - Updated the definition grammar to allow options to have a "key:value" style, to eventually support capabilities. - Added an "optional" option for parameters that says a syscall will accept a null value. - Some bonnibel fixes, as definition file changes weren't always properly causing updates in the build dep graph. - The syscall implementation function signatures are no longer exposed in syscall.h. Also, the unused syscall enum has been removed. --- assets/grammars/definitions.g | 3 +- definitions/objects/endpoint.def | 2 +- definitions/objects/process.def | 4 +- definitions/objects/system.def | 2 +- requirements.txt | 1 + scripts/bonnibel/module.py | 10 +- scripts/bonnibel/source.py | 2 + scripts/definitions/context.py | 12 +- scripts/definitions/parser.py | 374 ++++++++++++++++--------- scripts/definitions/types/__init__.py | 9 +- scripts/definitions/types/function.py | 12 + scripts/definitions/types/primitive.py | 10 +- scripts/definitions/types/type.py | 1 + src/kernel/kernel.module | 10 +- src/kernel/syscall.cpp.cog | 36 ++- src/kernel/syscall.h.cog | 41 +-- src/kernel/syscall_verify.cpp.cog | 73 +++++ src/kernel/syscalls/endpoint.cpp | 6 +- src/kernel/syscalls/object.cpp | 3 - src/kernel/syscalls/system.cpp | 20 +- src/kernel/syscalls/vm_area.cpp | 3 - 21 files changed, 415 insertions(+), 219 deletions(-) create mode 100644 src/kernel/syscall_verify.cpp.cog diff --git a/assets/grammars/definitions.g b/assets/grammars/definitions.g index 1523515..02f896f 100644 --- a/assets/grammars/definitions.g +++ b/assets/grammars/definitions.g @@ -26,13 +26,14 @@ object_name: "object" name id: NUMBER name: IDENTIFIER -options: "[" IDENTIFIER+ "]" +options: "[" ( OPTION | IDENTIFIER )+ "]" description: COMMENT+ PRIMITIVE: INT_TYPE | "size" | "string" | "buffer" | "address" INT_TYPE: /u?int(8|16|32|64)?/ NUMBER: /(0x)?[0-9a-fA-F]+/ UID: /[0-9a-fA-F]{16}/ +OPTION.2: IDENTIFIER ":" IDENTIFIER COMMENT: /#.*/ PATH: /"[^"]*"/ diff --git a/definitions/objects/endpoint.def b/definitions/objects/endpoint.def index 77dda93..e753894 100644 --- a/definitions/objects/endpoint.def +++ b/definitions/objects/endpoint.def @@ -17,7 +17,7 @@ object endpoint : kobject { # is available. method receive { param tag uint64 [out] - param data buffer [out] + param data buffer [out optional] param timeout uint64 # Receive timeout in nanoseconds } diff --git a/definitions/objects/process.def b/definitions/objects/process.def index 6113c45..0b6db39 100644 --- a/definitions/objects/process.def +++ b/definitions/objects/process.def @@ -28,7 +28,7 @@ object process : kobject { # Give the given process a handle that points to the same # object as the specified handle. method give_handle { - param sender object kobject # A handle in the caller process to send - param receiver object kobject [out] # The handle as the recipient will see it + param sender object kobject # A handle in the caller process to send + param receiver object kobject [out optional] # The handle as the recipient will see it } } diff --git a/definitions/objects/system.def b/definitions/objects/system.def index 0b6188d..cacb726 100644 --- a/definitions/objects/system.def +++ b/definitions/objects/system.def @@ -8,7 +8,7 @@ object system : kobject { # Get a log line from the kernel log method get_log { - param buffer buffer [out] # Buffer for the log message data structure + param buffer buffer [out optional] # Buffer for the log message data structure } # Ask the kernel to send this process messages whenever diff --git a/requirements.txt b/requirements.txt index 6cb549a..c7c90af 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,3 +2,4 @@ cogapp >= 3 ninja >= 1.10.2 peru >= 1.2.1 pyyaml >= 5.4 +lark == 0.12.0 diff --git a/scripts/bonnibel/module.py b/scripts/bonnibel/module.py index 5b98ecf..458f6cb 100644 --- a/scripts/bonnibel/module.py +++ b/scripts/bonnibel/module.py @@ -141,6 +141,7 @@ class Module: inputs = [] parse_deps = [] + parse_dep = "${module_dir}/.parse_dep.phony" for start in self.sources: source = start @@ -148,6 +149,11 @@ class Module: while source and source.action: output = source.output + if source.action.parse_deps: + oodeps = [parse_dep] + else: + oodeps = [] + if source.action.rule: build.newline() build.build( @@ -156,6 +162,7 @@ class Module: inputs = source.input, implicit = list(map(resolve, source.deps)) + list(source.action.deps), + order_only = oodeps, variables = {"name": source.name}, ) @@ -167,7 +174,6 @@ class Module: source = output - parse_dep = "${module_dir}/.parse_dep.phony" build.newline() build.build( rule = "touch", @@ -183,7 +189,7 @@ class Module: rule = self.kind, outputs = output, inputs = inputs, - implicit = [parse_dep] + libs, + implicit = libs, order_only = order_only, ) diff --git a/scripts/bonnibel/source.py b/scripts/bonnibel/source.py index 9064c00..020063a 100644 --- a/scripts/bonnibel/source.py +++ b/scripts/bonnibel/source.py @@ -3,6 +3,7 @@ class Action: implicit = property(lambda self: False) rule = property(lambda self: None) deps = property(lambda self: tuple()) + parse_deps = property(lambda self: False) def __init__(self, name): self.__name = name @@ -14,6 +15,7 @@ class Action: class Compile(Action): rule = property(lambda self: f'compile_{self.name}') deps = property(lambda self: ("${module_dir}/.parse_dep.phony",)) + parse_deps = property(lambda self: True) def __init__(self, name, suffix = ".o"): super().__init__(name) diff --git a/scripts/definitions/context.py b/scripts/definitions/context.py index 341183c..2aa9257 100644 --- a/scripts/definitions/context.py +++ b/scripts/definitions/context.py @@ -34,6 +34,7 @@ class Context: pending = set() pending.add(filename) + from .parser import LarkError from .parser import Lark_StandAlone as Parser from .transformer import DefTransformer @@ -47,7 +48,16 @@ class Context: path = self.find(name) parser = Parser(transformer=DefTransformer(name)) - imps, objs, ints = parser.parse(open(path, "r").read()) + + try: + imps, objs, ints = parser.parse(open(path, "r").read()) + except LarkError as e: + import sys + import textwrap + print(f"\nError parsing {name}:", file=sys.stderr) + print(textwrap.indent(str(e), " "), file=sys.stderr) + sys.exit(1) + objects.update(objs) interfaces.update(ints) diff --git a/scripts/definitions/parser.py b/scripts/definitions/parser.py index 46a19ac..d4e711d 100644 --- a/scripts/definitions/parser.py +++ b/scripts/definitions/parser.py @@ -1,5 +1,5 @@ -# The file was automatically generated by Lark v0.11.3 -__version__ = "0.11.3" +# The file was automatically generated by Lark v0.12.0 +__version__ = "0.12.0" # # @@ -124,7 +124,11 @@ class UnexpectedInput(LarkError): class UnexpectedEOF(ParseError, UnexpectedInput): + #-- + def __init__(self, expected, state=None, terminals_by_name=None): + super(UnexpectedEOF, self).__init__() + self.expected = expected self.state = state from .lexer import Token @@ -135,7 +139,6 @@ class UnexpectedEOF(ParseError, UnexpectedInput): self.column = -1 self._terminals_by_name = terminals_by_name - super(UnexpectedEOF, self).__init__() def __str__(self): message = "Unexpected end-of-input. " @@ -144,8 +147,12 @@ class UnexpectedEOF(ParseError, UnexpectedInput): class UnexpectedCharacters(LexError, UnexpectedInput): + #-- + def __init__(self, seq, lex_pos, line, column, allowed=None, considered_tokens=None, state=None, token_history=None, terminals_by_name=None, considered_rules=None): + super(UnexpectedCharacters, self).__init__() + ## self.line = line @@ -165,7 +172,6 @@ class UnexpectedCharacters(LexError, UnexpectedInput): self.char = seq[lex_pos] self._context = self.get_context(seq) - super(UnexpectedCharacters, self).__init__() def __str__(self): message = "No terminal matches '%s' in the current parser context, at line %d col %d" % (self.char, self.line, self.column) @@ -181,11 +187,13 @@ class UnexpectedToken(ParseError, UnexpectedInput): #-- def __init__(self, token, expected, considered_rules=None, state=None, interactive_parser=None, terminals_by_name=None, token_history=None): + super(UnexpectedToken, self).__init__() + ## self.line = getattr(token, 'line', '?') self.column = getattr(token, 'column', '?') - self.pos_in_stream = getattr(token, 'pos_in_stream', None) + self.pos_in_stream = getattr(token, 'start_pos', None) self.state = state self.token = token @@ -197,7 +205,6 @@ class UnexpectedToken(ParseError, UnexpectedInput): self._terminals_by_name = terminals_by_name self.token_history = token_history - super(UnexpectedToken, self).__init__() @property def accepts(self): @@ -224,12 +231,13 @@ class VisitError(LarkError): #-- def __init__(self, rule, obj, orig_exc): - self.obj = obj - self.orig_exc = orig_exc - message = 'Error trying to process rule "%s":\n\n%s' % (rule, orig_exc) super(VisitError, self).__init__(message) + self.rule = rule + self.obj = obj + self.orig_exc = orig_exc + import sys, re import logging @@ -297,14 +305,13 @@ class Serialize(object): fields = getattr(self, '__serialize_fields__') res = {f: _serialize(getattr(self, f), memo) for f in fields} res['__type__'] = type(self).__name__ - postprocess = getattr(self, '_serialize', None) - if postprocess: - postprocess(res, memo) + if hasattr(self, '_serialize'): + self._serialize(res, memo) return res @classmethod def deserialize(cls, data, memo): - namespace = getattr(cls, '__serialize_namespace__', {}) + namespace = getattr(cls, '__serialize_namespace__', []) namespace = {c.__name__:c for c in namespace} fields = getattr(cls, '__serialize_fields__') @@ -318,9 +325,10 @@ class Serialize(object): setattr(inst, f, _deserialize(data[f], namespace, memo)) except KeyError as e: raise KeyError("Cannot find key for class", cls, e) - postprocess = getattr(inst, '_deserialize', None) - if postprocess: - postprocess() + + if hasattr(inst, '_deserialize'): + inst._deserialize() + return inst @@ -408,7 +416,18 @@ def get_regexp_width(expr): try: return [int(x) for x in sre_parse.parse(regexp_final).getwidth()] except sre_constants.error: - raise ValueError(expr) + if not regex: + raise ValueError(expr) + else: + ## + + ## + + c = regex.compile(regexp_final) + if c.match('') is None: + return 1, sre_constants.MAXREPEAT + else: + return 0, sre_constants.MAXREPEAT from collections import OrderedDict @@ -603,6 +622,26 @@ class Transformer(_Decoratable): return token +def merge_transformers(base_transformer=None, **transformers_to_merge): + #-- + if base_transformer is None: + base_transformer = Transformer() + for prefix, transformer in transformers_to_merge.items(): + for method_name in dir(transformer): + method = getattr(transformer, method_name) + if not callable(method): + continue + if method_name.startswith("_") or method_name == "transform": + continue + prefixed_method = prefix + "__" + method_name + if hasattr(base_transformer, prefixed_method): + raise AttributeError("Cannot merge: method '%s' appears more than once" % prefixed_method) + + setattr(base_transformer, prefixed_method, method) + + return base_transformer + + class InlineTransformer(Transformer): ## def _call_userfunc(self, tree, new_children=None): @@ -957,6 +996,7 @@ class Rule(Serialize): +from warnings import warn from copy import copy @@ -1065,24 +1105,29 @@ class TerminalDef(Serialize): class Token(Str): #-- - __slots__ = ('type', 'pos_in_stream', 'value', 'line', 'column', 'end_line', 'end_column', 'end_pos') + __slots__ = ('type', 'start_pos', 'value', 'line', 'column', 'end_line', 'end_column', 'end_pos') - def __new__(cls, type_, value, pos_in_stream=None, line=None, column=None, end_line=None, end_column=None, end_pos=None): + def __new__(cls, type_, value, start_pos=None, line=None, column=None, end_line=None, end_column=None, end_pos=None, pos_in_stream=None): try: - self = super(Token, cls).__new__(cls, value) + inst = super(Token, cls).__new__(cls, value) except UnicodeDecodeError: value = value.decode('latin1') - self = super(Token, cls).__new__(cls, value) + inst = super(Token, cls).__new__(cls, value) - self.type = type_ - self.pos_in_stream = pos_in_stream - self.value = value - self.line = line - self.column = column - self.end_line = end_line - self.end_column = end_column - self.end_pos = end_pos - return self + inst.type = type_ + inst.start_pos = start_pos if start_pos is not None else pos_in_stream + inst.value = value + inst.line = line + inst.column = column + inst.end_line = end_line + inst.end_column = end_column + inst.end_pos = end_pos + return inst + + @property + def pos_in_stream(self): + warn("Attribute Token.pos_in_stream was renamed to Token.start_pos", DeprecationWarning, 2) + return self.start_pos def update(self, type_=None, value=None): return Token.new_borrow_pos( @@ -1093,16 +1138,16 @@ class Token(Str): @classmethod def new_borrow_pos(cls, type_, value, borrow_t): - return cls(type_, value, borrow_t.pos_in_stream, borrow_t.line, borrow_t.column, borrow_t.end_line, borrow_t.end_column, borrow_t.end_pos) + return cls(type_, value, borrow_t.start_pos, borrow_t.line, borrow_t.column, borrow_t.end_line, borrow_t.end_column, borrow_t.end_pos) def __reduce__(self): - return (self.__class__, (self.type, self.value, self.pos_in_stream, self.line, self.column)) + return (self.__class__, (self.type, self.value, self.start_pos, self.line, self.column)) def __repr__(self): return 'Token(%r, %r)' % (self.type, self.value) def __deepcopy__(self, memo): - return Token(self.type, self.value, self.pos_in_stream, self.line, self.column) + return Token(self.type, self.value, self.start_pos, self.line, self.column) def __eq__(self, other): if isinstance(other, Token) and self.type != other.type: @@ -1142,15 +1187,13 @@ class LineCounter: class UnlessCallback: - def __init__(self, mres): - self.mres = mres + def __init__(self, scanner): + self.scanner = scanner def __call__(self, t): - for mre, type_from_index in self.mres: - m = mre.match(t.value) - if m: - t.type = type_from_index[m.lastindex] - break + res = self.scanner.match(t.value, 0) + if res: + _value, t.type = res return t @@ -1165,6 +1208,11 @@ class CallChain: return self.callback2(t) if self.cond(t2) else t2 +def _get_match(re_, regexp, s, flags): + m = re_.match(regexp, s, flags) + if m: + return m.group(0) + def _create_unless(terminals, g_regex_flags, re_, use_bytes): tokens_by_type = classify(terminals, lambda t: type(t.pattern)) assert len(tokens_by_type) <= 2, tokens_by_type.keys() @@ -1176,44 +1224,58 @@ def _create_unless(terminals, g_regex_flags, re_, use_bytes): if strtok.priority > retok.priority: continue s = strtok.pattern.value - m = re_.match(retok.pattern.to_regexp(), s, g_regex_flags) - if m and m.group(0) == s: + if s == _get_match(re_, retok.pattern.to_regexp(), s, g_regex_flags): unless.append(strtok) if strtok.pattern.flags <= retok.pattern.flags: embedded_strs.add(strtok) if unless: - callback[retok.name] = UnlessCallback(build_mres(unless, g_regex_flags, re_, match_whole=True, use_bytes=use_bytes)) + callback[retok.name] = UnlessCallback(Scanner(unless, g_regex_flags, re_, match_whole=True, use_bytes=use_bytes)) - terminals = [t for t in terminals if t not in embedded_strs] - return terminals, callback + new_terminals = [t for t in terminals if t not in embedded_strs] + return new_terminals, callback -def _build_mres(terminals, max_size, g_regex_flags, match_whole, re_, use_bytes): - ## - ## +class Scanner: + def __init__(self, terminals, g_regex_flags, re_, use_bytes, match_whole=False): + self.terminals = terminals + self.g_regex_flags = g_regex_flags + self.re_ = re_ + self.use_bytes = use_bytes + self.match_whole = match_whole - ## + self.allowed_types = {t.name for t in self.terminals} - postfix = '$' if match_whole else '' - mres = [] - while terminals: - pattern = u'|'.join(u'(?P<%s>%s)' % (t.name, t.pattern.to_regexp() + postfix) for t in terminals[:max_size]) - if use_bytes: - pattern = pattern.encode('latin-1') - try: - mre = re_.compile(pattern, g_regex_flags) - except AssertionError: ## + self._mres = self._build_mres(terminals, len(terminals)) - return _build_mres(terminals, max_size//2, g_regex_flags, match_whole, re_, use_bytes) + def _build_mres(self, terminals, max_size): + ## - mres.append((mre, {i: n for n, i in mre.groupindex.items()})) - terminals = terminals[max_size:] - return mres + ## + ## -def build_mres(terminals, g_regex_flags, re_, use_bytes, match_whole=False): - return _build_mres(terminals, len(terminals), g_regex_flags, match_whole, re_, use_bytes) + postfix = '$' if self.match_whole else '' + mres = [] + while terminals: + pattern = u'|'.join(u'(?P<%s>%s)' % (t.name, t.pattern.to_regexp() + postfix) for t in terminals[:max_size]) + if self.use_bytes: + pattern = pattern.encode('latin-1') + try: + mre = self.re_.compile(pattern, self.g_regex_flags) + except AssertionError: ## + + return self._build_mres(terminals, max_size//2) + + mres.append((mre, {i: n for n, i in mre.groupindex.items()})) + terminals = terminals[max_size:] + return mres + + def match(self, text, pos): + for mre, type_from_index in self._mres: + m = mre.match(text, pos) + if m: + return m.group(0), type_from_index[m.lastindex] def _regexp_has_newline(r): @@ -1265,9 +1327,9 @@ class TraditionalLexer(Lexer): self.use_bytes = conf.use_bytes self.terminals_by_name = conf.terminals_by_name - self._mres = None + self._scanner = None - def _build(self): + def _build_scanner(self): terminals, self.callback = _create_unless(self.terminals, self.g_regex_flags, self.re, self.use_bytes) assert all(self.callback.values()) @@ -1279,19 +1341,16 @@ class TraditionalLexer(Lexer): else: self.callback[type_] = f - self._mres = build_mres(terminals, self.g_regex_flags, self.re, self.use_bytes) + self._scanner = Scanner(terminals, self.g_regex_flags, self.re, self.use_bytes) @property - def mres(self): - if self._mres is None: - self._build() - return self._mres + def scanner(self): + if self._scanner is None: + self._build_scanner() + return self._scanner def match(self, text, pos): - for mre, type_from_index in self.mres: - m = mre.match(text, pos) - if m: - return m.group(0), type_from_index[m.lastindex] + return self.scanner.match(text, pos) def lex(self, state, parser_state): with suppress(EOFError): @@ -1303,7 +1362,7 @@ class TraditionalLexer(Lexer): while line_ctr.char_pos < len(lex_state.text): res = self.match(lex_state.text, line_ctr.char_pos) if not res: - allowed = {v for m, tfi in self.mres for v in tfi.values()} - self.ignore_types + allowed = self.scanner.allowed_types - self.ignore_types if not allowed: allowed = {""} raise UnexpectedCharacters(lex_state.text, line_ctr.char_pos, line_ctr.line, line_ctr.column, @@ -1447,6 +1506,17 @@ class LexerConf(Serialize): def _deserialize(self): self.terminals_by_name = {t.name: t for t in self.terminals} + def __deepcopy__(self, memo=None): + return type(self)( + deepcopy(self.terminals, memo), + self.re_module, + deepcopy(self.ignore, memo), + deepcopy(self.postlex, memo), + deepcopy(self.callbacks, memo), + deepcopy(self.g_regex_flags, memo), + deepcopy(self.skip_validation, memo), + deepcopy(self.use_bytes, memo), + ) class ParserConf(Serialize): @@ -1476,51 +1546,73 @@ class ExpandSingleChild: return self.node_builder(children) + class PropagatePositions: - def __init__(self, node_builder): + def __init__(self, node_builder, node_filter=None): self.node_builder = node_builder + self.node_filter = node_filter def __call__(self, children): res = self.node_builder(children) - ## - if isinstance(res, Tree): - res_meta = res.meta - for c in children: - if isinstance(c, Tree): - child_meta = c.meta - if not child_meta.empty: - res_meta.line = child_meta.line - res_meta.column = child_meta.column - res_meta.start_pos = child_meta.start_pos - res_meta.empty = False - break - elif isinstance(c, Token): - res_meta.line = c.line - res_meta.column = c.column - res_meta.start_pos = c.pos_in_stream - res_meta.empty = False - break + ## - for c in reversed(children): - if isinstance(c, Tree): - child_meta = c.meta - if not child_meta.empty: - res_meta.end_line = child_meta.end_line - res_meta.end_column = child_meta.end_column - res_meta.end_pos = child_meta.end_pos - res_meta.empty = False - break - elif isinstance(c, Token): - res_meta.end_line = c.end_line - res_meta.end_column = c.end_column - res_meta.end_pos = c.end_pos + ## + + ## + + ## + + + res_meta = res.meta + + first_meta = self._pp_get_meta(children) + if first_meta is not None: + if not hasattr(res_meta, 'line'): + ## + + res_meta.line = getattr(first_meta, 'container_line', first_meta.line) + res_meta.column = getattr(first_meta, 'container_column', first_meta.column) + res_meta.start_pos = getattr(first_meta, 'container_start_pos', first_meta.start_pos) res_meta.empty = False - break + + res_meta.container_line = getattr(first_meta, 'container_line', first_meta.line) + res_meta.container_column = getattr(first_meta, 'container_column', first_meta.column) + + last_meta = self._pp_get_meta(reversed(children)) + if last_meta is not None: + if not hasattr(res_meta, 'end_line'): + res_meta.end_line = getattr(last_meta, 'container_end_line', last_meta.end_line) + res_meta.end_column = getattr(last_meta, 'container_end_column', last_meta.end_column) + res_meta.end_pos = getattr(last_meta, 'container_end_pos', last_meta.end_pos) + res_meta.empty = False + + res_meta.container_end_line = getattr(last_meta, 'container_end_line', last_meta.end_line) + res_meta.container_end_column = getattr(last_meta, 'container_end_column', last_meta.end_column) return res + def _pp_get_meta(self, children): + for c in children: + if self.node_filter is not None and not self.node_filter(c): + continue + if isinstance(c, Tree): + if not c.meta.empty: + return c.meta + elif isinstance(c, Token): + return c + +def make_propagate_positions(option): + if callable(option): + return partial(PropagatePositions, node_filter=option) + elif option is True: + return PropagatePositions + elif option is False: + return None + + raise ConfigurationError('Invalid option for propagate_positions: %r' % option) + class ChildFilter: def __init__(self, to_include, append_none, node_builder): @@ -1647,8 +1739,7 @@ class AmbiguousExpander: if i in self.to_expand: ambiguous.append(i) - to_expand = [j for j, grandchild in enumerate(child.children) if _is_ambig_tree(grandchild)] - child.expand_kids_by_index(*to_expand) + child.expand_kids_by_data('_ambig') if not ambiguous: return self.node_builder(children) @@ -1741,6 +1832,8 @@ class ParseTreeBuilder: self.rule_builders = list(self._init_builders(rules)) def _init_builders(self, rules): + propagate_positions = make_propagate_positions(self.propagate_positions) + for rule in rules: options = rule.options keep_all_tokens = options.keep_all_tokens @@ -1749,7 +1842,7 @@ class ParseTreeBuilder: wrapper_chain = list(filter(None, [ (expand_single_child and not rule.alias) and ExpandSingleChild, maybe_create_child_filter(rule.expansion, keep_all_tokens, self.ambiguous, options.empty_indices if self.maybe_placeholders else None), - self.propagate_positions and PropagatePositions, + propagate_positions, self.ambiguous and maybe_create_ambiguous_expander(self.tree_class, rule.expansion, keep_all_tokens), self.ambiguous and partial(AmbiguousIntermediateExpander, self.tree_class) ])) @@ -1961,8 +2054,8 @@ class _Parser(object): for token in state.lexer.lex(state): state.feed_token(token) - token = Token.new_borrow_pos('$END', '', token) if token else Token('$END', '', 0, 1, 1) - return state.feed_token(token, True) + end_token = Token.new_borrow_pos('$END', '', token) if token else Token('$END', '', 0, 1, 1) + return state.feed_token(end_token, True) except UnexpectedInput as e: try: e.interactive_parser = InteractiveParser(self, state, state.lexer) @@ -2072,8 +2165,7 @@ class MakeParsingFrontend: lexer_conf.lexer_type = self.lexer_type return ParsingFrontend(lexer_conf, parser_conf, options) - @classmethod - def deserialize(cls, data, memo, lexer_conf, callbacks, options): + def deserialize(self, data, memo, lexer_conf, callbacks, options): parser_conf = ParserConf.deserialize(data['parser_conf'], memo) parser = LALR_Parser.deserialize(data['parser'], memo, callbacks, options.debug) parser_conf.callbacks = callbacks @@ -2128,26 +2220,26 @@ class ParsingFrontend(Serialize): def _verify_start(self, start=None): if start is None: - start = self.parser_conf.start - if len(start) > 1: - raise ConfigurationError("Lark initialized with more than 1 possible start rule. Must specify which start rule to parse", start) - start ,= start + start_decls = self.parser_conf.start + if len(start_decls) > 1: + raise ConfigurationError("Lark initialized with more than 1 possible start rule. Must specify which start rule to parse", start_decls) + start ,= start_decls elif start not in self.parser_conf.start: raise ConfigurationError("Unknown start rule %s. Must be one of %r" % (start, self.parser_conf.start)) return start def parse(self, text, start=None, on_error=None): - start = self._verify_start(start) + chosen_start = self._verify_start(start) stream = text if self.skip_lexer else LexerThread(self.lexer, text) kw = {} if on_error is None else {'on_error': on_error} - return self.parser.parse(stream, start, **kw) + return self.parser.parse(stream, chosen_start, **kw) def parse_interactive(self, text=None, start=None): - start = self._verify_start(start) + chosen_start = self._verify_start(start) if self.parser_conf.parser_type != 'lalr': raise ConfigurationError("parse_interactive() currently only works with parser='lalr' ") stream = text if self.skip_lexer else LexerThread(self.lexer, text) - return self.parser.parse_interactive(stream, start) + return self.parser.parse_interactive(stream, chosen_start) def get_frontend(parser, lexer): @@ -2218,8 +2310,9 @@ class LarkOptions(Serialize): Applies the transformer to every parse tree (equivalent to applying it after the parse, but faster) propagate_positions Propagates (line, column, end_line, end_column) attributes into all tree branches. + Accepts ``False``, ``True``, or a callable, which will filter which nodes to ignore when propagating. maybe_placeholders - When True, the ``[]`` operator returns ``None`` when not matched. + When ``True``, the ``[]`` operator returns ``None`` when not matched. When ``False``, ``[]`` behaves like the ``?`` operator, and returns no value at all. (default= ``False``. Recommended to set to ``True``) @@ -2275,7 +2368,7 @@ class LarkOptions(Serialize): A List of either paths or loader functions to specify from where grammars are imported source_path Override the source of from where the grammar was loaded. Useful for relative imports and unconventional grammar loading - **=== End Options ===** + **=== End of Options ===** """ if __doc__: __doc__ += OPTIONS_DOC @@ -2327,7 +2420,7 @@ class LarkOptions(Serialize): for name, default in self._defaults.items(): if name in o: value = o.pop(name) - if isinstance(default, bool) and name not in ('cache', 'use_bytes'): + if isinstance(default, bool) and name not in ('cache', 'use_bytes', 'propagate_positions'): value = bool(value) else: value = default @@ -2343,7 +2436,7 @@ class LarkOptions(Serialize): assert_config(self.parser, ('earley', 'lalr', 'cyk', None)) if self.parser == 'earley' and self.transformer: - raise ConfigurationError('Cannot specify an embedded transformer when using the Earley algorithm.' + raise ConfigurationError('Cannot specify an embedded transformer when using the Earley algorithm. ' 'Please use your transformer on the resulting parse tree, or use a different algorithm (i.e. LALR)') if o: @@ -2522,7 +2615,9 @@ class Lark(Serialize): if self.options.ambiguity not in _VALID_AMBIGUITY_OPTIONS: raise ConfigurationError("invalid ambiguity option: %r. Must be one of %r" % (self.options.ambiguity, _VALID_AMBIGUITY_OPTIONS)) - if self.options.postlex is not None: + if self.options.parser is None: + terminals_to_keep = '*' + elif self.options.postlex is not None: terminals_to_keep = set(self.options.postlex.always_accept) else: terminals_to_keep = set() @@ -2635,11 +2730,11 @@ class Lark(Serialize): d = f else: d = pickle.load(f) - memo = d['memo'] + memo_json = d['memo'] data = d['data'] - assert memo - memo = SerializeMemoizer.deserialize(memo, {'Rule': Rule, 'TerminalDef': TerminalDef}, {}) + assert memo_json + memo = SerializeMemoizer.deserialize(memo_json, {'Rule': Rule, 'TerminalDef': TerminalDef}, {}) options = dict(data['options']) if (set(kwargs) - _LOAD_ALLOWED_OPTIONS) & set(LarkOptions._defaults): raise ConfigurationError("Some options are not allowed when loading a Parser: {}" @@ -2680,11 +2775,11 @@ class Lark(Serialize): @classmethod def open_from_package(cls, package, grammar_path, search_paths=("",), **options): #-- - package = FromPackageLoader(package, search_paths) - full_path, text = package(None, grammar_path) + package_loader = FromPackageLoader(package, search_paths) + full_path, text = package_loader(None, grammar_path) options.setdefault('source_path', full_path) options.setdefault('import_paths', []) - options['import_paths'].append(package) + options['import_paths'].append(package_loader) return cls(text, **options) def __repr__(self): @@ -2708,6 +2803,7 @@ class Lark(Serialize): return self._terminals_dict[name] def parse_interactive(self, text=None, start=None): + #-- return self.parser.parse_interactive(text, start=start) def parse(self, text, start=None, on_error=None): @@ -2716,7 +2812,7 @@ class Lark(Serialize): @property def source(self): - warn("Lark.source attribute has been renamed to Lark.source_path", DeprecationWarning) + warn("Attribute Lark.source was renamed to Lark.source_path", DeprecationWarning) return self.source_path @source.setter @@ -2725,7 +2821,7 @@ class Lark(Serialize): @property def grammar_source(self): - warn("Lark.grammar_source attribute has been renamed to Lark.source_grammar", DeprecationWarning) + warn("Attribute Lark.grammar_source was renamed to Lark.source_grammar", DeprecationWarning) return self.source_grammar @grammar_source.setter @@ -2798,10 +2894,10 @@ class Indenter(PostLex): import pickle, zlib, base64 DATA = ( -{'parser': {'lexer_conf': {'terminals': [{'@': 0}, {'@': 1}, {'@': 2}, {'@': 3}, {'@': 4}, {'@': 5}, {'@': 6}, {'@': 7}, {'@': 8}, {'@': 9}, {'@': 10}, {'@': 11}, {'@': 12}, {'@': 13}, {'@': 14}, {'@': 15}, {'@': 16}, {'@': 17}, {'@': 18}], 'ignore': ['WS'], 'g_regex_flags': 0, 'use_bytes': False, 'lexer_type': 'contextual', '__type__': 'LexerConf'}, 'parser_conf': {'rules': [{'@': 19}, {'@': 20}, {'@': 21}, {'@': 22}, {'@': 23}, {'@': 24}, {'@': 25}, {'@': 26}, {'@': 27}, {'@': 28}, {'@': 29}, {'@': 30}, {'@': 31}, {'@': 32}, {'@': 33}, {'@': 34}, {'@': 35}, {'@': 36}, {'@': 37}, {'@': 38}, {'@': 39}, {'@': 40}, {'@': 41}, {'@': 42}, {'@': 43}, {'@': 44}, {'@': 45}, {'@': 46}, {'@': 47}, {'@': 48}, {'@': 49}, {'@': 50}, {'@': 51}, {'@': 52}, {'@': 53}, {'@': 54}, {'@': 55}, {'@': 56}, {'@': 57}, {'@': 58}, {'@': 59}, {'@': 60}, {'@': 61}, {'@': 62}, {'@': 63}, {'@': 64}, {'@': 65}, {'@': 66}, {'@': 67}, {'@': 68}, {'@': 69}, {'@': 70}, {'@': 71}, {'@': 72}, {'@': 73}, {'@': 74}, {'@': 75}, {'@': 76}, {'@': 77}, {'@': 78}, {'@': 79}, {'@': 80}, {'@': 81}, {'@': 82}, {'@': 83}, {'@': 84}, {'@': 85}, {'@': 86}, {'@': 87}, {'@': 88}, {'@': 89}, {'@': 90}, {'@': 91}, {'@': 92}, {'@': 93}, {'@': 94}, {'@': 95}, {'@': 96}, {'@': 97}, {'@': 98}, {'@': 99}, {'@': 100}], 'start': ['start'], 'parser_type': 'lalr', '__type__': 'ParserConf'}, 'parser': {'tokens': {0: '__start_plus_1', 1: 'OBJECT', 2: 'description', 3: 'IMPORT', 4: 'INTERFACE', 5: 'start', 6: 'import_statement', 7: 'object', 8: '__start_star_0', 9: 'interface', 10: '__description_plus_6', 11: 'COMMENT', 12: 'name', 13: 'IDENTIFIER', 14: 'RBRACE', 15: 'PARAM', 16: 'METHOD', 17: 'method', 18: '__object_star_2', 19: '$END', 20: 'COLON', 21: 'LBRACE', 22: 'LSQB', 23: 'super', 24: 'options', 25: 'FUNCTION', 26: 'EXPOSE', 27: 'param', 28: 'object_name', 29: 'type', 30: 'PRIMITIVE', 31: '__function_star_4', 32: 'interface_param', 33: 'function', 34: 'expose', 35: 'PATH', 36: 'uid', 37: '__ANON_0', 38: 'RSQB', 39: '__interface_star_3', 40: 'UID', 41: '__options_plus_5'}, 'states': {0: {0: (0, 90), 1: (0, 129), 2: (0, 59), 3: (0, 39), 4: (0, 52), 5: (0, 25), 6: (0, 37), 7: (0, 8), 8: (0, 21), 9: (0, 66), 10: (0, 86), 11: (0, 111)}, 1: {12: (0, 112), 13: (0, 31)}, 2: {10: (0, 86), 11: (0, 111), 2: (0, 30), 14: (1, {'@': 76}), 15: (1, {'@': 76})}, 3: {12: (0, 95), 13: (0, 31)}, 4: {16: (1, {'@': 63}), 14: (1, {'@': 63}), 11: (1, {'@': 63})}, 5: {16: (0, 157), 17: (0, 126), 14: (0, 6), 2: (0, 10), 10: (0, 86), 18: (0, 22), 11: (0, 111)}, 6: {19: (1, {'@': 29}), 11: (1, {'@': 29}), 1: (1, {'@': 29}), 4: (1, {'@': 29})}, 7: {16: (1, {'@': 67}), 14: (1, {'@': 67}), 11: (1, {'@': 67})}, 8: {19: (1, {'@': 87}), 11: (1, {'@': 87}), 1: (1, {'@': 87}), 4: (1, {'@': 87})}, 9: {18: (0, 114), 16: (0, 157), 14: (0, 54), 17: (0, 126), 2: (0, 10), 10: (0, 86), 11: (0, 111)}, 10: {16: (0, 135)}, 11: {20: (0, 26), 21: (0, 134), 22: (0, 161), 23: (0, 15), 24: (0, 34)}, 12: {16: (0, 157), 17: (0, 126), 2: (0, 10), 10: (0, 86), 18: (0, 27), 11: (0, 111), 14: (0, 80)}, 13: {19: (1, {'@': 44}), 11: (1, {'@': 44}), 1: (1, {'@': 44}), 4: (1, {'@': 44})}, 14: {25: (1, {'@': 48}), 26: (1, {'@': 48}), 14: (1, {'@': 48}), 11: (1, {'@': 48})}, 15: {21: (0, 70)}, 16: {19: (1, {'@': 37}), 11: (1, {'@': 37}), 1: (1, {'@': 37}), 4: (1, {'@': 37})}, 17: {19: (1, {'@': 34}), 11: (1, {'@': 34}), 1: (1, {'@': 34}), 4: (1, {'@': 34})}, 18: {15: (0, 61), 14: (0, 105), 27: (0, 116)}, 19: {28: (0, 63), 29: (0, 14), 1: (0, 118), 30: (0, 127)}, 20: {15: (0, 61), 14: (0, 76), 27: (0, 116)}, 21: {1: (0, 129), 0: (0, 141), 2: (0, 59), 3: (0, 39), 4: (0, 52), 6: (0, 53), 7: (0, 8), 9: (0, 66), 10: (0, 86), 11: (0, 111)}, 22: {16: (0, 157), 2: (0, 10), 10: (0, 86), 11: (0, 111), 17: (0, 136), 14: (0, 115)}, 23: {14: (1, {'@': 77}), 15: (1, {'@': 77})}, 24: {25: (1, {'@': 46}), 26: (1, {'@': 46}), 14: (1, {'@': 46}), 11: (1, {'@': 46})}, 25: {}, 26: {13: (0, 31), 12: (0, 49)}, 27: {16: (0, 157), 2: (0, 10), 10: (0, 86), 11: (0, 111), 14: (0, 82), 17: (0, 136)}, 28: {15: (0, 61), 14: (0, 36), 27: (0, 116)}, 29: {15: (0, 61), 14: (0, 140), 27: (0, 116)}, 30: {14: (1, {'@': 75}), 15: (1, {'@': 75})}, 31: {25: (1, {'@': 82}), 22: (1, {'@': 82}), 26: (1, {'@': 82}), 14: (1, {'@': 82}), 11: (1, {'@': 82}), 21: (1, {'@': 82}), 30: (1, {'@': 82}), 1: (1, {'@': 82}), 20: (1, {'@': 82}), 15: (1, {'@': 82}), 16: (1, {'@': 82})}, 32: {21: (0, 151)}, 33: {31: (0, 29), 14: (0, 7), 27: (0, 72), 15: (0, 61)}, 34: {20: (0, 26), 21: (0, 60), 23: (0, 48)}, 35: {25: (1, {'@': 47}), 26: (1, {'@': 47}), 14: (1, {'@': 47}), 11: (1, {'@': 47})}, 36: {25: (1, {'@': 51}), 26: (1, {'@': 51}), 14: (1, {'@': 51}), 11: (1, {'@': 51})}, 37: {3: (1, {'@': 85}), 1: (1, {'@': 85}), 4: (1, {'@': 85}), 11: (1, {'@': 85})}, 38: {25: (0, 1), 2: (0, 43), 10: (0, 86), 32: (0, 84), 33: (0, 35), 34: (0, 24), 11: (0, 111), 26: (0, 19), 14: (0, 132)}, 39: {35: (0, 130)}, 40: {36: (0, 159), 37: (0, 158)}, 41: {19: (1, {'@': 39}), 11: (1, {'@': 39}), 1: (1, {'@': 39}), 4: (1, {'@': 39})}, 42: {25: (1, {'@': 81}), 26: (1, {'@': 81}), 14: (1, {'@': 81}), 11: (1, {'@': 81}), 22: (1, {'@': 81}), 15: (1, {'@': 81})}, 43: {25: (0, 3)}, 44: {19: (1, {'@': 42}), 11: (1, {'@': 42}), 1: (1, {'@': 42}), 4: (1, {'@': 42})}, 45: {25: (1, {'@': 58}), 26: (1, {'@': 58}), 14: (1, {'@': 58}), 11: (1, {'@': 58})}, 46: {21: (0, 138), 25: (1, {'@': 59}), 26: (1, {'@': 59}), 14: (1, {'@': 59}), 11: (1, {'@': 59})}, 47: {19: (1, {'@': 26}), 11: (1, {'@': 26}), 1: (1, {'@': 26}), 4: (1, {'@': 26})}, 48: {21: (0, 55)}, 49: {21: (1, {'@': 50})}, 50: {21: (0, 71), 16: (1, {'@': 71}), 14: (1, {'@': 71}), 11: (1, {'@': 71})}, 51: {16: (1, {'@': 64}), 14: (1, {'@': 64}), 11: (1, {'@': 64})}, 52: {12: (0, 100), 13: (0, 31)}, 53: {3: (1, {'@': 86}), 1: (1, {'@': 86}), 4: (1, {'@': 86}), 11: (1, {'@': 86})}, 54: {19: (1, {'@': 35}), 11: (1, {'@': 35}), 1: (1, {'@': 35}), 4: (1, {'@': 35})}, 55: {36: (0, 57), 37: (0, 158)}, 56: {16: (0, 157), 2: (0, 10), 14: (0, 104), 10: (0, 86), 11: (0, 111), 17: (0, 136)}, 57: {16: (0, 157), 14: (0, 83), 17: (0, 126), 2: (0, 10), 10: (0, 86), 18: (0, 85), 11: (0, 111)}, 58: {15: (0, 61), 14: (0, 92), 27: (0, 116)}, 59: {1: (0, 98), 4: (0, 67)}, 60: {36: (0, 12), 37: (0, 158)}, 61: {12: (0, 122), 13: (0, 31)}, 62: {25: (1, {'@': 93}), 26: (1, {'@': 93}), 14: (1, {'@': 93}), 11: (1, {'@': 93})}, 63: {25: (1, {'@': 80}), 26: (1, {'@': 80}), 14: (1, {'@': 80}), 11: (1, {'@': 80}), 15: (1, {'@': 80}), 22: (1, {'@': 80})}, 64: {19: (1, {'@': 40}), 11: (1, {'@': 40}), 1: (1, {'@': 40}), 4: (1, {'@': 40})}, 65: {25: (0, 1), 2: (0, 43), 10: (0, 86), 14: (0, 44), 32: (0, 84), 33: (0, 35), 34: (0, 24), 11: (0, 111), 26: (0, 19)}, 66: {19: (1, {'@': 88}), 11: (1, {'@': 88}), 1: (1, {'@': 88}), 4: (1, {'@': 88})}, 67: {12: (0, 162), 13: (0, 31)}, 68: {19: (1, {'@': 41}), 11: (1, {'@': 41}), 1: (1, {'@': 41}), 4: (1, {'@': 41})}, 69: {16: (1, {'@': 73}), 14: (1, {'@': 73}), 11: (1, {'@': 73})}, 70: {37: (0, 158), 36: (0, 77)}, 71: {31: (0, 18), 27: (0, 72), 15: (0, 61), 14: (0, 110)}, 72: {14: (1, {'@': 95}), 15: (1, {'@': 95})}, 73: {37: (0, 158), 36: (0, 154)}, 74: {25: (0, 1), 2: (0, 43), 10: (0, 86), 32: (0, 84), 33: (0, 35), 34: (0, 24), 11: (0, 111), 26: (0, 19), 14: (0, 64)}, 75: {19: (1, {'@': 27}), 11: (1, {'@': 27}), 1: (1, {'@': 27}), 4: (1, {'@': 27})}, 76: {25: (1, {'@': 57}), 26: (1, {'@': 57}), 14: (1, {'@': 57}), 11: (1, {'@': 57})}, 77: {16: (0, 157), 17: (0, 126), 2: (0, 10), 10: (0, 86), 18: (0, 145), 11: (0, 111), 14: (0, 75)}, 78: {19: (1, {'@': 90}), 11: (1, {'@': 90}), 1: (1, {'@': 90}), 4: (1, {'@': 90})}, 79: {16: (0, 157), 2: (0, 10), 14: (0, 119), 10: (0, 86), 11: (0, 111), 17: (0, 136)}, 80: {19: (1, {'@': 25}), 11: (1, {'@': 25}), 1: (1, {'@': 25}), 4: (1, {'@': 25})}, 81: {19: (1, {'@': 33}), 11: (1, {'@': 33}), 1: (1, {'@': 33}), 4: (1, {'@': 33})}, 82: {19: (1, {'@': 24}), 11: (1, {'@': 24}), 1: (1, {'@': 24}), 4: (1, {'@': 24})}, 83: {19: (1, {'@': 23}), 11: (1, {'@': 23}), 1: (1, {'@': 23}), 4: (1, {'@': 23})}, 84: {25: (1, {'@': 94}), 26: (1, {'@': 94}), 14: (1, {'@': 94}), 11: (1, {'@': 94})}, 85: {14: (0, 139), 16: (0, 157), 2: (0, 10), 10: (0, 86), 11: (0, 111), 17: (0, 136)}, 86: {11: (0, 133), 1: (1, {'@': 84}), 4: (1, {'@': 84}), 14: (1, {'@': 84}), 15: (1, {'@': 84}), 16: (1, {'@': 84}), 25: (1, {'@': 84})}, 87: {20: (0, 26), 23: (0, 150), 22: (0, 161), 24: (0, 164), 21: (0, 155)}, 88: {13: (1, {'@': 98}), 38: (1, {'@': 98})}, 89: {31: (0, 97), 27: (0, 72), 14: (0, 99), 15: (0, 61)}, 90: {1: (0, 129), 2: (0, 59), 9: (0, 78), 10: (0, 86), 4: (0, 52), 7: (0, 143), 11: (0, 111), 19: (1, {'@': 20})}, 91: {21: (0, 128), 25: (1, {'@': 53}), 26: (1, {'@': 53}), 14: (1, {'@': 53}), 11: (1, {'@': 53})}, 92: {16: (1, {'@': 72}), 14: (1, {'@': 72}), 11: (1, {'@': 72})}, 93: {19: (1, {'@': 30}), 11: (1, {'@': 30}), 1: (1, {'@': 30}), 4: (1, {'@': 30})}, 94: {19: (1, {'@': 43}), 11: (1, {'@': 43}), 1: (1, {'@': 43}), 4: (1, {'@': 43})}, 95: {24: (0, 91), 22: (0, 161), 21: (0, 108), 25: (1, {'@': 56}), 26: (1, {'@': 56}), 14: (1, {'@': 56}), 11: (1, {'@': 56})}, 96: {25: (1, {'@': 60}), 26: (1, {'@': 60}), 14: (1, {'@': 60}), 11: (1, {'@': 60})}, 97: {15: (0, 61), 14: (0, 96), 27: (0, 116)}, 98: {12: (0, 11), 13: (0, 31)}, 99: {25: (1, {'@': 61}), 26: (1, {'@': 61}), 14: (1, {'@': 61}), 11: (1, {'@': 61})}, 100: {24: (0, 153), 21: (0, 147), 22: (0, 161)}, 101: {37: (0, 158), 36: (0, 123)}, 102: {16: (0, 157), 17: (0, 126), 2: (0, 10), 10: (0, 86), 18: (0, 79), 11: (0, 111), 14: (0, 81)}, 103: {19: (1, {'@': 45}), 11: (1, {'@': 45}), 1: (1, {'@': 45}), 4: (1, {'@': 45})}, 104: {19: (1, {'@': 36}), 11: (1, {'@': 36}), 1: (1, {'@': 36}), 4: (1, {'@': 36})}, 105: {16: (1, {'@': 69}), 14: (1, {'@': 69}), 11: (1, {'@': 69})}, 106: {25: (1, {'@': 54}), 26: (1, {'@': 54}), 14: (1, {'@': 54}), 11: (1, {'@': 54})}, 107: {24: (0, 142), 21: (0, 33), 22: (0, 161), 16: (1, {'@': 68}), 14: (1, {'@': 68}), 11: (1, {'@': 68})}, 108: {31: (0, 144), 14: (0, 125), 27: (0, 72), 15: (0, 61)}, 109: {25: (0, 1), 39: (0, 38), 2: (0, 43), 10: (0, 86), 33: (0, 35), 34: (0, 24), 11: (0, 111), 26: (0, 19), 32: (0, 62), 14: (0, 41)}, 110: {16: (1, {'@': 70}), 14: (1, {'@': 70}), 11: (1, {'@': 70})}, 111: {11: (1, {'@': 99}), 1: (1, {'@': 99}), 4: (1, {'@': 99}), 14: (1, {'@': 99}), 15: (1, {'@': 99}), 16: (1, {'@': 99}), 25: (1, {'@': 99})}, 112: {24: (0, 46), 21: (0, 89), 22: (0, 161), 25: (1, {'@': 62}), 26: (1, {'@': 62}), 14: (1, {'@': 62}), 11: (1, {'@': 62})}, 113: {19: (1, {'@': 31}), 11: (1, {'@': 31}), 1: (1, {'@': 31}), 4: (1, {'@': 31})}, 114: {16: (0, 157), 2: (0, 10), 10: (0, 86), 14: (0, 17), 11: (0, 111), 17: (0, 136)}, 115: {19: (1, {'@': 28}), 11: (1, {'@': 28}), 1: (1, {'@': 28}), 4: (1, {'@': 28})}, 116: {14: (1, {'@': 96}), 15: (1, {'@': 96})}, 117: {31: (0, 148), 27: (0, 72), 15: (0, 61), 14: (0, 51)}, 118: {13: (0, 31), 12: (0, 42)}, 119: {19: (1, {'@': 32}), 11: (1, {'@': 32}), 1: (1, {'@': 32}), 4: (1, {'@': 32})}, 120: {24: (0, 2), 11: (0, 111), 22: (0, 161), 10: (0, 86), 2: (0, 23), 14: (1, {'@': 78}), 15: (1, {'@': 78})}, 121: {16: (0, 157), 2: (0, 10), 10: (0, 86), 14: (0, 93), 11: (0, 111), 17: (0, 136)}, 122: {29: (0, 120), 30: (0, 127), 1: (0, 118), 28: (0, 63)}, 123: {18: (0, 121), 16: (0, 157), 17: (0, 126), 2: (0, 10), 10: (0, 86), 14: (0, 113), 11: (0, 111)}, 124: {24: (0, 50), 21: (0, 131), 22: (0, 161), 16: (1, {'@': 74}), 14: (1, {'@': 74}), 11: (1, {'@': 74})}, 125: {25: (1, {'@': 55}), 26: (1, {'@': 55}), 14: (1, {'@': 55}), 11: (1, {'@': 55})}, 126: {16: (1, {'@': 91}), 14: (1, {'@': 91}), 11: (1, {'@': 91})}, 127: {25: (1, {'@': 79}), 26: (1, {'@': 79}), 14: (1, {'@': 79}), 11: (1, {'@': 79}), 15: (1, {'@': 79}), 22: (1, {'@': 79})}, 128: {31: (0, 28), 27: (0, 72), 15: (0, 61), 14: (0, 146)}, 129: {12: (0, 87), 13: (0, 31)}, 130: {3: (1, {'@': 21}), 1: (1, {'@': 21}), 4: (1, {'@': 21}), 11: (1, {'@': 21})}, 131: {31: (0, 58), 27: (0, 72), 15: (0, 61), 14: (0, 69)}, 132: {19: (1, {'@': 38}), 11: (1, {'@': 38}), 1: (1, {'@': 38}), 4: (1, {'@': 38})}, 133: {11: (1, {'@': 100}), 1: (1, {'@': 100}), 4: (1, {'@': 100}), 14: (1, {'@': 100}), 15: (1, {'@': 100}), 16: (1, {'@': 100}), 25: (1, {'@': 100})}, 134: {37: (0, 158), 36: (0, 5)}, 135: {12: (0, 107), 13: (0, 31)}, 136: {16: (1, {'@': 92}), 14: (1, {'@': 92}), 11: (1, {'@': 92})}, 137: {14: (0, 13), 25: (0, 1), 2: (0, 43), 10: (0, 86), 32: (0, 84), 33: (0, 35), 34: (0, 24), 11: (0, 111), 26: (0, 19)}, 138: {31: (0, 20), 27: (0, 72), 15: (0, 61), 14: (0, 45)}, 139: {19: (1, {'@': 22}), 11: (1, {'@': 22}), 1: (1, {'@': 22}), 4: (1, {'@': 22})}, 140: {16: (1, {'@': 66}), 14: (1, {'@': 66}), 11: (1, {'@': 66})}, 141: {1: (0, 129), 2: (0, 59), 9: (0, 78), 10: (0, 86), 4: (0, 52), 7: (0, 143), 11: (0, 111), 19: (1, {'@': 19})}, 142: {21: (0, 117), 16: (1, {'@': 65}), 14: (1, {'@': 65}), 11: (1, {'@': 65})}, 143: {19: (1, {'@': 89}), 11: (1, {'@': 89}), 1: (1, {'@': 89}), 4: (1, {'@': 89})}, 144: {15: (0, 61), 14: (0, 106), 27: (0, 116)}, 145: {14: (0, 47), 16: (0, 157), 2: (0, 10), 10: (0, 86), 11: (0, 111), 17: (0, 136)}, 146: {25: (1, {'@': 52}), 26: (1, {'@': 52}), 14: (1, {'@': 52}), 11: (1, {'@': 52})}, 147: {36: (0, 166), 37: (0, 158)}, 148: {15: (0, 61), 27: (0, 116), 14: (0, 4)}, 149: {20: (1, {'@': 83}), 21: (1, {'@': 83}), 25: (1, {'@': 83}), 26: (1, {'@': 83}), 14: (1, {'@': 83}), 11: (1, {'@': 83}), 16: (1, {'@': 83}), 15: (1, {'@': 83})}, 150: {21: (0, 152)}, 151: {37: (0, 158), 36: (0, 109)}, 152: {37: (0, 158), 36: (0, 9)}, 153: {21: (0, 40)}, 154: {25: (0, 1), 14: (0, 68), 39: (0, 74), 2: (0, 43), 10: (0, 86), 33: (0, 35), 34: (0, 24), 11: (0, 111), 26: (0, 19), 32: (0, 62)}, 155: {37: (0, 158), 36: (0, 167)}, 156: {38: (0, 149), 13: (0, 88)}, 157: {12: (0, 124), 13: (0, 31)}, 158: {40: (0, 165)}, 159: {25: (0, 1), 39: (0, 65), 2: (0, 43), 10: (0, 86), 14: (0, 94), 33: (0, 35), 34: (0, 24), 11: (0, 111), 26: (0, 19), 32: (0, 62)}, 160: {21: (0, 101)}, 161: {13: (0, 163), 41: (0, 156)}, 162: {24: (0, 32), 21: (0, 73), 22: (0, 161)}, 163: {13: (1, {'@': 97}), 38: (1, {'@': 97})}, 164: {21: (0, 168), 20: (0, 26), 23: (0, 160)}, 165: {25: (1, {'@': 49}), 26: (1, {'@': 49}), 14: (1, {'@': 49}), 11: (1, {'@': 49}), 16: (1, {'@': 49})}, 166: {25: (0, 1), 39: (0, 137), 2: (0, 43), 10: (0, 86), 33: (0, 35), 34: (0, 24), 11: (0, 111), 26: (0, 19), 14: (0, 103), 32: (0, 62)}, 167: {16: (0, 157), 17: (0, 126), 2: (0, 10), 10: (0, 86), 18: (0, 56), 14: (0, 16), 11: (0, 111)}, 168: {37: (0, 158), 36: (0, 102)}}, 'start_states': {'start': 0}, 'end_states': {'start': 25}}, 'options': {'debug': False, 'keep_all_tokens': False, 'tree_class': None, 'cache': False, 'postlex': None, 'parser': 'lalr', 'lexer': 'contextual', 'transformer': None, 'start': ['start'], 'priority': 'normal', 'ambiguity': 'auto', 'regex': False, 'propagate_positions': False, 'lexer_callbacks': {}, 'maybe_placeholders': False, 'edit_terminals': None, 'g_regex_flags': 0, 'use_bytes': False, 'import_paths': [], 'source_path': None}, '__type__': 'ParsingFrontend'}, 'rules': [{'@': 19}, {'@': 20}, {'@': 21}, {'@': 22}, {'@': 23}, {'@': 24}, {'@': 25}, {'@': 26}, {'@': 27}, {'@': 28}, {'@': 29}, {'@': 30}, {'@': 31}, {'@': 32}, {'@': 33}, {'@': 34}, {'@': 35}, {'@': 36}, {'@': 37}, {'@': 38}, {'@': 39}, {'@': 40}, {'@': 41}, {'@': 42}, {'@': 43}, {'@': 44}, {'@': 45}, {'@': 46}, {'@': 47}, {'@': 48}, {'@': 49}, {'@': 50}, {'@': 51}, {'@': 52}, {'@': 53}, {'@': 54}, {'@': 55}, {'@': 56}, {'@': 57}, {'@': 58}, {'@': 59}, {'@': 60}, {'@': 61}, {'@': 62}, {'@': 63}, {'@': 64}, {'@': 65}, {'@': 66}, {'@': 67}, {'@': 68}, {'@': 69}, {'@': 70}, {'@': 71}, {'@': 72}, {'@': 73}, {'@': 74}, {'@': 75}, {'@': 76}, {'@': 77}, {'@': 78}, {'@': 79}, {'@': 80}, {'@': 81}, {'@': 82}, {'@': 83}, {'@': 84}, {'@': 85}, {'@': 86}, {'@': 87}, {'@': 88}, {'@': 89}, {'@': 90}, {'@': 91}, {'@': 92}, {'@': 93}, {'@': 94}, {'@': 95}, {'@': 96}, {'@': 97}, {'@': 98}, {'@': 99}, {'@': 100}], 'options': {'debug': False, 'keep_all_tokens': False, 'tree_class': None, 'cache': False, 'postlex': None, 'parser': 'lalr', 'lexer': 'contextual', 'transformer': None, 'start': ['start'], 'priority': 'normal', 'ambiguity': 'auto', 'regex': False, 'propagate_positions': False, 'lexer_callbacks': {}, 'maybe_placeholders': False, 'edit_terminals': None, 'g_regex_flags': 0, 'use_bytes': False, 'import_paths': [], 'source_path': None}, '__type__': 'Lark'} +{'parser': {'lexer_conf': {'terminals': [{'@': 0}, {'@': 1}, {'@': 2}, {'@': 3}, {'@': 4}, {'@': 5}, {'@': 6}, {'@': 7}, {'@': 8}, {'@': 9}, {'@': 10}, {'@': 11}, {'@': 12}, {'@': 13}, {'@': 14}, {'@': 15}, {'@': 16}, {'@': 17}, {'@': 18}, {'@': 19}], 'ignore': ['WS'], 'g_regex_flags': 0, 'use_bytes': False, 'lexer_type': 'contextual', '__type__': 'LexerConf'}, 'parser_conf': {'rules': [{'@': 20}, {'@': 21}, {'@': 22}, {'@': 23}, {'@': 24}, {'@': 25}, {'@': 26}, {'@': 27}, {'@': 28}, {'@': 29}, {'@': 30}, {'@': 31}, {'@': 32}, {'@': 33}, {'@': 34}, {'@': 35}, {'@': 36}, {'@': 37}, {'@': 38}, {'@': 39}, {'@': 40}, {'@': 41}, {'@': 42}, {'@': 43}, {'@': 44}, {'@': 45}, {'@': 46}, {'@': 47}, {'@': 48}, {'@': 49}, {'@': 50}, {'@': 51}, {'@': 52}, {'@': 53}, {'@': 54}, {'@': 55}, {'@': 56}, {'@': 57}, {'@': 58}, {'@': 59}, {'@': 60}, {'@': 61}, {'@': 62}, {'@': 63}, {'@': 64}, {'@': 65}, {'@': 66}, {'@': 67}, {'@': 68}, {'@': 69}, {'@': 70}, {'@': 71}, {'@': 72}, {'@': 73}, {'@': 74}, {'@': 75}, {'@': 76}, {'@': 77}, {'@': 78}, {'@': 79}, {'@': 80}, {'@': 81}, {'@': 82}, {'@': 83}, {'@': 84}, {'@': 85}, {'@': 86}, {'@': 87}, {'@': 88}, {'@': 89}, {'@': 90}, {'@': 91}, {'@': 92}, {'@': 93}, {'@': 94}, {'@': 95}, {'@': 96}, {'@': 97}, {'@': 98}, {'@': 99}, {'@': 100}, {'@': 101}, {'@': 102}, {'@': 103}], 'start': ['start'], 'parser_type': 'lalr', '__type__': 'ParserConf'}, 'parser': {'tokens': {0: 'FUNCTION', 1: 'PARAM', 2: 'RBRACE', 3: 'COMMENT', 4: 'EXPOSE', 5: 'METHOD', 6: 'description', 7: '__description_plus_6', 8: 'method', 9: 'LBRACE', 10: 'COLON', 11: 'super', 12: 'LSQB', 13: 'options', 14: '$END', 15: 'OBJECT', 16: 'INTERFACE', 17: '__options_plus_5', 18: 'OPTION', 19: 'IDENTIFIER', 20: '__object_star_2', 21: 'function', 22: '__interface_star_3', 23: 'expose', 24: 'interface_param', 25: 'name', 26: '__function_star_4', 27: 'param', 28: 'interface', 29: 'object', 30: 'RSQB', 31: '__ANON_0', 32: 'uid', 33: 'UID', 34: 'PRIMITIVE', 35: 'type', 36: 'object_name', 37: 'IMPORT', 38: '__start_plus_1', 39: '__start_star_0', 40: 'import_statement', 41: 'start', 42: 'PATH'}, 'states': {0: {0: (0, 74)}, 1: {1: (1, {'@': 78}), 2: (1, {'@': 78})}, 2: {0: (1, {'@': 47}), 3: (1, {'@': 47}), 2: (1, {'@': 47}), 4: (1, {'@': 47})}, 3: {5: (0, 78), 6: (0, 43), 7: (0, 106), 3: (0, 145), 2: (0, 117), 8: (0, 27)}, 4: {9: (0, 99), 10: (0, 55), 11: (0, 24), 12: (0, 8), 13: (0, 21)}, 5: {14: (1, {'@': 90}), 3: (1, {'@': 90}), 15: (1, {'@': 90}), 16: (1, {'@': 90})}, 6: {14: (1, {'@': 26}), 3: (1, {'@': 26}), 15: (1, {'@': 26}), 16: (1, {'@': 26})}, 7: {1: (1, {'@': 76}), 2: (1, {'@': 76})}, 8: {17: (0, 166), 18: (0, 136), 19: (0, 148)}, 9: {13: (0, 146), 9: (0, 19), 12: (0, 8), 0: (1, {'@': 63}), 3: (1, {'@': 63}), 2: (1, {'@': 63}), 4: (1, {'@': 63})}, 10: {5: (0, 78), 6: (0, 43), 20: (0, 3), 8: (0, 29), 7: (0, 106), 3: (0, 145), 2: (0, 45)}, 11: {6: (0, 0), 21: (0, 17), 0: (0, 40), 2: (0, 130), 22: (0, 133), 23: (0, 2), 7: (0, 106), 3: (0, 145), 24: (0, 77), 4: (0, 70)}, 12: {19: (0, 132), 25: (0, 126)}, 13: {0: (1, {'@': 53}), 3: (1, {'@': 53}), 2: (1, {'@': 53}), 4: (1, {'@': 53})}, 14: {0: (1, {'@': 56}), 3: (1, {'@': 56}), 2: (1, {'@': 56}), 4: (1, {'@': 56})}, 15: {14: (1, {'@': 31}), 3: (1, {'@': 31}), 15: (1, {'@': 31}), 16: (1, {'@': 31})}, 16: {0: (1, {'@': 59}), 3: (1, {'@': 59}), 2: (1, {'@': 59}), 4: (1, {'@': 59})}, 17: {0: (1, {'@': 48}), 3: (1, {'@': 48}), 2: (1, {'@': 48}), 4: (1, {'@': 48})}, 18: {25: (0, 85), 19: (0, 132)}, 19: {2: (0, 113), 26: (0, 137), 27: (0, 36), 1: (0, 12)}, 20: {14: (1, {'@': 23}), 3: (1, {'@': 23}), 15: (1, {'@': 23}), 16: (1, {'@': 23})}, 21: {9: (0, 103), 11: (0, 100), 10: (0, 55)}, 22: {14: (1, {'@': 41}), 3: (1, {'@': 41}), 15: (1, {'@': 41}), 16: (1, {'@': 41})}, 23: {3: (1, {'@': 74}), 2: (1, {'@': 74}), 5: (1, {'@': 74})}, 24: {9: (0, 92)}, 25: {3: (1, {'@': 103}), 5: (1, {'@': 103}), 0: (1, {'@': 103}), 15: (1, {'@': 103}), 16: (1, {'@': 103}), 1: (1, {'@': 103}), 2: (1, {'@': 103})}, 26: {14: (1, {'@': 37}), 3: (1, {'@': 37}), 15: (1, {'@': 37}), 16: (1, {'@': 37})}, 27: {3: (1, {'@': 93}), 2: (1, {'@': 93}), 5: (1, {'@': 93})}, 28: {3: (1, {'@': 68}), 2: (1, {'@': 68}), 5: (1, {'@': 68})}, 29: {3: (1, {'@': 92}), 2: (1, {'@': 92}), 5: (1, {'@': 92})}, 30: {13: (0, 98), 9: (0, 91), 10: (0, 55), 11: (0, 51), 12: (0, 8)}, 31: {16: (0, 147), 15: (0, 68), 6: (0, 80), 7: (0, 106), 28: (0, 38), 3: (0, 145), 29: (0, 5), 14: (1, {'@': 20})}, 32: {6: (0, 0), 21: (0, 17), 0: (0, 40), 24: (0, 119), 23: (0, 2), 7: (0, 106), 3: (0, 145), 4: (0, 70), 2: (0, 160)}, 33: {14: (1, {'@': 27}), 3: (1, {'@': 27}), 15: (1, {'@': 27}), 16: (1, {'@': 27})}, 34: {2: (0, 131), 27: (0, 149), 1: (0, 12)}, 35: {19: (0, 132), 25: (0, 159)}, 36: {1: (1, {'@': 96}), 2: (1, {'@': 96})}, 37: {1: (0, 12), 26: (0, 44), 27: (0, 36), 2: (0, 16)}, 38: {14: (1, {'@': 91}), 3: (1, {'@': 91}), 15: (1, {'@': 91}), 16: (1, {'@': 91})}, 39: {30: (1, {'@': 101}), 19: (1, {'@': 101}), 18: (1, {'@': 101})}, 40: {25: (0, 9), 19: (0, 132)}, 41: {6: (0, 0), 21: (0, 17), 0: (0, 40), 23: (0, 2), 7: (0, 106), 3: (0, 145), 24: (0, 77), 4: (0, 70), 22: (0, 56), 2: (0, 101)}, 42: {5: (0, 78), 6: (0, 43), 2: (0, 116), 20: (0, 127), 8: (0, 29), 7: (0, 106), 3: (0, 145)}, 43: {5: (0, 18)}, 44: {1: (0, 12), 27: (0, 149), 2: (0, 46)}, 45: {14: (1, {'@': 30}), 3: (1, {'@': 30}), 15: (1, {'@': 30}), 16: (1, {'@': 30})}, 46: {0: (1, {'@': 58}), 3: (1, {'@': 58}), 2: (1, {'@': 58}), 4: (1, {'@': 58})}, 47: {31: (0, 65), 32: (0, 41)}, 48: {5: (0, 78), 6: (0, 43), 7: (0, 106), 3: (0, 145), 2: (0, 26), 8: (0, 27)}, 49: {26: (0, 34), 27: (0, 36), 1: (0, 12), 2: (0, 28)}, 50: {7: (0, 106), 6: (0, 1), 3: (0, 145), 12: (0, 8), 13: (0, 59), 1: (1, {'@': 79}), 2: (1, {'@': 79})}, 51: {9: (0, 112)}, 52: {2: (0, 83), 27: (0, 149), 1: (0, 12)}, 53: {14: (1, {'@': 39}), 3: (1, {'@': 39}), 15: (1, {'@': 39}), 16: (1, {'@': 39})}, 54: {14: (1, {'@': 38}), 3: (1, {'@': 38}), 15: (1, {'@': 38}), 16: (1, {'@': 38})}, 55: {19: (0, 132), 25: (0, 60)}, 56: {6: (0, 0), 21: (0, 17), 2: (0, 53), 0: (0, 40), 24: (0, 119), 23: (0, 2), 7: (0, 106), 3: (0, 145), 4: (0, 70)}, 57: {14: (1, {'@': 36}), 3: (1, {'@': 36}), 15: (1, {'@': 36}), 16: (1, {'@': 36})}, 58: {3: (1, {'@': 70}), 2: (1, {'@': 70}), 5: (1, {'@': 70})}, 59: {7: (0, 106), 6: (0, 7), 3: (0, 145), 1: (1, {'@': 77}), 2: (1, {'@': 77})}, 60: {9: (1, {'@': 51})}, 61: {12: (0, 8), 13: (0, 124), 9: (0, 165), 3: (1, {'@': 75}), 2: (1, {'@': 75}), 5: (1, {'@': 75})}, 62: {9: (0, 102), 12: (0, 8), 13: (0, 81)}, 63: {14: (1, {'@': 34}), 3: (1, {'@': 34}), 15: (1, {'@': 34}), 16: (1, {'@': 34})}, 64: {0: (1, {'@': 52}), 3: (1, {'@': 52}), 2: (1, {'@': 52}), 4: (1, {'@': 52})}, 65: {33: (0, 69)}, 66: {2: (0, 151), 27: (0, 36), 26: (0, 121), 1: (0, 12)}, 67: {9: (0, 105)}, 68: {25: (0, 30), 19: (0, 132)}, 69: {0: (1, {'@': 50}), 3: (1, {'@': 50}), 2: (1, {'@': 50}), 4: (1, {'@': 50}), 5: (1, {'@': 50})}, 70: {15: (0, 35), 34: (0, 154), 35: (0, 139), 36: (0, 157)}, 71: {2: (0, 90), 27: (0, 149), 1: (0, 12)}, 72: {5: (0, 78), 6: (0, 43), 2: (0, 75), 7: (0, 106), 3: (0, 145), 8: (0, 27)}, 73: {31: (0, 65), 32: (0, 42)}, 74: {25: (0, 115), 19: (0, 132)}, 75: {14: (1, {'@': 35}), 3: (1, {'@': 35}), 15: (1, {'@': 35}), 16: (1, {'@': 35})}, 76: {32: (0, 109), 31: (0, 65)}, 77: {0: (1, {'@': 94}), 3: (1, {'@': 94}), 2: (1, {'@': 94}), 4: (1, {'@': 94})}, 78: {25: (0, 61), 19: (0, 132)}, 79: {5: (0, 78), 6: (0, 43), 8: (0, 29), 20: (0, 142), 7: (0, 106), 3: (0, 145), 2: (0, 6)}, 80: {15: (0, 150), 16: (0, 164)}, 81: {9: (0, 47)}, 82: {27: (0, 149), 2: (0, 64), 1: (0, 12)}, 83: {0: (1, {'@': 55}), 3: (1, {'@': 55}), 2: (1, {'@': 55}), 4: (1, {'@': 55})}, 84: {37: (1, {'@': 87}), 3: (1, {'@': 87}), 15: (1, {'@': 87}), 16: (1, {'@': 87})}, 85: {13: (0, 97), 9: (0, 49), 12: (0, 8), 3: (1, {'@': 69}), 2: (1, {'@': 69}), 5: (1, {'@': 69})}, 86: {15: (0, 68), 6: (0, 80), 16: (0, 147), 29: (0, 168), 38: (0, 138), 37: (0, 111), 28: (0, 144), 39: (0, 129), 7: (0, 106), 3: (0, 145), 40: (0, 134), 41: (0, 122)}, 87: {27: (0, 149), 2: (0, 141), 1: (0, 12)}, 88: {13: (0, 67), 9: (0, 76), 12: (0, 8)}, 89: {5: (0, 78), 6: (0, 43), 2: (0, 120), 7: (0, 106), 3: (0, 145), 8: (0, 27)}, 90: {3: (1, {'@': 64}), 2: (1, {'@': 64}), 5: (1, {'@': 64})}, 91: {31: (0, 65), 32: (0, 162)}, 92: {31: (0, 65), 32: (0, 93)}, 93: {5: (0, 78), 6: (0, 43), 2: (0, 110), 8: (0, 29), 7: (0, 106), 20: (0, 169), 3: (0, 145)}, 94: {3: (1, {'@': 65}), 2: (1, {'@': 65}), 5: (1, {'@': 65})}, 95: {20: (0, 89), 5: (0, 78), 6: (0, 43), 8: (0, 29), 2: (0, 63), 7: (0, 106), 3: (0, 145)}, 96: {30: (1, {'@': 100}), 19: (1, {'@': 100}), 18: (1, {'@': 100})}, 97: {9: (0, 135), 3: (1, {'@': 66}), 2: (1, {'@': 66}), 5: (1, {'@': 66})}, 98: {9: (0, 156), 11: (0, 158), 10: (0, 55)}, 99: {31: (0, 65), 32: (0, 10)}, 100: {9: (0, 73)}, 101: {14: (1, {'@': 40}), 3: (1, {'@': 40}), 15: (1, {'@': 40}), 16: (1, {'@': 40})}, 102: {32: (0, 11), 31: (0, 65)}, 103: {31: (0, 65), 32: (0, 79)}, 104: {5: (0, 78), 6: (0, 43), 20: (0, 161), 8: (0, 29), 7: (0, 106), 2: (0, 152), 3: (0, 145)}, 105: {32: (0, 167), 31: (0, 65)}, 106: {3: (0, 25), 5: (1, {'@': 85}), 0: (1, {'@': 85}), 15: (1, {'@': 85}), 16: (1, {'@': 85}), 1: (1, {'@': 85}), 2: (1, {'@': 85})}, 107: {2: (0, 14), 27: (0, 36), 26: (0, 52), 1: (0, 12)}, 108: {9: (1, {'@': 84}), 10: (1, {'@': 84}), 3: (1, {'@': 84}), 4: (1, {'@': 84}), 0: (1, {'@': 84}), 2: (1, {'@': 84}), 1: (1, {'@': 84}), 5: (1, {'@': 84})}, 109: {6: (0, 0), 21: (0, 17), 0: (0, 40), 23: (0, 2), 7: (0, 106), 22: (0, 32), 3: (0, 145), 24: (0, 77), 4: (0, 70), 2: (0, 153)}, 110: {14: (1, {'@': 28}), 3: (1, {'@': 28}), 15: (1, {'@': 28}), 16: (1, {'@': 28})}, 111: {42: (0, 143)}, 112: {31: (0, 65), 32: (0, 163)}, 113: {0: (1, {'@': 62}), 3: (1, {'@': 62}), 2: (1, {'@': 62}), 4: (1, {'@': 62})}, 114: {14: (1, {'@': 44}), 3: (1, {'@': 44}), 15: (1, {'@': 44}), 16: (1, {'@': 44})}, 115: {9: (0, 107), 13: (0, 118), 12: (0, 8), 0: (1, {'@': 57}), 3: (1, {'@': 57}), 2: (1, {'@': 57}), 4: (1, {'@': 57})}, 116: {14: (1, {'@': 24}), 3: (1, {'@': 24}), 15: (1, {'@': 24}), 16: (1, {'@': 24})}, 117: {14: (1, {'@': 29}), 3: (1, {'@': 29}), 15: (1, {'@': 29}), 16: (1, {'@': 29})}, 118: {9: (0, 123), 0: (1, {'@': 54}), 3: (1, {'@': 54}), 2: (1, {'@': 54}), 4: (1, {'@': 54})}, 119: {0: (1, {'@': 95}), 3: (1, {'@': 95}), 2: (1, {'@': 95}), 4: (1, {'@': 95})}, 120: {14: (1, {'@': 33}), 3: (1, {'@': 33}), 15: (1, {'@': 33}), 16: (1, {'@': 33})}, 121: {2: (0, 58), 27: (0, 149), 1: (0, 12)}, 122: {}, 123: {26: (0, 82), 27: (0, 36), 2: (0, 13), 1: (0, 12)}, 124: {9: (0, 66), 3: (1, {'@': 72}), 2: (1, {'@': 72}), 5: (1, {'@': 72})}, 125: {14: (1, {'@': 25}), 3: (1, {'@': 25}), 15: (1, {'@': 25}), 16: (1, {'@': 25})}, 126: {34: (0, 154), 35: (0, 50), 36: (0, 157), 15: (0, 35)}, 127: {5: (0, 78), 6: (0, 43), 7: (0, 106), 2: (0, 20), 3: (0, 145), 8: (0, 27)}, 128: {0: (1, {'@': 61}), 3: (1, {'@': 61}), 2: (1, {'@': 61}), 4: (1, {'@': 61})}, 129: {15: (0, 68), 6: (0, 80), 16: (0, 147), 29: (0, 168), 38: (0, 31), 40: (0, 84), 37: (0, 111), 28: (0, 144), 7: (0, 106), 3: (0, 145)}, 130: {14: (1, {'@': 42}), 3: (1, {'@': 42}), 15: (1, {'@': 42}), 16: (1, {'@': 42})}, 131: {3: (1, {'@': 67}), 2: (1, {'@': 67}), 5: (1, {'@': 67})}, 132: {15: (1, {'@': 83}), 34: (1, {'@': 83}), 9: (1, {'@': 83}), 12: (1, {'@': 83}), 3: (1, {'@': 83}), 2: (1, {'@': 83}), 5: (1, {'@': 83}), 4: (1, {'@': 83}), 0: (1, {'@': 83}), 1: (1, {'@': 83}), 10: (1, {'@': 83})}, 133: {6: (0, 0), 21: (0, 17), 0: (0, 40), 24: (0, 119), 23: (0, 2), 7: (0, 106), 2: (0, 22), 3: (0, 145), 4: (0, 70)}, 134: {37: (1, {'@': 86}), 3: (1, {'@': 86}), 15: (1, {'@': 86}), 16: (1, {'@': 86})}, 135: {2: (0, 94), 27: (0, 36), 26: (0, 71), 1: (0, 12)}, 136: {30: (1, {'@': 98}), 19: (1, {'@': 98}), 18: (1, {'@': 98})}, 137: {2: (0, 128), 27: (0, 149), 1: (0, 12)}, 138: {16: (0, 147), 15: (0, 68), 6: (0, 80), 7: (0, 106), 28: (0, 38), 3: (0, 145), 29: (0, 5), 14: (1, {'@': 21})}, 139: {0: (1, {'@': 49}), 3: (1, {'@': 49}), 2: (1, {'@': 49}), 4: (1, {'@': 49})}, 140: {6: (0, 0), 21: (0, 17), 0: (0, 40), 24: (0, 119), 2: (0, 155), 23: (0, 2), 7: (0, 106), 3: (0, 145), 4: (0, 70)}, 141: {3: (1, {'@': 73}), 2: (1, {'@': 73}), 5: (1, {'@': 73})}, 142: {5: (0, 78), 6: (0, 43), 7: (0, 106), 3: (0, 145), 2: (0, 125), 8: (0, 27)}, 143: {37: (1, {'@': 22}), 3: (1, {'@': 22}), 15: (1, {'@': 22}), 16: (1, {'@': 22})}, 144: {14: (1, {'@': 89}), 3: (1, {'@': 89}), 15: (1, {'@': 89}), 16: (1, {'@': 89})}, 145: {3: (1, {'@': 102}), 5: (1, {'@': 102}), 0: (1, {'@': 102}), 15: (1, {'@': 102}), 16: (1, {'@': 102}), 1: (1, {'@': 102}), 2: (1, {'@': 102})}, 146: {9: (0, 37), 0: (1, {'@': 60}), 3: (1, {'@': 60}), 2: (1, {'@': 60}), 4: (1, {'@': 60})}, 147: {25: (0, 88), 19: (0, 132)}, 148: {30: (1, {'@': 99}), 19: (1, {'@': 99}), 18: (1, {'@': 99})}, 149: {1: (1, {'@': 97}), 2: (1, {'@': 97})}, 150: {25: (0, 4), 19: (0, 132)}, 151: {3: (1, {'@': 71}), 2: (1, {'@': 71}), 5: (1, {'@': 71})}, 152: {14: (1, {'@': 32}), 3: (1, {'@': 32}), 15: (1, {'@': 32}), 16: (1, {'@': 32})}, 153: {14: (1, {'@': 46}), 3: (1, {'@': 46}), 15: (1, {'@': 46}), 16: (1, {'@': 46})}, 154: {3: (1, {'@': 80}), 4: (1, {'@': 80}), 0: (1, {'@': 80}), 2: (1, {'@': 80}), 12: (1, {'@': 80}), 1: (1, {'@': 80})}, 155: {14: (1, {'@': 43}), 3: (1, {'@': 43}), 15: (1, {'@': 43}), 16: (1, {'@': 43})}, 156: {32: (0, 95), 31: (0, 65)}, 157: {3: (1, {'@': 81}), 4: (1, {'@': 81}), 0: (1, {'@': 81}), 2: (1, {'@': 81}), 12: (1, {'@': 81}), 1: (1, {'@': 81})}, 158: {9: (0, 170)}, 159: {0: (1, {'@': 82}), 3: (1, {'@': 82}), 2: (1, {'@': 82}), 4: (1, {'@': 82}), 12: (1, {'@': 82}), 1: (1, {'@': 82})}, 160: {14: (1, {'@': 45}), 3: (1, {'@': 45}), 15: (1, {'@': 45}), 16: (1, {'@': 45})}, 161: {5: (0, 78), 6: (0, 43), 7: (0, 106), 3: (0, 145), 2: (0, 15), 8: (0, 27)}, 162: {5: (0, 78), 6: (0, 43), 2: (0, 54), 20: (0, 48), 8: (0, 29), 7: (0, 106), 3: (0, 145)}, 163: {5: (0, 78), 6: (0, 43), 8: (0, 29), 7: (0, 106), 20: (0, 72), 3: (0, 145), 2: (0, 57)}, 164: {19: (0, 132), 25: (0, 62)}, 165: {2: (0, 23), 27: (0, 36), 26: (0, 87), 1: (0, 12)}, 166: {30: (0, 108), 18: (0, 96), 19: (0, 39)}, 167: {6: (0, 0), 21: (0, 17), 0: (0, 40), 23: (0, 2), 7: (0, 106), 3: (0, 145), 24: (0, 77), 4: (0, 70), 2: (0, 114), 22: (0, 140)}, 168: {14: (1, {'@': 88}), 3: (1, {'@': 88}), 15: (1, {'@': 88}), 16: (1, {'@': 88})}, 169: {5: (0, 78), 6: (0, 43), 7: (0, 106), 3: (0, 145), 2: (0, 33), 8: (0, 27)}, 170: {32: (0, 104), 31: (0, 65)}}, 'start_states': {'start': 86}, 'end_states': {'start': 122}}, 'options': {'debug': False, 'keep_all_tokens': False, 'tree_class': None, 'cache': False, 'postlex': None, 'parser': 'lalr', 'lexer': 'contextual', 'transformer': None, 'start': ['start'], 'priority': 'normal', 'ambiguity': 'auto', 'regex': False, 'propagate_positions': False, 'lexer_callbacks': {}, 'maybe_placeholders': False, 'edit_terminals': None, 'g_regex_flags': 0, 'use_bytes': False, 'import_paths': [], 'source_path': None}, '__type__': 'ParsingFrontend'}, 'rules': [{'@': 20}, {'@': 21}, {'@': 22}, {'@': 23}, {'@': 24}, {'@': 25}, {'@': 26}, {'@': 27}, {'@': 28}, {'@': 29}, {'@': 30}, {'@': 31}, {'@': 32}, {'@': 33}, {'@': 34}, {'@': 35}, {'@': 36}, {'@': 37}, {'@': 38}, {'@': 39}, {'@': 40}, {'@': 41}, {'@': 42}, {'@': 43}, {'@': 44}, {'@': 45}, {'@': 46}, {'@': 47}, {'@': 48}, {'@': 49}, {'@': 50}, {'@': 51}, {'@': 52}, {'@': 53}, {'@': 54}, {'@': 55}, {'@': 56}, {'@': 57}, {'@': 58}, {'@': 59}, {'@': 60}, {'@': 61}, {'@': 62}, {'@': 63}, {'@': 64}, {'@': 65}, {'@': 66}, {'@': 67}, {'@': 68}, {'@': 69}, {'@': 70}, {'@': 71}, {'@': 72}, {'@': 73}, {'@': 74}, {'@': 75}, {'@': 76}, {'@': 77}, {'@': 78}, {'@': 79}, {'@': 80}, {'@': 81}, {'@': 82}, {'@': 83}, {'@': 84}, {'@': 85}, {'@': 86}, {'@': 87}, {'@': 88}, {'@': 89}, {'@': 90}, {'@': 91}, {'@': 92}, {'@': 93}, {'@': 94}, {'@': 95}, {'@': 96}, {'@': 97}, {'@': 98}, {'@': 99}, {'@': 100}, {'@': 101}, {'@': 102}, {'@': 103}], 'options': {'debug': False, 'keep_all_tokens': False, 'tree_class': None, 'cache': False, 'postlex': None, 'parser': 'lalr', 'lexer': 'contextual', 'transformer': None, 'start': ['start'], 'priority': 'normal', 'ambiguity': 'auto', 'regex': False, 'propagate_positions': False, 'lexer_callbacks': {}, 'maybe_placeholders': False, 'edit_terminals': None, 'g_regex_flags': 0, 'use_bytes': False, 'import_paths': [], 'source_path': None}, '__type__': 'Lark'} ) MEMO = ( -{0: {'name': 'IDENTIFIER', 'pattern': {'value': '(?:_|(?:[A-Z]|[a-z]))(?:(?:(?:_|(?:[A-Z]|[a-z]))|[0-9]))*', 'flags': [], '_width': [1, 4294967295], '__type__': 'PatternRE'}, 'priority': 1, '__type__': 'TerminalDef'}, 1: {'name': 'WS', 'pattern': {'value': '(?:[ \t\x0c\r\n])+', 'flags': [], '_width': [1, 4294967295], '__type__': 'PatternRE'}, 'priority': 1, '__type__': 'TerminalDef'}, 2: {'name': 'PRIMITIVE', 'pattern': {'value': '(?:(?:(?:(?:(?:u?int(8|16|32|64)?|size)|string)|funcptr)|buffer)|address)', 'flags': [], '_width': [3, 7], '__type__': 'PatternRE'}, 'priority': 1, '__type__': 'TerminalDef'}, 3: {'name': 'UID', 'pattern': {'value': '[0-9a-fA-F]{16}', 'flags': [], '_width': [16, 16], '__type__': 'PatternRE'}, 'priority': 1, '__type__': 'TerminalDef'}, 4: {'name': 'COMMENT', 'pattern': {'value': '#.*', 'flags': [], '_width': [1, 4294967295], '__type__': 'PatternRE'}, 'priority': 1, '__type__': 'TerminalDef'}, 5: {'name': 'PATH', 'pattern': {'value': '"[^"]*"', 'flags': [], '_width': [2, 4294967295], '__type__': 'PatternRE'}, 'priority': 1, '__type__': 'TerminalDef'}, 6: {'name': 'IMPORT', 'pattern': {'value': 'import', 'flags': [], '__type__': 'PatternStr'}, 'priority': 1, '__type__': 'TerminalDef'}, 7: {'name': 'OBJECT', 'pattern': {'value': 'object', 'flags': [], '__type__': 'PatternStr'}, 'priority': 1, '__type__': 'TerminalDef'}, 8: {'name': 'LBRACE', 'pattern': {'value': '{', 'flags': [], '__type__': 'PatternStr'}, 'priority': 1, '__type__': 'TerminalDef'}, 9: {'name': 'RBRACE', 'pattern': {'value': '}', 'flags': [], '__type__': 'PatternStr'}, 'priority': 1, '__type__': 'TerminalDef'}, 10: {'name': 'INTERFACE', 'pattern': {'value': 'interface', 'flags': [], '__type__': 'PatternStr'}, 'priority': 1, '__type__': 'TerminalDef'}, 11: {'name': 'EXPOSE', 'pattern': {'value': 'expose', 'flags': [], '__type__': 'PatternStr'}, 'priority': 1, '__type__': 'TerminalDef'}, 12: {'name': '__ANON_0', 'pattern': {'value': 'uid', 'flags': [], '__type__': 'PatternStr'}, 'priority': 1, '__type__': 'TerminalDef'}, 13: {'name': 'COLON', 'pattern': {'value': ':', 'flags': [], '__type__': 'PatternStr'}, 'priority': 1, '__type__': 'TerminalDef'}, 14: {'name': 'FUNCTION', 'pattern': {'value': 'function', 'flags': [], '__type__': 'PatternStr'}, 'priority': 1, '__type__': 'TerminalDef'}, 15: {'name': 'METHOD', 'pattern': {'value': 'method', 'flags': [], '__type__': 'PatternStr'}, 'priority': 1, '__type__': 'TerminalDef'}, 16: {'name': 'PARAM', 'pattern': {'value': 'param', 'flags': [], '__type__': 'PatternStr'}, 'priority': 1, '__type__': 'TerminalDef'}, 17: {'name': 'LSQB', 'pattern': {'value': '[', 'flags': [], '__type__': 'PatternStr'}, 'priority': 1, '__type__': 'TerminalDef'}, 18: {'name': 'RSQB', 'pattern': {'value': ']', 'flags': [], '__type__': 'PatternStr'}, 'priority': 1, '__type__': 'TerminalDef'}, 19: {'origin': {'name': 'start', '__type__': 'NonTerminal'}, 'expansion': [{'name': '__start_star_0', '__type__': 'NonTerminal'}, {'name': '__start_plus_1', '__type__': 'NonTerminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 20: {'origin': {'name': 'start', '__type__': 'NonTerminal'}, 'expansion': [{'name': '__start_plus_1', '__type__': 'NonTerminal'}], 'order': 1, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 21: {'origin': {'name': 'import_statement', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'IMPORT', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'PATH', 'filter_out': False, '__type__': 'Terminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 22: {'origin': {'name': 'object', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'OBJECT', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}, {'name': 'super', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': '__object_star_2', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 23: {'origin': {'name': 'object', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'OBJECT', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}, {'name': 'super', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 1, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 24: {'origin': {'name': 'object', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'OBJECT', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': '__object_star_2', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 2, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 25: {'origin': {'name': 'object', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'OBJECT', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 3, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 26: {'origin': {'name': 'object', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'OBJECT', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'super', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': '__object_star_2', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 4, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 27: {'origin': {'name': 'object', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'OBJECT', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'super', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 5, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 28: {'origin': {'name': 'object', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'OBJECT', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': '__object_star_2', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 6, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 29: {'origin': {'name': 'object', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'OBJECT', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 7, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 30: {'origin': {'name': 'object', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'OBJECT', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}, {'name': 'super', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': '__object_star_2', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 8, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 31: {'origin': {'name': 'object', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'OBJECT', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}, {'name': 'super', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 9, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 32: {'origin': {'name': 'object', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'OBJECT', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': '__object_star_2', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 10, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 33: {'origin': {'name': 'object', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'OBJECT', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 11, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 34: {'origin': {'name': 'object', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'OBJECT', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'super', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': '__object_star_2', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 12, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 35: {'origin': {'name': 'object', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'OBJECT', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'super', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 13, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 36: {'origin': {'name': 'object', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'OBJECT', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': '__object_star_2', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 14, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 37: {'origin': {'name': 'object', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'OBJECT', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 15, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 38: {'origin': {'name': 'interface', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'INTERFACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': '__interface_star_3', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 39: {'origin': {'name': 'interface', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'INTERFACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 1, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 40: {'origin': {'name': 'interface', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'INTERFACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': '__interface_star_3', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 2, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 41: {'origin': {'name': 'interface', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'INTERFACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 3, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 42: {'origin': {'name': 'interface', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'INTERFACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': '__interface_star_3', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 4, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 43: {'origin': {'name': 'interface', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'INTERFACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 5, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 44: {'origin': {'name': 'interface', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'INTERFACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': '__interface_star_3', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 6, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 45: {'origin': {'name': 'interface', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'INTERFACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 7, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 46: {'origin': {'name': 'interface_param', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'expose', '__type__': 'NonTerminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': True, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 47: {'origin': {'name': 'interface_param', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'function', '__type__': 'NonTerminal'}], 'order': 1, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': True, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 48: {'origin': {'name': 'expose', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'EXPOSE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'type', '__type__': 'NonTerminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 49: {'origin': {'name': 'uid', '__type__': 'NonTerminal'}, 'expansion': [{'name': '__ANON_0', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'UID', 'filter_out': False, '__type__': 'Terminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 50: {'origin': {'name': 'super', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'COLON', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 51: {'origin': {'name': 'function', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'FUNCTION', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': '__function_star_4', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 52: {'origin': {'name': 'function', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'FUNCTION', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 1, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 53: {'origin': {'name': 'function', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'FUNCTION', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}], 'order': 2, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 54: {'origin': {'name': 'function', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'FUNCTION', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': '__function_star_4', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 3, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 55: {'origin': {'name': 'function', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'FUNCTION', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 4, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 56: {'origin': {'name': 'function', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'FUNCTION', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}], 'order': 5, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 57: {'origin': {'name': 'function', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'FUNCTION', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': '__function_star_4', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 6, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 58: {'origin': {'name': 'function', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'FUNCTION', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 7, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 59: {'origin': {'name': 'function', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'FUNCTION', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}], 'order': 8, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 60: {'origin': {'name': 'function', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'FUNCTION', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': '__function_star_4', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 9, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 61: {'origin': {'name': 'function', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'FUNCTION', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 10, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 62: {'origin': {'name': 'function', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'FUNCTION', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}], 'order': 11, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 63: {'origin': {'name': 'method', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'METHOD', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': '__function_star_4', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 64: {'origin': {'name': 'method', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'METHOD', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 1, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 65: {'origin': {'name': 'method', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'METHOD', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}], 'order': 2, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 66: {'origin': {'name': 'method', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'METHOD', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': '__function_star_4', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 3, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 67: {'origin': {'name': 'method', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'METHOD', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 4, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 68: {'origin': {'name': 'method', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'METHOD', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}], 'order': 5, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 69: {'origin': {'name': 'method', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'METHOD', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': '__function_star_4', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 6, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 70: {'origin': {'name': 'method', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'METHOD', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 7, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 71: {'origin': {'name': 'method', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'METHOD', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}], 'order': 8, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 72: {'origin': {'name': 'method', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'METHOD', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': '__function_star_4', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 9, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 73: {'origin': {'name': 'method', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'METHOD', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 10, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 74: {'origin': {'name': 'method', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'METHOD', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}], 'order': 11, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 75: {'origin': {'name': 'param', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'PARAM', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'type', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}, {'name': 'description', '__type__': 'NonTerminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 76: {'origin': {'name': 'param', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'PARAM', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'type', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}], 'order': 1, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 77: {'origin': {'name': 'param', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'PARAM', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'type', '__type__': 'NonTerminal'}, {'name': 'description', '__type__': 'NonTerminal'}], 'order': 2, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 78: {'origin': {'name': 'param', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'PARAM', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'type', '__type__': 'NonTerminal'}], 'order': 3, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 79: {'origin': {'name': 'type', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'PRIMITIVE', 'filter_out': False, '__type__': 'Terminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': True, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 80: {'origin': {'name': 'type', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'object_name', '__type__': 'NonTerminal'}], 'order': 1, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': True, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 81: {'origin': {'name': 'object_name', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'OBJECT', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 82: {'origin': {'name': 'name', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'IDENTIFIER', 'filter_out': False, '__type__': 'Terminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 83: {'origin': {'name': 'options', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'LSQB', 'filter_out': True, '__type__': 'Terminal'}, {'name': '__options_plus_5', '__type__': 'NonTerminal'}, {'name': 'RSQB', 'filter_out': True, '__type__': 'Terminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 84: {'origin': {'name': 'description', '__type__': 'NonTerminal'}, 'expansion': [{'name': '__description_plus_6', '__type__': 'NonTerminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 85: {'origin': {'name': '__start_star_0', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'import_statement', '__type__': 'NonTerminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 86: {'origin': {'name': '__start_star_0', '__type__': 'NonTerminal'}, 'expansion': [{'name': '__start_star_0', '__type__': 'NonTerminal'}, {'name': 'import_statement', '__type__': 'NonTerminal'}], 'order': 1, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 87: {'origin': {'name': '__start_plus_1', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'object', '__type__': 'NonTerminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 88: {'origin': {'name': '__start_plus_1', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'interface', '__type__': 'NonTerminal'}], 'order': 1, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 89: {'origin': {'name': '__start_plus_1', '__type__': 'NonTerminal'}, 'expansion': [{'name': '__start_plus_1', '__type__': 'NonTerminal'}, {'name': 'object', '__type__': 'NonTerminal'}], 'order': 2, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 90: {'origin': {'name': '__start_plus_1', '__type__': 'NonTerminal'}, 'expansion': [{'name': '__start_plus_1', '__type__': 'NonTerminal'}, {'name': 'interface', '__type__': 'NonTerminal'}], 'order': 3, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 91: {'origin': {'name': '__object_star_2', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'method', '__type__': 'NonTerminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 92: {'origin': {'name': '__object_star_2', '__type__': 'NonTerminal'}, 'expansion': [{'name': '__object_star_2', '__type__': 'NonTerminal'}, {'name': 'method', '__type__': 'NonTerminal'}], 'order': 1, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 93: {'origin': {'name': '__interface_star_3', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'interface_param', '__type__': 'NonTerminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 94: {'origin': {'name': '__interface_star_3', '__type__': 'NonTerminal'}, 'expansion': [{'name': '__interface_star_3', '__type__': 'NonTerminal'}, {'name': 'interface_param', '__type__': 'NonTerminal'}], 'order': 1, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 95: {'origin': {'name': '__function_star_4', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'param', '__type__': 'NonTerminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 96: {'origin': {'name': '__function_star_4', '__type__': 'NonTerminal'}, 'expansion': [{'name': '__function_star_4', '__type__': 'NonTerminal'}, {'name': 'param', '__type__': 'NonTerminal'}], 'order': 1, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 97: {'origin': {'name': '__options_plus_5', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'IDENTIFIER', 'filter_out': False, '__type__': 'Terminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 98: {'origin': {'name': '__options_plus_5', '__type__': 'NonTerminal'}, 'expansion': [{'name': '__options_plus_5', '__type__': 'NonTerminal'}, {'name': 'IDENTIFIER', 'filter_out': False, '__type__': 'Terminal'}], 'order': 1, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 99: {'origin': {'name': '__description_plus_6', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'COMMENT', 'filter_out': False, '__type__': 'Terminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 100: {'origin': {'name': '__description_plus_6', '__type__': 'NonTerminal'}, 'expansion': [{'name': '__description_plus_6', '__type__': 'NonTerminal'}, {'name': 'COMMENT', 'filter_out': False, '__type__': 'Terminal'}], 'order': 1, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}} +{0: {'name': 'IDENTIFIER', 'pattern': {'value': '(?:(?:[A-Z]|[a-z])|_)(?:(?:(?:[A-Z]|[a-z])|[0-9]|_))*', 'flags': [], '_width': [1, 4294967295], '__type__': 'PatternRE'}, 'priority': 1, '__type__': 'TerminalDef'}, 1: {'name': 'WS', 'pattern': {'value': '(?:[ \t\x0c\r\n])+', 'flags': [], '_width': [1, 4294967295], '__type__': 'PatternRE'}, 'priority': 1, '__type__': 'TerminalDef'}, 2: {'name': 'PRIMITIVE', 'pattern': {'value': '(?:address|string|buffer|u?int(8|16|32|64)?|size)', 'flags': [], '_width': [3, 7], '__type__': 'PatternRE'}, 'priority': 1, '__type__': 'TerminalDef'}, 3: {'name': 'UID', 'pattern': {'value': '[0-9a-fA-F]{16}', 'flags': [], '_width': [16, 16], '__type__': 'PatternRE'}, 'priority': 1, '__type__': 'TerminalDef'}, 4: {'name': 'OPTION', 'pattern': {'value': '(?:(?:[A-Z]|[a-z])|_)(?:(?:(?:[A-Z]|[a-z])|[0-9]|_))*:(?:(?:[A-Z]|[a-z])|_)(?:(?:(?:[A-Z]|[a-z])|[0-9]|_))*', 'flags': [], '_width': [3, 4294967295], '__type__': 'PatternRE'}, 'priority': 2, '__type__': 'TerminalDef'}, 5: {'name': 'COMMENT', 'pattern': {'value': '#.*', 'flags': [], '_width': [1, 4294967295], '__type__': 'PatternRE'}, 'priority': 1, '__type__': 'TerminalDef'}, 6: {'name': 'PATH', 'pattern': {'value': '"[^"]*"', 'flags': [], '_width': [2, 4294967295], '__type__': 'PatternRE'}, 'priority': 1, '__type__': 'TerminalDef'}, 7: {'name': 'IMPORT', 'pattern': {'value': 'import', 'flags': [], '__type__': 'PatternStr'}, 'priority': 1, '__type__': 'TerminalDef'}, 8: {'name': 'OBJECT', 'pattern': {'value': 'object', 'flags': [], '__type__': 'PatternStr'}, 'priority': 1, '__type__': 'TerminalDef'}, 9: {'name': 'LBRACE', 'pattern': {'value': '{', 'flags': [], '__type__': 'PatternStr'}, 'priority': 1, '__type__': 'TerminalDef'}, 10: {'name': 'RBRACE', 'pattern': {'value': '}', 'flags': [], '__type__': 'PatternStr'}, 'priority': 1, '__type__': 'TerminalDef'}, 11: {'name': 'INTERFACE', 'pattern': {'value': 'interface', 'flags': [], '__type__': 'PatternStr'}, 'priority': 1, '__type__': 'TerminalDef'}, 12: {'name': 'EXPOSE', 'pattern': {'value': 'expose', 'flags': [], '__type__': 'PatternStr'}, 'priority': 1, '__type__': 'TerminalDef'}, 13: {'name': '__ANON_0', 'pattern': {'value': 'uid', 'flags': [], '__type__': 'PatternStr'}, 'priority': 1, '__type__': 'TerminalDef'}, 14: {'name': 'COLON', 'pattern': {'value': ':', 'flags': [], '__type__': 'PatternStr'}, 'priority': 1, '__type__': 'TerminalDef'}, 15: {'name': 'FUNCTION', 'pattern': {'value': 'function', 'flags': [], '__type__': 'PatternStr'}, 'priority': 1, '__type__': 'TerminalDef'}, 16: {'name': 'METHOD', 'pattern': {'value': 'method', 'flags': [], '__type__': 'PatternStr'}, 'priority': 1, '__type__': 'TerminalDef'}, 17: {'name': 'PARAM', 'pattern': {'value': 'param', 'flags': [], '__type__': 'PatternStr'}, 'priority': 1, '__type__': 'TerminalDef'}, 18: {'name': 'LSQB', 'pattern': {'value': '[', 'flags': [], '__type__': 'PatternStr'}, 'priority': 1, '__type__': 'TerminalDef'}, 19: {'name': 'RSQB', 'pattern': {'value': ']', 'flags': [], '__type__': 'PatternStr'}, 'priority': 1, '__type__': 'TerminalDef'}, 20: {'origin': {'name': 'start', '__type__': 'NonTerminal'}, 'expansion': [{'name': '__start_star_0', '__type__': 'NonTerminal'}, {'name': '__start_plus_1', '__type__': 'NonTerminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 21: {'origin': {'name': 'start', '__type__': 'NonTerminal'}, 'expansion': [{'name': '__start_plus_1', '__type__': 'NonTerminal'}], 'order': 1, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 22: {'origin': {'name': 'import_statement', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'IMPORT', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'PATH', 'filter_out': False, '__type__': 'Terminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 23: {'origin': {'name': 'object', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'OBJECT', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}, {'name': 'super', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': '__object_star_2', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 24: {'origin': {'name': 'object', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'OBJECT', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}, {'name': 'super', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 1, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 25: {'origin': {'name': 'object', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'OBJECT', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': '__object_star_2', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 2, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 26: {'origin': {'name': 'object', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'OBJECT', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 3, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 27: {'origin': {'name': 'object', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'OBJECT', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'super', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': '__object_star_2', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 4, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 28: {'origin': {'name': 'object', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'OBJECT', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'super', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 5, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 29: {'origin': {'name': 'object', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'OBJECT', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': '__object_star_2', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 6, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 30: {'origin': {'name': 'object', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'OBJECT', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 7, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 31: {'origin': {'name': 'object', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'OBJECT', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}, {'name': 'super', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': '__object_star_2', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 8, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 32: {'origin': {'name': 'object', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'OBJECT', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}, {'name': 'super', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 9, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 33: {'origin': {'name': 'object', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'OBJECT', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': '__object_star_2', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 10, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 34: {'origin': {'name': 'object', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'OBJECT', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 11, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 35: {'origin': {'name': 'object', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'OBJECT', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'super', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': '__object_star_2', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 12, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 36: {'origin': {'name': 'object', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'OBJECT', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'super', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 13, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 37: {'origin': {'name': 'object', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'OBJECT', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': '__object_star_2', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 14, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 38: {'origin': {'name': 'object', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'OBJECT', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 15, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 39: {'origin': {'name': 'interface', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'INTERFACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': '__interface_star_3', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 40: {'origin': {'name': 'interface', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'INTERFACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 1, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 41: {'origin': {'name': 'interface', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'INTERFACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': '__interface_star_3', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 2, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 42: {'origin': {'name': 'interface', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'INTERFACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 3, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 43: {'origin': {'name': 'interface', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'INTERFACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': '__interface_star_3', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 4, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 44: {'origin': {'name': 'interface', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'INTERFACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 5, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 45: {'origin': {'name': 'interface', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'INTERFACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': '__interface_star_3', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 6, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 46: {'origin': {'name': 'interface', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'INTERFACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'uid', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 7, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 47: {'origin': {'name': 'interface_param', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'expose', '__type__': 'NonTerminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': True, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 48: {'origin': {'name': 'interface_param', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'function', '__type__': 'NonTerminal'}], 'order': 1, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': True, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 49: {'origin': {'name': 'expose', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'EXPOSE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'type', '__type__': 'NonTerminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 50: {'origin': {'name': 'uid', '__type__': 'NonTerminal'}, 'expansion': [{'name': '__ANON_0', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'UID', 'filter_out': False, '__type__': 'Terminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 51: {'origin': {'name': 'super', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'COLON', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 52: {'origin': {'name': 'function', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'FUNCTION', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': '__function_star_4', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 53: {'origin': {'name': 'function', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'FUNCTION', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 1, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 54: {'origin': {'name': 'function', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'FUNCTION', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}], 'order': 2, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 55: {'origin': {'name': 'function', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'FUNCTION', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': '__function_star_4', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 3, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 56: {'origin': {'name': 'function', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'FUNCTION', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 4, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 57: {'origin': {'name': 'function', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'FUNCTION', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}], 'order': 5, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 58: {'origin': {'name': 'function', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'FUNCTION', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': '__function_star_4', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 6, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 59: {'origin': {'name': 'function', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'FUNCTION', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 7, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 60: {'origin': {'name': 'function', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'FUNCTION', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}], 'order': 8, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 61: {'origin': {'name': 'function', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'FUNCTION', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': '__function_star_4', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 9, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 62: {'origin': {'name': 'function', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'FUNCTION', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 10, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 63: {'origin': {'name': 'function', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'FUNCTION', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}], 'order': 11, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 64: {'origin': {'name': 'method', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'METHOD', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': '__function_star_4', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 65: {'origin': {'name': 'method', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'METHOD', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 1, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 66: {'origin': {'name': 'method', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'METHOD', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}], 'order': 2, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 67: {'origin': {'name': 'method', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'METHOD', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': '__function_star_4', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 3, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 68: {'origin': {'name': 'method', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'METHOD', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 4, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 69: {'origin': {'name': 'method', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'description', '__type__': 'NonTerminal'}, {'name': 'METHOD', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}], 'order': 5, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 70: {'origin': {'name': 'method', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'METHOD', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': '__function_star_4', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 6, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 71: {'origin': {'name': 'method', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'METHOD', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 7, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 72: {'origin': {'name': 'method', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'METHOD', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}], 'order': 8, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 73: {'origin': {'name': 'method', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'METHOD', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': '__function_star_4', '__type__': 'NonTerminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 9, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 74: {'origin': {'name': 'method', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'METHOD', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'LBRACE', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'RBRACE', 'filter_out': True, '__type__': 'Terminal'}], 'order': 10, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 75: {'origin': {'name': 'method', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'METHOD', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}], 'order': 11, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 76: {'origin': {'name': 'param', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'PARAM', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'type', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}, {'name': 'description', '__type__': 'NonTerminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 77: {'origin': {'name': 'param', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'PARAM', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'type', '__type__': 'NonTerminal'}, {'name': 'options', '__type__': 'NonTerminal'}], 'order': 1, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 78: {'origin': {'name': 'param', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'PARAM', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'type', '__type__': 'NonTerminal'}, {'name': 'description', '__type__': 'NonTerminal'}], 'order': 2, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 79: {'origin': {'name': 'param', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'PARAM', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}, {'name': 'type', '__type__': 'NonTerminal'}], 'order': 3, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 80: {'origin': {'name': 'type', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'PRIMITIVE', 'filter_out': False, '__type__': 'Terminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': True, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 81: {'origin': {'name': 'type', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'object_name', '__type__': 'NonTerminal'}], 'order': 1, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': True, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 82: {'origin': {'name': 'object_name', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'OBJECT', 'filter_out': True, '__type__': 'Terminal'}, {'name': 'name', '__type__': 'NonTerminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 83: {'origin': {'name': 'name', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'IDENTIFIER', 'filter_out': False, '__type__': 'Terminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 84: {'origin': {'name': 'options', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'LSQB', 'filter_out': True, '__type__': 'Terminal'}, {'name': '__options_plus_5', '__type__': 'NonTerminal'}, {'name': 'RSQB', 'filter_out': True, '__type__': 'Terminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 85: {'origin': {'name': 'description', '__type__': 'NonTerminal'}, 'expansion': [{'name': '__description_plus_6', '__type__': 'NonTerminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 86: {'origin': {'name': '__start_star_0', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'import_statement', '__type__': 'NonTerminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 87: {'origin': {'name': '__start_star_0', '__type__': 'NonTerminal'}, 'expansion': [{'name': '__start_star_0', '__type__': 'NonTerminal'}, {'name': 'import_statement', '__type__': 'NonTerminal'}], 'order': 1, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 88: {'origin': {'name': '__start_plus_1', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'object', '__type__': 'NonTerminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 89: {'origin': {'name': '__start_plus_1', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'interface', '__type__': 'NonTerminal'}], 'order': 1, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 90: {'origin': {'name': '__start_plus_1', '__type__': 'NonTerminal'}, 'expansion': [{'name': '__start_plus_1', '__type__': 'NonTerminal'}, {'name': 'object', '__type__': 'NonTerminal'}], 'order': 2, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 91: {'origin': {'name': '__start_plus_1', '__type__': 'NonTerminal'}, 'expansion': [{'name': '__start_plus_1', '__type__': 'NonTerminal'}, {'name': 'interface', '__type__': 'NonTerminal'}], 'order': 3, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 92: {'origin': {'name': '__object_star_2', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'method', '__type__': 'NonTerminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 93: {'origin': {'name': '__object_star_2', '__type__': 'NonTerminal'}, 'expansion': [{'name': '__object_star_2', '__type__': 'NonTerminal'}, {'name': 'method', '__type__': 'NonTerminal'}], 'order': 1, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 94: {'origin': {'name': '__interface_star_3', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'interface_param', '__type__': 'NonTerminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 95: {'origin': {'name': '__interface_star_3', '__type__': 'NonTerminal'}, 'expansion': [{'name': '__interface_star_3', '__type__': 'NonTerminal'}, {'name': 'interface_param', '__type__': 'NonTerminal'}], 'order': 1, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 96: {'origin': {'name': '__function_star_4', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'param', '__type__': 'NonTerminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 97: {'origin': {'name': '__function_star_4', '__type__': 'NonTerminal'}, 'expansion': [{'name': '__function_star_4', '__type__': 'NonTerminal'}, {'name': 'param', '__type__': 'NonTerminal'}], 'order': 1, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 98: {'origin': {'name': '__options_plus_5', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'OPTION', 'filter_out': False, '__type__': 'Terminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 99: {'origin': {'name': '__options_plus_5', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'IDENTIFIER', 'filter_out': False, '__type__': 'Terminal'}], 'order': 1, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 100: {'origin': {'name': '__options_plus_5', '__type__': 'NonTerminal'}, 'expansion': [{'name': '__options_plus_5', '__type__': 'NonTerminal'}, {'name': 'OPTION', 'filter_out': False, '__type__': 'Terminal'}], 'order': 2, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 101: {'origin': {'name': '__options_plus_5', '__type__': 'NonTerminal'}, 'expansion': [{'name': '__options_plus_5', '__type__': 'NonTerminal'}, {'name': 'IDENTIFIER', 'filter_out': False, '__type__': 'Terminal'}], 'order': 3, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 102: {'origin': {'name': '__description_plus_6', '__type__': 'NonTerminal'}, 'expansion': [{'name': 'COMMENT', 'filter_out': False, '__type__': 'Terminal'}], 'order': 0, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}, 103: {'origin': {'name': '__description_plus_6', '__type__': 'NonTerminal'}, 'expansion': [{'name': '__description_plus_6', '__type__': 'NonTerminal'}, {'name': 'COMMENT', 'filter_out': False, '__type__': 'Terminal'}], 'order': 1, 'alias': None, 'options': {'keep_all_tokens': False, 'expand1': False, 'priority': None, 'template_source': None, 'empty_indices': (), '__type__': 'RuleOptions'}, '__type__': 'Rule'}} ) Shift = 0 Reduce = 1 diff --git a/scripts/definitions/types/__init__.py b/scripts/definitions/types/__init__.py index 7aa2b04..5b76bca 100644 --- a/scripts/definitions/types/__init__.py +++ b/scripts/definitions/types/__init__.py @@ -5,10 +5,15 @@ def _indent(x): class Description(str): pass class Import(str): pass -class Options(set): +class Options(dict): + def __init__(self, opts = tuple()): + for opt in opts: + parts = opt.split(":", 1) + self[parts[0]] = "".join(parts[1:]) + def __str__(self): if not self: return "" - return "[{}]".format(" ".join(self)) + return "[{}]".format(" ".join(self.keys())) class UID(int): def __str__(self): diff --git a/scripts/definitions/types/function.py b/scripts/definitions/types/function.py index 3119cc8..354285d 100644 --- a/scripts/definitions/types/function.py +++ b/scripts/definitions/types/function.py @@ -47,3 +47,15 @@ class Param: return "param {} {} {} {}".format( self.name, repr(self.type), self.options, self.desc or "") + @property + def outparam(self): + return "out" in self.options or "inout" in self.options + + @property + def refparam(self): + return self.type.reference or self.outparam + + @property + def optional(self): + return "optional" in self.options + diff --git a/scripts/definitions/types/primitive.py b/scripts/definitions/types/primitive.py index 03350bf..06d8691 100644 --- a/scripts/definitions/types/primitive.py +++ b/scripts/definitions/types/primitive.py @@ -8,9 +8,9 @@ class Primitive(Type): def __repr__(self): return f'Primitive({self.name})' - def c_names(self, options=None): + def c_names(self, options=dict()): one = self.c_type - if options and "out" in options or "inout" in options: + if "out" in options or "inout" in options: one += " *" return ((one, ""),) @@ -23,11 +23,13 @@ class PrimitiveRef(Primitive): super().__init__(name, c_type) self.__counted = counted - def c_names(self, options=None): + reference = property(lambda self: True) + + def c_names(self, options=dict()): one = f"{self.c_type} *" two = "size_t" - if options and "out" in options or "inout" in options: + if "out" in options or "inout" in options: two += " *" else: one = "const " + one diff --git a/scripts/definitions/types/type.py b/scripts/definitions/types/type.py index 565f871..a337e8f 100644 --- a/scripts/definitions/types/type.py +++ b/scripts/definitions/types/type.py @@ -3,6 +3,7 @@ class Type: self.__name = name name = property(lambda self: self.__name) + reference = property(lambda self: False) def c_names(self, options): raise NotImplemented("Call to base Type.c_names") diff --git a/src/kernel/kernel.module b/src/kernel/kernel.module index 8c07876..9f5fe44 100644 --- a/src/kernel/kernel.module +++ b/src/kernel/kernel.module @@ -48,6 +48,7 @@ kernel = module("kernel", "syscall.cpp.cog", "syscall.h.cog", "syscall.s", + "syscall_verify.cpp.cog", "syscalls.inc.cog", "syscalls/channel.cpp", "syscalls/endpoint.cpp", @@ -68,10 +69,15 @@ from os.path import join layout = join(source_root, "definitions/memory_layout.yaml") sysconf = join(source_root, "definitions/sysconf.yaml") -definitions = glob('definitions/**/*.def', recursive=True) +definitions = glob(join(source_root, 'definitions/**/*.def'), recursive=True) kernel.add_depends(["memory.h.cog"], [layout]) kernel.add_depends(["sysconf.h.cog"], [sysconf]) -kernel.add_depends(["syscall.cpp.cog", "syscall.h.cog", "syscalls.inc.cog"], definitions) +kernel.add_depends([ + "syscall.cpp.cog", + "syscall.h.cog", + "syscalls.inc.cog", + "syscall_verify.cpp.cog", + ], definitions) kernel.variables['ldflags'] = ["${ldflags}", "-T", "${source_root}/src/kernel/kernel.ld"] diff --git a/src/kernel/syscall.cpp.cog b/src/kernel/syscall.cpp.cog index 3df6bbd..70b07f2 100644 --- a/src/kernel/syscall.cpp.cog +++ b/src/kernel/syscall.cpp.cog @@ -21,9 +21,39 @@ ctx = Context(definitions_path) ctx.parse("syscalls.def") syscalls = ctx.interfaces['syscalls'] -cog.outl(f"constexpr size_t num_syscalls = {len(syscalls.methods)};") ]]]*/ /// [[[end]]] + +namespace syscalls +{ + /*[[[cog code generation + + last_scope = None + for id, scope, method in syscalls.methods: + if scope != last_scope: + cog.outl() + last_scope = scope + + if scope: + name = f"{scope.name}_{method.name}" + else: + name = method.name + + args = [] + if method.constructor: + args.append("j6_handle_t *handle") + elif not method.static: + args.append("j6_handle_t handle") + + for param in method.params: + for type, suffix in param.type.c_names(param.options): + args.append(f"{type} {param.name}{suffix}") + + cog.outl(f"""j6_status_t _syscall_verify_{name} ({", ".join(args)});""") + ]]]*/ + //[[[end]]] +} + uintptr_t syscall_registry[num_syscalls] __attribute__((section(".syscall_registry"))); void @@ -44,8 +74,8 @@ syscall_initialize() else: name = method.name - cog.outl(f"syscall_registry[{id}] = reinterpret_cast(syscalls::{name});") - cog.outl(f"""log::debug(logs::syscall, "Enabling syscall {id:x} as {name}");""") + cog.outl(f"syscall_registry[{id}] = reinterpret_cast(syscalls::_syscall_verify_{name});") + cog.outl(f"""log::debug(logs::syscall, "Enabling syscall {id:02x} as {name}");""") cog.outl("") ]]]*/ //[[[end]]] diff --git a/src/kernel/syscall.h.cog b/src/kernel/syscall.h.cog index 1506df9..c56d120 100644 --- a/src/kernel/syscall.h.cog +++ b/src/kernel/syscall.h.cog @@ -13,48 +13,9 @@ ctx = Context(definitions_path) ctx.parse("syscalls.def") syscalls = ctx.interfaces["syscalls"] +cog.outl(f"constexpr size_t num_syscalls = {len(syscalls.methods)};") ]]]*/ /// [[[end]]] -enum class syscall : uint64_t -{ - /*[[[cog code generation - - for id, scope, method in syscalls.methods: - if scope: - name = f"{scope.name}_{method.name}" - else: - name = method.name - cog.outl(f"{name:20} = {id},") - - ]]]*/ - //[[[end]]] -}; - void syscall_initialize(); extern "C" void syscall_enable(); - -namespace syscalls -{ -/*[[[cog code generation - -for id, scope, method in syscalls.methods: - if scope: - name = f"{scope.name}_{method.name}" - else: - name = method.name - - args = [] - if method.constructor: - args.append("j6_handle_t *handle") - elif not method.static: - args.append("j6_handle_t handle") - - for param in method.params: - for type, suffix in param.type.c_names(param.options): - args.append(f"{type} {param.name}{suffix}") - - cog.outl(f"""j6_status_t {name} ({", ".join(args)});""") -]]]*/ -//[[[end]]] -} diff --git a/src/kernel/syscall_verify.cpp.cog b/src/kernel/syscall_verify.cpp.cog new file mode 100644 index 0000000..ae89402 --- /dev/null +++ b/src/kernel/syscall_verify.cpp.cog @@ -0,0 +1,73 @@ +// vim: ft=cpp + +#include +#include +#include +#include + +namespace { + template + __attribute__((always_inline)) + inline bool check_refparam(const T* param, bool optional) { + return reinterpret_cast(param) < arch::kernel_offset && + (optional || param); + } +} + +namespace syscalls { + +/*[[[cog code generation +from definitions.context import Context + +ctx = Context(definitions_path) +ctx.parse("syscalls.def") +syscalls = ctx.interfaces["syscalls"] + +cbool = {True: "true", False: "false"} + +for id, scope, method in syscalls.methods: + if scope: + name = f"{scope.name}_{method.name}" + else: + name = f"{method.name}" + + args = [] + argdefs = [] + refparams = [] + + if method.constructor: + argdefs.append("j6_handle_t *handle") + args.append("handle") + refparams.append(("handle", False)) + elif not method.static: + argdefs.append("j6_handle_t handle") + args.append("handle") + + for param in method.params: + for type, suffix in param.type.c_names(param.options): + arg = f"{param.name}{suffix}" + argdefs.append(f"{type} {arg}") + args.append(arg) + + if param.refparam: + subs = param.type.c_names(param.options) + refparams.append((param.name + subs[0][1], param.optional)) + if param.outparam: + for sub in subs[1:]: + refparams.append((param.name + sub[1], param.optional)) + + cog.outl(f"""extern j6_status_t {name} ({", ".join(argdefs)});""") + cog.outl(f"""j6_status_t _syscall_verify_{name} ({", ".join(argdefs)}) {{""") + + for pname, optional in refparams: + cog.outl(f" if (!check_refparam({pname}, {cbool[optional]}))") + cog.outl( " return j6_err_invalid_arg;") + cog.outl() + + cog.outl(f""" return syscalls::{name}({", ".join(args)});""") + cog.outl("}") + cog.outl("\n") +]]]*/ +//[[[end]]] + +} // namespace syscalls diff --git a/src/kernel/syscalls/endpoint.cpp b/src/kernel/syscalls/endpoint.cpp index d163e08..135b702 100644 --- a/src/kernel/syscalls/endpoint.cpp +++ b/src/kernel/syscalls/endpoint.cpp @@ -29,7 +29,9 @@ endpoint_send(j6_handle_t handle, uint64_t tag, const void * data, size_t data_l j6_status_t endpoint_receive(j6_handle_t handle, uint64_t * tag, void * data, size_t * data_len, uint64_t timeout) { - if (!tag || !data_len || (*data_len && !data)) + // Data is marked optional, but we need the length, and if length > 0, + // data is not optional. + if (!data_len || (*data_len && !data)) return j6_err_invalid_arg; endpoint *e = get_handle(handle); @@ -46,7 +48,7 @@ endpoint_receive(j6_handle_t handle, uint64_t * tag, void * data, size_t * data_ j6_status_t endpoint_sendrecv(j6_handle_t handle, uint64_t * tag, void * data, size_t * data_len, uint64_t timeout) { - if (!tag || (*tag & j6_tag_system_flag)) + if (*tag & j6_tag_system_flag) return j6_err_invalid_arg; endpoint *e = get_handle(handle); diff --git a/src/kernel/syscalls/object.cpp b/src/kernel/syscalls/object.cpp index 5b07583..0557e4f 100644 --- a/src/kernel/syscalls/object.cpp +++ b/src/kernel/syscalls/object.cpp @@ -13,9 +13,6 @@ namespace syscalls { j6_status_t kobject_koid(j6_handle_t handle, j6_koid_t *koid) { - if (koid == nullptr) - return j6_err_invalid_arg; - kobject *obj = get_handle(handle); if (!obj) return j6_err_invalid_arg; diff --git a/src/kernel/syscalls/system.cpp b/src/kernel/syscalls/system.cpp index 4999f1e..8d8a3fb 100644 --- a/src/kernel/syscalls/system.cpp +++ b/src/kernel/syscalls/system.cpp @@ -19,9 +19,6 @@ namespace syscalls { j6_status_t log(const char *message) { - if (message == nullptr) - return j6_err_invalid_arg; - thread &th = thread::current(); log::info(logs::syscall, "Message[%llx]: %s", th.koid(), message); return j6_status_ok; @@ -36,23 +33,24 @@ noop() } j6_status_t -system_get_log(j6_handle_t sys, void *buffer, size_t *size) +system_get_log(j6_handle_t sys, void *buffer, size_t *buffer_len) { - if (!size || (*size && !buffer)) + // Buffer is marked optional, but we need the length, and if length > 0, + // buffer is not optional. + if (!buffer_len || (*buffer_len && !buffer)) return j6_err_invalid_arg; - size_t orig_size = *size; - *size = g_logger.get_entry(buffer, *size); + size_t orig_size = *buffer_len; + *buffer_len = g_logger.get_entry(buffer, *buffer_len); if (!g_logger.has_log()) system::get().deassert_signal(j6_signal_system_has_log); - return (*size > orig_size) ? j6_err_insufficient : j6_status_ok; + return (*buffer_len > orig_size) ? j6_err_insufficient : j6_status_ok; } j6_status_t system_bind_irq(j6_handle_t sys, j6_handle_t endp, unsigned irq) { - // TODO: check capabilities on sys handle endpoint *e = get_handle(endp); if (!e) return j6_err_invalid_arg; @@ -65,9 +63,6 @@ system_bind_irq(j6_handle_t sys, j6_handle_t endp, unsigned irq) j6_status_t system_map_phys(j6_handle_t handle, j6_handle_t * area, uintptr_t phys, size_t size, uint32_t flags) { - // TODO: check capabilities on sys handle - if (!area) return j6_err_invalid_arg; - // TODO: check to see if frames are already used? How would that collide with // the bootloader's allocated pages already being marked used? if (!(flags & vm_flags::mmio)) @@ -82,7 +77,6 @@ system_map_phys(j6_handle_t handle, j6_handle_t * area, uintptr_t phys, size_t s j6_status_t system_request_iopl(j6_handle_t handle, unsigned iopl) { - // TODO: check capabilities on sys handle if (iopl != 0 && iopl != 3) return j6_err_invalid_arg; diff --git a/src/kernel/syscalls/vm_area.cpp b/src/kernel/syscalls/vm_area.cpp index fb9dd02..d28ab98 100644 --- a/src/kernel/syscalls/vm_area.cpp +++ b/src/kernel/syscalls/vm_area.cpp @@ -56,9 +56,6 @@ vma_unmap(j6_handle_t handle, j6_handle_t proc) j6_status_t vma_resize(j6_handle_t handle, size_t *size) { - if (!size) - return j6_err_invalid_arg; - vm_area *a = get_handle(handle); if (!a) return j6_err_invalid_arg;