예제 #1
0
class Scope(FooNode):
    name = Field()
    deps = Field()
    defs = Field()

    annotations = Annotations(ple_unit_root=True)

    @langkit_property()
    def initial_env():
        return Self.name.match(
            lambda p=T.Prefix: p.prefix.referenced_unit.root.cast_or_raise(
                T.Scope.list).filter(lambda scope: scope.name.symbols == p.
                                     prefix.symbols).at_or_raise(0).
            children_env,
            lambda _: Self.children_env,
        )

    env_spec = EnvSpec(
        set_initial_env(Self.initial_env, unsound=True),
        add_to_env_kv(key=Self.name.suffix_symbol, val=Self),
        add_env(),
    )
예제 #2
0
class GPRNode(ASTNode):
    annotations = Annotations(generic_list_type="BaseList")
예제 #3
0
파일: test.py 프로젝트: nyulacska/langkit
 class FooNode(ASTNode):
     annotations = Annotations(generic_list_type='FooList')
예제 #4
0
 class Subunit(FooNode):
     annotations = Annotations(ple_unit_root=True)
     fields = Field()
예제 #5
0
 class Example(FooNode):
     annotations = Annotations(ple_unit_root=True)
예제 #6
0
 class SyntheticNode(FooNode):
     annotations = Annotations(ple_unit_root=True)
예제 #7
0
class NumLiteral(SingleTokNode):
    annotations = Annotations(repr_name='Num')
예제 #8
0
class StringLiteral(SingleTokNode):
    annotations = Annotations(repr_name='Str')
예제 #9
0
class Identifier(SingleTokNode):
    annotations = Annotations(repr_name='Id')
예제 #10
0
파일: test.py 프로젝트: pmderodat/langkit
class RebindableEnvCreator(BaseEnvCreator):
    annotations = Annotations(rebindable=True)