Ignore:
Timestamp:
Feb 1, 2016, 2:24:50 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, 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:
2a4b088, b4cd03b7
Parents:
ae8b942
Message:

correctly set type for complex constants, consolidate function name tables, add offsetof, refactor printing complex constants to use basic types

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    rae8b942 r5721a6d  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Oct  8 17:17:54 2015
    13 // Update Count     : 1473
     12// Last Modified On : Mon Feb  1 13:51:20 2016
     13// Update Count     : 1481
    1414//
    1515
     
    7878%token ENUM STRUCT UNION
    7979%token TYPE FTYPE DTYPE CONTEXT                                                 // CFA
    80 %token SIZEOF
     80%token SIZEOF OFFSETOF
    8181%token ATTRIBUTE EXTENSION                                                              // GCC
    8282%token IF ELSE SWITCH CASE DEFAULT DO WHILE FOR BREAK CONTINUE GOTO RETURN
     
    443443        | SIZEOF '(' type_name_no_function ')'
    444444                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::SizeOf ), new TypeValueNode( $3 )); }
     445        | OFFSETOF '(' type_name_no_function ',' no_attr_identifier ')'
     446        { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::OffsetOf ), new TypeValueNode( $3 ), new VarRefNode( $5 )); }
    445447        | ATTR_IDENTIFIER
    446448                { $$ = new CompositeExprNode( new OperatorNode( OperatorNode::Attr ), new VarRefNode( $1 )); }
Note: See TracChangeset for help on using the changeset viewer.