Ignore:
Timestamp:
Jun 27, 2018, 3:28:41 PM (6 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
new-env, with_gc
Children:
b21c77a
Parents:
0182bfa (diff), 63238a4 (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' into with_gc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/ParseNode.h

    r0182bfa r28f3a19  
    1010// Created On       : Sat May 16 13:28:16 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Apr 30 09:19:17 2018
    13 // Update Count     : 831
     12// Last Modified On : Wed Jun  6 16:17:18 2018
     13// Update Count     : 843
    1414//
    1515
     
    7777
    7878        ParseNode * next = nullptr;
    79         std::string * name = nullptr;
     79        const std::string * name = nullptr;
    8080        CodeLocation location = yylloc;
    8181}; // ParseNode
     
    8787        InitializerNode( ExpressionNode *, bool aggrp = false,  ExpressionNode * des = nullptr );
    8888        InitializerNode( InitializerNode *, bool aggrp = false, ExpressionNode * des = nullptr );
     89        InitializerNode( bool isDelete );
    8990        ~InitializerNode();
    9091        virtual InitializerNode * clone() const { assert( false ); return nullptr; }
     
    9798        InitializerNode * set_maybeConstructed( bool value ) { maybeConstructed = value; return this; }
    9899        bool get_maybeConstructed() const { return maybeConstructed; }
     100
     101        bool get_isDelete() const { return isDelete; }
    99102
    100103        InitializerNode * next_init() const { return kids; }
     
    110113        InitializerNode * kids;
    111114        bool maybeConstructed;
     115        bool isDelete;
    112116}; // InitializerNode
    113117
     
    167171};
    168172
    169 Expression * build_constantInteger( std::string &str );
    170 Expression * build_constantFloat( std::string &str );
    171 Expression * build_constantChar( std::string &str );
    172 Expression * build_constantStr( std::string &str );
     173Expression * build_constantInteger( std::string & str ); // these 4 routines modify the string
     174Expression * build_constantFloat( std::string & str );
     175Expression * build_constantChar( std::string & str );
     176Expression * build_constantStr( std::string & str );
    173177Expression * build_field_name_FLOATING_FRACTIONconstant( const std::string & str );
    174178Expression * build_field_name_FLOATING_DECIMALconstant( const std::string & str );
     
    226230        static DeclarationNode * newBuiltinType( BuiltinType );
    227231        static DeclarationNode * newForall( DeclarationNode * );
    228         static DeclarationNode * newFromTypedef( std::string * );
    229         static DeclarationNode * newFunction( std::string * name, DeclarationNode * ret, DeclarationNode * param, StatementNode * body );
     232        static DeclarationNode * newFromTypedef( const std::string * );
     233        static DeclarationNode * newFunction( const std::string * name, DeclarationNode * ret, DeclarationNode * param, StatementNode * body );
    230234        static DeclarationNode * newAggregate( Aggregate kind, const std::string * name, ExpressionNode * actuals, DeclarationNode * fields, bool body );
    231         static DeclarationNode * newEnum( std::string * name, DeclarationNode * constants, bool body );
    232         static DeclarationNode * newEnumConstant( std::string * name, ExpressionNode * constant );
    233         static DeclarationNode * newName( std::string * );
    234         static DeclarationNode * newFromTypeGen( std::string *, ExpressionNode * params );
    235         static DeclarationNode * newTypeParam( TypeClass, std::string * );
     235        static DeclarationNode * newEnum( const std::string * name, DeclarationNode * constants, bool body );
     236        static DeclarationNode * newEnumConstant( const std::string * name, ExpressionNode * constant );
     237        static DeclarationNode * newName( const std::string * );
     238        static DeclarationNode * newFromTypeGen( const std::string *, ExpressionNode * params );
     239        static DeclarationNode * newTypeParam( TypeClass, const std::string * );
    236240        static DeclarationNode * newTrait( const std::string * name, DeclarationNode * params, DeclarationNode * asserts );
    237241        static DeclarationNode * newTraitUse( const std::string * name, ExpressionNode * params );
    238         static DeclarationNode * newTypeDecl( std::string * name, DeclarationNode * typeParams );
     242        static DeclarationNode * newTypeDecl( const std::string * name, DeclarationNode * typeParams );
    239243        static DeclarationNode * newPointer( DeclarationNode * qualifiers, OperKinds kind );
    240244        static DeclarationNode * newArray( ExpressionNode * size, DeclarationNode * qualifiers, bool isStatic );
     
    243247        static DeclarationNode * newTuple( DeclarationNode * members );
    244248        static DeclarationNode * newTypeof( ExpressionNode * expr );
    245         static DeclarationNode * newAttr( std::string *, ExpressionNode * expr ); // @ attributes
    246         static DeclarationNode * newAttr( std::string *, DeclarationNode * type ); // @ attributes
    247         static DeclarationNode * newAttribute( std::string *, ExpressionNode * expr = nullptr ); // gcc attributes
     249        static DeclarationNode * newAttr( const std::string *, ExpressionNode * expr ); // @ attributes
     250        static DeclarationNode * newAttr( const std::string *, DeclarationNode * type ); // @ attributes
     251        static DeclarationNode * newAttribute( const std::string *, ExpressionNode * expr = nullptr ); // gcc attributes
    248252        static DeclarationNode * newAsmStmt( StatementNode * stmt ); // gcc external asm statement
    249253        static DeclarationNode * newStaticAssert( ExpressionNode * condition, Expression * message );
     
    399403};
    400404
     405Expression * build_if_control( IfCtl * ctl, std::list< Statement * > & init );
    401406Statement * build_if( IfCtl * ctl, StatementNode * then_stmt, StatementNode * else_stmt );
    402407Statement * build_switch( bool isSwitch, ExpressionNode * ctl, StatementNode * stmt );
    403408Statement * build_case( ExpressionNode * ctl );
    404409Statement * build_default();
    405 Statement * build_while( ExpressionNode * ctl, StatementNode * stmt, bool kind = false );
     410Statement * build_while( IfCtl * ctl, StatementNode * stmt );
     411Statement * build_do_while( ExpressionNode * ctl, StatementNode * stmt );
    406412Statement * build_for( ForCtl * forctl, StatementNode * stmt );
    407413Statement * build_branch( BranchStmt::Type kind );
Note: See TracChangeset for help on using the changeset viewer.