ADT
        aaron-thesis
        arm-eh
        ast-experimental
        cleanup-dtors
        ctor
        deferred_resn
        demangler
        enum
        forall-pointer-decay
        gc_noraii
        jacob/cs343-translation
        jenkins-sandbox
        memory
        new-ast
        new-ast-unique-expr
        new-env
        no_list
        persistent-indexer
        pthread-emulation
        qualifiedEnum
        resolv-new
        string
        with_gc
      
      
        
          | Last change
 on this file since fe3b61b was             d9a0e76, checked in by Peter A. Buhr <pabuhr@…>, 11 years ago | 
        
          | 
remove Parser.old, add -XCFA to driver, copy ptrdiff_t from stddef.h in preclude, remove casts from initialization constants, adjust formatting
 | 
        
          | 
              
Property                 mode
 set to                 100644 | 
        
          | File size:
            958 bytes | 
      
      
| Rev | Line |  | 
|---|
| [51b73452] | 1 | #include "AlternativePrinter.h" | 
|---|
|  | 2 | #include "AlternativeFinder.h" | 
|---|
|  | 3 | #include "Alternative.h" | 
|---|
|  | 4 | #include "SynTree/Statement.h" | 
|---|
|  | 5 | #include "SynTree/Type.h" | 
|---|
|  | 6 | #include "SynTree/Expression.h" | 
|---|
|  | 7 | #include "utility.h" | 
|---|
|  | 8 |  | 
|---|
|  | 9 | namespace ResolvExpr { | 
|---|
| [d9a0e76] | 10 | AlternativePrinter::AlternativePrinter( std::ostream &os ) : SymTab::Indexer( false ), os( os ) {} | 
|---|
| [51b73452] | 11 |  | 
|---|
| [d9a0e76] | 12 | void AlternativePrinter::visit( ExprStmt *exprStmt ) { | 
|---|
|  | 13 | TypeEnvironment env; | 
|---|
|  | 14 | AlternativeFinder finder( *this, env ); | 
|---|
|  | 15 | finder.findWithAdjustment( exprStmt->get_expr() ); | 
|---|
|  | 16 | int count = 1; | 
|---|
|  | 17 | os << "There are " << finder.get_alternatives().size() << " alternatives" << std::endl; | 
|---|
|  | 18 | for ( AltList::const_iterator i = finder.get_alternatives().begin(); i != finder.get_alternatives().end(); ++i ) { | 
|---|
|  | 19 | os << "Alternative " << count++ << " ==============" << std::endl; | 
|---|
|  | 20 | printAll( i->expr->get_results(), os ); | 
|---|
|  | 21 | //    i->print( os ); | 
|---|
|  | 22 | os << std::endl; | 
|---|
|  | 23 | } // for | 
|---|
|  | 24 | } // AlternativePrinter::visit | 
|---|
| [51b73452] | 25 | } // namespace ResolvExpr | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.