source: src/ResolvExpr/AlternativePrinter.cc @ 906e24d

aaron-thesisarm-ehcleanup-dtorsdeferred_resndemanglerjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerresolv-newwith_gc
Last change on this file since 906e24d was 906e24d, checked in by Rob Schluntz <rschlunt@…>, 5 years ago

replace results list on Expressions with a single Type field

  • Property mode set to 100644
File size: 1.4 KB
Line 
1//
2// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
3//
4// The contents of this file are covered under the licence agreement in the
5// file "LICENCE" distributed with Cforall.
6//
7// AlternativePrinter.cc --
8//
9// Author           : Richard C. Bilson
10// Created On       : Sun May 17 06:53:19 2015
11// Last Modified By : Peter A. Buhr
12// Last Modified On : Sun May 17 06:55:05 2015
13// Update Count     : 2
14//
15
16#include "AlternativePrinter.h"
17#include "AlternativeFinder.h"
18#include "Alternative.h"
19#include "SynTree/Statement.h"
20#include "SynTree/Type.h"
21#include "SynTree/Expression.h"
22#include "Common/utility.h"
23
24namespace ResolvExpr {
25        AlternativePrinter::AlternativePrinter( std::ostream &os ) : SymTab::Indexer( false ), os( os ) {}
26
27        void AlternativePrinter::visit( ExprStmt *exprStmt ) {
28                TypeEnvironment env;
29                AlternativeFinder finder( *this, env );
30                finder.findWithAdjustment( exprStmt->get_expr() );
31                int count = 1;
32                os << "There are " << finder.get_alternatives().size() << " alternatives" << std::endl;
33                for ( AltList::const_iterator i = finder.get_alternatives().begin(); i != finder.get_alternatives().end(); ++i ) {
34                        os << "Alternative " << count++ << " ==============" << std::endl;
35                        i->expr->get_result()->print( os );
36                        //    i->print( os );
37                        os << std::endl;
38                } // for
39        } // AlternativePrinter::visit
40} // namespace ResolvExpr
41
42// Local Variables: //
43// tab-width: 4 //
44// mode: c++ //
45// compile-command: "make install" //
46// End: //
Note: See TracBrowser for help on using the repository browser.