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 48ca586 was
843054c2,
checked in by Peter A. Buhr <pabuhr@…>, 9 years ago
|
licencing: seventh groups of files
|
-
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 "utility.h" |
---|
23 | |
---|
24 | namespace 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 | printAll( i->expr->get_results(), 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.