Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# https://pypi.python.org/pypi/tatsu/
#
# Any changes you make to it will be overwritten the next time
# the file is generated.
from __future__ import print_function, division, absolute_import, unicode_literals
from tatsu.objectmodel import Node
from tatsu.semantics import ModelBuilderSemantics
class ModelBase(Node):
pass
class TextGrammarModelBuilderSemantics(ModelBuilderSemantics):
def __init__(self, context=None, types=None):
types = [
t for t in globals().values()
if type(t) is type and issubclass(t, ModelBase)
] + (types or [])
super(TextGrammarModelBuilderSemantics, self).__init__(context=context, types=types)
class Literal(ModelBase):
value = None
class AdjectiveNoun(ModelBase):
adjective = None
noun = None
# CAVEAT UTILITOR
#
# This file was automatically generated by TatSu.
#
# https://pypi.python.org/pypi/tatsu/
#
# Any changes you make to it will be overwritten the next time
# the file is generated.
from __future__ import print_function, division, absolute_import, unicode_literals
from tatsu.objectmodel import Node
from tatsu.semantics import ModelBuilderSemantics
class CalcModelBuilderSemantics(ModelBuilderSemantics):
def __init__(self):
types = [
t for t in globals().values()
if type(t) is type and issubclass(t, ModelBase)
]
super(CalcModelBuilderSemantics, self).__init__(types=types)
class ModelBase(Node):
pass
class Add(ModelBase):
def __init__(self,
left=None,
op=None,
def compile(grammar, name=None, semantics=None, asmodel=False, **kwargs):
cache = __compiled_grammar_cache
if (grammar, semantics) in cache:
model = cache[(grammar, semantics)]
else:
gen = GrammarGenerator(name, **kwargs)
model = cache[grammar] = gen.parse(grammar, **kwargs)
model.semantics = semantics or asmodel and ModelBuilderSemantics()
return model
# https://pypi.python.org/pypi/tatsu/
#
# Any changes you make to it will be overwritten the next time
# the file is generated.
from __future__ import print_function, division, absolute_import, unicode_literals
from tatsu.objectmodel import Node
from tatsu.semantics import ModelBuilderSemantics
class ModelBase(Node):
pass
class JavaScriptModelBuilderSemantics(ModelBuilderSemantics):
def __init__(self, context=None, types=None):
types = [
t for t in globals().values()
if type(t) is type and issubclass(t, ModelBase)
] + (types or [])
super(JavaScriptModelBuilderSemantics, self).__init__(context=context, types=types)
class Integer(ModelBase):
value = None
class Float(ModelBase):
value = None
# https://pypi.python.org/pypi/tatsu/
#
# Any changes you make to it will be overwritten the next time
# the file is generated.
from __future__ import print_function, division, absolute_import, unicode_literals
from tatsu.objectmodel import Node
from tatsu.semantics import ModelBuilderSemantics
class ModelBase(Node):
pass
class GameLogicModelBuilderSemantics(ModelBuilderSemantics):
def __init__(self, context=None, types=None):
types = [
t for t in globals().values()
if type(t) is type and issubclass(t, ModelBase)
] + (types or [])
super(GameLogicModelBuilderSemantics, self).__init__(context=context, types=types)
class VariableNode(ModelBase):
name = None
type = None
class SignatureNode(ModelBase):
name = None
types = None
# CAVEAT UTILITOR
#
# This file was automatically generated by TatSu.
#
# https://pypi.python.org/pypi/tatsu/
#
# Any changes you make to it will be overwritten the next time
# the file is generated.
from __future__ import print_function, division, absolute_import, unicode_literals
from tatsu.objectmodel import Node
from tatsu.semantics import ModelBuilderSemantics
class CalcModelBuilderSemantics(ModelBuilderSemantics):
def __init__(self):
types = [
t for t in globals().values()
if type(t) is type and issubclass(t, ModelBase)
]
super(CalcModelBuilderSemantics, self).__init__(types=types)
class ModelBase(Node):
pass
class Add(ModelBase):
def __init__(self,
left=None,
op=None,