def p_opaque_enum_declaration(p): """ opaque-enum-declaration : enum-key IDENTIFIER """ p[0] = risha_ast.enums.EnumHead(enum_key=p[1], identifier=risha_ast.Identifier( identifier=p[2], row=p.lineno(2), col=p.lexpos(2)), row=p[1].row, col=p[1].col)
def p_elaborated_type_specifier_class(p): """ elaborated-type-specifier : CLASS IDENTIFIER """ p[0] = risha_ast.ClassHead(class_key=p[1], class_name=risha_ast.Identifier( identifier=p[2], row=p.lineno(2), col=p.lexpos(2)), row=p.lineno(1), col=p.lexpos(1))
def p_elaborated_type_specifier_enum(p): """ elaborated-type-specifier : enum-key IDENTIFIER """ p[0] = risha_ast.enums.EnumHead(enum_key=p[1], identifier=risha_ast.Identifier( identifier=p[2], row=p.lineno(2), col=p.lexpos(2)), row=p[1].row, col=p[1].col)
def p_alias_declaration(p): """ alias-declaration : USING IDENTIFIER ASSIGNMENT type-id SEMICOLON """ p[0] = risha_ast.AliasDeclaration( identifier=risha_ast.Identifier(identifier=p[2], row=p.lineno(2), col=p.lexpos(2)), type_id=p[4], row=p.lineno(1), col=p.lexpos(1))
def p_enum_head(p): """ enum-head : enum-key | enum-key IDENTIFIER """ if len(p) == 2: p[0] = risha_ast.enums.EnumHead(enum_key=p[1], identifier=None, row=p[1].row, col=p[1].col) else: p[0] = risha_ast.enums.EnumHead(enum_key=p[1], identifier=risha_ast.Identifier( identifier=p[2], row=p.lineno(2), col=p.lexpos(2)), row=p[1].row, col=p[1].col)
def p_enumerator(p): """ enumerator : IDENTIFIER """ p[0] = risha_ast.Identifier(identifier=p[1], row=p.lineno(1), col=p.lexpos(1))
def p_enum_name(p): """ enum-name : IDENTIFIER """ p[0] = risha_ast.Identifier(identifier=p[1], row=p.lineno(1), col=p.lineno(1))
def p_unqualified_id_identifier(p): """ unqualified-id : IDENTIFIER """ p[0] = risha_ast.Identifier(identifier=p[1], row=p.lineno(1), col=p.lexpos(1))
def p_class_name(p): """ class-name : IDENTIFIER """ p[0] = risha_ast.Identifier(identifier=p[1], row=p.lineno(1), col=p.lexpos(1))