Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/ParseNode.h

    r401e61f r25bca42  
    1010// Created On       : Sat May 16 13:28:16 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Jun  4 22:21:04 2018
    13 // Update Count     : 832
     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
     
    171171};
    172172
    173 Expression * build_constantInteger( std::string &str );
    174 Expression * build_constantFloat( std::string &str );
    175 Expression * build_constantChar( std::string &str );
    176 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 );
    177177Expression * build_field_name_FLOATING_FRACTIONconstant( const std::string & str );
    178178Expression * build_field_name_FLOATING_DECIMALconstant( const std::string & str );
     
    230230        static DeclarationNode * newBuiltinType( BuiltinType );
    231231        static DeclarationNode * newForall( DeclarationNode * );
    232         static DeclarationNode * newFromTypedef( std::string * );
    233         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 );
    234234        static DeclarationNode * newAggregate( Aggregate kind, const std::string * name, ExpressionNode * actuals, DeclarationNode * fields, bool body );
    235         static DeclarationNode * newEnum( std::string * name, DeclarationNode * constants, bool body );
    236         static DeclarationNode * newEnumConstant( std::string * name, ExpressionNode * constant );
    237         static DeclarationNode * newName( std::string * );
    238         static DeclarationNode * newFromTypeGen( std::string *, ExpressionNode * params );
    239         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 * );
    240240        static DeclarationNode * newTrait( const std::string * name, DeclarationNode * params, DeclarationNode * asserts );
    241241        static DeclarationNode * newTraitUse( const std::string * name, ExpressionNode * params );
    242         static DeclarationNode * newTypeDecl( std::string * name, DeclarationNode * typeParams );
     242        static DeclarationNode * newTypeDecl( const std::string * name, DeclarationNode * typeParams );
    243243        static DeclarationNode * newPointer( DeclarationNode * qualifiers, OperKinds kind );
    244244        static DeclarationNode * newArray( ExpressionNode * size, DeclarationNode * qualifiers, bool isStatic );
     
    247247        static DeclarationNode * newTuple( DeclarationNode * members );
    248248        static DeclarationNode * newTypeof( ExpressionNode * expr );
    249         static DeclarationNode * newAttr( std::string *, ExpressionNode * expr ); // @ attributes
    250         static DeclarationNode * newAttr( std::string *, DeclarationNode * type ); // @ attributes
    251         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
    252252        static DeclarationNode * newAsmStmt( StatementNode * stmt ); // gcc external asm statement
    253253        static DeclarationNode * newStaticAssert( ExpressionNode * condition, Expression * message );
Note: See TracChangeset for help on using the changeset viewer.