]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.spreadsheet.common/src/org/simantics/spreadsheet/common/expression/analysis/ReversedDepthFirstAdapter.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.spreadsheet.common / src / org / simantics / spreadsheet / common / expression / analysis / ReversedDepthFirstAdapter.java
diff --git a/bundles/org.simantics.spreadsheet.common/src/org/simantics/spreadsheet/common/expression/analysis/ReversedDepthFirstAdapter.java b/bundles/org.simantics.spreadsheet.common/src/org/simantics/spreadsheet/common/expression/analysis/ReversedDepthFirstAdapter.java
new file mode 100644 (file)
index 0000000..b0282e9
--- /dev/null
@@ -0,0 +1,544 @@
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
+ * in Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ *     VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+/* This file was generated by SableCC (http://www.sablecc.org/). */\r
+\r
+package org.simantics.spreadsheet.common.expression.analysis;\r
+\r
+import org.simantics.spreadsheet.common.expression.node.*;\r
+\r
+public class ReversedDepthFirstAdapter extends AnalysisAdapter\r
+{\r
+    public void inStart(Start node)\r
+    {\r
+        defaultIn(node);\r
+    }\r
+\r
+    public void outStart(Start node)\r
+    {\r
+        defaultOut(node);\r
+    }\r
+\r
+    public void defaultIn(@SuppressWarnings("unused") Node node)\r
+    {\r
+        // Do nothing\r
+    }\r
+\r
+    public void defaultOut(@SuppressWarnings("unused") Node node)\r
+    {\r
+        // Do nothing\r
+    }\r
+\r
+    @Override\r
+    public void caseStart(Start node)\r
+    {\r
+        inStart(node);\r
+        node.getEOF().apply(this);\r
+        node.getPExpression().apply(this);\r
+        outStart(node);\r
+    }\r
+\r
+    public void inAMultExpression(AMultExpression node)\r
+    {\r
+        defaultIn(node);\r
+    }\r
+\r
+    public void outAMultExpression(AMultExpression node)\r
+    {\r
+        defaultOut(node);\r
+    }\r
+\r
+    @Override\r
+    public void caseAMultExpression(AMultExpression node)\r
+    {\r
+        inAMultExpression(node);\r
+        if(node.getMultiplicative() != null)\r
+        {\r
+            node.getMultiplicative().apply(this);\r
+        }\r
+        outAMultExpression(node);\r
+    }\r
+\r
+    public void inAPlusExpression(APlusExpression node)\r
+    {\r
+        defaultIn(node);\r
+    }\r
+\r
+    public void outAPlusExpression(APlusExpression node)\r
+    {\r
+        defaultOut(node);\r
+    }\r
+\r
+    @Override\r
+    public void caseAPlusExpression(APlusExpression node)\r
+    {\r
+        inAPlusExpression(node);\r
+        if(node.getRight() != null)\r
+        {\r
+            node.getRight().apply(this);\r
+        }\r
+        if(node.getPlus() != null)\r
+        {\r
+            node.getPlus().apply(this);\r
+        }\r
+        if(node.getLeft() != null)\r
+        {\r
+            node.getLeft().apply(this);\r
+        }\r
+        outAPlusExpression(node);\r
+    }\r
+\r
+    public void inAMinusExpression(AMinusExpression node)\r
+    {\r
+        defaultIn(node);\r
+    }\r
+\r
+    public void outAMinusExpression(AMinusExpression node)\r
+    {\r
+        defaultOut(node);\r
+    }\r
+\r
+    @Override\r
+    public void caseAMinusExpression(AMinusExpression node)\r
+    {\r
+        inAMinusExpression(node);\r
+        if(node.getMultiplicative() != null)\r
+        {\r
+            node.getMultiplicative().apply(this);\r
+        }\r
+        if(node.getMinus() != null)\r
+        {\r
+            node.getMinus().apply(this);\r
+        }\r
+        if(node.getExpression() != null)\r
+        {\r
+            node.getExpression().apply(this);\r
+        }\r
+        outAMinusExpression(node);\r
+    }\r
+\r
+    public void inAUnaryMultiplicative(AUnaryMultiplicative node)\r
+    {\r
+        defaultIn(node);\r
+    }\r
+\r
+    public void outAUnaryMultiplicative(AUnaryMultiplicative node)\r
+    {\r
+        defaultOut(node);\r
+    }\r
+\r
+    @Override\r
+    public void caseAUnaryMultiplicative(AUnaryMultiplicative node)\r
+    {\r
+        inAUnaryMultiplicative(node);\r
+        if(node.getUnary() != null)\r
+        {\r
+            node.getUnary().apply(this);\r
+        }\r
+        outAUnaryMultiplicative(node);\r
+    }\r
+\r
+    public void inAMultMultiplicative(AMultMultiplicative node)\r
+    {\r
+        defaultIn(node);\r
+    }\r
+\r
+    public void outAMultMultiplicative(AMultMultiplicative node)\r
+    {\r
+        defaultOut(node);\r
+    }\r
+\r
+    @Override\r
+    public void caseAMultMultiplicative(AMultMultiplicative node)\r
+    {\r
+        inAMultMultiplicative(node);\r
+        if(node.getRight() != null)\r
+        {\r
+            node.getRight().apply(this);\r
+        }\r
+        if(node.getMult() != null)\r
+        {\r
+            node.getMult().apply(this);\r
+        }\r
+        if(node.getLeft() != null)\r
+        {\r
+            node.getLeft().apply(this);\r
+        }\r
+        outAMultMultiplicative(node);\r
+    }\r
+\r
+    public void inADivMultiplicative(ADivMultiplicative node)\r
+    {\r
+        defaultIn(node);\r
+    }\r
+\r
+    public void outADivMultiplicative(ADivMultiplicative node)\r
+    {\r
+        defaultOut(node);\r
+    }\r
+\r
+    @Override\r
+    public void caseADivMultiplicative(ADivMultiplicative node)\r
+    {\r
+        inADivMultiplicative(node);\r
+        if(node.getRight() != null)\r
+        {\r
+            node.getRight().apply(this);\r
+        }\r
+        if(node.getDiv() != null)\r
+        {\r
+            node.getDiv().apply(this);\r
+        }\r
+        if(node.getLeft() != null)\r
+        {\r
+            node.getLeft().apply(this);\r
+        }\r
+        outADivMultiplicative(node);\r
+    }\r
+\r
+    public void inAPrimaryUnary(APrimaryUnary node)\r
+    {\r
+        defaultIn(node);\r
+    }\r
+\r
+    public void outAPrimaryUnary(APrimaryUnary node)\r
+    {\r
+        defaultOut(node);\r
+    }\r
+\r
+    @Override\r
+    public void caseAPrimaryUnary(APrimaryUnary node)\r
+    {\r
+        inAPrimaryUnary(node);\r
+        if(node.getPrimary() != null)\r
+        {\r
+            node.getPrimary().apply(this);\r
+        }\r
+        outAPrimaryUnary(node);\r
+    }\r
+\r
+    public void inAUnaryplusUnary(AUnaryplusUnary node)\r
+    {\r
+        defaultIn(node);\r
+    }\r
+\r
+    public void outAUnaryplusUnary(AUnaryplusUnary node)\r
+    {\r
+        defaultOut(node);\r
+    }\r
+\r
+    @Override\r
+    public void caseAUnaryplusUnary(AUnaryplusUnary node)\r
+    {\r
+        inAUnaryplusUnary(node);\r
+        if(node.getUnary() != null)\r
+        {\r
+            node.getUnary().apply(this);\r
+        }\r
+        if(node.getPlus() != null)\r
+        {\r
+            node.getPlus().apply(this);\r
+        }\r
+        outAUnaryplusUnary(node);\r
+    }\r
+\r
+    public void inAUnaryminusUnary(AUnaryminusUnary node)\r
+    {\r
+        defaultIn(node);\r
+    }\r
+\r
+    public void outAUnaryminusUnary(AUnaryminusUnary node)\r
+    {\r
+        defaultOut(node);\r
+    }\r
+\r
+    @Override\r
+    public void caseAUnaryminusUnary(AUnaryminusUnary node)\r
+    {\r
+        inAUnaryminusUnary(node);\r
+        if(node.getUnary() != null)\r
+        {\r
+            node.getUnary().apply(this);\r
+        }\r
+        if(node.getMinus() != null)\r
+        {\r
+            node.getMinus().apply(this);\r
+        }\r
+        outAUnaryminusUnary(node);\r
+    }\r
+\r
+    public void inASingleArgList(ASingleArgList node)\r
+    {\r
+        defaultIn(node);\r
+    }\r
+\r
+    public void outASingleArgList(ASingleArgList node)\r
+    {\r
+        defaultOut(node);\r
+    }\r
+\r
+    @Override\r
+    public void caseASingleArgList(ASingleArgList node)\r
+    {\r
+        inASingleArgList(node);\r
+        if(node.getExpression() != null)\r
+        {\r
+            node.getExpression().apply(this);\r
+        }\r
+        outASingleArgList(node);\r
+    }\r
+\r
+    public void inASequenceArgList(ASequenceArgList node)\r
+    {\r
+        defaultIn(node);\r
+    }\r
+\r
+    public void outASequenceArgList(ASequenceArgList node)\r
+    {\r
+        defaultOut(node);\r
+    }\r
+\r
+    @Override\r
+    public void caseASequenceArgList(ASequenceArgList node)\r
+    {\r
+        inASequenceArgList(node);\r
+        if(node.getExpression() != null)\r
+        {\r
+            node.getExpression().apply(this);\r
+        }\r
+        if(node.getComma() != null)\r
+        {\r
+            node.getComma().apply(this);\r
+        }\r
+        if(node.getArgList() != null)\r
+        {\r
+            node.getArgList().apply(this);\r
+        }\r
+        outASequenceArgList(node);\r
+    }\r
+\r
+    public void inAValuePrimary(AValuePrimary node)\r
+    {\r
+        defaultIn(node);\r
+    }\r
+\r
+    public void outAValuePrimary(AValuePrimary node)\r
+    {\r
+        defaultOut(node);\r
+    }\r
+\r
+    @Override\r
+    public void caseAValuePrimary(AValuePrimary node)\r
+    {\r
+        inAValuePrimary(node);\r
+        if(node.getValue() != null)\r
+        {\r
+            node.getValue().apply(this);\r
+        }\r
+        outAValuePrimary(node);\r
+    }\r
+\r
+    public void inAFunctionPrimary(AFunctionPrimary node)\r
+    {\r
+        defaultIn(node);\r
+    }\r
+\r
+    public void outAFunctionPrimary(AFunctionPrimary node)\r
+    {\r
+        defaultOut(node);\r
+    }\r
+\r
+    @Override\r
+    public void caseAFunctionPrimary(AFunctionPrimary node)\r
+    {\r
+        inAFunctionPrimary(node);\r
+        if(node.getRPar() != null)\r
+        {\r
+            node.getRPar().apply(this);\r
+        }\r
+        if(node.getArgList() != null)\r
+        {\r
+            node.getArgList().apply(this);\r
+        }\r
+        if(node.getFunc() != null)\r
+        {\r
+            node.getFunc().apply(this);\r
+        }\r
+        outAFunctionPrimary(node);\r
+    }\r
+\r
+    public void inASingleRange(ASingleRange node)\r
+    {\r
+        defaultIn(node);\r
+    }\r
+\r
+    public void outASingleRange(ASingleRange node)\r
+    {\r
+        defaultOut(node);\r
+    }\r
+\r
+    @Override\r
+    public void caseASingleRange(ASingleRange node)\r
+    {\r
+        inASingleRange(node);\r
+        if(node.getCell() != null)\r
+        {\r
+            node.getCell().apply(this);\r
+        }\r
+        outASingleRange(node);\r
+    }\r
+\r
+    public void inAMultiRange(AMultiRange node)\r
+    {\r
+        defaultIn(node);\r
+    }\r
+\r
+    public void outAMultiRange(AMultiRange node)\r
+    {\r
+        defaultOut(node);\r
+    }\r
+\r
+    @Override\r
+    public void caseAMultiRange(AMultiRange node)\r
+    {\r
+        inAMultiRange(node);\r
+        if(node.getRight() != null)\r
+        {\r
+            node.getRight().apply(this);\r
+        }\r
+        if(node.getColon() != null)\r
+        {\r
+            node.getColon().apply(this);\r
+        }\r
+        if(node.getLeft() != null)\r
+        {\r
+            node.getLeft().apply(this);\r
+        }\r
+        outAMultiRange(node);\r
+    }\r
+\r
+    public void inAStringValue(AStringValue node)\r
+    {\r
+        defaultIn(node);\r
+    }\r
+\r
+    public void outAStringValue(AStringValue node)\r
+    {\r
+        defaultOut(node);\r
+    }\r
+\r
+    @Override\r
+    public void caseAStringValue(AStringValue node)\r
+    {\r
+        inAStringValue(node);\r
+        if(node.getString() != null)\r
+        {\r
+            node.getString().apply(this);\r
+        }\r
+        outAStringValue(node);\r
+    }\r
+\r
+    public void inAConstantValue(AConstantValue node)\r
+    {\r
+        defaultIn(node);\r
+    }\r
+\r
+    public void outAConstantValue(AConstantValue node)\r
+    {\r
+        defaultOut(node);\r
+    }\r
+\r
+    @Override\r
+    public void caseAConstantValue(AConstantValue node)\r
+    {\r
+        inAConstantValue(node);\r
+        if(node.getNumber() != null)\r
+        {\r
+            node.getNumber().apply(this);\r
+        }\r
+        outAConstantValue(node);\r
+    }\r
+\r
+    public void inARangeValue(ARangeValue node)\r
+    {\r
+        defaultIn(node);\r
+    }\r
+\r
+    public void outARangeValue(ARangeValue node)\r
+    {\r
+        defaultOut(node);\r
+    }\r
+\r
+    @Override\r
+    public void caseARangeValue(ARangeValue node)\r
+    {\r
+        inARangeValue(node);\r
+        if(node.getRange() != null)\r
+        {\r
+            node.getRange().apply(this);\r
+        }\r
+        outARangeValue(node);\r
+    }\r
+\r
+    public void inAAddressValue(AAddressValue node)\r
+    {\r
+        defaultIn(node);\r
+    }\r
+\r
+    public void outAAddressValue(AAddressValue node)\r
+    {\r
+        defaultOut(node);\r
+    }\r
+\r
+    @Override\r
+    public void caseAAddressValue(AAddressValue node)\r
+    {\r
+        inAAddressValue(node);\r
+        if(node.getRange() != null)\r
+        {\r
+            node.getRange().apply(this);\r
+        }\r
+        if(node.getAmpersand() != null)\r
+        {\r
+            node.getAmpersand().apply(this);\r
+        }\r
+        outAAddressValue(node);\r
+    }\r
+\r
+    public void inAExprValue(AExprValue node)\r
+    {\r
+        defaultIn(node);\r
+    }\r
+\r
+    public void outAExprValue(AExprValue node)\r
+    {\r
+        defaultOut(node);\r
+    }\r
+\r
+    @Override\r
+    public void caseAExprValue(AExprValue node)\r
+    {\r
+        inAExprValue(node);\r
+        if(node.getRPar() != null)\r
+        {\r
+            node.getRPar().apply(this);\r
+        }\r
+        if(node.getExpression() != null)\r
+        {\r
+            node.getExpression().apply(this);\r
+        }\r
+        if(node.getLPar() != null)\r
+        {\r
+            node.getLPar().apply(this);\r
+        }\r
+        outAExprValue(node);\r
+    }\r
+}\r