Changeset 0f9e4403 for src/Parser/ParseNode.h
- Timestamp:
- Apr 15, 2016, 12:03:11 PM (9 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 29ad0ac
- Parents:
- c5833e8 (diff), 37f0da8 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/ParseNode.h
rc5833e8 r0f9e4403 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // ParseNode.h -- 7 // ParseNode.h -- 8 8 // 9 9 // Author : Rodolfo G. Esteves 10 10 // Created On : Sat May 16 13:28:16 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Mon Feb 1 13:32:32 201613 // Update Count : 18411 // Last Modified By : Rob Schluntz 12 // Last Modified On : Mon Apr 11 11:50:52 2016 13 // Update Count : 205 14 14 // 15 15 … … 108 108 109 109 ConstantNode( Type, std::string * ); 110 ConstantNode( const ConstantNode &other ) : value( *new std::string( other.value ) ) {};110 ConstantNode( const ConstantNode &other ) : type( other.type ), btype( other.btype), value( *new std::string( other.value ) ) {}; 111 111 ~ConstantNode() { delete &value; } 112 112 … … 177 177 enum Type { TupleC, Comma, TupleFieldSel, // n-adic 178 178 // triadic 179 Cond, NCond, 179 Cond, NCond, 180 180 // diadic 181 SizeOf, AlignOf, OffsetOf, Attr, CompLit, Plus, Minus, Mul, Div, Mod, Or, And, 182 BitOr, BitAnd, Xor, Cast, LShift, RShift, LThan, GThan, LEThan, GEThan, Eq, Neq, 181 SizeOf, AlignOf, OffsetOf, Attr, CompLit, Plus, Minus, Mul, Div, Mod, Or, And, 182 BitOr, BitAnd, Xor, Cast, LShift, RShift, LThan, GThan, LEThan, GEThan, Eq, Neq, 183 183 Assign, MulAssn, DivAssn, ModAssn, PlusAssn, MinusAssn, LSAssn, RSAssn, AndAssn, ERAssn, OrAssn, 184 184 Index, FieldSel, PFieldSel, Range, … … 309 309 ValofExprNode( const ValofExprNode &other ); 310 310 ~ValofExprNode(); 311 311 312 312 virtual ValofExprNode *clone() const { return new ValofExprNode( *this ); } 313 313 … … 329 329 enum BasicType { Char, Int, Float, Double, Void, Bool, Complex, Imaginary }; 330 330 enum Modifier { Signed, Unsigned, Short, Long }; 331 enum Aggregate { Struct, Union, Context };331 enum Aggregate { Struct, Union, Trait }; 332 332 enum TypeClass { Type, Dtype, Ftype }; 333 334 static const char *storageName[]; 333 enum BuiltinType { Valist }; 334 335 static const char *storageName[]; 335 336 static const char *qualifierName[]; 336 337 static const char *basicTypeName[]; … … 338 339 static const char *aggregateName[]; 339 340 static const char *typeClassName[]; 341 static const char *builtinTypeName[]; 340 342 341 343 static DeclarationNode *newFunction( std::string *name, DeclarationNode *ret, DeclarationNode *param, StatementNode *body, bool newStyle = false ); … … 352 354 static DeclarationNode *newFromTypeGen( std::string *, ExpressionNode *params ); 353 355 static DeclarationNode *newTypeParam( TypeClass, std::string *); 354 static DeclarationNode *new Context( std::string *name, DeclarationNode *params, DeclarationNode *asserts );355 static DeclarationNode *new ContextUse( std::string *name, ExpressionNode *params );356 static DeclarationNode *newTrait( std::string *name, DeclarationNode *params, DeclarationNode *asserts ); 357 static DeclarationNode *newTraitUse( std::string *name, ExpressionNode *params ); 356 358 static DeclarationNode *newTypeDecl( std::string *name, DeclarationNode *typeParams ); 357 359 static DeclarationNode *newPointer( DeclarationNode *qualifiers ); … … 363 365 static DeclarationNode *newAttr( std::string *, ExpressionNode *expr ); 364 366 static DeclarationNode *newAttr( std::string *, DeclarationNode *type ); 367 static DeclarationNode *newBuiltinType( BuiltinType ); 365 368 366 369 DeclarationNode *addQualifiers( DeclarationNode *); … … 401 404 LinkageSpec::Type get_linkage() const { return linkage; } 402 405 DeclarationNode *extractAggregate() const; 406 ExpressionNode *get_enumeratorValue() const { return enumeratorValue; } 403 407 404 408 DeclarationNode(); … … 413 417 std::list< std::string > attributes; 414 418 ExpressionNode *bitfieldWidth; 419 ExpressionNode *enumeratorValue; 415 420 InitializerNode *initializer; 416 421 bool hasEllipsis; … … 422 427 class StatementNode : public ParseNode { 423 428 public: 424 enum Type { Exp, If, Switch, Case, Default, Choose, Fallthru, 429 enum Type { Exp, If, Switch, Case, Default, Choose, Fallthru, 425 430 While, Do, For, 426 431 Goto, Continue, Break, Return, Throw, … … 530 535 bool aggregate; 531 536 ExpressionNode *designator; // may be list 537 InitializerNode *kids; 538 }; 539 540 class CompoundLiteralNode : public ExpressionNode { 541 public: 542 CompoundLiteralNode( DeclarationNode *type, InitializerNode *kids ); 543 CompoundLiteralNode( const CompoundLiteralNode &type ); 544 ~CompoundLiteralNode(); 545 546 virtual CompoundLiteralNode *clone() const; 547 548 DeclarationNode *get_type() const { return type; } 549 CompoundLiteralNode *set_type( DeclarationNode *t ) { type = t; return this; } 550 551 InitializerNode *get_initializer() const { return kids; } 552 CompoundLiteralNode *set_initializer( InitializerNode *k ) { kids = k; return this; } 553 554 void print( std::ostream &, int indent = 0 ) const; 555 void printOneLine( std::ostream &, int indent = 0 ) const; 556 557 virtual Expression *build() const; 558 private: 559 DeclarationNode *type; 532 560 InitializerNode *kids; 533 561 };
Note:
See TracChangeset
for help on using the changeset viewer.