1 2 3 package org.sablecc.sablecc.launcher.syntax3.analysis; 4 5 import java.util.*; 6 import org.sablecc.sablecc.launcher.syntax3.node.*; 7 8 public class ReversedDepthFirstAdapter extends AnalysisAdapter 9 { 10 public void inStart(Start node) 11 { 12 defaultIn(node); 13 } 14 15 public void outStart(Start node) 16 { 17 defaultOut(node); 18 } 19 20 public void defaultIn(@SuppressWarnings ("unused") Node node) 21 { 22 } 24 25 public void defaultOut(@SuppressWarnings ("unused") Node node) 26 { 27 } 29 30 @Override 31 public void caseStart(Start node) 32 { 33 inStart(node); 34 node.getEOF().apply(this); 35 node.getPArgument().apply(this); 36 outStart(node); 37 } 38 39 public void inAShortOptionsArgument(AShortOptionsArgument node) 40 { 41 defaultIn(node); 42 } 43 44 public void outAShortOptionsArgument(AShortOptionsArgument node) 45 { 46 defaultOut(node); 47 } 48 49 @Override 50 public void caseAShortOptionsArgument(AShortOptionsArgument node) 51 { 52 inAShortOptionsArgument(node); 53 { 54 List<PShortOption> copy = new ArrayList<PShortOption>(node.getShortOptions()); 55 Collections.reverse(copy); 56 for(PShortOption e : copy) 57 { 58 e.apply(this); 59 } 60 } 61 outAShortOptionsArgument(node); 62 } 63 64 public void inALongOptionArgument(ALongOptionArgument node) 65 { 66 defaultIn(node); 67 } 68 69 public void outALongOptionArgument(ALongOptionArgument node) 70 { 71 defaultOut(node); 72 } 73 74 @Override 75 public void caseALongOptionArgument(ALongOptionArgument node) 76 { 77 inALongOptionArgument(node); 78 if(node.getLongOption() != null) 79 { 80 node.getLongOption().apply(this); 81 } 82 outALongOptionArgument(node); 83 } 84 85 public void inAPlainArgument(APlainArgument node) 86 { 87 defaultIn(node); 88 } 89 90 public void outAPlainArgument(APlainArgument node) 91 { 92 defaultOut(node); 93 } 94 95 @Override 96 public void caseAPlainArgument(APlainArgument node) 97 { 98 inAPlainArgument(node); 99 if(node.getText() != null) 100 { 101 node.getText().apply(this); 102 } 103 outAPlainArgument(node); 104 } 105 106 public void inAShortOption(AShortOption node) 107 { 108 defaultIn(node); 109 } 110 111 public void outAShortOption(AShortOption node) 112 { 113 defaultOut(node); 114 } 115 116 @Override 117 public void caseAShortOption(AShortOption node) 118 { 119 inAShortOption(node); 120 if(node.getOperand() != null) 121 { 122 node.getOperand().apply(this); 123 } 124 if(node.getShortName() != null) 125 { 126 node.getShortName().apply(this); 127 } 128 outAShortOption(node); 129 } 130 131 public void inALongOption(ALongOption node) 132 { 133 defaultIn(node); 134 } 135 136 public void outALongOption(ALongOption node) 137 { 138 defaultOut(node); 139 } 140 141 @Override 142 public void caseALongOption(ALongOption node) 143 { 144 inALongOption(node); 145 if(node.getOperand() != null) 146 { 147 node.getOperand().apply(this); 148 } 149 if(node.getLongName() != null) 150 { 151 node.getLongName().apply(this); 152 } 153 outALongOption(node); 154 } 155 156 public void inAOperand(AOperand node) 157 { 158 defaultIn(node); 159 } 160 161 public void outAOperand(AOperand node) 162 { 163 defaultOut(node); 164 } 165 166 @Override 167 public void caseAOperand(AOperand node) 168 { 169 inAOperand(node); 170 if(node.getOperandText() != null) 171 { 172 node.getOperandText().apply(this); 173 } 174 outAOperand(node); 175 } 176 } 177 | Popular Tags |