source: translator/ResolvExpr/AlternativePrinter.cc @ 0b8cd722

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsctordeferred_resndemanglerenumforall-pointer-decaygc_noraiijacob/cs343-translationjenkins-sandboxmemorynew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newstringwith_gc
Last change on this file since 0b8cd722 was d9a0e76, checked in by Peter A. Buhr <pabuhr@…>, 10 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
Line 
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
9namespace ResolvExpr {
10    AlternativePrinter::AlternativePrinter( std::ostream &os ) : SymTab::Indexer( false ), os( os ) {}
11
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
25} // namespace ResolvExpr
Note: See TracBrowser for help on using the repository browser.