source: src/ResolvExpr/Candidate.cpp @ 9019b14

ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationnew-astnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since 9019b14 was 99d4584, checked in by Aaron Moss <a3moss@…>, 5 years ago

Further stubs for resolver port

  • also switched order of constructor params on Indenter
  • Property mode set to 100644
File size: 1.3 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// Candidate.cpp --
8//
9// Author           : Aaron B. Moss
10// Created On       : Wed Jun 5 14:30:00 2019
11// Last Modified By : Aaron B. Moss
12// Last Modified On : Wed Jun 5 14:30:00 2019
13// Update Count     : 1
14//
15
16#include "Candidate.hpp"
17
18#include <iostream>
19
20#include "AST/Print.hpp"
21
22namespace ResolvExpr {
23
24void print( std::ostream & os, const Candidate & cand, Indenter indent ) {
25        os << "Cost " << cand.cost << ": ";
26        if ( cand.expr ) {
27                ++indent;
28                ast::print( os, cand.expr, indent );
29                os << std::endl << indent-1 << "(types:" << std::endl;
30                os << indent;
31                ast::print( os, cand.expr->result, indent );
32                --indent;
33                os << std::endl << indent << ")" << std::endl;
34        } else {
35                os << "Null expression!" << std::endl;
36        } // if
37        os << indent << "Environment:";
38        ast::print( os, cand.env, indent+1 );
39        os << std::endl;
40}
41
42void print( std::ostream & os, const CandidateList & cands, Indenter indent ) {
43        for ( const CandidateRef & cand : cands ) {
44                print( os, *cand, indent );
45                os << std::endl;
46        }
47}
48
49} // namespace ResolvExpr
50
51// Local Variables: //
52// tab-width: 4 //
53// mode: c++ //
54// compile-command: "make install" //
55// End: //
Note: See TracBrowser for help on using the repository browser.