Ignore:
Timestamp:
May 18, 2015, 11:20:23 AM (9 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
Children:
51587aa
Parents:
a32b204
Message:

licencing: third groups of files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • translator/SynTree/CodeGenVisitor.cc

    ra32b204 r0dd3a2f  
     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// CodeGenVisitor.cc --
     8//
     9// Author           : Richard C. Bilson
     10// Created On       : Mon May 18 07:44:20 2015
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Mon May 18 07:57:51 2015
     13// Update Count     : 3
     14//
     15
    116#include <iostream>
    217#include <list>
     
    722using namespace std;
    823
    9 //*** Types
    10 void CodeGenVisitor::visit(Type *type){ }
    11 void CodeGenVisitor::visit(BasicType *basicType) { }
     24void CodeGenVisitor::visit( Type *type ){ }
     25void CodeGenVisitor::visit( BasicType *basicType ) { }
    1226
    13 //*** Constant
    14 void CodeGenVisitor::visit(Constant *constant) {
    15     cout << constant->get_value() << endl;
     27void CodeGenVisitor::visit( Constant *constant ) {
     28        cout << constant->get_value() << endl;
    1629}
    1730
    18 //*** Expressions
    19 void CodeGenVisitor::visit(Expression *expr){ }
     31void CodeGenVisitor::visit( Expression *expr ){ }
    2032
    21 void CodeGenVisitor::visit(ConstantExpr *cnst){
    22     if (cnst != 0)
    23         visit(cnst->get_constant());
     33void CodeGenVisitor::visit( ConstantExpr *cnst ) {
     34        if ( cnst != 0 )
     35                visit(cnst->get_constant());
    2436}
    2537
    26 //*** Statements
    27 void CodeGenVisitor::visit(Statement *stmt){ }
     38void CodeGenVisitor::visit( Statement *stmt ) { }
    2839
    29 void CodeGenVisitor::visit(ExprStmt *exprStmt){
    30     if (exprStmt != 0)
    31         exprStmt->get_expr()->accept(*this);    // visit(exprStmt->get_expr()) doesn't work
     40void CodeGenVisitor::visit( ExprStmt *exprStmt ) {
     41        if ( exprStmt != 0 )
     42                exprStmt->get_expr()->accept( *this );                  // visit(exprStmt->get_expr()) doesn't work
    3243}
    3344
    34 void CodeGenVisitor::visit(SwitchStmt *switchStmt){
    35     cout << "switch (" << endl;     
    36     // visit(switchStmt->get_condition());   // why doesn't this work?
    37     switchStmt->get_condition()->accept(*this);
     45void CodeGenVisitor::visit( SwitchStmt *switchStmt ) {
     46        cout << "switch (" << endl;         
     47        // visit(switchStmt->get_condition());   // why doesn't this work?
     48        switchStmt->get_condition()->accept(*this);
    3849
    39     cout << ") {" << endl;     
    40     // visit(switchStmt->get_body());  // why doesn't this work?
    41     cout << "}" << endl;       
     50        cout << ") {" << endl; 
     51        // visit(switchStmt->get_body());  // why doesn't this work?
     52        cout << "}" << endl;   
    4253}
    4354
    44 
     55// Local Variables: //
     56// tab-width: 4 //
     57// mode: c++ //
     58// compile-command: "make install" //
     59// End: //
Note: See TracChangeset for help on using the changeset viewer.