Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    rbd85400 r974906e2  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // cfa.y -- 
    8 // 
     7// cfa.y --
     8//
    99// Author           : Peter A. Buhr
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Feb  1 18:22:42 2016
    13 // Update Count     : 1483
    14 // 
     12// Last Modified On : Thu Oct  8 17:17:54 2015
     13// Update Count     : 1473
     14//
    1515
    1616// This grammar is based on the ANSI99/11 C grammar, specifically parts of EXPRESSION and STATEMENTS, and on the C
     
    7878%token ENUM STRUCT UNION
    7979%token TYPE FTYPE DTYPE CONTEXT                                                 // CFA
    80 %token SIZEOF OFFSETOF
     80%token SIZEOF
    8181%token ATTRIBUTE EXTENSION                                                              // GCC
    8282%token IF ELSE SWITCH CASE DEFAULT DO WHILE FOR BREAK CONTINUE GOTO RETURN
     
    319319        ;
    320320
     321// no zero_one because ambiguity with 0.0 : double constant or field selection
    321322no_attr_identifier:
    322323        IDENTIFIER
    323         | zero_one                                                                                      // CFA
    324324        ;
    325325
     
    357357        | postfix_expression '(' argument_expression_list ')'
    358358                { $$ = 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;
    361359        | postfix_expression '.' no_attr_identifier
    362360                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::FieldSel ), $1, new VarRefNode( $3 )); }
     
    407405        no_attr_identifier
    408406                { $$ = 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;
    411407        | no_attr_identifier '.' field
    412408                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::FieldSel ), new VarRefNode( $1 ), $3 ); }
     
    447443        | SIZEOF '(' type_name_no_function ')'
    448444                { $$ = 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 )); }
    451445        | ATTR_IDENTIFIER
    452446                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::Attr ), new VarRefNode( $1 )); }
     
    16881682                { $$ = $2; }
    16891683        | ATassign initializer
    1690                 { $$ = $2; }
     1684                { $$ = $2->set_maybeConstructed( false ); }
    16911685        ;
    16921686
Note: See TracChangeset for help on using the changeset viewer.