Changeset 6a276a0 for src/SynTree


Ignore:
Timestamp:
Mar 14, 2018, 1:19:39 PM (6 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, with_gc
Children:
720a007
Parents:
e2c70ab
Message:

Update parser for new fallthrough semantics

Location:
src/SynTree
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Statement.cc

    re2c70ab r6a276a0  
    3434Statement::Statement( const std::list<Label> & labels ) : labels( labels ) {}
    3535
    36 void Statement::print( std::ostream & os, Indenter ) const {
     36void Statement::print( std::ostream & os, Indenter indent ) const {
    3737        if ( ! labels.empty() ) {
    38                 os << "Labels: {";
     38                os << indent << "... Labels: {";
    3939                for ( const Label & l : labels ) {
    4040                        os << l << ",";
     
    223223
    224224void CaseStmt::print( std::ostream &os, Indenter indent ) const {
    225         if ( isDefault() ) os << "Default ";
     225        if ( isDefault() ) os << indent << "Default ";
    226226        else {
    227                 os << "Case ";
     227                os << indent << "Case ";
    228228                condition->print( os, indent );
    229229        } // if
     
    231231
    232232        for ( Statement * stmt : stmts ) {
     233                os << indent+1;
    233234                stmt->print( os, indent+1 );
    234235        }
     
    478479}
    479480
    480 void NullStmt::print( std::ostream &os, Indenter ) const {
     481void NullStmt::print( std::ostream &os, Indenter indent ) const {
    481482        os << "Null Statement" << endl;
     483        Statement::print( os, indent );
    482484}
    483485
  • src/SynTree/Statement.h

    re2c70ab r6a276a0  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Sep  3 20:46:46 2017
    13 // Update Count     : 77
     12// Last Modified On : Thu Mar  8 14:53:02 2018
     13// Update Count     : 78
    1414//
    1515
     
    255255class BranchStmt : public Statement {
    256256  public:
    257         enum Type { Goto = 0, Break, Continue };
     257        enum Type { Goto = 0, Break, Continue, FallThrough, FallThroughDefault };
    258258
    259259        // originalTarget kept for error messages.
Note: See TracChangeset for help on using the changeset viewer.