Changeset c5d7701 for src/Parser


Ignore:
Timestamp:
Jun 14, 2018, 5:34:39 PM (6 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
Children:
704d11e
Parents:
29f9e20
Message:

Add QualifiedType? node

Location:
src/Parser
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/DeclarationNode.cc

    r29f9e20 rc5d7701  
    253253        return newnode;
    254254} // DeclarationNode::newFromTypedef
     255
     256DeclarationNode * DeclarationNode::newQualifiedType( DeclarationNode * parent, DeclarationNode * child) {
     257        return child;
     258        // return parent->add_last( child );
     259}
    255260
    256261DeclarationNode * DeclarationNode::newAggregate( Aggregate kind, const string * name, ExpressionNode * actuals, DeclarationNode * fields, bool body ) {
  • src/Parser/ParseNode.h

    r29f9e20 rc5d7701  
    231231        static DeclarationNode * newForall( DeclarationNode * );
    232232        static DeclarationNode * newFromTypedef( const std::string * );
     233        static DeclarationNode * newQualifiedType( DeclarationNode *, DeclarationNode * );
    233234        static DeclarationNode * newFunction( const std::string * name, DeclarationNode * ret, DeclarationNode * param, StatementNode * body );
    234235        static DeclarationNode * newAggregate( Aggregate kind, const std::string * name, ExpressionNode * actuals, DeclarationNode * fields, bool body );
  • src/Parser/parser.yy

    r29f9e20 rc5d7701  
    17941794                { SemanticError( yylloc, "Qualified name is currently unimplemented." ); $$ = nullptr; }
    17951795        | type_name '.' TYPEDEFname
    1796                 { SemanticError( yylloc, "Qualified name is currently unimplemented." ); $$ = nullptr; }
     1796                { $$ = DeclarationNode::newQualifiedType( $1, DeclarationNode::newFromTypedef( $3 ) ); }
    17971797        | typegen_name
    17981798        | '.' typegen_name
    17991799                { SemanticError( yylloc, "Qualified name is currently unimplemented." ); $$ = nullptr; }
    18001800        | type_name '.' typegen_name
    1801                 { SemanticError( yylloc, "Qualified name is currently unimplemented." ); $$ = nullptr; }
     1801                { $$ = DeclarationNode::newQualifiedType( $1, $3 ); }
    18021802        ;
    18031803
Note: See TracChangeset for help on using the changeset viewer.