Changeset 5809461 for src/Parser


Ignore:
Timestamp:
Sep 1, 2017, 6:59:48 PM (7 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
b0dfbc4
Parents:
bc3127d
Message:

Fix handling of GCC label address and computed goto

Location:
src/Parser
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/ExpressionNode.cc

    rbc3127d r5809461  
    230230        //      ret = new UntypedExpr( new NameExpr( units, ret ) );
    231231        // } // if
    232                
     232
    233233        delete &str;                                                                            // created by lex
    234234        return ret;
     
    282282} // build_varref
    283283
    284 
     284// TODO: get rid of this and OperKinds and reuse code from OperatorTable
    285285static const char * OperName[] = {                                              // must harmonize with OperKinds
    286286        // diadic
     
    290290        "?[?]", "...",
    291291        // monadic
    292         "+?", "-?", "AddressOf", "*?", "!?", "~?", "++?", "?++", "--?", "?--", "&&"
     292        "+?", "-?", "AddressOf", "*?", "!?", "~?", "++?", "?++", "--?", "?--",
    293293}; // OperName
    294294
  • src/Parser/ParseNode.h

    rbc3127d r5809461  
    154154        Index, Range,
    155155        // monadic
    156         UnPlus, UnMinus, AddressOf, PointTo, Neg, BitNeg, Incr, IncrPost, Decr, DecrPost, LabelAddress,
     156        UnPlus, UnMinus, AddressOf, PointTo, Neg, BitNeg, Incr, IncrPost, Decr, DecrPost,
    157157        Ctor, Dtor,
    158158}; // OperKinds
  • src/Parser/parser.yy

    rbc3127d r5809461  
    536536                                $$ = new ExpressionNode( build_unary_val( $1, $2 ) );
    537537                                break;
     538                          case OperKinds::And:
     539                                $$ = new ExpressionNode( new AddressExpr( build_addressOf( $2 ) ) );
     540                                break;
    538541                          default:
    539542                                assert( false );
     
    562565        | ATTR_IDENTIFIER '(' type ')'
    563566                { $$ = new ExpressionNode( build_attrtype( build_varref( $1 ), $3 ) ); }
    564 //      | ANDAND IDENTIFIER                                                                     // GCC, address of label
    565 //              { $$ = new ExpressionNode( new OperatorNode( OperKinds::LabelAddress ), new ExpressionNode( build_varref( $2 ) ); }
    566567        ;
    567568
Note: See TracChangeset for help on using the changeset viewer.