Changeset d83b266 for src/Parser


Ignore:
Timestamp:
Jul 26, 2021, 2:42:34 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
0a061c0
Parents:
c86ee4c (diff), 98233b3 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

Location:
src/Parser
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/DeclarationNode.cc

    rc86ee4c rd83b266  
    1010// Created On       : Sat May 16 12:34:05 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Mar 23 08:44:08 2021
    13 // Update Count     : 1149
     12// Last Modified On : Wed Jul 14 17:36:57 2021
     13// Update Count     : 1154
    1414//
    1515
     
    385385        newnode->type = new TypeData( basetypeof ? TypeData::Basetypeof : TypeData::Typeof );
    386386        newnode->type->typeexpr = expr;
     387        return newnode;
     388}
     389
     390DeclarationNode * DeclarationNode::newVtableType( DeclarationNode * decl ) {
     391        DeclarationNode * newnode = new DeclarationNode;
     392        newnode->type = new TypeData( TypeData::Vtable );
     393        newnode->setBase( decl->type );
    387394        return newnode;
    388395}
  • src/Parser/ParseNode.h

    rc86ee4c rd83b266  
    1010// Created On       : Sat May 16 13:28:16 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Mar 12 15:19:04 2021
    13 // Update Count     : 897
     12// Last Modified On : Wed Jul 14 17:28:53 2021
     13// Update Count     : 900
    1414//
    1515
     
    249249        static DeclarationNode * newTuple( DeclarationNode * members );
    250250        static DeclarationNode * newTypeof( ExpressionNode * expr, bool basetypeof = false );
     251        static DeclarationNode * newVtableType( DeclarationNode * expr );
    251252        static DeclarationNode * newAttribute( const std::string *, ExpressionNode * expr = nullptr ); // gcc attributes
    252253        static DeclarationNode * newDirectiveStmt( StatementNode * stmt ); // gcc external directive statement
  • src/Parser/TypeData.cc

    rc86ee4c rd83b266  
    99// Author           : Rodolfo G. Esteves
    1010// Created On       : Sat May 16 15:12:51 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Dec 16 07:56:46 2019
    13 // Update Count     : 662
     11// Last Modified By : Henry Xue
     12// Last Modified On : Tue Jul 20 04:10:50 2021
     13// Update Count     : 673
    1414//
    1515
     
    100100                typeexpr = nullptr;
    101101                break;
     102          case Vtable:
     103                break;
    102104          case Builtin:
    103105                // builtin = new Builtin_t;
     
    170172                // delete typeexpr->expr;
    171173                delete typeexpr;
     174                break;
     175          case Vtable:
    172176                break;
    173177          case Builtin:
     
    249253          case Basetypeof:
    250254                newtype->typeexpr = maybeClone( typeexpr );
     255                break;
     256          case Vtable:
    251257                break;
    252258          case Builtin:
     
    467473          case Basetypeof:
    468474          case Builtin:
     475          case Vtable:
    469476                assertf(false, "Tried to get leaf name from kind without a name: %d", kind);
    470477                break;
     
    546553          case TypeData::Basetypeof:
    547554                return buildTypeof( td );
     555          case TypeData::Vtable:
     556                return buildVtable( td );
    548557          case TypeData::Builtin:
    549558                switch ( td->builtintype ) {
     
    769778          case AggregateDecl::Struct:
    770779          case AggregateDecl::Coroutine:
     780          case AggregateDecl::Exception:
    771781          case AggregateDecl::Generator:
    772782          case AggregateDecl::Monitor:
     
    945955        assert( td->typeexpr );
    946956        // assert( td->typeexpr->expr );
    947         return new TypeofType{
    948                 buildQualifiers( td ), td->typeexpr->build(), td->kind == TypeData::Basetypeof };
     957        return new TypeofType{ buildQualifiers( td ), td->typeexpr->build(), td->kind == TypeData::Basetypeof };
    949958} // buildTypeof
     959
     960
     961VTableType * buildVtable( const TypeData * td ) {
     962        assert( td->base );
     963        return new VTableType{ buildQualifiers( td ), typebuild( td->base ) };
     964} // buildVtable
    950965
    951966
  • src/Parser/TypeData.h

    rc86ee4c rd83b266  
    1010// Created On       : Sat May 16 15:18:36 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Mar 27 09:05:35 2021
    13 // Update Count     : 200
     12// Last Modified On : Wed Jul 14 17:44:05 2021
     13// Update Count     : 202
    1414//
    1515
     
    2727struct TypeData {
    2828        enum Kind { Basic, Pointer, Reference, Array, Function, Aggregate, AggregateInst, Enum, EnumConstant, Symbolic,
    29                                 SymbolicInst, Tuple, Typeof, Basetypeof, Builtin, GlobalScope, Qualified, Unknown };
     29                                SymbolicInst, Tuple, Typeof, Basetypeof, Vtable, Builtin, GlobalScope, Qualified, Unknown };
    3030
    3131        struct Aggregate_t {
     
    128128TupleType * buildTuple( const TypeData * );
    129129TypeofType * buildTypeof( const TypeData * );
     130VTableType * buildVtable( const TypeData * );
    130131Declaration * buildDecl( const TypeData *, const std::string &, Type::StorageClasses, Expression *, Type::FuncSpecifiers funcSpec, LinkageSpec::Spec, Expression * asmName,
    131132                                                 Initializer * init = nullptr, std::list< class Attribute * > attributes = std::list< class Attribute * >() );
  • src/Parser/parser.yy

    rc86ee4c rd83b266  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Jun 29 09:12:47 2021
    13 // Update Count     : 5027
     12// Last Modified On : Tue Jul 20 22:03:04 2021
     13// Update Count     : 5031
    1414//
    1515
     
    19231923
    19241924vtable:
    1925         VTABLE '(' type_list ')' default_opt
    1926                 { SemanticError( yylloc, "vtable is currently unimplemented." ); $$ = nullptr; }
     1925        VTABLE '(' type_name ')' default_opt
     1926                { $$ = DeclarationNode::newVtableType( $3 ); }
     1927                // { SemanticError( yylloc, "vtable is currently unimplemented." ); $$ = nullptr; }
    19271928        ;
    19281929
Note: See TracChangeset for help on using the changeset viewer.