def __new__(cls, *args): """ This constructor can be used in the grammar to create a parser for this AST node. """ from langkit.parsers import _Row, _Transform return _Transform(_Row(*args), T.Defer(cls._resolve, cls._name.camel))
def type_ref(self): """ TypeRepo.Defer instance for the ASTNodeType subclass corresponding to this alternative. """ def get(): assert self._type return self._type return T.Defer(get, 'Alternative({})'.format(self.name.camel))
def entity(cls): return T.Defer(lambda: cls._resolve().entity, '{}.entity'.format(cls._name.camel))
def array(cls): """ Return the array type whose element type is `cls`. """ return T.Defer(lambda: cls._resolve().array, '{}.array'.format(cls._name.camel))