Ignore:
Timestamp:
Jul 3, 2015, 6:08:20 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:
f6d7e0f
Parents:
0df292b
Message:

include file with keywords, fix type of label address expressions, fix computed goto to any expressions, generic types first attempt

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Statement.cc

    r0df292b r2871210  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Jun 23 11:42:09 2015
    13 // Update Count     : 21
     12// Last Modified On : Mon Jun 29 17:37:10 2015
     13// Update Count     : 22
    1414//
    1515
     
    2828using std::endl;
    2929
    30 Statement::Statement( std::list<Label> _labels ) : labels(_labels ) {}
     30Statement::Statement( std::list<Label> _labels ) : labels( _labels ) {}
    3131
    3232void Statement::print( std::ostream &, int indent ) const {}
     
    3434Statement::~Statement() {}
    3535
    36 ExprStmt::ExprStmt( std::list<Label> _labels, Expression *_expr ) : Statement(_labels ), expr(_expr ) {}
     36ExprStmt::ExprStmt( std::list<Label> _labels, Expression *_expr ) : Statement( _labels ), expr( _expr ) {}
    3737
    3838ExprStmt::~ExprStmt() {}
     
    4646
    4747BranchStmt::BranchStmt( std::list<Label> labels, Label _target, Type _type ) throw ( SemanticError ) :
    48         Statement( labels ), originalTarget(_target ), target(_target ), type(_type ) {
     48        Statement( labels ), originalTarget( _target ), target( _target ), computedTarget( NULL ), type( _type ) {
    4949        //actually this is a syntactic error signaled by the parser
    5050        if ( type == BranchStmt::Goto && target.size() == 0 )
     
    5353
    5454BranchStmt::BranchStmt( std::list<Label> labels, Expression *_computedTarget, Type _type ) throw ( SemanticError ) :
    55         Statement( labels ), computedTarget(_computedTarget ), type(_type ) {
     55        Statement( labels ), computedTarget( _computedTarget ), type( _type ) {
    5656        if ( type != BranchStmt::Goto || computedTarget == 0 )
    5757                throw SemanticError("Computed target not valid in branch statement");
     
    7575
    7676IfStmt::IfStmt( std::list<Label> _labels, Expression *_condition, Statement *_thenPart, Statement *_elsePart ):
    77         Statement(_labels ), condition(_condition ), thenPart(_thenPart ), elsePart(_elsePart ) {}
     77        Statement( _labels ), condition( _condition ), thenPart( _thenPart ), elsePart( _elsePart ) {}
    7878
    7979IfStmt::~IfStmt() {}
     
    9393
    9494SwitchStmt::SwitchStmt( std::list<Label> _labels, Expression * _condition, std::list<Statement *> &_branches ):
    95         Statement(_labels ), condition(_condition ), branches(_branches ) {
     95        Statement( _labels ), condition( _condition ), branches( _branches ) {
    9696}
    9797
     
    117117
    118118CaseStmt::CaseStmt( std::list<Label> _labels, Expression *_condition, std::list<Statement *> &_statements, bool deflt ) throw ( SemanticError ) :
    119         Statement(_labels ), condition(_condition ), stmts(_statements ), _isDefault( deflt ) {
     119        Statement( _labels ), condition( _condition ), stmts( _statements ), _isDefault( deflt ) {
    120120        if ( isDefault() && condition != 0 )
    121121                throw SemanticError("default with conditions");
     
    149149//ChooseStmt::ChooseStmt( std::list<Label> labels, Expression *condition, Statement *body ) {}
    150150ChooseStmt::ChooseStmt( std::list<Label> _labels, Expression * _condition, std::list<Statement *> &_branches ):
    151         Statement(_labels ), condition(_condition ), branches(_branches ) {
     151        Statement( _labels ), condition( _condition ), branches( _branches ) {
    152152}
    153153
Note: See TracChangeset for help on using the changeset viewer.