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 DepthFirstAdapter 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.getPArgument().apply(this); 35 node.getEOF().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 for(PShortOption e : copy) 56 { 57 e.apply(this); 58 } 59 } 60 outAShortOptionsArgument(node); 61 } 62 63 public void inALongOptionArgument(ALongOptionArgument node) 64 { 65 defaultIn(node); 66 } 67 68 public void outALongOptionArgument(ALongOptionArgument node) 69 { 70 defaultOut(node); 71 } 72 73 @Override 74 public void caseALongOptionArgument(ALongOptionArgument node) 75 { 76 inALongOptionArgument(node); 77 if(node.getLongOption() != null) 78 { 79 node.getLongOption().apply(this); 80 } 81 outALongOptionArgument(node); 82 } 83 84 public void inAPlainArgument(APlainArgument node) 85 { 86 defaultIn(node); 87 } 88 89 public void outAPlainArgument(APlainArgument node) 90 { 91 defaultOut(node); 92 } 93 94 @Override 95 public void caseAPlainArgument(APlainArgument node) 96 { 97 inAPlainArgument(node); 98 if(node.getText() != null) 99 { 100 node.getText().apply(this); 101 } 102 outAPlainArgument(node); 103 } 104 105 public void inAShortOption(AShortOption node) 106 { 107 defaultIn(node); 108 } 109 110 public void outAShortOption(AShortOption node) 111 { 112 defaultOut(node); 113 } 114 115 @Override 116 public void caseAShortOption(AShortOption node) 117 { 118 inAShortOption(node); 119 if(node.getShortName() != null) 120 { 121 node.getShortName().apply(this); 122 } 123 if(node.getOperand() != null) 124 { 125 node.getOperand().apply(this); 126 } 127 outAShortOption(node); 128 } 129 130 public void inALongOption(ALongOption node) 131 { 132 defaultIn(node); 133 } 134 135 public void outALongOption(ALongOption node) 136 { 137 defaultOut(node); 138 } 139 140 @Override 141 public void caseALongOption(ALongOption node) 142 { 143 inALongOption(node); 144 if(node.getLongName() != null) 145 { 146 node.getLongName().apply(this); 147 } 148 if(node.getOperand() != null) 149 { 150 node.getOperand().apply(this); 151 } 152 outALongOption(node); 153 } 154 155 public void inAOperand(AOperand node) 156 { 157 defaultIn(node); 158 } 159 160 public void outAOperand(AOperand node) 161 { 162 defaultOut(node); 163 } 164 165 @Override 166 public void caseAOperand(AOperand node) 167 { 168 inAOperand(node); 169 if(node.getOperandText() != null) 170 { 171 node.getOperandText().apply(this); 172 } 173 outAOperand(node); 174 } 175 } 176 | Popular Tags |