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