ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsdeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newwith_gc
Last change
on this file since 026bb82 was
906e24d,
checked in by Rob Schluntz <rschlunt@…>, 8 years ago
|
replace results list on Expressions with a single Type field
|
-
Property mode set to
100644
|
File size:
1.4 KB
|
Rev | Line | |
---|
[a32b204] | 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 | // |
---|
[906e24d] | 7 | // AlternativePrinter.cc -- |
---|
[a32b204] | 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 | |
---|
[51b7345] | 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" |
---|
[d3b7937] | 22 | #include "Common/utility.h" |
---|
[51b7345] | 23 | |
---|
| 24 | namespace ResolvExpr { |
---|
[a32b204] | 25 | AlternativePrinter::AlternativePrinter( std::ostream &os ) : SymTab::Indexer( false ), os( os ) {} |
---|
[51b7345] | 26 | |
---|
[a32b204] | 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; |
---|
[906e24d] | 35 | i->expr->get_result()->print( os ); |
---|
[a32b204] | 36 | // i->print( os ); |
---|
| 37 | os << std::endl; |
---|
| 38 | } // for |
---|
| 39 | } // AlternativePrinter::visit |
---|
[51b7345] | 40 | } // namespace ResolvExpr |
---|
[a32b204] | 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.