Changeset 2644


Ignore:
Timestamp:
Nov 18, 2012, 4:56:41 PM (6 years ago)
Author:
ksherdy
Message:

Updated compiler vistor/transformer naming convention. By convention, visitors do not modify the AST, whereas transformers modify the AST.

Location:
proto/pablo/src/compiler/visitors
Files:
7 moved

Legend:

Unmodified
Added
Removed
  • proto/pablo/src/compiler/visitors/AdvanceCombinerTransformer.java

    r2641 r2644  
    99import ast.*;
    1010
    11 public class AdvanceCombiner {
     11public class AdvanceCombinerTransformer {
    1212       
    1313    private ASTNode ASTTree;
    1414   
    15     public AdvanceCombiner(ASTNode astTree) {
     15    public AdvanceCombinerTransformer(ASTNode astTree) {
    1616        this.ASTTree = astTree;
    1717    }
  • proto/pablo/src/compiler/visitors/AdvanceNCounterVisitor.java

    r2632 r2644  
    55import ast.*;
    66
    7 public class AdvanceNCounter {
     7public class AdvanceNCounterVisitor {
    88        private ASTNode ASTree;
    99       
    10         public AdvanceNCounter(ASTNode ASTree) {
     10        public AdvanceNCounterVisitor(ASTNode ASTree) {
    1111                this.ASTree = ASTree;
    1212        }
  • proto/pablo/src/compiler/visitors/AugmentedAssignmentTransformer.java

    r2621 r2644  
    1111import tokens.*;
    1212
    13 public class AugmentedAssignment {
     13public class AugmentedAssignmentTransformer {
    1414
    1515        private static Map<Lextant, Lextant> augmentedAssignmentMap = new HashMap<Lextant, Lextant>();
     
    2424        private ASTNode ASTree;
    2525       
    26         public AugmentedAssignment(ASTNode ASTree) {
     26        public AugmentedAssignmentTransformer(ASTNode ASTree) {
    2727                this.ASTree = ASTree;
    2828        }
  • proto/pablo/src/compiler/visitors/Bitwise2IDISATransformer.java

    r2641 r2644  
    88import compiler.lang.idisa.*;
    99
    10 public class Bitwise2IDISA {
     10public class Bitwise2IDISATransformer {
    1111        private ASTNode ASTree;
    1212       
    13         public Bitwise2IDISA(ASTNode ASTree) {
     13        public Bitwise2IDISATransformer(ASTNode ASTree) {
    1414                this.ASTree = ASTree;
    1515        }
  • proto/pablo/src/compiler/visitors/CarryCounterVisitor.java

    r2633 r2644  
    55import compiler.lang.pablo.builtins.BuiltinsUtil;
    66
    7 public class CarryCounter {
     7public class CarryCounterVisitor {
    88       
    99    private ASTNode ASTree;
    1010   
    11     public CarryCounter(ASTNode ASTree) {
     11    public CarryCounterVisitor(ASTNode ASTree) {
    1212        this.ASTree = ASTree;
    1313    }
    1414   
    1515    public int count() {
    16         CarryCounterVisitor visitor = new CarryCounterVisitor();
     16        CarryCounter visitor = new CarryCounter();
    1717        this.ASTree.accept(visitor);
    18         return ((CarryCounterVisitor)visitor).carryCount();
     18        return ((CarryCounter)visitor).carryCount();
    1919    }   
    2020       
    21         private class CarryCounterVisitor extends VoidVisitor.Default {
     21        private class CarryCounter extends VoidVisitor.Default {
    2222                private int carryCount = 0;
    2323
  • proto/pablo/src/compiler/visitors/CarryQIntroTransformer.java

    r2641 r2644  
    1010import ast.*;
    1111
    12 public class CarryQIntro {
     12public class CarryQIntroTransformer {
    1313               
    1414        private ASTNode ASTTree; // FunctionDefNode     
    1515               
    16     public CarryQIntro(ASTNode node) {
     16    public CarryQIntroTransformer(ASTNode node) {
    1717        assert node instanceof FunctionDefNode;
    1818        this.ASTTree = node;
     
    6565                        //this.lastStmtCarries = 0;
    6666                       
    67                         int carryCount = (new CarryCounter(node)).count();
     67                        int carryCount = (new CarryCounterVisitor(node)).count();
    6868                        if(carryCount > 0) {
    6969                       
     
    9999
    100100                public void visitEnter(IfStatementNode node) { // Current if strategy does not test any_carry() on n bits
    101                         assert (new AdvanceNCounter(node).count() == 0): "Advance(x,n) within if: illegal\n";
     101                        assert (new AdvanceNCounterVisitor(node).count() == 0): "Advance(x,n) within if: illegal\n";
    102102                       
    103103                        int carryBase = this.currentCarry;
    104                         int carryCount = (new CarryCounter(node)).count();
     104                        int carryCount = (new CarryCounterVisitor(node)).count();
    105105                                               
    106106                        if((carryCount == 0) || (!this.ciMode)) {
  • proto/pablo/src/compiler/visitors/Pablo2CarryQTransformer.java

    r2641 r2644  
    1616import ast.*;
    1717
    18 public class Pablo2CarryQ {
     18public class Pablo2CarryQTransformer {
    1919               
    2020        private ASTNode ASTTree; // FunctionDefNode     
     
    2525        //    self.carryout = carryout   
    2626       
    27     public Pablo2CarryQ(ASTNode node) {
     27    public Pablo2CarryQTransformer(ASTNode node) {
    2828        assert node instanceof FunctionDefNode;
    2929        this.ASTTree = node;
Note: See TracChangeset for help on using the changeset viewer.