Ignore:
Timestamp:
Aug 20, 2016, 7:06:26 PM (9 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, 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:
ab57786, d30790f
Parents:
e6955b1 (diff), 4a7d895 (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.
Message:

Merge branch 'master' of plg2:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    re6955b1 r80722d0  
    311311constant:
    312312                // ENUMERATIONconstant is not included here; it is treated as a variable with type "enumeration constant".
    313 INTEGERconstant                                                                 { $$ = new ExpressionNode( build_constantInteger( *$1 ) ); }
    314         | FLOATINGconstant                                                      { $$ = new ExpressionNode( build_constantFloat( *$1 ) ); }
    315         | CHARACTERconstant                                                     { $$ = new ExpressionNode( build_constantChar( *$1 ) ); }
     313        INTEGERconstant                                                                 { $$ = new ExpressionNode( build_constantInteger( assign_strptr($1) ) ); }
     314        | FLOATINGconstant                                                      { $$ = new ExpressionNode( build_constantFloat( assign_strptr($1) ) ); }
     315        | CHARACTERconstant                                                     { $$ = new ExpressionNode( build_constantChar( assign_strptr($1) ) ); }
    316316        ;
    317317
     
    338338
    339339string_literal_list:                                                                    // juxtaposed strings are concatenated
    340         STRINGliteral                                                           { $$ = build_constantStr( *$1 ); }
     340        STRINGliteral                                                           { $$ = build_constantStr( assign_strptr($1) ); }
    341341        | string_literal_list STRINGliteral
    342342                {
     
    838838jump_statement:
    839839        GOTO IDENTIFIER ';'
    840                 { $$ = new StatementNode( build_branch( *$2, BranchStmt::Goto ) ); }
     840                { $$ = new StatementNode( build_branch( assign_strptr($2), BranchStmt::Goto ) ); }
    841841        | GOTO '*' comma_expression ';'                                         // GCC, computed goto
    842842                // The syntax for the GCC computed goto violates normal expression precedence, e.g., goto *i+3; => goto *(i+3);
     
    849849                // A semantic check is required to ensure this statement appears only in the body of an iteration statement, and
    850850                // the target of the transfer appears only at the start of an iteration statement.
    851                 { $$ = new StatementNode( build_branch( *$2, BranchStmt::Continue ) ); delete $2; }
     851                { $$ = new StatementNode( build_branch( assign_strptr($2), BranchStmt::Continue ) ); }
    852852        | BREAK ';'
    853853                // A semantic check is required to ensure this statement appears only in the body of an iteration statement.
     
    856856                // A semantic check is required to ensure this statement appears only in the body of an iteration statement, and
    857857                // the target of the transfer appears only at the start of an iteration statement.
    858                 { $$ = new StatementNode( build_branch( *$2, BranchStmt::Break ) ); delete $2; }
     858                { $$ = new StatementNode( build_branch( assign_strptr($2), BranchStmt::Break ) ); }
    859859        | RETURN comma_expression_opt ';'
    860860                { $$ = new StatementNode( build_return( $2 ) ); }
     
    979979label_list:
    980980        no_attr_identifier
    981                 { $$ = new LabelNode(); $$->labels.push_back( *$1 ); }
     981                { $$ = new LabelNode(); $$->labels.push_back( assign_strptr($1) ); }
    982982        | label_list ',' no_attr_identifier
    983                 { $$ = $1; $1->labels.push_back( *$3 ); }
     983                { $$ = $1; $1->labels.push_back( assign_strptr($3) ); }
    984984        ;
    985985
     
    19931993                {
    19941994                        linkageStack.push( linkage );                           // handle nested extern "C"/"Cforall"
    1995                         linkage = LinkageSpec::fromString( *$2 );
     1995                        linkage = LinkageSpec::fromString( assign_strptr($2) );
    19961996                }
    19971997          '{' external_definition_list_opt '}'                          // C++-style linkage specifier
     
    21372137
    21382138any_word:                                                                                               // GCC
    2139         identifier_or_type_name {}
    2140         | storage_class {}
    2141         | basic_type_name {}
    2142         | type_qualifier {}
     2139        identifier_or_type_name { delete $1; }
     2140        | storage_class { delete $1; }
     2141        | basic_type_name { delete $1; }
     2142        | type_qualifier { delete $1; }
    21432143        ;
    21442144
Note: See TracChangeset for help on using the changeset viewer.