Changeset 59db689 for src/Parser/parser.yy
- Timestamp:
- Jun 6, 2015, 11:38:58 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, string, with_gc
- Children:
- cd623a4
- Parents:
- a65d92e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
ra65d92e r59db689 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jun 4 21:38:06 201513 // Update Count : 102 112 // Last Modified On : Sat Jun 6 20:18:36 2015 13 // Update Count : 1026 14 14 // 15 15 … … 295 295 // ENUMERATIONconstant is not included here; it is treated as a variable with type 296 296 // "enumeration constant". 297 INTEGERconstant { $$ = new ConstantNode( ConstantNode::Integer, $1); }298 | FLOATINGconstant { $$ = new ConstantNode( ConstantNode::Float, $1); }299 | CHARACTERconstant { $$ = new ConstantNode( ConstantNode::Character, $1); }297 INTEGERconstant { $$ = new ConstantNode( ConstantNode::Integer, $1 ); } 298 | FLOATINGconstant { $$ = new ConstantNode( ConstantNode::Float, $1 ); } 299 | CHARACTERconstant { $$ = new ConstantNode( ConstantNode::Character, $1 ); } 300 300 ; 301 301 … … 321 321 322 322 string_literal_list: // juxtaposed strings are concatenated 323 STRINGliteral { $$ = new ConstantNode( ConstantNode::String, $1); }324 | string_literal_list STRINGliteral { $$ = $1->append ( $2 ); }323 STRINGliteral { $$ = new ConstantNode( ConstantNode::String, $1 ); } 324 | string_literal_list STRINGliteral { $$ = $1->appendstr( $2 ); } 325 325 ; 326 326 … … 536 536 logical_OR_expression 537 537 | logical_OR_expression '?' comma_expression ':' conditional_expression 538 { $$ = new CompositeExprNode( new OperatorNode(OperatorNode::Cond), (ExpressionNode *)mkList((*$1,*$3,*$5))); }538 { $$ = new CompositeExprNode( new OperatorNode(OperatorNode::Cond), (ExpressionNode *)mkList( (*$1, *$3, *$5) ) ); } 539 539 | logical_OR_expression '?' /* empty */ ':' conditional_expression // GCC, omitted first operand 540 540 { $$=new CompositeExprNode(new OperatorNode(OperatorNode::NCond),$1,$4); } 541 541 | logical_OR_expression '?' comma_expression ':' tuple // CFA, tuple expression 542 { $$ = new CompositeExprNode( new OperatorNode(OperatorNode::Cond), (ExpressionNode *)mkList(( *$1, *$3, *$5 ))); }542 { $$ = new CompositeExprNode( new OperatorNode(OperatorNode::Cond), (ExpressionNode *)mkList( (*$1, *$3, *$5) ) ); } 543 543 ; 544 544
Note: See TracChangeset
for help on using the changeset viewer.