Changeset e04ef3a


Ignore:
Timestamp:
Jun 14, 2016, 12:53:03 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, with_gc
Children:
c8c03683
Parents:
55ba7339
Message:

add gcc extension, first attempt, not done yet

Location:
src
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.cc

    r55ba7339 re04ef3a  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Fri May 06 16:01:00 2016
    13 // Update Count     : 255
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Thu Jun  9 13:21:00 2016
     13// Update Count     : 256
    1414//
    1515
     
    250250        //*** Expressions
    251251        void CodeGenerator::visit( ApplicationExpr *applicationExpr ) {
     252                extension( applicationExpr );
    252253                if ( VariableExpr *varExpr = dynamic_cast< VariableExpr* >( applicationExpr->get_function() ) ) {
    253254                        OperatorInfo opInfo;
     
    361362
    362363        void CodeGenerator::visit( UntypedExpr *untypedExpr ) {
     364                extension( untypedExpr );
    363365                if ( NameExpr *nameExpr = dynamic_cast< NameExpr* >( untypedExpr->get_function() ) ) {
    364366                        OperatorInfo opInfo;
     
    445447
    446448        void CodeGenerator::visit( NameExpr *nameExpr ) {
     449                extension( nameExpr );
    447450                OperatorInfo opInfo;
    448451                if ( operatorLookup( nameExpr->get_name(), opInfo ) ) {
     
    455458
    456459        void CodeGenerator::visit( AddressExpr *addressExpr ) {
     460                extension( addressExpr );
    457461                output << "(&";
    458462                // this hack makes sure that we don't convert "constant_zero" to "0" if we're taking its address
     
    466470
    467471        void CodeGenerator::visit( CastExpr *castExpr ) {
     472                extension( castExpr );
    468473                output << "(";
    469474                if ( castExpr->get_results().empty() ) {
     
    488493
    489494        void CodeGenerator::visit( MemberExpr *memberExpr ) {
     495                extension( memberExpr );
    490496                memberExpr->get_aggregate()->accept( *this );
    491497                output << "." << mangleName( memberExpr->get_member() );
     
    493499
    494500        void CodeGenerator::visit( VariableExpr *variableExpr ) {
     501                extension( variableExpr );
    495502                OperatorInfo opInfo;
    496503                if ( variableExpr->get_var()->get_linkage() == LinkageSpec::Intrinsic && operatorLookup( variableExpr->get_var()->get_name(), opInfo ) && opInfo.type == OT_CONSTANT ) {
     
    503510        void CodeGenerator::visit( ConstantExpr *constantExpr ) {
    504511                assert( constantExpr->get_constant() );
     512                extension( constantExpr );
    505513                constantExpr->get_constant()->accept( *this );
    506514        }
    507515
    508516        void CodeGenerator::visit( SizeofExpr *sizeofExpr ) {
     517                extension( sizeofExpr );
    509518                output << "sizeof(";
    510519                if ( sizeofExpr->get_isType() ) {
     
    517526
    518527        void CodeGenerator::visit( AlignofExpr *alignofExpr ) {
     528                extension( alignofExpr );
    519529                // use GCC extension to avoid bumping std to C11
    520530                output << "__alignof__(";
     
    532542
    533543        void CodeGenerator::visit( OffsetofExpr *offsetofExpr ) {
     544                extension( offsetofExpr );
    534545                // use GCC builtin
    535546                output << "__builtin_offsetof(";
     
    544555
    545556        void CodeGenerator::visit( LogicalExpr *logicalExpr ) {
     557                extension( logicalExpr );
    546558                output << "(";
    547559                logicalExpr->get_arg1()->accept( *this );
     
    556568
    557569        void CodeGenerator::visit( ConditionalExpr *conditionalExpr ) {
     570                extension( conditionalExpr );
    558571                output << "(";
    559572                conditionalExpr->get_arg1()->accept( *this );
     
    566579
    567580        void CodeGenerator::visit( CommaExpr *commaExpr ) {
     581                extension( commaExpr );
    568582                output << "(";
    569583                commaExpr->get_arg1()->accept( *this );
     
    578592
    579593        void CodeGenerator::visit( AsmExpr *asmExpr ) {
     594                extension( asmExpr );
    580595                if ( asmExpr->get_inout() ) {
    581596                        output << "[ ";
  • src/CodeGen/CodeGenerator.h

    r55ba7339 re04ef3a  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Mar  2 17:32:24 2016
    13 // Update Count     : 28
     12// Last Modified On : Thu Jun  9 13:15:58 2016
     13// Update Count     : 29
    1414//
    1515
     
    9494                        std::ostream& operator()(std::ostream & os);
    9595                };
     96
     97                void extension( Expression *expr ) {
     98                        if ( expr->get_extension() ) {
     99                                output << "__extension__ ";
     100                        } // if
     101                } // extension
    96102          private:
    97103
  • src/Common/utility.h

    r55ba7339 re04ef3a  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Thu Apr 28 13:18:24 2016
    13 // Update Count     : 16
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Wed Jun  8 17:33:59 2016
     13// Update Count     : 22
    1414//
    1515
     
    3333}
    3434
     35template<typename T, typename U>
     36struct maybeBuild_t {
     37        static T * doit( const U *orig ) {
     38                if ( orig ) {
     39                        return orig->build();
     40                } else {
     41                        return 0;
     42                } // if
     43        }
     44};
     45
    3546template< typename T, typename U >
    3647static inline T * maybeBuild( const U *orig ) {
    37         if ( orig ) {
    38                 return orig->build();
    39         } else {
    40                 return 0;
    41         } // if
     48        return maybeBuild_t<T,U>::doit(orig);
    4249}
    4350
  • src/Parser/ExpressionNode.cc

    r55ba7339 re04ef3a  
    1010// Created On       : Sat May 16 13:17:07 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Apr  8 15:43:05 2016
    13 // Update Count     : 296
     12// Last Modified On : Mon Jun 13 14:46:17 2016
     13// Update Count     : 307
    1414//
    1515
     
    3232using namespace std;
    3333
    34 ExpressionNode::ExpressionNode() : ParseNode(), argName( 0 ) {}
    35 
    36 ExpressionNode::ExpressionNode( const string *name ) : ParseNode( name ), argName( 0 ) {}
    37 
    38 ExpressionNode::ExpressionNode( const ExpressionNode &other ) : ParseNode( other.name ) {
     34ExpressionNode::ExpressionNode() : ParseNode() {}
     35
     36ExpressionNode::ExpressionNode( const string *name ) : ParseNode( name ) {}
     37
     38ExpressionNode::ExpressionNode( const ExpressionNode &other ) : ParseNode( other.name ), extension( other.extension ) {
    3939        if ( other.argName ) {
    4040                argName = other.argName->clone();
     
    344344
    345345Expression *DesignatorNode::build() const {
    346         Expression * ret = get_argName()->build();
     346        Expression * ret = maybeBuild<Expression>(get_argName());
    347347
    348348        if ( isArrayIndex ) {
     
    389389        "Cond", "NCond",
    390390        // diadic
    391         "SizeOf", "AlignOf", "OffsetOf", "Attr", "CompLit", "?+?", "?-?", "?*?", "?/?", "?%?", "||", "&&",
     391        "SizeOf", "AlignOf", "OffsetOf", "Attr", "?+?", "?-?", "?*?", "?/?", "?%?", "||", "&&",
    392392        "?|?", "?&?", "?^?", "Cast", "?<<?", "?>>?", "?<?", "?>?", "?<=?", "?>=?", "?==?", "?!=?",
    393393        "?=?", "?*=?", "?/=?", "?%=?", "?+=?", "?-=?", "?<<=?", "?>>=?", "?&=?", "?^=?", "?|=?",
     
    466466
    467467        if ( ! ( op = dynamic_cast<OperatorNode *>( function ) ) ) { // function as opposed to operator
    468                 return new UntypedExpr( function->build(), args, maybeBuild< Expression >( get_argName() ));
     468                return new UntypedExpr( maybeBuild<Expression>(function), args, maybeBuild< Expression >( get_argName() ));
    469469        } // if
    470470
     
    550550                        if ( dynamic_cast< VoidType* >( targetType ) ) {
    551551                                delete targetType;
    552                                 return new CastExpr( expr_node->build(), maybeBuild< Expression >( get_argName() ) );
     552                                return new CastExpr( maybeBuild<Expression>(expr_node), maybeBuild< Expression >( get_argName() ) );
    553553                        } else {
    554                                 return new CastExpr( expr_node->build(),targetType, maybeBuild< Expression >( get_argName() ) );
     554                                return new CastExpr( maybeBuild<Expression>(expr_node),targetType, maybeBuild< Expression >( get_argName() ) );
    555555                        } // if
    556556                }
     
    621621                        assert( var );
    622622                        if ( ! get_args()->get_link() ) {
    623                                 return new AttrExpr( var->build(), ( Expression*)0);
     623                                return new AttrExpr( maybeBuild<Expression>(var), ( Expression*)0);
    624624                        } else if ( TypeValueNode * arg = dynamic_cast<TypeValueNode *>( get_args()->get_link()) ) {
    625                                 return new AttrExpr( var->build(), arg->get_decl()->buildType());
     625                                return new AttrExpr( maybeBuild<Expression>(var), arg->get_decl()->buildType());
    626626                        } else {
    627                                 return new AttrExpr( var->build(), args.back());
    628                         } // if
    629                 }
    630           case OperatorNode::CompLit:
    631                 throw UnimplementedError( "C99 compound literals" );
    632                 // the short-circuited operators
     627                                return new AttrExpr( maybeBuild<Expression>(var), args.back());
     628                        } // if
     629                }
    633630          case OperatorNode::Or:
    634631          case OperatorNode::And:
     
    719716
    720717Expression *AsmExprNode::build() const {
    721         return new AsmExpr( maybeBuild< Expression >( inout ), (ConstantExpr *)constraint->build(), operand->build() );
     718        return new AsmExpr( maybeBuild< Expression >( inout ), (ConstantExpr *)maybeBuild<Expression>(constraint), maybeBuild<Expression>(operand) );
    722719}
    723720
     
    796793
    797794Expression *ValofExprNode::build() const {
    798         return new UntypedValofExpr ( get_body()->build(), maybeBuild< Expression >( get_argName() ) );
     795        return new UntypedValofExpr ( maybeBuild<Statement>(get_body()), maybeBuild< Expression >( get_argName() ) );
    799796}
    800797
     
    908905
    909906Expression *CompoundLiteralNode::build() const {
    910         Declaration * newDecl = type->build();                          // compound literal type
     907        Declaration * newDecl = maybeBuild<Declaration>(type); // compound literal type
    911908        if ( DeclarationWithType * newDeclWithType = dynamic_cast< DeclarationWithType * >( newDecl ) ) { // non-sue compound-literal type
    912                 return new CompoundLiteralExpr( newDeclWithType->get_type(), kids->build() );
     909                return new CompoundLiteralExpr( newDeclWithType->get_type(), maybeBuild<Initializer>(kids) );
    913910        // these types do not have associated type information
    914911        } else if ( StructDecl * newDeclStructDecl = dynamic_cast< StructDecl * >( newDecl )  ) {
    915                 return new CompoundLiteralExpr( new StructInstType( Type::Qualifiers(), newDeclStructDecl->get_name() ), kids->build() );
     912                return new CompoundLiteralExpr( new StructInstType( Type::Qualifiers(), newDeclStructDecl->get_name() ), maybeBuild<Initializer>(kids) );
    916913        } else if ( UnionDecl * newDeclUnionDecl = dynamic_cast< UnionDecl * >( newDecl )  ) {
    917                 return new CompoundLiteralExpr( new UnionInstType( Type::Qualifiers(), newDeclUnionDecl->get_name() ), kids->build() );
     914                return new CompoundLiteralExpr( new UnionInstType( Type::Qualifiers(), newDeclUnionDecl->get_name() ), maybeBuild<Initializer>(kids) );
    918915        } else if ( EnumDecl * newDeclEnumDecl = dynamic_cast< EnumDecl * >( newDecl )  ) {
    919                 return new CompoundLiteralExpr( new EnumInstType( Type::Qualifiers(), newDeclEnumDecl->get_name() ), kids->build() );
     916                return new CompoundLiteralExpr( new EnumInstType( Type::Qualifiers(), newDeclEnumDecl->get_name() ), maybeBuild<Initializer>(kids) );
    920917        } else {
    921918                assert( false );
  • src/Parser/ParseNode.h

    r55ba7339 re04ef3a  
    99// Author           : Rodolfo G. Esteves
    1010// Created On       : Sat May 16 13:28:16 2015
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Thu Apr 14 15:37:52 2016
    13 // Update Count     : 205
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Mon Jun 13 16:04:47 2016
     13// Update Count     : 240
    1414//
    1515
     
    2020#include <list>
    2121#include <iterator>
     22#include <memory>
    2223
    2324#include "Common/utility.h"
    2425#include "Parser/LinkageSpec.h"
    2526#include "SynTree/Type.h"
     27#include "SynTree/Expression.h"
    2628//#include "SynTree/Declaration.h"
    2729#include "Common/UniqueName.h"
     
    7981        ExpressionNode *set_argName( const std::string *aName );
    8082        ExpressionNode *set_argName( ExpressionNode *aDesignator );
     83        bool get_extension() const { return extension; }
     84        ExpressionNode *set_extension( bool exten ) { extension = exten; return this; }
    8185
    8286        virtual void print( std::ostream &, int indent = 0) const = 0;
     
    8791        void printDesignation ( std::ostream &, int indent = 0) const;
    8892  private:
    89         ExpressionNode *argName;
     93        ExpressionNode *argName = 0;
     94        bool extension = false;
     95};
     96
     97template< typename T >
     98struct maybeBuild_t<Expression, T> {
     99        static inline Expression * doit( const T *orig ) {
     100                if ( orig ) {
     101                        Expression *p = orig->build();
     102                        p->set_extension( orig->get_extension() );
     103                        return p;
     104                } else {
     105                        return 0;
     106                } // if
     107        }
    90108};
    91109
     
    179197                                Cond, NCond,
    180198                                // diadic
    181                                 SizeOf, AlignOf, OffsetOf, Attr, CompLit, Plus, Minus, Mul, Div, Mod, Or, And,
     199                                SizeOf, AlignOf, OffsetOf, Attr, Plus, Minus, Mul, Div, Mod, Or, And,
    182200                                BitOr, BitAnd, Xor, Cast, LShift, RShift, LThan, GThan, LEThan, GEThan, Eq, Neq,
    183201                                Assign, MulAssn, DivAssn, ModAssn, PlusAssn, MinusAssn, LSAssn, RSAssn, AndAssn, ERAssn, OrAssn,
     
    574592        while ( cur ) {
    575593                try {
    576                         SynTreeType *result = dynamic_cast< SynTreeType *>( cur->build() );
     594//                      SynTreeType *result = dynamic_cast< SynTreeType *>( maybeBuild<typename std::result_of<decltype(&NodeType::build)(NodeType)>::type>( cur ) );
     595                        SynTreeType *result = dynamic_cast< SynTreeType *>( maybeBuild<typename std::pointer_traits<decltype(cur->build())>::element_type>( cur ) );
    577596                        if ( result ) {
    578597                                *out++ = result;
  • src/Parser/StatementNode.cc

    r55ba7339 re04ef3a  
    1010// Created On       : Sat May 16 14:59:41 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jul 30 14:39:39 2015
    13 // Update Count     : 130
     12// Last Modified On : Thu Jun  9 14:18:46 2016
     13// Update Count     : 132
    1414//
    1515
     
    222222                                branches.pop_front();
    223223                        } // if
    224                         return new IfStmt( labs, notZeroExpr( get_control()->build() ), thenb, elseb );
     224                        return new IfStmt( labs, notZeroExpr( maybeBuild<Expression>(get_control()) ), thenb, elseb );
    225225                }
    226226          case While:
    227227                assert( branches.size() == 1 );
    228                 return new WhileStmt( labs, notZeroExpr( get_control()->build() ), branches.front() );
     228                return new WhileStmt( labs, notZeroExpr( maybeBuild<Expression>(get_control()) ), branches.front() );
    229229          case Do:
    230230                assert( branches.size() == 1 );
    231                 return new WhileStmt( labs, notZeroExpr( get_control()->build() ), branches.front(), true );
     231                return new WhileStmt( labs, notZeroExpr( maybeBuild<Expression>(get_control()) ), branches.front(), true );
    232232          case For:
    233233                {
     
    244244                        Expression *cond = 0;
    245245                        if ( ctl->get_condition() != 0 )
    246                                 cond = notZeroExpr( ctl->get_condition()->build() );
     246                                cond = notZeroExpr( maybeBuild<Expression>(ctl->get_condition()) );
    247247
    248248                        Expression *incr = 0;
    249249                        if ( ctl->get_change() != 0 )
    250                                 incr = ctl->get_change()->build();
     250                                incr = maybeBuild<Expression>(ctl->get_change());
    251251
    252252                        return new ForStmt( labs, init, cond, incr, branches.front() );
    253253                }
    254254          case Switch:
    255                 return new SwitchStmt( labs, get_control()->build(), branches );
     255                return new SwitchStmt( labs, maybeBuild<Expression>(get_control()), branches );
    256256          case Choose:
    257                 return new ChooseStmt( labs, get_control()->build(), branches );
     257                return new ChooseStmt( labs, maybeBuild<Expression>(get_control()), branches );
    258258          case Fallthru:
    259259                return new FallthruStmt( labs );
    260260          case Case:
    261                 return new CaseStmt( labs, get_control()->build(), branches );
     261                return new CaseStmt( labs, maybeBuild<Expression>(get_control()), branches );
    262262          case Default:
    263263                return new CaseStmt( labs, 0, branches, true );
     
    266266                        if ( get_target() == "" ) {                                     // computed goto
    267267                                assert( get_control() != 0 );
    268                                 return new BranchStmt( labs, get_control()->build(), BranchStmt::Goto );
     268                                return new BranchStmt( labs, maybeBuild<Expression>(get_control()), BranchStmt::Goto );
    269269                        } // if
    270270
  • src/Parser/parser.cc

    r55ba7339 re04ef3a  
    52995299/* Line 1806 of yacc.c  */
    53005300#line 432 "parser.yy"
    5301     { (yyval.en) = (yyvsp[(2) - (2)].en); }
     5301    { (yyval.en) = (yyvsp[(2) - (2)].en)->set_extension( true ); }
    53025302    break;
    53035303
     
    58095809/* Line 1806 of yacc.c  */
    58105810#line 685 "parser.yy"
    5811     { (yyval.sn) = new StatementNode( (yyvsp[(2) - (2)].decl) ); }
     5811    { (yyval.sn) = new StatementNode( (yyvsp[(2) - (2)].decl) )/*->set_extension( true )*/; }
    58125812    break;
    58135813
     
    71227122/* Line 1806 of yacc.c  */
    71237123#line 1475 "parser.yy"
    7124     { (yyval.decl) = (yyvsp[(2) - (3)].decl); }
     7124    { (yyval.decl) = (yyvsp[(2) - (3)].decl)/*->set_extension( true )*/; }
    71257125    break;
    71267126
     
    71297129/* Line 1806 of yacc.c  */
    71307130#line 1478 "parser.yy"
    7131     { (yyval.decl) = (yyvsp[(2) - (3)].decl); }
     7131    { (yyval.decl) = (yyvsp[(2) - (3)].decl)/*->set_extension( true )*/; }
    71327132    break;
    71337133
     
    79137913/* Line 1806 of yacc.c  */
    79147914#line 1994 "parser.yy"
    7915     { (yyval.decl) = (yyvsp[(2) - (2)].decl); }
     7915    { (yyval.decl) = (yyvsp[(2) - (2)].decl)/*->set_extension( true )*/; }
    79167916    break;
    79177917
  • src/Parser/parser.yy

    r55ba7339 re04ef3a  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Jun  7 08:08:31 2016
    13 // Update Count     : 1560
     12// Last Modified On : Mon Jun 13 15:00:23 2016
     13// Update Count     : 1578
    1414//
    1515
     
    430430                { $$ = $1; }
    431431        | EXTENSION cast_expression                                                     // GCC
    432                 { $$ = $2; }
     432                { $$ = $2->set_extension( true ); }
    433433        | ptrref_operator cast_expression                                       // CFA
    434434                { $$ = new CompositeExprNode( $1, $2 ); }
     
    683683                { $$ = new StatementNode( $1 ); }
    684684        | EXTENSION declaration                                                         // GCC
    685                 { $$ = new StatementNode( $2 ); }
     685                { $$ = new StatementNode( $2 )/*->set_extension( true )*/; }
    686686        | function_definition
    687687                { $$ = new StatementNode( $1 ); }
     
    14731473        new_field_declaring_list ';'                                            // CFA, new style field declaration
    14741474        | EXTENSION new_field_declaring_list ';'                        // GCC
    1475                 { $$ = $2; }
     1475                { $$ = $2/*->set_extension( true )*/; }
    14761476        | field_declaring_list ';'
    14771477        | EXTENSION field_declaring_list ';'                            // GCC
    1478                 { $$ = $2; }
     1478                { $$ = $2/*->set_extension( true )*/; }
    14791479        ;
    14801480
     
    19921992                }
    19931993        | EXTENSION external_definition
    1994                 { $$ = $2; }
     1994                { $$ = $2/*->set_extension( true )*/; }
    19951995        ;
    19961996
  • src/ResolvExpr/AlternativeFinder.cc

    r55ba7339 re04ef3a  
    99// Author           : Richard C. Bilson
    1010// Created On       : Sat May 16 23:52:08 2015
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Wed Apr 20 14:24:03 2016
    13 // Update Count     : 24
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Mon Jun 13 16:13:54 2016
     13// Update Count     : 25
    1414//
    1515
     
    757757                for ( std::list< DeclarationWithType* >::iterator i = declList.begin(); i != declList.end(); ++i ) {
    758758                        VariableExpr newExpr( *i, nameExpr->get_argName() );
     759                        newExpr.set_extension( nameExpr->get_extension() );
    759760                        alternatives.push_back( Alternative( newExpr.clone(), env, Cost() ) );
    760761                        PRINT(
  • src/SynTree/Expression.cc

    r55ba7339 re04ef3a  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Fri May 13 13:23:11 2016
    13 // Update Count     : 40
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Mon Jun 13 16:03:39 2016
     13// Update Count     : 42
    1414//
    1515
     
    3232Expression::Expression( Expression *_aname ) : env( 0 ), argName( _aname ) {}
    3333
    34 Expression::Expression( const Expression &other ) : env( maybeClone( other.env ) ), argName( maybeClone( other.get_argName() ) ) {
     34Expression::Expression( const Expression &other ) : env( maybeClone( other.env ) ), argName( maybeClone( other.get_argName() ) ), extension( other.extension ) {
    3535        cloneAll( other.results, results );
    3636}
     
    5959                os << std::string( indent, ' ' ) << "with designator:";
    6060                argName->print( os, indent+2 );
     61        } // if
     62
     63        if ( extension ) {
     64                os << std::string( indent, ' ' ) << "with extension:";
    6165        } // if
    6266}
  • src/SynTree/Expression.h

    r55ba7339 re04ef3a  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Wed Apr 27 17:06:49 2016
    13 // Update Count     : 21
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Wed Jun  8 17:05:30 2016
     13// Update Count     : 22
    1414//
    1515
     
    3838        Expression *get_argName() const { return argName; }
    3939        void set_argName( Expression *name ) { argName = name; }
     40        bool get_extension() const { return extension; }
     41        void set_extension( bool exten ) { extension = exten; }
    4042
    4143        virtual Expression *clone() const = 0;
     
    4749        TypeSubstitution *env;
    4850        Expression* argName; // if expression is used as an argument, it can be "designated" by this name
     51        bool extension = false;
    4952};
    5053
Note: See TracChangeset for help on using the changeset viewer.