1 /*******************************************************************************
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 /* This file was generated by SableCC (http://www.sablecc.org/). */
14 package org.simantics.spreadsheet.common.expression.analysis;
16 import org.simantics.spreadsheet.common.expression.node.*;
18 public class DepthFirstAdapter extends AnalysisAdapter
20 public void inStart(Start node)
25 public void outStart(Start node)
30 public void defaultIn(@SuppressWarnings("unused") Node node)
35 public void defaultOut(@SuppressWarnings("unused") Node node)
41 public void caseStart(Start node)
44 node.getPExpression().apply(this);
45 node.getEOF().apply(this);
49 public void inAMultExpression(AMultExpression node)
54 public void outAMultExpression(AMultExpression node)
60 public void caseAMultExpression(AMultExpression node)
62 inAMultExpression(node);
63 if(node.getMultiplicative() != null)
65 node.getMultiplicative().apply(this);
67 outAMultExpression(node);
70 public void inAPlusExpression(APlusExpression node)
75 public void outAPlusExpression(APlusExpression node)
81 public void caseAPlusExpression(APlusExpression node)
83 inAPlusExpression(node);
84 if(node.getLeft() != null)
86 node.getLeft().apply(this);
88 if(node.getPlus() != null)
90 node.getPlus().apply(this);
92 if(node.getRight() != null)
94 node.getRight().apply(this);
96 outAPlusExpression(node);
99 public void inAMinusExpression(AMinusExpression node)
104 public void outAMinusExpression(AMinusExpression node)
110 public void caseAMinusExpression(AMinusExpression node)
112 inAMinusExpression(node);
113 if(node.getExpression() != null)
115 node.getExpression().apply(this);
117 if(node.getMinus() != null)
119 node.getMinus().apply(this);
121 if(node.getMultiplicative() != null)
123 node.getMultiplicative().apply(this);
125 outAMinusExpression(node);
128 public void inAUnaryMultiplicative(AUnaryMultiplicative node)
133 public void outAUnaryMultiplicative(AUnaryMultiplicative node)
139 public void caseAUnaryMultiplicative(AUnaryMultiplicative node)
141 inAUnaryMultiplicative(node);
142 if(node.getUnary() != null)
144 node.getUnary().apply(this);
146 outAUnaryMultiplicative(node);
149 public void inAMultMultiplicative(AMultMultiplicative node)
154 public void outAMultMultiplicative(AMultMultiplicative node)
160 public void caseAMultMultiplicative(AMultMultiplicative node)
162 inAMultMultiplicative(node);
163 if(node.getLeft() != null)
165 node.getLeft().apply(this);
167 if(node.getMult() != null)
169 node.getMult().apply(this);
171 if(node.getRight() != null)
173 node.getRight().apply(this);
175 outAMultMultiplicative(node);
178 public void inADivMultiplicative(ADivMultiplicative node)
183 public void outADivMultiplicative(ADivMultiplicative node)
189 public void caseADivMultiplicative(ADivMultiplicative node)
191 inADivMultiplicative(node);
192 if(node.getLeft() != null)
194 node.getLeft().apply(this);
196 if(node.getDiv() != null)
198 node.getDiv().apply(this);
200 if(node.getRight() != null)
202 node.getRight().apply(this);
204 outADivMultiplicative(node);
207 public void inAPrimaryUnary(APrimaryUnary node)
212 public void outAPrimaryUnary(APrimaryUnary node)
218 public void caseAPrimaryUnary(APrimaryUnary node)
220 inAPrimaryUnary(node);
221 if(node.getPrimary() != null)
223 node.getPrimary().apply(this);
225 outAPrimaryUnary(node);
228 public void inAUnaryplusUnary(AUnaryplusUnary node)
233 public void outAUnaryplusUnary(AUnaryplusUnary node)
239 public void caseAUnaryplusUnary(AUnaryplusUnary node)
241 inAUnaryplusUnary(node);
242 if(node.getPlus() != null)
244 node.getPlus().apply(this);
246 if(node.getUnary() != null)
248 node.getUnary().apply(this);
250 outAUnaryplusUnary(node);
253 public void inAUnaryminusUnary(AUnaryminusUnary node)
258 public void outAUnaryminusUnary(AUnaryminusUnary node)
264 public void caseAUnaryminusUnary(AUnaryminusUnary node)
266 inAUnaryminusUnary(node);
267 if(node.getMinus() != null)
269 node.getMinus().apply(this);
271 if(node.getUnary() != null)
273 node.getUnary().apply(this);
275 outAUnaryminusUnary(node);
278 public void inASingleArgList(ASingleArgList node)
283 public void outASingleArgList(ASingleArgList node)
289 public void caseASingleArgList(ASingleArgList node)
291 inASingleArgList(node);
292 if(node.getExpression() != null)
294 node.getExpression().apply(this);
296 outASingleArgList(node);
299 public void inASequenceArgList(ASequenceArgList node)
304 public void outASequenceArgList(ASequenceArgList node)
310 public void caseASequenceArgList(ASequenceArgList node)
312 inASequenceArgList(node);
313 if(node.getArgList() != null)
315 node.getArgList().apply(this);
317 if(node.getComma() != null)
319 node.getComma().apply(this);
321 if(node.getExpression() != null)
323 node.getExpression().apply(this);
325 outASequenceArgList(node);
328 public void inAValuePrimary(AValuePrimary node)
333 public void outAValuePrimary(AValuePrimary node)
339 public void caseAValuePrimary(AValuePrimary node)
341 inAValuePrimary(node);
342 if(node.getValue() != null)
344 node.getValue().apply(this);
346 outAValuePrimary(node);
349 public void inAFunctionPrimary(AFunctionPrimary node)
354 public void outAFunctionPrimary(AFunctionPrimary node)
360 public void caseAFunctionPrimary(AFunctionPrimary node)
362 inAFunctionPrimary(node);
363 if(node.getFunc() != null)
365 node.getFunc().apply(this);
367 if(node.getArgList() != null)
369 node.getArgList().apply(this);
371 if(node.getRPar() != null)
373 node.getRPar().apply(this);
375 outAFunctionPrimary(node);
378 public void inASingleRange(ASingleRange node)
383 public void outASingleRange(ASingleRange node)
389 public void caseASingleRange(ASingleRange node)
391 inASingleRange(node);
392 if(node.getCell() != null)
394 node.getCell().apply(this);
396 outASingleRange(node);
399 public void inAMultiRange(AMultiRange node)
404 public void outAMultiRange(AMultiRange node)
410 public void caseAMultiRange(AMultiRange node)
413 if(node.getLeft() != null)
415 node.getLeft().apply(this);
417 if(node.getColon() != null)
419 node.getColon().apply(this);
421 if(node.getRight() != null)
423 node.getRight().apply(this);
425 outAMultiRange(node);
428 public void inAStringValue(AStringValue node)
433 public void outAStringValue(AStringValue node)
439 public void caseAStringValue(AStringValue node)
441 inAStringValue(node);
442 if(node.getString() != null)
444 node.getString().apply(this);
446 outAStringValue(node);
449 public void inAConstantValue(AConstantValue node)
454 public void outAConstantValue(AConstantValue node)
460 public void caseAConstantValue(AConstantValue node)
462 inAConstantValue(node);
463 if(node.getNumber() != null)
465 node.getNumber().apply(this);
467 outAConstantValue(node);
470 public void inARangeValue(ARangeValue node)
475 public void outARangeValue(ARangeValue node)
481 public void caseARangeValue(ARangeValue node)
484 if(node.getRange() != null)
486 node.getRange().apply(this);
488 outARangeValue(node);
491 public void inAAddressValue(AAddressValue node)
496 public void outAAddressValue(AAddressValue node)
502 public void caseAAddressValue(AAddressValue node)
504 inAAddressValue(node);
505 if(node.getAmpersand() != null)
507 node.getAmpersand().apply(this);
509 if(node.getRange() != null)
511 node.getRange().apply(this);
513 outAAddressValue(node);
516 public void inAExprValue(AExprValue node)
521 public void outAExprValue(AExprValue node)
527 public void caseAExprValue(AExprValue node)
530 if(node.getLPar() != null)
532 node.getLPar().apply(this);
534 if(node.getExpression() != null)
536 node.getExpression().apply(this);
538 if(node.getRPar() != null)
540 node.getRPar().apply(this);