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 c8ffe20b was 51b73452, checked in by Peter A. Buhr <pabuhr@…>, 11 years ago |
|
initial commit
|
-
Property mode
set to
100644
|
|
File size:
1.0 KB
|
| Line | |
|---|
| 1 | /*
|
|---|
| 2 | * This file is part of the Cforall project
|
|---|
| 3 | *
|
|---|
| 4 | * $Id: AlternativePrinter.cc,v 1.5 2005/08/29 20:14:15 rcbilson Exp $
|
|---|
| 5 | *
|
|---|
| 6 | */
|
|---|
| 7 |
|
|---|
| 8 | #include "AlternativePrinter.h"
|
|---|
| 9 | #include "AlternativeFinder.h"
|
|---|
| 10 | #include "Alternative.h"
|
|---|
| 11 | #include "SynTree/Statement.h"
|
|---|
| 12 | #include "SynTree/Type.h"
|
|---|
| 13 | #include "SynTree/Expression.h"
|
|---|
| 14 | #include "utility.h"
|
|---|
| 15 |
|
|---|
| 16 | namespace ResolvExpr {
|
|---|
| 17 |
|
|---|
| 18 | AlternativePrinter::AlternativePrinter( std::ostream &os )
|
|---|
| 19 | : SymTab::Indexer( false ), os( os )
|
|---|
| 20 | {
|
|---|
| 21 | }
|
|---|
| 22 |
|
|---|
| 23 | void
|
|---|
| 24 | AlternativePrinter::visit(ExprStmt *exprStmt)
|
|---|
| 25 | {
|
|---|
| 26 | TypeEnvironment env;
|
|---|
| 27 | AlternativeFinder finder( *this, env );
|
|---|
| 28 | finder.findWithAdjustment( exprStmt->get_expr() );
|
|---|
| 29 | int count = 1;
|
|---|
| 30 | os << "There are " << finder.get_alternatives().size() << " alternatives" << std::endl;
|
|---|
| 31 | for( AltList::const_iterator i = finder.get_alternatives().begin(); i != finder.get_alternatives().end(); ++i ) {
|
|---|
| 32 | os << "Alternative " << count++ << " ==============" << std::endl;
|
|---|
| 33 | printAll( i->expr->get_results(), os );
|
|---|
| 34 | // i->print( os );
|
|---|
| 35 | os << std::endl;
|
|---|
| 36 | }
|
|---|
| 37 | }
|
|---|
| 38 |
|
|---|
| 39 | } // namespace ResolvExpr
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.