예제 #1
0
 def reduce_OptInheritable_ATTRIBUTE_NameAndExtends_NL(self, *kids):
     np: NameWithParents = kids[2].val
     self.val = esast.AttributeDeclaration(
         name=np.name,
         extends=np.extends,
         inheritable=kids[0].val
     )
예제 #2
0
    def reduce_ATTRIBUTE_ParenRawString_DeclarationSpecsBlob(self, *kids):
        eql = kids[1].parse_as_attribute_decl()
        attributes = []
        for spec in kids[2].val:
            if isinstance(spec, esast.Attribute):
                attributes.append(spec)
            else:
                raise SchemaSyntaxError(
                    'illegal definition', context=spec.context)

        self.val = esast.AttributeDeclaration(
            name=eql.name.name,
            extends=eql.bases,
            type=eql.type,
            attributes=attributes)
예제 #3
0
    def reduce_attribute_with_specs(self, *kids):
        """%reduce OptInheritable ATTRIBUTE NameAndExtends
                   DeclarationSpecsBlob
        """
        np: NameWithParents = kids[2].val

        self.val = esast.AttributeDeclaration(
            name=np.name,
            extends=np.extends,
            **_process_decl_body(
                kids[3].val,
                (
                    esast.Attribute,
                    esast.Field
                )
            )
        )
예제 #4
0
 def reduce_ATTRIBUTE_ParenRawString_NL(self, *kids):
     eql = kids[1].parse_as_attribute_decl()
     self.val = esast.AttributeDeclaration(
         name=eql.name.name,
         extends=eql.bases,
         type=eql.type)
예제 #5
0
 def reduce_ATTRIBUTE_ParenRawString_NL(self, *kids):
     eql = kids[1].parse_as_attribute_decl()
     self.val = esast.AttributeDeclaration(
         name=eql.name.name,
         extends=[qlast.TypeName(maintype=base) for base in eql.bases],
         type=eql.type)