Changeset d41280e for src/Parser/parser.yy
- Timestamp:
- Feb 8, 2016, 10:07:42 AM (10 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:
- c44e622
- Parents:
- 00ede9e (diff), bd85400 (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
-
src/Parser/parser.yy (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
r00ede9e rd41280e 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Oct 8 17:17:54 201513 // Update Count : 14 7312 // Last Modified On : Mon Feb 1 18:22:42 2016 13 // Update Count : 1483 14 14 // 15 15 … … 78 78 %token ENUM STRUCT UNION 79 79 %token TYPE FTYPE DTYPE CONTEXT // CFA 80 %token SIZEOF 80 %token SIZEOF OFFSETOF 81 81 %token ATTRIBUTE EXTENSION // GCC 82 82 %token IF ELSE SWITCH CASE DEFAULT DO WHILE FOR BREAK CONTINUE GOTO RETURN … … 319 319 ; 320 320 321 // no zero_one because ambiguity with 0.0 : double constant or field selection322 321 no_attr_identifier: 323 322 IDENTIFIER 323 | zero_one // CFA 324 324 ; 325 325 … … 357 357 | postfix_expression '(' argument_expression_list ')' 358 358 { $$ = new CompositeExprNode( $1, $3 ); } 359 // ambiguity with .0 so space required after field-selection, e.g. 360 // struct S { int 0, 1; } s; s. 0 = 0; s. 1 = 1; 359 361 | postfix_expression '.' no_attr_identifier 360 362 { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::FieldSel ), $1, new VarRefNode( $3 )); } … … 405 407 no_attr_identifier 406 408 { $$ = new VarRefNode( $1 ); } 409 // ambiguity with .0 so space required after field-selection, e.g. 410 // struct S { int 0, 1; } s; s. 0 = 0; s. 1 = 1; 407 411 | no_attr_identifier '.' field 408 412 { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::FieldSel ), new VarRefNode( $1 ), $3 ); } … … 443 447 | SIZEOF '(' type_name_no_function ')' 444 448 { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::SizeOf ), new TypeValueNode( $3 )); } 449 | OFFSETOF '(' type_name_no_function ',' no_attr_identifier ')' 450 { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::OffsetOf ), new TypeValueNode( $3 ), new VarRefNode( $5 )); } 445 451 | ATTR_IDENTIFIER 446 452 { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::Attr ), new VarRefNode( $1 )); }
Note:
See TracChangeset
for help on using the changeset viewer.