From: jkauttio Date: Mon, 31 Mar 2014 07:59:55 +0000 (+0000) Subject: Merge changes from trunk X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=6a7471473603600c44c702836d202aa5d09d2b00;p=simantics%2Fsysdyn.git Merge changes from trunk refs #2924 git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/branches/dev-jkauttio@29220 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Addition.java b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Addition.java index abf31cb4..27ee6841 100644 --- a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Addition.java +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Addition.java @@ -10,6 +10,10 @@ *******************************************************************************/ package fi.semantum.sysdyn.solver; +import java.util.Collection; +import java.util.Iterator; +import java.util.Map; + public class Addition implements IExpression { public IExpression exp1; @@ -27,9 +31,34 @@ public class Addition implements IExpression { @Override public Object evaluate(IEnvironment environment) { - Double d1 = (Double)exp1.evaluate(environment); - Double d2 = (Double)exp2.evaluate(environment); - return d1 + d2; + Object o1 = exp1.evaluate(environment); + Object o2 = exp2.evaluate(environment); + if(o1 instanceof Double && o2 instanceof Double) { + return (Double)o1 + (Double)o2; + } + if(o1 instanceof Array && o2 instanceof Array) { + Array la = (Array)o1; + Array ra = (Array)o2; + return la.add(ra); + } + throw new IllegalStateException(); + } + + @Override + public IExpression withBase(IFrame frame, String prefix) { + return new Addition(exp1.withBase(frame, prefix), exp2.withBase(frame, prefix)); } + @Override + public Object getPossibleConstant() { + return null; + } + + @Override + public IExpression rewrite(IFrame frame, Map copies) { + exp1 = exp1.rewrite(frame, copies); + exp2 = exp2.rewrite(frame, copies); + return this; + } + } diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/And.java b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/And.java index 0ed114b9..d77a191c 100644 --- a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/And.java +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/And.java @@ -11,22 +11,23 @@ package fi.semantum.sysdyn.solver; import java.util.ArrayList; +import java.util.Map; public class And implements IExpression { - public ArrayList exps; + public IExpression[] exps; public And(ArrayList exps) { - this.exps = exps; + this.exps = exps.toArray(new IExpression[exps.size()]); } @Override public String toString() { StringBuilder b = new StringBuilder(); - b.append(exps.get(0)); - for(int i=1;i ne = new ArrayList(); + for(IExpression e : exps) ne.add(e.withBase(frame, prefix)); + return new And(ne); + } + + @Override + public Object getPossibleConstant() { + return null; + } + + @Override + public IExpression rewrite(IFrame frame, Map copies) { + for(int i=0;i copies) { + args = args.rewrite(frame, copies); + return this; + } + } diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Argument.java b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Argument.java index e5258945..3a7013f4 100644 --- a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Argument.java +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Argument.java @@ -10,6 +10,8 @@ *******************************************************************************/ package fi.semantum.sysdyn.solver; +import java.util.Map; + public class Argument implements IExpression { public String name; @@ -30,4 +32,19 @@ public class Argument implements IExpression { throw new UnsupportedOperationException(); } + @Override + public IExpression withBase(IFrame frame, String prefix) { + return new Argument(prefix+name, modification.withBase(frame, prefix)); + } + + @Override + public Object getPossibleConstant() { + return null; + } + + public Argument rewrite(IFrame frame, Map copies) { + modification = modification.rewrite(frame, copies); + return this; + } + } diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/ArgumentList.java b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/ArgumentList.java index 9766f084..02d4d439 100644 --- a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/ArgumentList.java +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/ArgumentList.java @@ -11,30 +11,51 @@ package fi.semantum.sysdyn.solver; import java.util.ArrayList; +import java.util.Map; public class ArgumentList { - public ArrayList args; + public Argument[] args; + public String op; public ArgumentList(ArrayList args) { - this.args = args; + this.args = args.toArray(new Argument[args.size()]); + this.op = ""; } - public ArgumentList() { - this.args = new ArrayList(); + public ArgumentList(ArrayList args, String op) { + this.args = args.toArray(new Argument[args.size()]); + this.op = op; + } + + public ArgumentList(String op) { + this.args = new Argument[0]; + this.op = op; } @Override public String toString() { - if(args.size() == 0) return "()"; + if(args.length == 0) return "()"; StringBuilder b = new StringBuilder(); - b.append("(" + args.get(0)); - for(int i=1;i a2 = new ArrayList(); + for(Argument a : args) a2.add((Argument)a.withBase(frame, prefix)); + return new ArgumentList(a2, op); + } + + public ArgumentList rewrite(IFrame frame, Map copies) { + for(int i=0;i copies) { + for(int i=0;i lae = elements(); + Collection rae = other.elements(); + if(lae.size() != rae.size()) throw new IllegalStateException(); + Iterator li = lae.iterator(); + Iterator ri = rae.iterator(); + for(int i=0;i lae = elements(); + Collection rae = other.elements(); + if(lae.size() != rae.size()) throw new IllegalStateException(); + Iterator li = lae.iterator(); + Iterator ri = rae.iterator(); + for(int i=0;i copies) { + start = start.rewrite(frame, copies); + end = end.rewrite(frame, copies); + return this; + } + } diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Assignment.java b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Assignment.java index aec5233a..fd7f1d06 100644 --- a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Assignment.java +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Assignment.java @@ -10,14 +10,18 @@ *******************************************************************************/ package fi.semantum.sysdyn.solver; +import org.omg.PortableInterceptor.SUCCESSFUL; + public class Assignment { public Variable target; + public IExpression[] subscripts; public IExpression expression; public boolean assigned = false; - public Assignment(Variable target, IExpression expression) { + public Assignment(Variable target, IExpression[] subscripts, IExpression expression) { this.target = target; + this.subscripts = subscripts; this.expression = expression; } @@ -26,4 +30,15 @@ public class Assignment { return target + " = " + expression; } + public Assignment withBase(IFrame frame, String prefix) { + if(subscripts != null) { + IExpression[] subscripts2 = new IExpression[subscripts.length]; + for(int i=0;i copies) { + return this; + } + } + diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Declaration.java b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Declaration.java index 16d45c03..a1490f52 100644 --- a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Declaration.java +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Declaration.java @@ -11,6 +11,8 @@ *******************************************************************************/ package fi.semantum.sysdyn.solver; +import java.util.Map; + public class Declaration implements IExpression { public Variable variable; @@ -31,4 +33,19 @@ public class Declaration implements IExpression { throw new UnsupportedOperationException(); } + @Override + public IExpression withBase(IFrame frame, String prefix) { + throw new UnsupportedOperationException(); + } + + @Override + public Object getPossibleConstant() { + return null; + } + + @Override + public IExpression rewrite(IFrame frame, Map copies) { + throw new UnsupportedOperationException(); + } + } diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Derivate.java b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Derivate.java index 8afcf24c..426e3fa7 100644 --- a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Derivate.java +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Derivate.java @@ -10,13 +10,17 @@ *******************************************************************************/ package fi.semantum.sysdyn.solver; +import java.util.Map; + public class Derivate implements IExpression { private Variable variable; + private IExpression[] subscripts; private IExpression e; - public Derivate(Variable variable, IExpression e) { + public Derivate(Variable variable, IExpression[] subscripts, IExpression e) { this.variable = variable; + this.subscripts = subscripts; this.e = e; } @@ -24,7 +28,7 @@ public class Derivate implements IExpression { public Object evaluate(IEnvironment _environment) { Environment environment = (Environment)_environment; // Double old = (Double)environment.getValue(variable.name + variable.subscriptKey()); - Double old = (Double)environment.getValue(variable.index(_environment)); + Double old = (Double)environment.getValue(variable.base.index(_environment, subscripts)); return old+environment.step*(Double)e.evaluate(environment); } @@ -32,5 +36,32 @@ public class Derivate implements IExpression { public String toString() { return e.toString(); } + + @Override + public IExpression withBase(IFrame frame, String prefix) { + if(subscripts != null) { + IExpression[] subscripts2 = new IExpression[subscripts.length]; + for(int i=0;i copies) { + if(subscripts != null) { + for(int i=0;i copies) { + throw new UnsupportedOperationException(); + } } diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Division.java b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Division.java index 34ee4e4c..0f643949 100644 --- a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Division.java +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Division.java @@ -10,6 +10,8 @@ *******************************************************************************/ package fi.semantum.sysdyn.solver; +import java.util.Map; + public class Division implements IExpression { public IExpression exp1; @@ -26,7 +28,15 @@ public class Division implements IExpression { } private Array arrayDiv(Array a, Double d) { - return a; + Array result = new Array(); + for(Object o : a.elements()) { + if(o instanceof Double) { + result.addElement((Double)o/d); + } else { + throw new IllegalStateException(); + } + } + return result; } @Override @@ -39,4 +49,21 @@ public class Division implements IExpression { else throw new UnsupportedOperationException(); } + @Override + public IExpression withBase(IFrame frame, String prefix) { + return new Division(exp1.withBase(frame, prefix), exp2.withBase(frame, prefix)); + } + + @Override + public Object getPossibleConstant() { + return null; + } + + @Override + public IExpression rewrite(IFrame frame, Map copies) { + exp1 = exp1.rewrite(frame, copies); + exp2 = exp2.rewrite(frame, copies); + return this; + } + } diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/ElementwiseProduct.java b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/ElementwiseProduct.java new file mode 100644 index 00000000..d8d3aafb --- /dev/null +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/ElementwiseProduct.java @@ -0,0 +1,71 @@ +/******************************************************************************* + * Copyright (c) 2013 Semantum Oy. + * 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: + * Semantum Oy - initial API and implementation + *******************************************************************************/ +package fi.semantum.sysdyn.solver; + +import java.util.Collection; +import java.util.Iterator; +import java.util.Map; + +public class ElementwiseProduct implements IExpression { + + public IExpression exp1; + public IExpression exp2; + + public ElementwiseProduct(IExpression exp1, IExpression exp2) { + this.exp1 = exp1; + this.exp2 = exp2; + } + + @Override + public String toString() { + return exp1 + " * " + exp2; + } + + @Override + public Object evaluate(IEnvironment environment) { + Object left = exp1.evaluate(environment); + Object right = exp2.evaluate(environment); + if(left instanceof Array && right instanceof Array) { + Array la = (Array)left; + Array ra = (Array)right; + Collection lae = la.elements(); + Collection rae = ra.elements(); + if(lae.size() != rae.size()) throw new UnsupportedOperationException(); + Iterator li = lae.iterator(); + Iterator ri = rae.iterator(); + Array result = new Array(); + for(int i=0;i copies) { + exp1 = exp1.rewrite(frame, copies); + exp2 = exp2.rewrite(frame, copies); + return this; + } + +} diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/EnumElementsVariableBase.java b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/EnumElementsVariableBase.java new file mode 100644 index 00000000..d80d5dfd --- /dev/null +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/EnumElementsVariableBase.java @@ -0,0 +1,46 @@ +/******************************************************************************* + * Copyright (c) 2013 VTT Technical Research Centre of Finland. + * 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 + *******************************************************************************/ +package fi.semantum.sysdyn.solver; + +public class EnumElementsVariableBase extends VariableBase { + + private Array result; + + public EnumElementsVariableBase(Model clazz) { + super("elements"); + result = new Array(); + for(VariableDeclaration vd : clazz.variables) { + Constant c = (Constant)vd.modification.args[0].modification; + result.addElement(c.value); + } + } + + public EnumElementsVariableBase(String name, Array result) { + super(name); + this.result = result; + } + + @Override + public Object evaluate(IEnvironment environment, IExpression[] subscripts) { + return result; + } + + @Override + VariableBase withBase(String prefix) { + return new EnumElementsVariableBase(prefix+name, result); + } + + @Override + public IExpression getPossibleConstant() { + return result; + } + +} diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/EnumSizeVariableBase.java b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/EnumSizeVariableBase.java new file mode 100644 index 00000000..6ed388f0 --- /dev/null +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/EnumSizeVariableBase.java @@ -0,0 +1,42 @@ +/******************************************************************************* + * Copyright (c) 2013 VTT Technical Research Centre of Finland. + * 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 + *******************************************************************************/ +package fi.semantum.sysdyn.solver; + +public class EnumSizeVariableBase extends VariableBase { + + private Double value; + + public EnumSizeVariableBase(Model clazz) { + super("size"); + value = (double)clazz.variables.size(); + } + + public EnumSizeVariableBase(String name, double value) { + super(name); + this.value = value; + } + + @Override + public Object evaluate(IEnvironment environment, IExpression[] subscripts) { + return value; + } + + @Override + VariableBase withBase(String prefix) { + return new EnumSizeVariableBase(prefix+name, value); + } + + @Override + public IExpression getPossibleConstant() { + return new Constant(value.toString()); + } + +} diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Environment.java b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Environment.java index 5f5db469..1e147408 100644 --- a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Environment.java +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Environment.java @@ -11,27 +11,29 @@ *******************************************************************************/ package fi.semantum.sysdyn.solver; +import java.util.ArrayList; +import java.util.Collection; import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; import java.util.TreeMap; interface Fn { public Object evaluate(IEnvironment environment, int argc); + public Object evaluateInput(IEnvironment environment, int argPosition); public void setLocals(IEnvironment environment); public int offset(); public Variable[] parameters(); } abstract class Fn1 implements Fn { + + Variable[] parameters; - static Variable[] parameters; - - static { - parameters = new Variable[5]; - parameters[0] = new Variable(new VariableBase("", 0)); - parameters[1] = new Variable(new VariableBase("", 1)); - parameters[2] = new Variable(new VariableBase("", 2)); - parameters[3] = new Variable(new VariableBase("", 3)); - parameters[4] = new Variable(new VariableBase("", 4)); + public Fn1(int pCount) { + parameters = new Variable[pCount]; + for(int i=0;i named = new HashMap(); + public Model model; public final double step; public double time; public boolean initial = true; + public int size; public Object[] valueTable; @@ -64,7 +75,7 @@ public class Environment implements IEnvironment, ISystem { this.step = step; this.time = start; - model.functions.put("size", new Fn1() { + model.functions.put("size", new Fn1(2) { @Override public Object evaluate(IEnvironment environment, int argc) { @@ -74,18 +85,44 @@ public class Environment implements IEnvironment, ISystem { } }); - model.functions.put("zidz", new Fn1() { + model.functions.put("zidz", new Fn1(2) { - @Override - public Object evaluate(IEnvironment environment, int argc) { - Double p1 = (Double)environment.getValue(0); - Double p2 = (Double)environment.getValue(1); + private Object evaluate(Double p1, Double p2) { if(Math.abs(p2) < 1e-12) return 0.0; else return p1 / p2; } + @Override + public Object evaluate(IEnvironment environment, int argc) { + Object o1 = environment.getValue(0); + Object o2 = environment.getValue(1); + + if(o1 instanceof Double && o2 instanceof Double) { + return evaluate((Double)o1, (Double)o2); + } + if(o1 instanceof Array && o2 instanceof Array) { + Array la = (Array)o1; + Array ra = (Array)o2; + Collection lae = la.elements(); + Collection rae = ra.elements(); + if(lae.size() != rae.size()) throw new UnsupportedOperationException(); + Iterator li = lae.iterator(); + Iterator ri = rae.iterator(); + Array result = new Array(); + for(int i=0;i getHistory(String ident) { @@ -260,9 +334,17 @@ public class Environment implements IEnvironment, ISystem { valueTable[key] = value; } + public void put(String key, Object value) { + named.put(key, value); + } + + public void setSize(int size) { + this.size = size; + } + @Override public int offset() { - return model.names.size(); + return size; } @Override @@ -283,30 +365,106 @@ public class Environment implements IEnvironment, ISystem { public double time() { return time; } + + double[] valueArray; + + public void addIndexed(int dimensions[], ArrayList keys, String prefix, int d) { + + if(d == dimensions.length) { + keys.add(prefix); + return; + } + + for(int i=0;i keys) { + +// int dimensions[] = base.dimensions; + if(dimensions == null) { + keys.add(name); + } else { + addIndexed(dimensions, keys, name, 0); + } + + } + + public void addVariable(Variable var, ArrayList keys) { + addVariable(var.base.name, var.base.dimensions, keys); + } + + public String[] getValueKeyArray() { + + ArrayList keys = new ArrayList(); + + for (int i = 0; i < model.assignmentArray.length; i++) { + addVariable(model.assignmentArray[i].target, keys); + } + + for (int i = 0; i < model.derivativeArray.length; i++) { + addVariable(model.derivativeArray[i].target, keys); + } + + // NOTE: there is room for optimization as parameter values that do not + // change should only be obtained once (and parameter values that do + // change are (possibly) included in assignments or derivatives) + for(int i = 0; i < model.parameterArray.length; i++) { + addVariable(model.parameterArray[i].variable, keys); + } + + for(Map.Entry entry : model.copies.entrySet()) { + addVariable(entry.getKey(), entry.getValue().dimensions, keys); + } + + valueArray = new double[keys.size()]; + + return keys.toArray(new String[keys.size()]); + + } + // TODO: this is probably not smart at all, figure out a better way to obtain results - public HashMap getValueMap() { - HashMap values = new HashMap(); + public double[] getValueArray() { + + int offset = 0; for (int i = 0; i < model.assignmentArray.length; i++) { Variable v = model.assignmentArray[i].target; - values.put(v.toString(), (Double)getValue(v.index(this))); + for(int index=0;index entry : model.copies.entrySet()) { + VariableBase base = entry.getValue(); + for(int index=0;index copies) { + exp1 = exp1.rewrite(frame, copies); + exp2 = exp2.rewrite(frame, copies); + return this; + } + } diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/ForArray.java b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/ForArray.java new file mode 100644 index 00000000..1f66818a --- /dev/null +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/ForArray.java @@ -0,0 +1,113 @@ +/******************************************************************************* + * Copyright (c) 2013 Semantum Oy. + * 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: + * Semantum Oy - initial API and implementation + *******************************************************************************/ +package fi.semantum.sysdyn.solver; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Map; + +public class ForArray implements IExpression { + + private ArrayList elements = new ArrayList(); + + public ForArray() { + + } + + public ForArray(ArrayList elements) { + this.elements = elements; + } + + public void addElement(Object element) { + if(element instanceof Constant) addElement(((Constant)element).value); + else elements.add(element); + } + + public void setElement(int index, Object element) { + elements.set(index, element); + } + + @Override + public Object evaluate(IEnvironment environment) { + return evaluated(environment); + } + + public Array evaluated(IEnvironment environment) { + + Array result = new Array(); + + IExpression exp = (IExpression)elements.get(0); + Argument arg = (Argument)elements.get(1); + + Array indices = (Array)arg.modification.evaluate(environment); + for(Object o : indices.elements()) { + environment.put(arg.name, o); +// Frame f = new Frame(environment, 1); +// f.put(arg.name, o); + result.addElement(exp.evaluate(environment)); + } + + return result; + + } + + @Override + public String toString() { + return elements.toString(); + } + + public int size(int col) { + return elements.size(); + } + + public Object element(int index) { + return elements.get(index); + } + + public Collection elements() { + return elements; + } + + public void ensureIndex(int index, boolean subArray) { + int needed = (index+1-elements.size()); + for(int i=0;i e = new ArrayList(); + for(Object o : elements) { + if(o instanceof IExpression) { + e.add(((IExpression)o).withBase(frame, prefix)); + } else { + e.add(o); + } + } + return new ForArray(e); + } + + @Override + public Object getPossibleConstant() { + return null; + } + + @Override + public IExpression rewrite(IFrame frame, Map copies) { + for(int i=0;i named; public Frame(IEnvironment parent, int offset) { this.parent = parent; @@ -29,11 +33,22 @@ public class Frame implements IEnvironment { public void put(int index, Object value) { parent.put(parent.offset() + index, value); } + + public void put(String key, Object value) { + if(named == null) named = new HashMap(); + named.put(key, value); + } @Override public Object getValue(int index) { return parent.getValue(parent.offset() + index); } + + @Override + public Object getNamedValue(String key) { + if(named == null) return null; + return named.get(key); + } @Override public ISystem getSystem() { diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Function.java b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Function.java index 925a192f..3c32e6e9 100644 --- a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Function.java +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Function.java @@ -11,11 +11,10 @@ package fi.semantum.sysdyn.solver; import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.Map; -public class Function implements Fn, IFrame { +final public class Function implements Fn, IFrame { public static final boolean PRINT = false; @@ -69,6 +68,11 @@ public class Function implements Fn, IFrame { return base; } + @Override + public VariableBase getBase(VariableBase base, String prefix) { + throw new IllegalStateException(); + } + public void prepare() { int nextIndex = 0; if(PRINT) @@ -84,15 +88,15 @@ public class Function implements Fn, IFrame { for(int i=0;i= ((Double)exp2.evaluate(environment)); } + @Override + public IExpression withBase(IFrame frame, String prefix) { + return new GreaterOrEqualThan(exp1.withBase(frame, prefix), exp2.withBase(frame, prefix)); + } + @Override + public Object getPossibleConstant() { + return null; + } + + @Override + public IExpression rewrite(IFrame frame, Map copies) { + exp1 = exp1.rewrite(frame, copies); + exp2 = exp2.rewrite(frame, copies); + return this; + } + } diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/GreaterThan.java b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/GreaterThan.java index 19554716..21d81acc 100644 --- a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/GreaterThan.java +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/GreaterThan.java @@ -10,6 +10,8 @@ *******************************************************************************/ package fi.semantum.sysdyn.solver; +import java.util.Map; + public class GreaterThan implements IExpression { public IExpression exp1; @@ -30,5 +32,21 @@ public class GreaterThan implements IExpression { return ((Double)exp1.evaluate(environment)) > ((Double)exp2.evaluate(environment)); } + @Override + public IExpression withBase(IFrame frame, String prefix) { + return new GreaterThan(exp1.withBase(frame, prefix), exp2.withBase(frame, prefix)); + } + @Override + public Object getPossibleConstant() { + return null; + } + + @Override + public IExpression rewrite(IFrame frame, Map copies) { + exp1 = exp1.rewrite(frame, copies); + exp2 = exp2.rewrite(frame, copies); + return this; + } + } diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/IEnvironment.java b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/IEnvironment.java index 71b6b738..036c1e9f 100644 --- a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/IEnvironment.java +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/IEnvironment.java @@ -13,8 +13,9 @@ package fi.semantum.sysdyn.solver; public interface IEnvironment { // Object getValue(String key); + Object getNamedValue(String key); Object getValue(int index); -// void put(String key, Object value); + void put(String key, Object value); void put(int index, Object value); // Object evaluateFunction(IEnvironment parent, String name, ArgumentList args); diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/IExpression.java b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/IExpression.java index e03d07ca..6377a3ad 100644 --- a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/IExpression.java +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/IExpression.java @@ -10,8 +10,13 @@ *******************************************************************************/ package fi.semantum.sysdyn.solver; +import java.util.Map; + public interface IExpression { public Object evaluate(IEnvironment environment); + public IExpression withBase(IFrame frame, String prefix); + public Object getPossibleConstant(); + public IExpression rewrite(IFrame frame, Map copies); } diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/IFrame.java b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/IFrame.java index 7edb1414..805ef557 100644 --- a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/IFrame.java +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/IFrame.java @@ -12,4 +12,6 @@ package fi.semantum.sysdyn.solver; public interface IFrame { public VariableBase getBase(String name); + public VariableBase getBase(VariableBase base, String prefix); + public Model getClass(String name); } diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/IfThenElse.java b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/IfThenElse.java index 72aafc65..2176faf4 100644 --- a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/IfThenElse.java +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/IfThenElse.java @@ -10,6 +10,8 @@ *******************************************************************************/ package fi.semantum.sysdyn.solver; +import java.util.Map; + public class IfThenElse implements IExpression { public IExpression exp; @@ -36,4 +38,22 @@ public class IfThenElse implements IExpression { } } + @Override + public IExpression withBase(IFrame frame, String prefix) { + return new IfThenElse(exp.withBase(frame, prefix), t.withBase(frame, prefix), e.withBase(frame, prefix)); + } + + @Override + public Object getPossibleConstant() { + return null; + } + + @Override + public IExpression rewrite(IFrame frame, Map copies) { + exp = exp.rewrite(frame, copies); + t = t.rewrite(frame, copies); + e = e.rewrite(frame, copies); + return this; + } + } diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/LessOrEqualThan.java b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/LessOrEqualThan.java index 33295cd1..7c2f2870 100644 --- a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/LessOrEqualThan.java +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/LessOrEqualThan.java @@ -10,6 +10,8 @@ *******************************************************************************/ package fi.semantum.sysdyn.solver; +import java.util.Map; + public class LessOrEqualThan implements IExpression { public IExpression exp1; @@ -32,5 +34,21 @@ public class LessOrEqualThan implements IExpression { return d1 <= d2; } + @Override + public IExpression withBase(IFrame frame, String prefix) { + return new LessOrEqualThan(exp1.withBase(frame, prefix), exp2.withBase(frame, prefix)); + } + @Override + public Object getPossibleConstant() { + return null; + } + + @Override + public IExpression rewrite(IFrame frame, Map copies) { + exp1 = exp1.rewrite(frame, copies); + exp2 = exp2.rewrite(frame, copies); + return this; + } + } diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/LessThan.java b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/LessThan.java index 6a3aea88..9a808538 100644 --- a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/LessThan.java +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/LessThan.java @@ -10,6 +10,8 @@ *******************************************************************************/ package fi.semantum.sysdyn.solver; +import java.util.Map; + public class LessThan implements IExpression { public IExpression exp1; @@ -32,4 +34,21 @@ public class LessThan implements IExpression { return ((Double)left) < ((Double)right); } + @Override + public IExpression withBase(IFrame frame, String prefix) { + return new LessThan(exp1.withBase(frame, prefix), exp2.withBase(frame, prefix)); + } + + @Override + public Object getPossibleConstant() { + return null; + } + + @Override + public IExpression rewrite(IFrame frame, Map copies) { + exp1 = exp1.rewrite(frame, copies); + exp2 = exp2.rewrite(frame, copies); + return this; + } + } diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/LineReader.java b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/LineReader.java index 1dc522fd..d4e2f420 100644 --- a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/LineReader.java +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/LineReader.java @@ -12,6 +12,7 @@ package fi.semantum.sysdyn.solver; import java.io.StringReader; +import fi.semantum.sysdyn.solver.Model.Globals; import fi.semantum.sysdyn.solver.parser.ModelParser; import fi.semantum.sysdyn.solver.parser.Node; import fi.semantum.sysdyn.solver.parser.SimpleNode; @@ -38,7 +39,7 @@ public class LineReader { public LineReader(String input, NodeCache cache) { chars = input.toCharArray(); this.cache = cache; - model = new Model(); + model = new Model(new Globals(), "", false); parser = new Parser(); } @@ -89,7 +90,6 @@ public class LineReader { cache.store(line, (SimpleNode)node); } - parser.currentFrame = model; parser.walk((SimpleNode)node, 0, model); } @@ -118,7 +118,6 @@ public class LineReader { cache.store(line, (SimpleNode)node); } - parser.currentFrame = model; parser.walk((SimpleNode)node, 0, model); } @@ -142,7 +141,6 @@ public class LineReader { cache.store(line, (SimpleNode)node); } - parser.currentFrame = model; parser.walk((SimpleNode)node, 0, model); } diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Model.java b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Model.java index 54580e00..4aa58463 100644 --- a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Model.java +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Model.java @@ -14,9 +14,14 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.Map; +import java.util.TreeMap; class Model implements IFrame { + static class Globals { + public Map classes = new HashMap(); + } + final public static boolean PRINT = false; public boolean initial = false; @@ -26,9 +31,26 @@ class Model implements IFrame { public ArrayList parameters = new ArrayList(); public ArrayList variables = new ArrayList(); public Map functions = new HashMap(); + public Map copies; public Assignment[] assignmentArray; public Assignment[] derivativeArray; + public ParameterDeclaration[] parameterArray; + + public final Globals globals; + + public String name; + public boolean isEnumClass; + + public Model(Globals globals, String name, boolean isEnumClass) { + this.globals = globals; + this.name = name; + this.isEnumClass = isEnumClass; + } + + public void addVariable(VariableDeclaration vd) { + this.variables.add(vd); + } public Fn getFunction(String name) { return functions.get(name); @@ -36,10 +58,24 @@ class Model implements IFrame { public HashMap names = new HashMap(); + public VariableBase getBase(VariableBase original, String prefix) { + VariableBase base = names.get(prefix+original.name); + if(base != null) return base; + base = original.withBase(prefix); + names.put(base.name, base); + return base; + } + public VariableBase getBase(String name) { VariableBase base = names.get(name); if(base == null) { - base = new VariableBase(name); + + if(isEnumClass) { + if("size".equals(name)) base = new EnumSizeVariableBase(this); + else if("elements".equals(name)) base = new EnumElementsVariableBase(this); + } + + if(base == null) base = new VariableBase(name); names.put(name, base); } return base; @@ -57,14 +93,14 @@ class Model implements IFrame { Frame frame = new Frame(environment, fn.offset()); ArrayList argh = new ArrayList(); - argh.add(args.args.get(0).modification.toString()); - for(int i=0;i argh = new ArrayList(); - for(int i=0;i work, VariableBase target) { + VariableBase deep = work.get(target.name); + if(deep == null) return target; + return resolveCopy(work, target); + } + + private void rewrite() { + + ArrayList parameterCopies = new ArrayList(); + ArrayList variableCopies = new ArrayList(); + + HashMap work = new HashMap(); + + for(ParameterDeclaration pd : parameters) { + if(pd.modification instanceof Variable) { + Variable var = (Variable)pd.modification; + if(!SolverUtils.isFullSubscript(var.subscripts)) continue; + if(!SolverUtils.isFullSubscript(pd.variable.subscripts)) continue; + parameterCopies.add(pd); + work.put(pd.variable.base.name, var.base); + } + } + for(Assignment ass : assignments) { + if(ass.expression instanceof Variable) { + Variable var = (Variable)ass.expression; + if(!SolverUtils.isFullSubscript(var.subscripts)) continue; + if(!SolverUtils.isFullSubscript(ass.target.subscripts)) continue; + variableCopies.add(ass); + work.put(ass.target.base.name, var.base); + } + } + + parameters.removeAll(parameterCopies); + assignments.removeAll(variableCopies); + + copies = new TreeMap(); + for(String key : work.keySet()) { + VariableBase b = resolveCopy(work, work.get(key)); + copies.put(key, b); + } + + for(VariableDeclaration vd : variables) { + vd.modification = vd.modification.rewrite(this, copies); + vd.variable = (Variable)vd.variable.rewrite(this, copies); + } + for(ParameterDeclaration pd : parameters) { + pd.modification = pd.modification.rewrite(this, copies); + } + for(Assignment ass : assignments) { + ass.expression = ass.expression.rewrite(this, copies); + } + for(Assignment ass : derivatives) { + ass.expression = ass.expression.rewrite(this, copies); + } + for(Assignment ass : initials) { + ass.expression = ass.expression.rewrite(this, copies); + } + + } + public int prepare() { if(PRINT) { @@ -107,19 +209,32 @@ class Model implements IFrame { System.err.println("=================="); } - for(VariableDeclaration vd : variables) { - vd.variable.base.tellSubscripts(vd.variable.subscripts); - } - for(ParameterDeclaration pd : parameters) { - pd.variable.base.tellSubscripts(pd.variable.subscripts); + rewrite(); + + boolean done = true; + + for(int i=0;i<50;i++) { + done = true; + for(VariableDeclaration vd : variables) { + done &= vd.variable.base.tellSubscripts(vd.variable.subscripts, null); + } + for(ParameterDeclaration pd : parameters) { + done &= pd.variable.base.tellSubscripts(pd.variable.subscripts, pd.modification); + } + if(done) break; } + + if(!done) throw new IllegalStateException(); + int nextIndex = 0; for(Map.Entry entry : names.entrySet()) { VariableBase base = entry.getValue(); base.index = nextIndex; if(PRINT) System.err.println("Variable: " + entry.getKey() + " " + base.index + " " + Arrays.toString(base.dimensions)); - nextIndex += base.dimension(); + int dim = base.dimension(); + if(dim == -1) dim = 1; + nextIndex += dim; } if(PRINT) @@ -129,4 +244,94 @@ class Model implements IFrame { } + public void prettyPrint() { + + System.err.println("initials"); + for(Assignment a : initials) { + System.err.println("-"+a); + } + System.err.println("assignments"); + for(Assignment a : assignments) { + System.err.println("-"+a); + } + System.err.println("derivatives"); + for(Assignment a : derivatives) { + System.err.println("-"+a); + } + System.err.println("parameters"); + for(ParameterDeclaration a : parameters) { + System.err.println("-"+a); + } + System.err.println("variables"); + for(VariableDeclaration a : variables) { + System.err.println("-"+a); + } + System.err.println("functions"); + for(Map.Entry a : functions.entrySet()) { + System.err.println("-"+a.getKey() + " " + a.getValue()); + } + + } + + @Override + public Model getClass(String name) { + return globals.classes.get(name); + } + + public boolean instantiateClass(String type_specifier, Declaration decl, IFrame currentFrame) { + + Model clazz = globals.classes.get(type_specifier); + if(clazz == null) return false; + + Map modifications = new HashMap(); + if(decl.modification instanceof ArgumentList) { + ArgumentList args = (ArgumentList)decl.modification; + for(Argument a : args.args) { + modifications.put(a.name, a.modification); + } + } + + for(VariableDeclaration vd : clazz.variables) { + String base = decl.variable.base.name + "."; + Variable var2 = vd.variable.withBase(currentFrame, base); + VariableDeclaration vd2 = new VariableDeclaration(var2, vd.direction, vd.type, vd.modification.withBase(currentFrame, base)); + variables.add(vd2); + } + for(ParameterDeclaration pd : clazz.parameters) { + IExpression modi = modifications.get(pd.variable.base.name); + if(modi != null) { + String base = decl.variable.base.name + "."; + Variable var2 = pd.variable.withBase(currentFrame, base); + var2.subscripts = null; + ParameterDeclaration pd2 = new ParameterDeclaration(var2, modi); + parameters.add(pd2); + modifications.remove(pd.variable.base.name); + } else { + String base = decl.variable.base.name + "."; + Variable var2 = pd.variable.withBase(currentFrame, base); + ParameterDeclaration pd2 = new ParameterDeclaration(var2, pd.modification.withBase(currentFrame, base)); + parameters.add(pd2); + } + } + + if(!modifications.isEmpty()) + throw new IllegalStateException(); + + for(Assignment ass : clazz.assignments) { + Assignment ass2 = ass.withBase(currentFrame, decl.variable.base.name + "."); + assignments.add(ass2); + } + for(Assignment ass : clazz.initials) { + Assignment ass2 = ass.withBase(currentFrame, decl.variable.base.name + "."); + initials.add(ass2); + } + for(Assignment ass : clazz.derivatives) { + Assignment ass2 = ass.withBase(currentFrame, decl.variable.base.name + "."); + derivatives.add(ass2); + } + + return true; + + } + } \ No newline at end of file diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/MultiStatement.java b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/MultiStatement.java new file mode 100644 index 00000000..fd878fd3 --- /dev/null +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/MultiStatement.java @@ -0,0 +1,40 @@ +/******************************************************************************* + * Copyright (c) 2013 Semantum Oy. + * 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: + * Semantum Oy - initial API and implementation + *******************************************************************************/ +package fi.semantum.sysdyn.solver; + +import java.util.ArrayList; + +public class MultiStatement implements IStatement { + + public ArrayList targets; + public Variable fn; + public ArgumentList args; + + public MultiStatement(ArrayList targets, Variable fn, ArgumentList args) { + this.targets = targets; + this.fn = fn; + this.args = args; + } + + @Override + public String toString() { + return targets + " := " + fn + " " + args; + } + + @Override + public void evaluate(IEnvironment environment) { + ArrayList values = (ArrayList)environment.getSystem().evaluateFunction(environment, fn.base.name, args); + for(int i=0;i copies) { + exp1 = exp1.rewrite(frame, copies); + exp2 = exp2.rewrite(frame, copies); + return this; + } + } diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Negation.java b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Negation.java index d20354dd..cdf125ba 100644 --- a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Negation.java +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Negation.java @@ -10,6 +10,8 @@ *******************************************************************************/ package fi.semantum.sysdyn.solver; +import java.util.Map; + public class Negation implements IExpression { public IExpression exp; @@ -28,4 +30,20 @@ public class Negation implements IExpression { return -((Double)exp.evaluate(environment)); } + @Override + public IExpression withBase(IFrame frame, String prefix) { + return new Negation(exp.withBase(frame, prefix)); + } + + @Override + public Object getPossibleConstant() { + return null; + } + + @Override + public IExpression rewrite(IFrame frame, Map copies) { + exp = exp.rewrite(frame, copies); + return this; + } + } diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/NodeClass.java b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/NodeClass.java index 2d8c909a..33415ec5 100644 --- a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/NodeClass.java +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/NodeClass.java @@ -22,6 +22,7 @@ public enum NodeClass { while_statement, statement, name, + element, element_list, element_modification, function_arguments, @@ -48,7 +49,9 @@ public enum NodeClass { add_op, mul_op, rel_op, - der_initial; + der_initial, + output_expression_list, + extends_clause; private NodeClass() { Parser.nodeNameMap.put(toString(), this); diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/NotEquals.java b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/NotEquals.java index e5bee880..41ca66a5 100644 --- a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/NotEquals.java +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/NotEquals.java @@ -10,6 +10,8 @@ *******************************************************************************/ package fi.semantum.sysdyn.solver; +import java.util.Map; + public class NotEquals implements IExpression { public IExpression exp1; @@ -30,5 +32,21 @@ public class NotEquals implements IExpression { return ((Double)exp1.evaluate(environment)) != ((Double)exp2.evaluate(environment)); } + @Override + public IExpression withBase(IFrame frame, String prefix) { + return new NotEquals(exp1.withBase(frame, prefix), exp2.withBase(frame, prefix)); + } + @Override + public Object getPossibleConstant() { + return null; + } + + @Override + public IExpression rewrite(IFrame frame, Map copies) { + exp1 = exp1.rewrite(frame, copies); + exp2 = exp2.rewrite(frame, copies); + return this; + } + } diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/NullModification.java b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/NullModification.java new file mode 100644 index 00000000..287d6180 --- /dev/null +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/NullModification.java @@ -0,0 +1,27 @@ +package fi.semantum.sysdyn.solver; + +import java.util.Map; + +public class NullModification implements IExpression { + + @Override + public Object evaluate(IEnvironment environment) { + return null; + } + + @Override + public IExpression withBase(IFrame frame, String prefix) { + return this; + } + + @Override + public Object getPossibleConstant() { + return this; + } + + @Override + public IExpression rewrite(IFrame frame, Map copies) { + return this; + } + +} diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Or.java b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Or.java index 1e72912a..e08c3282 100644 --- a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Or.java +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Or.java @@ -11,22 +11,23 @@ package fi.semantum.sysdyn.solver; import java.util.ArrayList; +import java.util.Map; public class Or implements IExpression { - public ArrayList exps; + public IExpression[] exps; public Or(ArrayList exps) { - this.exps = exps; + this.exps = exps.toArray(new IExpression[exps.size()]); } @Override public String toString() { StringBuilder b = new StringBuilder(); - b.append(exps.get(0)); - for(int i=1;i ne = new ArrayList(); + for(IExpression e : exps) ne.add(e.withBase(frame, prefix)); + return new Or(ne); + } + + @Override + public Object getPossibleConstant() { + return null; + } + + @Override + public IExpression rewrite(IFrame frame, Map copies) { + for(int i=0;i copies) { + throw new UnsupportedOperationException(); + } + } diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Parser.java b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Parser.java index 0b1f5aad..cbfac5e7 100644 --- a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Parser.java +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Parser.java @@ -11,19 +11,25 @@ *******************************************************************************/ package fi.semantum.sysdyn.solver; +import java.io.File; +import java.io.StringReader; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; +import org.simantics.utils.FileUtils; + +import fi.semantum.sysdyn.solver.Model.Globals; +import fi.semantum.sysdyn.solver.parser.ModelParser; import fi.semantum.sysdyn.solver.parser.SimpleNode; public class Parser { - public IFrame currentFrame; +// public IFrame currentFrame; private int PRINT = 0; - public Object walk(SimpleNode n, int indent, Model model) { + public Object walk(SimpleNode n, int indent, IFrame model) { Object result = walk_(n, indent, model); if(PRINT > 0) { for(int i=0;i nodeNameMap = new HashMap(); - public Object walk_(SimpleNode n, int indent, Model model) { + public Object walk_(SimpleNode n, int indent, IFrame frame) { + Model model = frame instanceof Model ? (Model)frame : null; + // TODO: most of this should probably be implemented in the parser NodeClass nc = NodeClass.of(n.toString()); if (nc == null) { - if(n.jjtGetNumChildren() == 1) return walk((SimpleNode)n.jjtGetChild(0), indent+2, model); + if(n.jjtGetNumChildren() == 1) return walk((SimpleNode)n.jjtGetChild(0), indent+2, frame); // not sure if this is ever called for(int i=0;i comps = new ArrayList(); for(int i=0;i indices = new ArrayList(); for(int i=0;i indices2 = (ArrayList)walk((SimpleNode)n.jjtGetChild(0), indent+2, model); + ArrayList indices2 = (ArrayList)walk((SimpleNode)n.jjtGetChild(0), indent+2, frame); ArrayList stms = new ArrayList(); for(int i=1;i thens = new ArrayList(); ArrayList elses = new ArrayList(); for(int i=1;i whiles = new ArrayList(); for(int i=1;i vars = (ArrayList)walk((SimpleNode)n.jjtGetChild(0), indent+2, frame); + Variable fn = (Variable)walk((SimpleNode)n.jjtGetChild(1), indent+2, frame); + ArgumentList args = (ArgumentList)walk((SimpleNode)n.jjtGetChild(2), indent+2, frame); + return new MultiStatement(vars, fn, args); + } else { + throw new IllegalStateException(); + } + case output_expression_list: + ArrayList vars = new ArrayList(); + for(int i=0;i elements = new ArrayList(); for(int i=0;i arguments = new ArrayList(); + for(int i=0;i args = new ArrayList(); for(int i=0;i statements = new ArrayList(); for(int i=0;i clauses = new ArrayList(); for(int i=declarationStart;i())); - if(currentFrame == model) model.variables.add(vd); - clauses.add(vd); + + boolean wasClass = model == null ? false : model.instantiateClass(type_specifier, decl, frame); + if(!wasClass) { + + if(decl.modification instanceof ArgumentList) { + VariableDeclaration vd = new VariableDeclaration(decl.variable, type_prefix, type_specifier, (ArgumentList)decl.modification); + if(model != null) + model.addVariable(vd); + clauses.add(vd); + } else if (decl.modification instanceof IExpression) { + ArrayList as = new ArrayList(); + as.add(new Argument("", (IExpression)decl.modification)); + ArgumentList al = new ArgumentList(as); + VariableDeclaration vd = new VariableDeclaration(decl.variable, type_prefix, type_specifier, al); + if(model != null) + model.addVariable(vd); + clauses.add(vd); + } else { + VariableDeclaration vd = new VariableDeclaration(decl.variable, type_prefix, type_specifier, new ArgumentList(new ArrayList())); + if(model != null) + model.addVariable(vd); + clauses.add(vd); + } + } + } } return clauses; case component_declaration: - return (Declaration)walk((SimpleNode)n.jjtGetChild(0), indent+2, model); + return (Declaration)walk((SimpleNode)n.jjtGetChild(0), indent+2, frame); case array_subscripts: IExpression[] subs = new IExpression[n.jjtGetNumChildren()]; for(int i=0;i stms2 = new ArrayList(); Function function = new Function(functionName, new StatementList(stms2)); - currentFrame = function; - ArrayList composition = (ArrayList)walk(child, indent+2, model); + ArrayList composition = (ArrayList)walk(child, indent+2, function); for(int i=1;i declarations = (ArrayList)composition.get(i); for(Object os_ : declarations) { - ArrayList os = (ArrayList)os_; - for(Object o : os) { - VariableDeclaration decl = (VariableDeclaration)o; - function.internals.add(decl); + if(os_ instanceof VariableDeclaration) { + VariableDeclaration decl = (VariableDeclaration)os_; + if("input".equals(decl.direction)) function.inputs.add(decl); + else if ("output".equals(decl.direction)) function.outputs.add(decl); + else throw new IllegalStateException(); + } else { + ArrayList os = (ArrayList)os_; + for(Object o : os) { + VariableDeclaration decl = (VariableDeclaration)o; + function.internals.add(decl); + } } } } } ArrayList declarations = (ArrayList)composition.get(0); for(Object os_ : declarations) { - ArrayList os = (ArrayList)os_; - for(Object o : os) { - VariableDeclaration decl = (VariableDeclaration)o; + if(os_ instanceof VariableDeclaration) { + VariableDeclaration decl = (VariableDeclaration)os_; if("input".equals(decl.direction)) function.inputs.add(decl); else if ("output".equals(decl.direction)) function.outputs.add(decl); else throw new IllegalStateException(); + } else { + ArrayList os = (ArrayList)os_; + for(Object o : os) { + VariableDeclaration decl = (VariableDeclaration)o; + if("input".equals(decl.direction)) function.inputs.add(decl); + else if ("output".equals(decl.direction)) function.outputs.add(decl); + else throw new IllegalStateException(); + } } } model.functions.put(functionName, function); - currentFrame = model; return function; + + } else if("model".equals(n.op)) { + + if(n.jjtGetNumChildren() == 1) { + return walk((SimpleNode)n.jjtGetChild(0), indent+2, frame); + } else { + System.err.println("undefined children for class_definition model"); + } + return null; + + } else if("class".equals(n.op)) { + + SimpleNode specifier = (SimpleNode)n.jjtGetChild(0); + Model clazz = new Model(model.globals, specifier.op, false); + model.globals.classes.put(specifier.op, clazz); + walk(specifier, indent+2, clazz); + + if(clazz.isEnumClass) { + Variable sizeVariable = new Variable(clazz, "size", null); + Variable elementsVariable = new Variable(clazz, "elements", new IExpression[] { new Constant(""+clazz.variables.size()) }); + clazz.parameters.add(new ParameterDeclaration(sizeVariable, sizeVariable.getPossibleConstant())); + clazz.parameters.add(new ParameterDeclaration(elementsVariable, elementsVariable.getPossibleConstant())); + } + + return null; + + } else { + System.err.println("class_definition " + n.op); } break; case array: - Array array = new Array(); if(n.jjtGetNumChildren() == 1) { - ArgumentList al = (ArgumentList)walk((SimpleNode)n.jjtGetChild(0), indent+2, model); - for(Argument arg : al.args) array.addElement(arg.modification); + ArgumentList al = (ArgumentList)walk((SimpleNode)n.jjtGetChild(0), indent+2, frame); + if("for".equals(al.op)) { + ForArray array = new ForArray(); + array.addElement(al.args[0].modification); + array.addElement(al.args[1]); + return array; + } else { + Array array = new Array(); + for(Argument arg : al.args) array.addElement(arg.modification); + return array; + } } - return array; case primary: if(n.op != null) { return Utils.parsePrimitive(n.op); } else { - return walk((SimpleNode)n.jjtGetChild(0), indent+2, model); + return walk((SimpleNode)n.jjtGetChild(0), indent+2, frame); } case component_reference: if(n.jjtGetNumChildren() == 1) { - return new Variable(currentFrame, n.op, (IExpression[])walk((SimpleNode)n.jjtGetChild(0), indent+2, model)); + return Variable.make(frame, n.op, (IExpression[])walk((SimpleNode)n.jjtGetChild(0), indent+2, frame)); } else { if ("time".equals(n.op)) { return new TimeVariable(); } - return new Variable(currentFrame, n.op, null); + return Variable.make(frame, n.op, null); } case relation: if(n.jjtGetNumChildren() == 3) { - IExpression exp1 = (IExpression)walk((SimpleNode)n.jjtGetChild(0), indent+2, model); - String op = (String)walk((SimpleNode)n.jjtGetChild(1), indent+2, model); - IExpression exp2 = (IExpression)walk((SimpleNode)n.jjtGetChild(2), indent+2, model); + IExpression exp1 = (IExpression)walk((SimpleNode)n.jjtGetChild(0), indent+2, frame); + String op = (String)walk((SimpleNode)n.jjtGetChild(1), indent+2, frame); + IExpression exp2 = (IExpression)walk((SimpleNode)n.jjtGetChild(2), indent+2, frame); String trimmed = op != null ? op.trim() : null; if("<".equals(trimmed)) { return new LessThan(exp1, exp2); @@ -306,13 +446,13 @@ public class Parser { } else return null; } else { - return walk((SimpleNode)n.jjtGetChild(0), indent+2, model); + return walk((SimpleNode)n.jjtGetChild(0), indent+2, frame); } case simple_expression: - if(n.jjtGetNumChildren() == 1) return walk((SimpleNode)n.jjtGetChild(0), indent+2, model); + if(n.jjtGetNumChildren() == 1) return walk((SimpleNode)n.jjtGetChild(0), indent+2, frame); else if(n.jjtGetNumChildren() == 2) { - IExpression start = (IExpression)walk((SimpleNode)n.jjtGetChild(0), indent+2, model); - IExpression end = (IExpression)walk((SimpleNode)n.jjtGetChild(1), indent+2, model); + IExpression start = (IExpression)walk((SimpleNode)n.jjtGetChild(0), indent+2, frame); + IExpression end = (IExpression)walk((SimpleNode)n.jjtGetChild(1), indent+2, frame); return new ArraySliceExpression(start, end); } else { throw new UnsupportedOperationException(); @@ -321,57 +461,67 @@ public class Parser { if(n.jjtGetNumChildren() > 1) { ArrayList logs = new ArrayList(); for(int i=0;i 1) { ArrayList terms = new ArrayList(); for(int i=0;i 1) { - IExpression left = (IExpression)walk((SimpleNode)n.jjtGetChild(0), indent+2, model); - for(int i=1;i 1) { - IExpression term = (IExpression)walk((SimpleNode)n.jjtGetChild(0), indent+2, model); + IExpression term = (IExpression)walk((SimpleNode)n.jjtGetChild(0), indent+2, frame); for(int i=1;i 0) { + while(condition > 0 && loops++ < 50) { - koss = 0; +// System.err.println("== LOOP " + loops + " =="); + + condition = 0; for(ParameterDeclaration pd : model.parameters) { try { if(!pd.assigned) { - pd.variable.assign(env, pd.modification.evaluate(env)); + pd.variable.assign(env, null, pd.modification.evaluate(env)); pd.assigned = true; } } catch (Exception e) { - koss++; + condition++; if(PRINT_EXCEPTIONS) { e.printStackTrace(); System.err.println("failed to assign " + pd.variable.toString()); @@ -97,9 +117,19 @@ public class Solver { try { if(!vd.assigned) { for(Argument arg : vd.modification.args) { - if("start".equals(arg.name)) { + if(arg.name.endsWith("start")) { Object value = arg.modification.evaluate(env); - vd.variable.assign(env, value); + if(vd.variable.base.dimension() == 1) { + vd.variable.assign(env, null, value); + } else { + if(value instanceof Double) { + Array array = new Array(); + for(int i=0;i values() { - return env.getValueMap(); + public double[] values() { + return env.getValueArray(); } public void step() { @@ -162,7 +200,7 @@ public class Solver { newValues[i] = assignments[i].expression.evaluate(env); } for(int i=0;i copies) { + exp1 = exp1.rewrite(frame, copies); + exp2 = exp2.rewrite(frame, copies); + return this; + } + } diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/TimeVariable.java b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/TimeVariable.java index c6a72515..d2d3e4c6 100644 --- a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/TimeVariable.java +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/TimeVariable.java @@ -10,6 +10,8 @@ *******************************************************************************/ package fi.semantum.sysdyn.solver; +import java.util.Map; + public class TimeVariable implements IExpression { @Override @@ -23,4 +25,19 @@ public class TimeVariable implements IExpression { return "time"; } + @Override + public IExpression withBase(IFrame frame, String prefix) { + return this; + } + + @Override + public Object getPossibleConstant() { + return null; + } + + @Override + public IExpression rewrite(IFrame frame, Map copies) { + return this; + } + } diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Variable.java b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Variable.java index 05531049..183d0cc3 100644 --- a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Variable.java +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/Variable.java @@ -11,6 +11,10 @@ *******************************************************************************/ package fi.semantum.sysdyn.solver; +import java.util.Map; + + + public class Variable implements IExpression { public VariableBase base; @@ -21,30 +25,21 @@ public class Variable implements IExpression { this.subscripts = subscripts; } + public static Object make(IFrame frame, String name, IExpression[] subscripts) { +// Array enumElements = enumerationElements(frame, name); +// if(enumElements != null) return enumElements; +// Constant enumSize = enumerationSize(frame, name); +// if(enumSize != null) return enumSize; + return new Variable(frame, name, subscripts); + } + public Variable(VariableBase base) { this.base = base; } - private int makeSubscriptIndex(IEnvironment env) { - if(base.dimensions == null) return 0; - int result = 0; - for(int i=0;i copies) { + VariableBase copy = copies.get(base.name); + if(copy == null) { + if(subscripts != null) { + for(int i=0;i dimensions[i]) dimensions[i] = index; + public VariableBase(String name, int index, int[] dimensions) { + this.name = name; + this.index = index; + this.dimensions = dimensions; + } + public boolean tellSubscripts(IExpression[] e, IExpression modification) { + + if(dimensions != UNINIT) return true; + + if(e != null) { + + if(dimensions == UNINIT) + dimensions = new int[e.length]; + + if(e.length == 0) + throw new IllegalStateException(); + + for(int i=0;i dimensions[i]) dimensions[i] = index; + } } + + } else { + + dimensions = null; + } + + return dimensions != UNINIT; + } public int dimension() { if(dimensions == null) return 1; @@ -48,4 +88,130 @@ public class VariableBase { for(int d : dimensions) if(d == -1) return true; return false; } + + VariableBase withBase(String prefix) { + return new VariableBase(prefix+name, index, dimensions); + } + + private int makeSubscriptIndex(IEnvironment env, IExpression[] subscripts) { + if(dimensions == null) return 0; + int result = 0; + for(int i=0;i 1) { + if(subscripts != null) { + + Slice[] sub = SolverUtils.parseSubscripts(environment, subscripts); + if(SolverUtils.isSlice(sub)) { + Array arr = new Array(); + intoArray(environment, index, 0, arr); + return arr.slice(sub); + } else { + return environment.getValue(index(environment, subscripts)); + } + + } else { + Array array = new Array(); + intoArray(environment, index, 0, array); + return array; + } + } + + Object result = environment.getNamedValue(name); + if(result == null) result = environment.getValue(index(environment, subscripts)); + if(result == null) throw new UnassignedVariableException("No value for " + name); + + if(SolverUtils.isArray(dimensions) && subscripts == null) { + return new Array().addElement(result); + } else { + return result; + } + + } + } + + public IExpression getPossibleConstant() { + return null; + } + } diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/VariableDeclaration.java b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/VariableDeclaration.java index 02043c75..08c8a49d 100644 --- a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/VariableDeclaration.java +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/VariableDeclaration.java @@ -10,6 +10,8 @@ *******************************************************************************/ package fi.semantum.sysdyn.solver; +import java.util.Map; + public class VariableDeclaration implements IExpression { @@ -36,4 +38,19 @@ public class VariableDeclaration implements IExpression { throw new UnsupportedOperationException(); } + @Override + public IExpression withBase(IFrame frame, String prefix) { + throw new UnsupportedOperationException(); + } + + @Override + public Object getPossibleConstant() { + return null; + } + + @Override + public IExpression rewrite(IFrame frame, Map copies) { + throw new UnsupportedOperationException(); + } + } diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/parser/ModelParser.java b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/parser/ModelParser.java index 828459b9..99bdaaee 100644 --- a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/parser/ModelParser.java +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/parser/ModelParser.java @@ -189,9 +189,11 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 34: jj_consume_token(34); + jjtn000.op = "class"; break; case 7: jj_consume_token(7); + jjtn000.op = "model"; break; case 61: jj_consume_token(61); @@ -293,21 +295,6 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo } comment(); } else if (jj_2_3(3)) { - jj_consume_token(IDENT); - jj_consume_token(88); - jj_consume_token(40); - jj_consume_token(62); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case IDENT: - enum_list(); - break; - default: - jj_la1[10] = jj_gen; - ; - } - jj_consume_token(63); - comment(); - } else if (jj_2_4(3)) { jj_consume_token(IDENT); jj_consume_token(88); jj_consume_token(58); @@ -322,7 +309,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo ; break; default: - jj_la1[11] = jj_gen; + jj_la1[10] = jj_gen; break label_2; } jj_consume_token(71); @@ -330,29 +317,24 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo } jj_consume_token(63); comment(); - } else { + } else if (jj_2_4(3)) { + jj_consume_token(IDENT); + jj_consume_token(88); + jj_consume_token(40); + jj_consume_token(62); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case 55: - jj_consume_token(55); - jj_consume_token(IDENT); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case 62: - class_modification(); - break; - default: - jj_la1[12] = jj_gen; - ; - } - string_comment(); - composition(); - jj_consume_token(35); - jj_consume_token(IDENT); + case IDENT: + enum_list(); break; default: - jj_la1[13] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); + jj_la1[11] = jj_gen; + ; } + jj_consume_token(63); + comment(); + } else { + jj_consume_token(-1); + throw new ParseException(); } } catch (Throwable jjte000) { if (jjtc000) { @@ -417,7 +399,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo ; break; default: - jj_la1[14] = jj_gen; + jj_la1[12] = jj_gen; break label_3; } jj_consume_token(71); @@ -520,7 +502,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo ; break; default: - jj_la1[15] = jj_gen; + jj_la1[13] = jj_gen; break label_4; } if (jj_2_5(2)) { @@ -540,7 +522,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo algorithm_section(); break; default: - jj_la1[16] = jj_gen; + jj_la1[14] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -554,7 +536,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo language_specification(); break; default: - jj_la1[17] = jj_gen; + jj_la1[15] = jj_gen; ; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -563,7 +545,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo external_function_call(); break; default: - jj_la1[18] = jj_gen; + jj_la1[16] = jj_gen; ; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -571,13 +553,13 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo annotation(); break; default: - jj_la1[19] = jj_gen; + jj_la1[17] = jj_gen; ; } jj_consume_token(70); break; default: - jj_la1[20] = jj_gen; + jj_la1[18] = jj_gen; ; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -586,7 +568,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo jj_consume_token(70); break; default: - jj_la1[21] = jj_gen; + jj_la1[19] = jj_gen; ; } } catch (Throwable jjte000) { @@ -637,7 +619,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo jj_consume_token(88); break; default: - jj_la1[22] = jj_gen; + jj_la1[20] = jj_gen; ; } jj_consume_token(IDENT); @@ -665,7 +647,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo expression_list(); break; default: - jj_la1[23] = jj_gen; + jj_la1[21] = jj_gen; ; } jj_consume_token(63); @@ -732,7 +714,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo ; break; default: - jj_la1[24] = jj_gen; + jj_la1[22] = jj_gen; break label_5; } element(); @@ -768,9 +750,15 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 36: import_clause(); + jjtree.closeNodeScope(jjtn000, true); + jjtc000 = false; + {if (true) return jjtn000;} break; case 55: extends_clause(); + jjtree.closeNodeScope(jjtn000, true); + jjtc000 = false; + {if (true) return jjtn000;} break; case 5: case 7: @@ -805,7 +793,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo jj_consume_token(8); break; default: - jj_la1[25] = jj_gen; + jj_la1[23] = jj_gen; ; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -813,23 +801,25 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo jj_consume_token(11); break; default: - jj_la1[26] = jj_gen; + jj_la1[24] = jj_gen; ; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 51: jj_consume_token(51); + jjtn000.op = "inner"; break; default: - jj_la1[27] = jj_gen; + jj_la1[25] = jj_gen; ; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 27: jj_consume_token(27); + jjtn000.op = "outer"; break; default: - jj_la1[28] = jj_gen; + jj_la1[26] = jj_gen; ; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -885,7 +875,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo component_clause(); break; default: - jj_la1[29] = jj_gen; + jj_la1[27] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -921,7 +911,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo component_clause(); break; default: - jj_la1[30] = jj_gen; + jj_la1[28] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -931,12 +921,12 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo comment(); break; default: - jj_la1[31] = jj_gen; + jj_la1[29] = jj_gen; ; } break; default: - jj_la1[32] = jj_gen; + jj_la1[30] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -945,7 +935,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo {if (true) return jjtn000;} break; default: - jj_la1[33] = jj_gen; + jj_la1[31] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -993,12 +983,12 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo jj_consume_token(82); break; default: - jj_la1[34] = jj_gen; + jj_la1[32] = jj_gen; ; } break; default: - jj_la1[35] = jj_gen; + jj_la1[33] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -1039,7 +1029,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo class_modification(); break; default: - jj_la1[36] = jj_gen; + jj_la1[34] = jj_gen; ; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -1047,7 +1037,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo annotation(); break; default: - jj_la1[37] = jj_gen; + jj_la1[35] = jj_gen; ; } } catch (Throwable jjte000) { @@ -1084,7 +1074,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo class_modification(); break; default: - jj_la1[38] = jj_gen; + jj_la1[36] = jj_gen; ; } } catch (Throwable jjte000) { @@ -1125,7 +1115,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo array_subscripts(); break; default: - jj_la1[39] = jj_gen; + jj_la1[37] = jj_gen; ; } componentList = component_list(); @@ -1180,13 +1170,13 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo jj_consume_token(23); break; default: - jj_la1[40] = jj_gen; + jj_la1[38] = jj_gen; jj_consume_token(-1); throw new ParseException(); } break; default: - jj_la1[41] = jj_gen; + jj_la1[39] = jj_gen; ; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -1207,13 +1197,13 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo jjtn000.op = "constant"; break; default: - jj_la1[42] = jj_gen; + jj_la1[40] = jj_gen; jj_consume_token(-1); throw new ParseException(); } break; default: - jj_la1[43] = jj_gen; + jj_la1[41] = jj_gen; ; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -1229,13 +1219,13 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo type = InterfaceVariableType.INPUT; jjtn000.op = "input"; break; default: - jj_la1[44] = jj_gen; + jj_la1[42] = jj_gen; jj_consume_token(-1); throw new ParseException(); } break; default: - jj_la1[45] = jj_gen; + jj_la1[43] = jj_gen; ; } jjtree.closeNodeScope(jjtn000, true); @@ -1299,7 +1289,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo ; break; default: - jj_la1[46] = jj_gen; + jj_la1[44] = jj_gen; break label_6; } jj_consume_token(71); @@ -1345,7 +1335,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo conditional_attribute(); break; default: - jj_la1[47] = jj_gen; + jj_la1[45] = jj_gen; ; } ret.description = comment(); @@ -1418,7 +1408,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo array_subscripts(); break; default: - jj_la1[48] = jj_gen; + jj_la1[46] = jj_gen; ; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -1428,7 +1418,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo ret.optional = modification(); break; default: - jj_la1[49] = jj_gen; + jj_la1[47] = jj_gen; ; } jjtree.closeNodeScope(jjtn000, true); @@ -1472,7 +1462,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo expression(); break; default: - jj_la1[50] = jj_gen; + jj_la1[48] = jj_gen; ; } break; @@ -1487,7 +1477,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo optional = true; break; default: - jj_la1[51] = jj_gen; + jj_la1[49] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -1533,7 +1523,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo argument_list(); break; default: - jj_la1[52] = jj_gen; + jj_la1[50] = jj_gen; ; } jj_consume_token(63); @@ -1572,7 +1562,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo ; break; default: - jj_la1[53] = jj_gen; + jj_la1[51] = jj_gen; break label_7; } jj_consume_token(71); @@ -1617,7 +1607,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo element_redeclaration(); break; default: - jj_la1[54] = jj_gen; + jj_la1[52] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -1653,7 +1643,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo jj_consume_token(10); break; default: - jj_la1[55] = jj_gen; + jj_la1[53] = jj_gen; ; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -1661,7 +1651,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo jj_consume_token(11); break; default: - jj_la1[56] = jj_gen; + jj_la1[54] = jj_gen; ; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -1673,7 +1663,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo element_replaceable(); break; default: - jj_la1[57] = jj_gen; + jj_la1[55] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -1712,7 +1702,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo modification(); break; default: - jj_la1[58] = jj_gen; + jj_la1[56] = jj_gen; ; } string_comment(); @@ -1749,7 +1739,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo jj_consume_token(10); break; default: - jj_la1[59] = jj_gen; + jj_la1[57] = jj_gen; ; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -1757,7 +1747,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo jj_consume_token(11); break; default: - jj_la1[60] = jj_gen; + jj_la1[58] = jj_gen; ; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -1813,7 +1803,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo component_clause1(); break; default: - jj_la1[61] = jj_gen; + jj_la1[59] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -1822,7 +1812,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo element_replaceable(); break; default: - jj_la1[62] = jj_gen; + jj_la1[60] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -1883,7 +1873,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo component_clause1(); break; default: - jj_la1[63] = jj_gen; + jj_la1[61] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -1892,7 +1882,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo constraining_clause(); break; default: - jj_la1[64] = jj_gen; + jj_la1[62] = jj_gen; ; } } catch (Throwable jjte000) { @@ -1988,7 +1978,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo jjtn000.op = "initial"; break; default: - jj_la1[65] = jj_gen; + jj_la1[63] = jj_gen; ; } jj_consume_token(45); @@ -2034,7 +2024,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo jj_consume_token(46); break; default: - jj_la1[66] = jj_gen; + jj_la1[64] = jj_gen; ; } jj_consume_token(4); @@ -2053,7 +2043,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo ; break; default: - jj_la1[67] = jj_gen; + jj_la1[65] = jj_gen; break label_9; } statement(); @@ -2137,7 +2127,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo function_call_args(); break; default: - jj_la1[68] = jj_gen; + jj_la1[66] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2187,7 +2177,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo function_call_args(); break; default: - jj_la1[69] = jj_gen; + jj_la1[67] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2219,7 +2209,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo when_statement(); break; default: - jj_la1[70] = jj_gen; + jj_la1[68] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2282,7 +2272,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo ; break; default: - jj_la1[71] = jj_gen; + jj_la1[69] = jj_gen; break label_10; } equation(); @@ -2295,7 +2285,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo ; break; default: - jj_la1[72] = jj_gen; + jj_la1[70] = jj_gen; break label_11; } jj_consume_token(20); @@ -2329,7 +2319,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo ; break; default: - jj_la1[73] = jj_gen; + jj_la1[71] = jj_gen; break label_12; } equation(); @@ -2367,7 +2357,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo ; break; default: - jj_la1[74] = jj_gen; + jj_la1[72] = jj_gen; break label_13; } equation(); @@ -2375,7 +2365,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo } break; default: - jj_la1[75] = jj_gen; + jj_la1[73] = jj_gen; ; } jj_consume_token(35); @@ -2509,7 +2499,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo ; break; default: - jj_la1[76] = jj_gen; + jj_la1[74] = jj_gen; break label_14; } then_statement(); @@ -2522,7 +2512,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo ; break; default: - jj_la1[77] = jj_gen; + jj_la1[75] = jj_gen; break label_15; } jj_consume_token(20); @@ -2543,7 +2533,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo ; break; default: - jj_la1[78] = jj_gen; + jj_la1[76] = jj_gen; break label_16; } elseif_statement(); @@ -2568,7 +2558,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo ; break; default: - jj_la1[79] = jj_gen; + jj_la1[77] = jj_gen; break label_17; } else_statement(); @@ -2576,7 +2566,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo } break; default: - jj_la1[80] = jj_gen; + jj_la1[78] = jj_gen; ; } jj_consume_token(35); @@ -2639,7 +2629,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo ; break; default: - jj_la1[81] = jj_gen; + jj_la1[79] = jj_gen; break label_18; } equation(); @@ -2692,7 +2682,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo ; break; default: - jj_la1[82] = jj_gen; + jj_la1[80] = jj_gen; break label_19; } statement(); @@ -2735,7 +2725,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo ; break; default: - jj_la1[83] = jj_gen; + jj_la1[81] = jj_gen; break label_20; } jj_consume_token(71); @@ -2777,7 +2767,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo expression(); break; default: - jj_la1[84] = jj_gen; + jj_la1[82] = jj_gen; ; } } catch (Throwable jjte000) { @@ -2825,7 +2815,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo ; break; default: - jj_la1[85] = jj_gen; + jj_la1[83] = jj_gen; break label_21; } statement(); @@ -2891,7 +2881,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo ; break; default: - jj_la1[86] = jj_gen; + jj_la1[84] = jj_gen; break label_22; } equation(); @@ -2904,7 +2894,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo ; break; default: - jj_la1[87] = jj_gen; + jj_la1[85] = jj_gen; break label_23; } jj_consume_token(25); @@ -2938,7 +2928,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo ; break; default: - jj_la1[88] = jj_gen; + jj_la1[86] = jj_gen; break label_24; } equation(); @@ -2992,7 +2982,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo ; break; default: - jj_la1[89] = jj_gen; + jj_la1[87] = jj_gen; break label_25; } statement(); @@ -3005,7 +2995,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo ; break; default: - jj_la1[90] = jj_gen; + jj_la1[88] = jj_gen; break label_26; } jj_consume_token(25); @@ -3026,7 +3016,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo ; break; default: - jj_la1[91] = jj_gen; + jj_la1[89] = jj_gen; break label_27; } statement(); @@ -3130,7 +3120,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo ; break; default: - jj_la1[92] = jj_gen; + jj_la1[90] = jj_gen; break label_28; } jj_consume_token(20); @@ -3143,7 +3133,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo jj_consume_token(0); break; default: - jj_la1[93] = jj_gen; + jj_la1[91] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -3185,7 +3175,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo ; break; default: - jj_la1[94] = jj_gen; + jj_la1[92] = jj_gen; break label_29; } jj_consume_token(20); @@ -3247,7 +3237,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo if_expression(); break; default: - jj_la1[95] = jj_gen; + jj_la1[93] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -3289,12 +3279,12 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo logical_expression(); break; default: - jj_la1[96] = jj_gen; + jj_la1[94] = jj_gen; ; } break; default: - jj_la1[97] = jj_gen; + jj_la1[95] = jj_gen; ; } } catch (Throwable jjte000) { @@ -3332,7 +3322,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo ; break; default: - jj_la1[98] = jj_gen; + jj_la1[96] = jj_gen; break label_30; } jj_consume_token(22); @@ -3373,7 +3363,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo ; break; default: - jj_la1[99] = jj_gen; + jj_la1[97] = jj_gen; break label_31; } jj_consume_token(9); @@ -3411,7 +3401,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo jj_consume_token(12); break; default: - jj_la1[100] = jj_gen; + jj_la1[98] = jj_gen; ; } relation(); @@ -3454,7 +3444,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo arithmetic_expression(); break; default: - jj_la1[101] = jj_gen; + jj_la1[99] = jj_gen; ; } } catch (Throwable jjte000) { @@ -3522,7 +3512,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo jjtn000.op = "<>"; break; default: - jj_la1[102] = jj_gen; + jj_la1[100] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -3547,7 +3537,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo add_op(); break; default: - jj_la1[103] = jj_gen; + jj_la1[101] = jj_gen; ; } term(); @@ -3561,7 +3551,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo ; break; default: - jj_la1[104] = jj_gen; + jj_la1[102] = jj_gen; break label_32; } add_op(); @@ -3614,7 +3604,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo jj_consume_token(81); break; default: - jj_la1[105] = jj_gen; + jj_la1[103] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -3642,7 +3632,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo ; break; default: - jj_la1[106] = jj_gen; + jj_la1[104] = jj_gen; break label_33; } mul_op(); @@ -3690,12 +3680,15 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo break; case 84: jj_consume_token(84); + jjtree.closeNodeScope(jjtn000, true); + jjtc000 = false; + jjtn000.op = ".*"; break; case 85: jj_consume_token(85); break; default: - jj_la1[107] = jj_gen; + jj_la1[105] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -3716,22 +3709,11 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 86: case 87: - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case 86: - jj_consume_token(86); - break; - case 87: - jj_consume_token(87); - primary(); - break; - default: - jj_la1[108] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } + factor_op(); + primary(); break; default: - jj_la1[109] = jj_gen; + jj_la1[106] = jj_gen; ; } } catch (Throwable jjte000) { @@ -3755,6 +3737,37 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo } } + final public void factor_op() throws ParseException { + /*@bgen(jjtree) factor_op */ + SimpleNode jjtn000 = new SimpleNode(JJTFACTOR_OP); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case 86: + jj_consume_token(86); + jjtree.closeNodeScope(jjtn000, true); + jjtc000 = false; + jjtn000.op = "^"; + break; + case 87: + jj_consume_token(87); + jjtree.closeNodeScope(jjtn000, true); + jjtc000 = false; + jjtn000.op = ".^"; + break; + default: + jj_la1[107] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } + } + final public void der_initial() throws ParseException { /*@bgen(jjtree) der_initial */ SimpleNode jjtn000 = new SimpleNode(JJTDER_INITIAL); @@ -3776,7 +3789,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo jjtn000.op = "initial"; break; default: - jj_la1[110] = jj_gen; + jj_la1[108] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -3816,7 +3829,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo ; break; default: - jj_la1[111] = jj_gen; + jj_la1[109] = jj_gen; break label_34; } jj_consume_token(70); @@ -3911,7 +3924,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo jjtn000.op = token.image; break; default: - jj_la1[112] = jj_gen; + jj_la1[110] = jj_gen; if (jj_2_9(2147483647)) { der_initial(); } else { @@ -3937,7 +3950,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo jj_consume_token(35); break; default: - jj_la1[113] = jj_gen; + jj_la1[111] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -3976,7 +3989,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo ret += "."; break; default: - jj_la1[114] = jj_gen; + jj_la1[112] = jj_gen; ; } jj_consume_token(IDENT); @@ -3988,7 +4001,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo ; break; default: - jj_la1[115] = jj_gen; + jj_la1[113] = jj_gen; break label_35; } jj_consume_token(68); @@ -4018,7 +4031,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo jj_consume_token(68); break; default: - jj_la1[116] = jj_gen; + jj_la1[114] = jj_gen; ; } t = jj_consume_token(IDENT); @@ -4028,7 +4041,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo array_subscripts(); break; default: - jj_la1[117] = jj_gen; + jj_la1[115] = jj_gen; ; } label_36: @@ -4038,7 +4051,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo ; break; default: - jj_la1[118] = jj_gen; + jj_la1[116] = jj_gen; break label_36; } jj_consume_token(68); @@ -4048,7 +4061,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo array_subscripts(); break; default: - jj_la1[119] = jj_gen; + jj_la1[117] = jj_gen; ; } } @@ -4103,7 +4116,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo function_arguments(); break; default: - jj_la1[120] = jj_gen; + jj_la1[118] = jj_gen; ; } jj_consume_token(63); @@ -4147,15 +4160,16 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo case 21: jj_consume_token(21); for_indices(); + jjtn000.op = "for"; break; default: - jj_la1[121] = jj_gen; + jj_la1[119] = jj_gen; jj_consume_token(-1); throw new ParseException(); } break; default: - jj_la1[122] = jj_gen; + jj_la1[120] = jj_gen; ; } } else { @@ -4164,7 +4178,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo named_arguments(); break; default: - jj_la1[123] = jj_gen; + jj_la1[121] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -4203,7 +4217,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo named_arguments(); break; default: - jj_la1[124] = jj_gen; + jj_la1[122] = jj_gen; ; } } catch (Throwable jjte000) { @@ -4286,7 +4300,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo expression(); break; default: - jj_la1[125] = jj_gen; + jj_la1[123] = jj_gen; ; } label_37: @@ -4296,7 +4310,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo ; break; default: - jj_la1[126] = jj_gen; + jj_la1[124] = jj_gen; break label_37; } jj_consume_token(71); @@ -4323,7 +4337,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo expression(); break; default: - jj_la1[127] = jj_gen; + jj_la1[125] = jj_gen; ; } } @@ -4362,7 +4376,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo ; break; default: - jj_la1[128] = jj_gen; + jj_la1[126] = jj_gen; break label_38; } jj_consume_token(71); @@ -4404,7 +4418,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo ; break; default: - jj_la1[129] = jj_gen; + jj_la1[127] = jj_gen; break label_39; } jj_consume_token(71); @@ -4467,7 +4481,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo expression(); break; default: - jj_la1[130] = jj_gen; + jj_la1[128] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -4501,7 +4515,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo annotation(); break; default: - jj_la1[131] = jj_gen; + jj_la1[129] = jj_gen; ; } {if (true) return ret;} @@ -4521,7 +4535,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo ; break; default: - jj_la1[132] = jj_gen; + jj_la1[130] = jj_gen; break label_40; } jj_consume_token(78); @@ -4531,7 +4545,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo } break; default: - jj_la1[133] = jj_gen; + jj_la1[131] = jj_gen; ; } {if (true) return ret;} @@ -4637,50 +4651,41 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo finally { jj_save(9, xla); } } - private boolean jj_3_10() { - if (jj_3R_47()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_48()) jj_scanpos = xsp; - return false; - } - - private boolean jj_3R_158() { - if (jj_3R_157()) return true; - return false; - } - - private boolean jj_3R_157() { + private boolean jj_3R_74() { + if (jj_scan_token(62)) return true; Token xsp; xsp = jj_scanpos; - if (jj_3_10()) { - jj_scanpos = xsp; - if (jj_3R_161()) return true; - } + if (jj_3R_165()) jj_scanpos = xsp; + if (jj_scan_token(63)) return true; return false; } private boolean jj_3R_85() { - if (jj_3R_93()) return true; + if (jj_3R_95()) return true; return false; } - private boolean jj_3R_120() { + private boolean jj_3R_124() { if (jj_scan_token(75)) return true; return false; } - private boolean jj_3R_125() { + private boolean jj_3R_129() { if (jj_scan_token(49)) return true; return false; } - private boolean jj_3R_74() { - if (jj_scan_token(62)) return true; + private boolean jj_3R_152() { Token xsp; xsp = jj_scanpos; - if (jj_3R_158()) jj_scanpos = xsp; - if (jj_scan_token(63)) return true; + if (jj_scan_token(68)) jj_scanpos = xsp; + if (jj_scan_token(IDENT)) return true; + xsp = jj_scanpos; + if (jj_3R_160()) jj_scanpos = xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_161()) { jj_scanpos = xsp; break; } + } return false; } @@ -4698,42 +4703,24 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo return false; } - private boolean jj_3R_103() { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(50)) jj_scanpos = xsp; - if (jj_scan_token(44)) return true; - return false; - } - - private boolean jj_3R_147() { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(68)) jj_scanpos = xsp; - if (jj_scan_token(IDENT)) return true; - xsp = jj_scanpos; - if (jj_3R_153()) jj_scanpos = xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_154()) { jj_scanpos = xsp; break; } - } - return false; - } - private boolean jj_3R_78() { if (jj_scan_token(68)) return true; if (jj_scan_token(IDENT)) return true; return false; } - private boolean jj_3R_151() { + private boolean jj_3R_158() { if (jj_scan_token(58)) return true; return false; } - private boolean jj_3R_71() { - if (jj_scan_token(21)) return true; - if (jj_3R_85()) return true; + private boolean jj_3R_106() { + if (jj_scan_token(7)) return true; + return false; + } + + private boolean jj_3R_150() { + if (jj_scan_token(84)) return true; return false; } @@ -4754,6 +4741,12 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo return false; } + private boolean jj_3R_71() { + if (jj_scan_token(21)) return true; + if (jj_3R_85()) return true; + return false; + } + private boolean jj_3R_46() { if (jj_3R_60()) return true; return false; @@ -4773,99 +4766,91 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo return false; } - private boolean jj_3R_119() { - if (jj_scan_token(74)) return true; + private boolean jj_3R_163() { + if (jj_scan_token(70)) return true; return false; } - private boolean jj_3_4() { - if (jj_scan_token(IDENT)) return true; - if (jj_scan_token(88)) return true; - if (jj_scan_token(58)) return true; + private boolean jj_3R_146() { + if (jj_3R_154()) return true; return false; } - private boolean jj_3_3() { + private boolean jj_3R_123() { + if (jj_scan_token(74)) return true; + return false; + } + + private boolean jj_3_4() { if (jj_scan_token(IDENT)) return true; if (jj_scan_token(88)) return true; if (jj_scan_token(40)) return true; return false; } - private boolean jj_3_2() { - if (jj_scan_token(IDENT)) return true; - if (jj_scan_token(88)) return true; + private boolean jj_3R_145() { + if (jj_scan_token(66)) return true; + if (jj_3R_153()) return true; + if (jj_scan_token(67)) return true; return false; } - private boolean jj_3R_156() { - if (jj_scan_token(70)) return true; + private boolean jj_3_3() { + if (jj_scan_token(IDENT)) return true; + if (jj_scan_token(88)) return true; + if (jj_scan_token(58)) return true; return false; } - private boolean jj_3R_142() { - if (jj_3R_149()) return true; + private boolean jj_3R_144() { + if (jj_scan_token(62)) return true; + if (jj_3R_47()) return true; + if (jj_scan_token(63)) return true; return false; } - private boolean jj_3_1() { + private boolean jj_3_2() { if (jj_scan_token(IDENT)) return true; - if (jj_3R_41()) return true; - if (jj_3R_42()) return true; - if (jj_scan_token(35)) return true; - return false; - } - - private boolean jj_3R_141() { - if (jj_scan_token(66)) return true; - if (jj_3R_148()) return true; - if (jj_scan_token(67)) return true; + if (jj_scan_token(88)) return true; return false; } - private boolean jj_3R_140() { - if (jj_scan_token(62)) return true; - if (jj_3R_47()) return true; - if (jj_scan_token(63)) return true; + private boolean jj_3R_156() { + if (jj_scan_token(87)) return true; return false; } - private boolean jj_3R_138() { - if (jj_3R_146()) return true; + private boolean jj_3R_142() { + if (jj_3R_151()) return true; return false; } - private boolean jj_3R_104() { - if (jj_scan_token(26)) return true; + private boolean jj_3R_143() { + if (jj_3R_152()) return true; return false; } - private boolean jj_3R_139() { - if (jj_3R_147()) return true; + private boolean jj_3_1() { + if (jj_scan_token(IDENT)) return true; + if (jj_3R_41()) return true; + if (jj_3R_42()) return true; + if (jj_scan_token(35)) return true; return false; } - private boolean jj_3R_137() { + private boolean jj_3R_141() { if (jj_scan_token(33)) return true; return false; } - private boolean jj_3R_133() { + private boolean jj_3R_137() { if (jj_scan_token(UNSIGNED_NUMBER)) return true; return false; } - private boolean jj_3R_130() { + private boolean jj_3R_134() { Token xsp; xsp = jj_scanpos; - if (jj_3R_133()) { - jj_scanpos = xsp; - if (jj_3R_134()) { - jj_scanpos = xsp; - if (jj_3R_135()) { - jj_scanpos = xsp; - if (jj_3R_136()) { - jj_scanpos = xsp; if (jj_3R_137()) { jj_scanpos = xsp; if (jj_3R_138()) { @@ -4878,6 +4863,14 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo jj_scanpos = xsp; if (jj_3R_142()) { jj_scanpos = xsp; + if (jj_3R_143()) { + jj_scanpos = xsp; + if (jj_3R_144()) { + jj_scanpos = xsp; + if (jj_3R_145()) { + jj_scanpos = xsp; + if (jj_3R_146()) { + jj_scanpos = xsp; if (jj_scan_token(35)) return true; } } @@ -4892,101 +4885,115 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo return false; } - private boolean jj_3R_136() { + private boolean jj_3R_140() { if (jj_scan_token(6)) return true; return false; } - private boolean jj_3R_145() { - if (jj_scan_token(83)) return true; + private boolean jj_3R_139() { + if (jj_scan_token(STRING)) return true; return false; } - private boolean jj_3R_143() { - if (jj_scan_token(87)) return true; - if (jj_3R_130()) return true; + private boolean jj_3R_108() { + if (jj_scan_token(26)) return true; return false; } - private boolean jj_3R_135() { - if (jj_scan_token(STRING)) return true; + private boolean jj_3R_138() { + if (jj_scan_token(UNSIGNED_INTEGER)) return true; return false; } - private boolean jj_3R_134() { - if (jj_scan_token(UNSIGNED_INTEGER)) return true; + private boolean jj_3R_149() { + if (jj_scan_token(83)) return true; return false; } - private boolean jj_3R_124() { + private boolean jj_3R_128() { if (jj_scan_token(42)) return true; return false; } - private boolean jj_3R_131() { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(86)) { - jj_scanpos = xsp; - if (jj_3R_143()) return true; - } + private boolean jj_3R_154() { + if (jj_scan_token(64)) return true; + if (jj_3R_164()) return true; + if (jj_scan_token(65)) return true; return false; } - private boolean jj_3R_149() { - if (jj_scan_token(64)) return true; - if (jj_3R_157()) return true; - if (jj_scan_token(65)) return true; + private boolean jj_3R_135() { + if (jj_3R_147()) return true; + if (jj_3R_134()) return true; return false; } - private boolean jj_3R_129() { - if (jj_scan_token(79)) return true; + private boolean jj_3R_105() { + if (jj_scan_token(34)) return true; return false; } - private boolean jj_3R_148() { - if (jj_3R_155()) return true; + private boolean jj_3R_153() { + if (jj_3R_162()) return true; Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_156()) { jj_scanpos = xsp; break; } + if (jj_3R_163()) { jj_scanpos = xsp; break; } } return false; } - private boolean jj_3R_150() { + private boolean jj_3R_157() { if (jj_3R_60()) return true; return false; } - private boolean jj_3R_118() { + private boolean jj_3R_133() { + if (jj_scan_token(79)) return true; + return false; + } + + private boolean jj_3R_151() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_157()) { + jj_scanpos = xsp; + if (jj_3R_158()) { + jj_scanpos = xsp; + if (jj_3R_159()) return true; + } + } + if (jj_3R_74()) return true; + return false; + } + + private boolean jj_3R_122() { if (jj_scan_token(73)) return true; return false; } - private boolean jj_3R_99() { + private boolean jj_3R_101() { Token xsp; xsp = jj_scanpos; if (jj_scan_token(30)) jj_scanpos = xsp; xsp = jj_scanpos; if (jj_scan_token(47)) jj_scanpos = xsp; xsp = jj_scanpos; - if (jj_scan_token(34)) { + if (jj_3R_105()) { jj_scanpos = xsp; - if (jj_scan_token(7)) { + if (jj_3R_106()) { jj_scanpos = xsp; if (jj_scan_token(61)) { jj_scanpos = xsp; if (jj_scan_token(24)) { jj_scanpos = xsp; - if (jj_3R_103()) { + if (jj_3R_107()) { jj_scanpos = xsp; if (jj_scan_token(38)) { jj_scanpos = xsp; if (jj_scan_token(37)) { jj_scanpos = xsp; - if (jj_3R_104()) { + if (jj_3R_108()) { jj_scanpos = xsp; if (jj_scan_token(17)) { jj_scanpos = xsp; @@ -5006,59 +5013,60 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo return false; } - private boolean jj_3R_115() { - if (jj_3R_130()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_3R_131()) jj_scanpos = xsp; + private boolean jj_3R_155() { + if (jj_scan_token(86)) return true; return false; } - private boolean jj_3R_146() { + private boolean jj_3R_147() { Token xsp; xsp = jj_scanpos; - if (jj_3R_150()) { - jj_scanpos = xsp; - if (jj_3R_151()) { + if (jj_3R_155()) { jj_scanpos = xsp; - if (jj_3R_152()) return true; + if (jj_3R_156()) return true; } - } - if (jj_3R_74()) return true; return false; } - private boolean jj_3R_116() { - if (jj_3R_132()) return true; - if (jj_3R_115()) return true; + private boolean jj_3R_119() { + if (jj_3R_134()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_135()) jj_scanpos = xsp; return false; } - private boolean jj_3R_109() { - if (jj_3R_114()) return true; - if (jj_3R_108()) return true; + private boolean jj_3R_120() { + if (jj_3R_136()) return true; + if (jj_3R_119()) return true; return false; } - private boolean jj_3R_102() { - if (jj_3R_110()) return true; - if (jj_3R_101()) return true; + private boolean jj_3R_113() { + if (jj_3R_118()) return true; + if (jj_3R_112()) return true; return false; } - private boolean jj_3R_144() { + private boolean jj_3R_104() { + if (jj_3R_114()) return true; + if (jj_3R_103()) return true; + return false; + } + + private boolean jj_3R_148() { if (jj_scan_token(82)) return true; return false; } - private boolean jj_3R_132() { + private boolean jj_3R_136() { Token xsp; xsp = jj_scanpos; - if (jj_3R_144()) { + if (jj_3R_148()) { jj_scanpos = xsp; - if (jj_3R_145()) { + if (jj_3R_149()) { jj_scanpos = xsp; - if (jj_scan_token(84)) { + if (jj_3R_150()) { jj_scanpos = xsp; if (jj_scan_token(85)) return true; } @@ -5067,17 +5075,17 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo return false; } - private boolean jj_3R_106() { + private boolean jj_3R_110() { if (jj_3R_60()) return true; return false; } - private boolean jj_3R_108() { - if (jj_3R_115()) return true; + private boolean jj_3R_112() { + if (jj_3R_119()) return true; Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_116()) { jj_scanpos = xsp; break; } + if (jj_3R_120()) { jj_scanpos = xsp; break; } } return false; } @@ -5088,22 +5096,22 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo return false; } - private boolean jj_3R_128() { + private boolean jj_3R_132() { if (jj_scan_token(78)) return true; return false; } - private boolean jj_3R_127() { + private boolean jj_3R_131() { if (jj_scan_token(56)) return true; return false; } - private boolean jj_3R_114() { + private boolean jj_3R_118() { Token xsp; xsp = jj_scanpos; - if (jj_3R_128()) { + if (jj_3R_132()) { jj_scanpos = xsp; - if (jj_3R_129()) { + if (jj_3R_133()) { jj_scanpos = xsp; if (jj_scan_token(80)) { jj_scanpos = xsp; @@ -5119,81 +5127,81 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo return false; } - private boolean jj_3R_95() { + private boolean jj_3R_97() { if (jj_scan_token(9)) return true; - if (jj_3R_94()) return true; + if (jj_3R_96()) return true; return false; } - private boolean jj_3R_107() { - if (jj_3R_114()) return true; + private boolean jj_3R_111() { + if (jj_3R_118()) return true; return false; } - private boolean jj_3R_126() { + private boolean jj_3R_130() { if (jj_scan_token(32)) return true; return false; } - private boolean jj_3R_113() { + private boolean jj_3R_117() { Token xsp; xsp = jj_scanpos; - if (jj_3R_126()) { + if (jj_3R_130()) { jj_scanpos = xsp; - if (jj_3R_127()) return true; + if (jj_3R_131()) return true; } return false; } - private boolean jj_3R_101() { + private boolean jj_3R_103() { Token xsp; xsp = jj_scanpos; - if (jj_3R_107()) jj_scanpos = xsp; - if (jj_3R_108()) return true; + if (jj_3R_111()) jj_scanpos = xsp; + if (jj_3R_112()) return true; while (true) { xsp = jj_scanpos; - if (jj_3R_109()) { jj_scanpos = xsp; break; } + if (jj_3R_113()) { jj_scanpos = xsp; break; } } return false; } - private boolean jj_3R_123() { + private boolean jj_3R_127() { if (jj_scan_token(5)) return true; return false; } - private boolean jj_3R_117() { + private boolean jj_3R_121() { if (jj_scan_token(72)) return true; return false; } - private boolean jj_3R_112() { + private boolean jj_3R_116() { Token xsp; xsp = jj_scanpos; - if (jj_3R_123()) { + if (jj_3R_127()) { jj_scanpos = xsp; - if (jj_3R_124()) { + if (jj_3R_128()) { jj_scanpos = xsp; - if (jj_3R_125()) return true; + if (jj_3R_129()) return true; } } return false; } - private boolean jj_3R_110() { + private boolean jj_3R_114() { Token xsp; xsp = jj_scanpos; - if (jj_3R_117()) { + if (jj_3R_121()) { jj_scanpos = xsp; - if (jj_3R_118()) { + if (jj_3R_122()) { jj_scanpos = xsp; - if (jj_3R_119()) { + if (jj_3R_123()) { jj_scanpos = xsp; - if (jj_3R_120()) { + if (jj_3R_124()) { jj_scanpos = xsp; - if (jj_3R_121()) { + if (jj_3R_125()) { jj_scanpos = xsp; - if (jj_3R_122()) return true; + if (jj_3R_126()) return true; } } } @@ -5202,7 +5210,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo return false; } - private boolean jj_3R_111() { + private boolean jj_3R_115() { Token xsp; xsp = jj_scanpos; if (jj_scan_token(16)) { @@ -5224,22 +5232,22 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo return false; } - private boolean jj_3R_105() { + private boolean jj_3R_109() { Token xsp; xsp = jj_scanpos; - if (jj_3R_111()) jj_scanpos = xsp; + if (jj_3R_115()) jj_scanpos = xsp; xsp = jj_scanpos; - if (jj_3R_112()) jj_scanpos = xsp; + if (jj_3R_116()) jj_scanpos = xsp; xsp = jj_scanpos; - if (jj_3R_113()) jj_scanpos = xsp; + if (jj_3R_117()) jj_scanpos = xsp; return false; } - private boolean jj_3R_98() { - if (jj_3R_101()) return true; + private boolean jj_3R_100() { + if (jj_3R_103()) return true; Token xsp; xsp = jj_scanpos; - if (jj_3R_102()) jj_scanpos = xsp; + if (jj_3R_104()) jj_scanpos = xsp; return false; } @@ -5253,11 +5261,11 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo return false; } - private boolean jj_3R_94() { + private boolean jj_3R_96() { Token xsp; xsp = jj_scanpos; if (jj_scan_token(12)) jj_scanpos = xsp; - if (jj_3R_98()) return true; + if (jj_3R_100()) return true; return false; } @@ -5283,11 +5291,11 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo } private boolean jj_3R_86() { - if (jj_3R_94()) return true; + if (jj_3R_96()) return true; Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_95()) { jj_scanpos = xsp; break; } + if (jj_3R_97()) { jj_scanpos = xsp; break; } } return false; } @@ -5307,6 +5315,11 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo return false; } + private boolean jj_3R_92() { + if (jj_scan_token(27)) return true; + return false; + } + private boolean jj_3_8() { if (jj_3R_45()) return true; return false; @@ -5320,14 +5333,19 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo return false; } - private boolean jj_3R_66() { - if (jj_3R_80()) return true; + private boolean jj_3R_172() { + if (jj_3R_47()) return true; return false; } - private boolean jj_3R_100() { - if (jj_3R_105()) return true; - if (jj_3R_106()) return true; + private boolean jj_3R_102() { + if (jj_3R_109()) return true; + if (jj_3R_110()) return true; + return false; + } + + private boolean jj_3R_66() { + if (jj_3R_80()) return true; return false; } @@ -5346,8 +5364,8 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo return false; } - private boolean jj_3R_165() { - if (jj_3R_47()) return true; + private boolean jj_3R_68() { + if (jj_scan_token(14)) return true; return false; } @@ -5373,13 +5391,14 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo return false; } - private boolean jj_3R_68() { - if (jj_scan_token(14)) return true; + private boolean jj_3R_161() { + if (jj_scan_token(68)) return true; + if (jj_scan_token(IDENT)) return true; return false; } - private boolean jj_3R_97() { - if (jj_3R_100()) return true; + private boolean jj_3R_99() { + if (jj_3R_102()) return true; return false; } @@ -5389,25 +5408,26 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo return false; } - private boolean jj_3R_154() { - if (jj_scan_token(68)) return true; - if (jj_scan_token(IDENT)) return true; + private boolean jj_3R_64() { + if (jj_scan_token(21)) return true; return false; } - private boolean jj_3_6() { - if (jj_scan_token(IDENT)) return true; - if (jj_scan_token(88)) return true; + private boolean jj_3R_49() { + if (jj_scan_token(STRING)) return true; return false; } - private boolean jj_3R_64() { - if (jj_scan_token(21)) return true; + private boolean jj_3_6() { + if (jj_scan_token(IDENT)) return true; + if (jj_scan_token(88)) return true; return false; } - private boolean jj_3R_49() { - if (jj_scan_token(STRING)) return true; + private boolean jj_3R_41() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_49()) jj_scanpos = xsp; return false; } @@ -5416,7 +5436,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo return false; } - private boolean jj_3R_122() { + private boolean jj_3R_126() { if (jj_scan_token(77)) return true; return false; } @@ -5436,13 +5456,6 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo return false; } - private boolean jj_3R_41() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_49()) jj_scanpos = xsp; - return false; - } - private boolean jj_3R_88() { if (jj_scan_token(46)) return true; return false; @@ -5467,7 +5480,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo return false; } - private boolean jj_3R_92() { + private boolean jj_3R_94() { if (jj_scan_token(13)) return true; return false; } @@ -5477,23 +5490,56 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo return false; } - private boolean jj_3R_96() { + private boolean jj_3R_98() { + if (jj_3R_101()) return true; + return false; + } + + private boolean jj_3R_171() { + if (jj_scan_token(69)) return true; + return false; + } + + private boolean jj_3R_93() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_98()) { + jj_scanpos = xsp; if (jj_3R_99()) return true; + } return false; } - private boolean jj_3R_91() { + private boolean jj_3R_169() { Token xsp; xsp = jj_scanpos; - if (jj_3R_96()) { + if (jj_3R_171()) { jj_scanpos = xsp; - if (jj_3R_97()) return true; + if (jj_3R_172()) return true; } return false; } - private boolean jj_3R_164() { - if (jj_scan_token(69)) return true; + private boolean jj_3R_167() { + if (jj_scan_token(71)) return true; + return false; + } + + private boolean jj_3R_107() { + Token xsp; + xsp = jj_scanpos; + if (jj_scan_token(50)) jj_scanpos = xsp; + if (jj_scan_token(44)) return true; + return false; + } + + private boolean jj_3R_91() { + if (jj_scan_token(51)) return true; + return false; + } + + private boolean jj_3R_160() { + if (jj_3R_166()) return true; return false; } @@ -5504,39 +5550,25 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo xsp = jj_scanpos; if (jj_scan_token(11)) jj_scanpos = xsp; xsp = jj_scanpos; - if (jj_scan_token(51)) jj_scanpos = xsp; - xsp = jj_scanpos; - if (jj_scan_token(27)) jj_scanpos = xsp; + if (jj_3R_91()) jj_scanpos = xsp; xsp = jj_scanpos; - if (jj_3R_91()) { - jj_scanpos = xsp; - if (jj_3R_92()) return true; - } - return false; - } - - private boolean jj_3R_162() { - Token xsp; + if (jj_3R_92()) jj_scanpos = xsp; xsp = jj_scanpos; - if (jj_3R_164()) { + if (jj_3R_93()) { jj_scanpos = xsp; - if (jj_3R_165()) return true; + if (jj_3R_94()) return true; } return false; } - private boolean jj_3R_160() { - if (jj_scan_token(71)) return true; - return false; - } - private boolean jj_3R_83() { if (jj_3R_90()) return true; return false; } - private boolean jj_3R_153() { - if (jj_3R_159()) return true; + private boolean jj_3R_166() { + if (jj_scan_token(66)) return true; + if (jj_3R_169()) return true; return false; } @@ -5545,12 +5577,6 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo return false; } - private boolean jj_3R_159() { - if (jj_scan_token(66)) return true; - if (jj_3R_162()) return true; - return false; - } - private boolean jj_3R_63() { if (jj_scan_token(71)) return true; return false; @@ -5579,7 +5605,17 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo return false; } - private boolean jj_3R_121() { + private boolean jj_3R_162() { + if (jj_3R_47()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_167()) { jj_scanpos = xsp; break; } + } + return false; + } + + private boolean jj_3R_125() { if (jj_scan_token(76)) return true; return false; } @@ -5598,35 +5634,38 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo return false; } - private boolean jj_3R_155() { - if (jj_3R_47()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3R_160()) { jj_scanpos = xsp; break; } - } - return false; - } - private boolean jj_3R_73() { if (jj_scan_token(43)) return true; if (jj_3R_47()) return true; return false; } - private boolean jj_3R_166() { + private boolean jj_3R_173() { if (jj_scan_token(IDENT)) return true; if (jj_scan_token(88)) return true; return false; } - private boolean jj_3R_152() { + private boolean jj_3R_159() { if (jj_scan_token(46)) return true; return false; } - private boolean jj_3R_163() { - if (jj_3R_166()) return true; + private boolean jj_3R_170() { + if (jj_3R_173()) return true; + return false; + } + + private boolean jj_3R_168() { + if (jj_3R_170()) return true; + return false; + } + + private boolean jj_3_10() { + if (jj_3R_47()) return true; + Token xsp; + xsp = jj_scanpos; + if (jj_3R_48()) jj_scanpos = xsp; return false; } @@ -5635,13 +5674,23 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo return false; } - private boolean jj_3R_51() { - if (jj_scan_token(59)) return true; + private boolean jj_3R_165() { + if (jj_3R_164()) return true; return false; } - private boolean jj_3R_161() { - if (jj_3R_163()) return true; + private boolean jj_3R_164() { + Token xsp; + xsp = jj_scanpos; + if (jj_3_10()) { + jj_scanpos = xsp; + if (jj_3R_168()) return true; + } + return false; + } + + private boolean jj_3R_51() { + if (jj_scan_token(59)) return true; return false; } @@ -5667,7 +5716,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo return false; } - private boolean jj_3R_93() { + private boolean jj_3R_95() { if (jj_scan_token(IDENT)) return true; return false; } @@ -5683,7 +5732,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo private Token jj_scanpos, jj_lastpos; private int jj_la; private int jj_gen; - final private int[] jj_la1 = new int[134]; + final private int[] jj_la1 = new int[132]; static private int[] jj_la1_0; static private int[] jj_la1_1; static private int[] jj_la1_2; @@ -5693,13 +5742,13 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo jj_la1_init_2(); } private static void jj_la1_init_0() { - jj_la1_0 = new int[] {0x0,0x0,0x45020880,0x800,0x40000000,0x0,0x0,0x5020080,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x10,0x10,0x0,0x0,0x4000,0x0,0x4000,0x0,0x80001040,0x4d8329a0,0x100,0x800,0x0,0x8000000,0x458300a0,0x458300a0,0x0,0x458320a0,0x4d8329a0,0x0,0x0,0x0,0x4000,0x0,0x0,0x810000,0x810000,0x20,0x20,0x0,0x0,0x0,0x80000000,0x0,0x0,0x0,0x0,0x2d00,0x0,0x2d00,0x400,0x800,0x2000,0x0,0x400,0x800,0x458300a0,0x458320a0,0x458300a0,0x0,0x0,0x0,0xa0240000,0x80200000,0x0,0xa0240000,0x80201040,0x100000,0x80201040,0x80201040,0x8000,0xa0240000,0x100000,0xa0240000,0xa0240000,0x8000,0x80201040,0xa0240000,0x0,0x0,0xa0240000,0x80201040,0x2000000,0x80201040,0xa0240000,0x2000000,0xa0240000,0x100000,0x80001040,0x100000,0x80001040,0x0,0x0,0x400000,0x200,0x1000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x80001040,0x200000,0x200000,0x0,0x0,0x80001040,0x0,0x80001040,0x0,0x0,0x80001040,0x4000,0x0,0x0,}; + jj_la1_0 = new int[] {0x0,0x0,0x45020880,0x800,0x40000000,0x0,0x0,0x5020080,0x0,0x0,0x0,0x0,0x0,0x10,0x10,0x0,0x0,0x4000,0x0,0x4000,0x0,0x80001040,0x4d8329a0,0x100,0x800,0x0,0x8000000,0x458300a0,0x458300a0,0x0,0x458320a0,0x4d8329a0,0x0,0x0,0x0,0x4000,0x0,0x0,0x810000,0x810000,0x20,0x20,0x0,0x0,0x0,0x80000000,0x0,0x0,0x0,0x0,0x2d00,0x0,0x2d00,0x400,0x800,0x2000,0x0,0x400,0x800,0x458300a0,0x458320a0,0x458300a0,0x0,0x0,0x0,0xa0240000,0x80200000,0x0,0xa0240000,0x80201040,0x100000,0x80201040,0x80201040,0x8000,0xa0240000,0x100000,0xa0240000,0xa0240000,0x8000,0x80201040,0xa0240000,0x0,0x0,0xa0240000,0x80201040,0x2000000,0x80201040,0xa0240000,0x2000000,0xa0240000,0x100000,0x80001040,0x100000,0x80001040,0x0,0x0,0x400000,0x200,0x1000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x80001040,0x200000,0x200000,0x0,0x0,0x80001040,0x0,0x80001040,0x0,0x0,0x80001040,0x4000,0x0,0x0,}; } private static void jj_la1_init_1() { - jj_la1_1 = new int[] {0x0,0x200000,0x20049064,0x0,0x0,0x8000,0x40000,0x20041064,0x0,0x40000000,0x0,0x0,0x40000000,0x800000,0x0,0x2106000,0x106000,0x0,0x0,0x0,0x8000000,0x0,0x0,0x4400400a,0x218e9475,0x0,0x0,0x80000,0x0,0x21069465,0x21069465,0x400000,0x21069465,0x218e9475,0x0,0x0,0x40000000,0x0,0x40000000,0x0,0x0,0x0,0x20400,0x20400,0x1000001,0x1000001,0x0,0x0,0x0,0x40000000,0x0,0x40000000,0x0,0x0,0x0,0x0,0x0,0x0,0x40000000,0x0,0x0,0x21069465,0x21069465,0x21069465,0x400000,0x4000,0x4000,0x40010800,0x880,0x40000000,0x40010800,0x4400488a,0x0,0x4400488a,0x4400488a,0x0,0x40010800,0x0,0x40010800,0x40010800,0x0,0x4400488a,0x40010800,0x0,0x200,0x40010800,0x4400488a,0x0,0x4400488a,0x40010800,0x0,0x40010800,0x0,0x4400400a,0x0,0x4400400a,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4004000,0x0,0x2,0x40000008,0x0,0x0,0x0,0x0,0x0,0x0,0x4400400a,0x0,0x0,0x0,0x0,0x4400400a,0x0,0x4400400a,0x0,0x0,0x4400400a,0x0,0x0,0x0,}; + jj_la1_1 = new int[] {0x0,0x200000,0x20049064,0x0,0x0,0x8000,0x40000,0x20041064,0x0,0x40000000,0x0,0x0,0x0,0x2106000,0x106000,0x0,0x0,0x0,0x8000000,0x0,0x0,0x4400400a,0x218e9475,0x0,0x0,0x80000,0x0,0x21069465,0x21069465,0x400000,0x21069465,0x218e9475,0x0,0x0,0x40000000,0x0,0x40000000,0x0,0x0,0x0,0x20400,0x20400,0x1000001,0x1000001,0x0,0x0,0x0,0x40000000,0x0,0x40000000,0x0,0x0,0x0,0x0,0x0,0x0,0x40000000,0x0,0x0,0x21069465,0x21069465,0x21069465,0x400000,0x4000,0x4000,0x40010800,0x880,0x40000000,0x40010800,0x4400488a,0x0,0x4400488a,0x4400488a,0x0,0x40010800,0x0,0x40010800,0x40010800,0x0,0x4400488a,0x40010800,0x0,0x200,0x40010800,0x4400488a,0x0,0x4400488a,0x40010800,0x0,0x40010800,0x0,0x4400400a,0x0,0x4400400a,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4004000,0x0,0x2,0x40000008,0x0,0x0,0x0,0x0,0x0,0x0,0x4400400a,0x0,0x0,0x0,0x0,0x4400400a,0x0,0x4400400a,0x0,0x0,0x4400400a,0x0,0x0,0x0,}; } private static void jj_la1_init_2() { - jj_la1_2 = new int[] {0x4000010,0x0,0xc0000000,0x0,0x0,0x0,0x0,0xc0000000,0x4,0x0,0x4000000,0x80,0x0,0x0,0x80,0x0,0x0,0x8000000,0x4000010,0x0,0x0,0x0,0x4000010,0x3c03c015,0xc4000010,0x0,0x0,0x0,0x0,0xc4000010,0xc4000010,0x0,0xc4000010,0xc4000010,0x10,0x4000010,0x0,0x0,0x0,0x4,0x0,0x0,0x0,0x0,0x0,0x0,0x80,0x0,0x4,0x3000000,0x1000000,0x3000000,0x4000010,0x80,0x4000010,0x0,0x0,0x4000010,0x3000000,0x0,0x0,0xc4000010,0xc4000010,0xc4000010,0x0,0x0,0x0,0x4000010,0x4000000,0x2000000,0x4000010,0x3c03c015,0x0,0x3c03c015,0x3c03c015,0x0,0x4000010,0x0,0x4000010,0x4000010,0x0,0x3c03c015,0x4000010,0x80,0x0,0x4000010,0x3c03c015,0x0,0x3c03c015,0x4000010,0x0,0x4000010,0x0,0x3c03c015,0x0,0x3c03c015,0x20,0x20,0x0,0x0,0x0,0x3f00,0x3f00,0x3c000,0x3c000,0x3c000,0x3c0000,0x3c0000,0xc00000,0xc00000,0x4000010,0x40,0x38000000,0x4000015,0x10,0x10,0x10,0x4,0x10,0x4,0x3c03c015,0x80,0x80,0x4000000,0x80,0x3c03c015,0x80,0x3c03c015,0x80,0x80,0x3c03c035,0x0,0x4000,0x8000000,}; + jj_la1_2 = new int[] {0x4000010,0x0,0xc0000000,0x0,0x0,0x0,0x0,0xc0000000,0x4,0x0,0x80,0x4000000,0x80,0x0,0x0,0x8000000,0x4000010,0x0,0x0,0x0,0x4000010,0x3c03c015,0xc4000010,0x0,0x0,0x0,0x0,0xc4000010,0xc4000010,0x0,0xc4000010,0xc4000010,0x10,0x4000010,0x0,0x0,0x0,0x4,0x0,0x0,0x0,0x0,0x0,0x0,0x80,0x0,0x4,0x3000000,0x1000000,0x3000000,0x4000010,0x80,0x4000010,0x0,0x0,0x4000010,0x3000000,0x0,0x0,0xc4000010,0xc4000010,0xc4000010,0x0,0x0,0x0,0x4000010,0x4000000,0x2000000,0x4000010,0x3c03c015,0x0,0x3c03c015,0x3c03c015,0x0,0x4000010,0x0,0x4000010,0x4000010,0x0,0x3c03c015,0x4000010,0x80,0x0,0x4000010,0x3c03c015,0x0,0x3c03c015,0x4000010,0x0,0x4000010,0x0,0x3c03c015,0x0,0x3c03c015,0x20,0x20,0x0,0x0,0x0,0x3f00,0x3f00,0x3c000,0x3c000,0x3c000,0x3c0000,0x3c0000,0xc00000,0xc00000,0x4000010,0x40,0x38000000,0x4000015,0x10,0x10,0x10,0x4,0x10,0x4,0x3c03c015,0x80,0x80,0x4000000,0x80,0x3c03c015,0x80,0x3c03c015,0x80,0x80,0x3c03c035,0x0,0x4000,0x8000000,}; } final private JJCalls[] jj_2_rtns = new JJCalls[10]; private boolean jj_rescan = false; @@ -5716,7 +5765,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo token = new Token(); jj_ntk = -1; jj_gen = 0; - for (int i = 0; i < 134; i++) jj_la1[i] = -1; + for (int i = 0; i < 132; i++) jj_la1[i] = -1; for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } @@ -5732,7 +5781,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo jj_ntk = -1; jjtree.reset(); jj_gen = 0; - for (int i = 0; i < 134; i++) jj_la1[i] = -1; + for (int i = 0; i < 132; i++) jj_la1[i] = -1; for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } @@ -5743,7 +5792,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo token = new Token(); jj_ntk = -1; jj_gen = 0; - for (int i = 0; i < 134; i++) jj_la1[i] = -1; + for (int i = 0; i < 132; i++) jj_la1[i] = -1; for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } @@ -5755,7 +5804,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo jj_ntk = -1; jjtree.reset(); jj_gen = 0; - for (int i = 0; i < 134; i++) jj_la1[i] = -1; + for (int i = 0; i < 132; i++) jj_la1[i] = -1; for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } @@ -5765,7 +5814,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo token = new Token(); jj_ntk = -1; jj_gen = 0; - for (int i = 0; i < 134; i++) jj_la1[i] = -1; + for (int i = 0; i < 132; i++) jj_la1[i] = -1; for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } @@ -5776,7 +5825,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo jj_ntk = -1; jjtree.reset(); jj_gen = 0; - for (int i = 0; i < 134; i++) jj_la1[i] = -1; + for (int i = 0; i < 132; i++) jj_la1[i] = -1; for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } @@ -5893,7 +5942,7 @@ public class ModelParser/*@bgen(jjtree)*/implements ModelParserTreeConstants, Mo la1tokens[jj_kind] = true; jj_kind = -1; } - for (int i = 0; i < 134; i++) { + for (int i = 0; i < 132; i++) { if (jj_la1[i] == jj_gen) { for (int j = 0; j < 32; j++) { if ((jj_la1_0[i] & (1< 93) - kind = 93; - jjCheckNAddTwoStates(10, 11); - } - else if (curChar == 45) - jjCheckNAdd(10); - break; - case 37: - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(32, 33); - if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(25, 26); - if ((0x3ff000000000000L & l) != 0L) + case 13: + if (curChar == 47) { - if (kind > 92) - kind = 92; - jjCheckNAdd(24); + if (kind > 3) + kind = 3; + jjCheckNAdd(20); } + else if (curChar == 42) + jjCheckNAddStates(0, 2); break; case 0: if ((0x3ff000000000000L & l) != 0L) { if (kind > 92) kind = 92; - jjCheckNAddStates(0, 4); + jjCheckNAddStates(3, 7); } else if ((0x100002600L & l) != 0L) { if (kind > 1) kind = 1; } - else if (curChar == 45) - jjCheckNAddStates(5, 7); else if (curChar == 47) jjAddStates(8, 9); else if (curChar == 46) - jjCheckNAddTwoStates(9, 10); + jjCheckNAdd(9); else if (curChar == 34) jjCheckNAddStates(10, 12); break; - case 15: - if (curChar == 47) - { - if (kind > 3) - kind = 3; - jjCheckNAdd(22); - } - else if (curChar == 42) - jjCheckNAddStates(13, 15); - break; case 2: if ((0x3ff400000000000L & l) == 0L) break; @@ -1033,129 +1005,109 @@ private int jjMoveNfa_0(int startState, int curPos) break; case 8: if (curChar == 46) - jjCheckNAddTwoStates(9, 10); + jjCheckNAdd(9); break; - case 10: + case 9: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 93) kind = 93; - jjCheckNAddTwoStates(10, 11); - break; - case 12: - if (curChar == 45) - jjCheckNAdd(13); + jjCheckNAddTwoStates(9, 10); break; - case 13: + case 11: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 93) kind = 93; - jjCheckNAdd(13); + jjstateSet[jjnewStateCnt++] = 11; break; - case 14: + case 12: if (curChar == 47) jjAddStates(8, 9); break; - case 16: + case 14: if ((0xfffffbffffffffffL & l) != 0L) - jjCheckNAddStates(13, 15); + jjCheckNAddStates(0, 2); break; - case 17: + case 15: if (curChar == 42) - jjstateSet[jjnewStateCnt++] = 18; + jjstateSet[jjnewStateCnt++] = 16; break; - case 18: + case 16: if ((0xffff7fffffffffffL & l) != 0L) - jjCheckNAddStates(13, 15); + jjCheckNAddStates(0, 2); break; - case 19: + case 17: if (curChar == 47 && kind > 2) kind = 2; break; - case 20: + case 18: if (curChar == 42) - jjstateSet[jjnewStateCnt++] = 19; + jjstateSet[jjnewStateCnt++] = 17; break; - case 21: + case 19: if (curChar != 47) break; if (kind > 3) kind = 3; - jjCheckNAdd(22); + jjCheckNAdd(20); break; - case 22: + case 20: if ((0xfffffffffffffbffL & l) == 0L) break; if (kind > 3) kind = 3; - jjCheckNAdd(22); + jjCheckNAdd(20); break; - case 23: - if (curChar == 45) - jjCheckNAddStates(5, 7); + case 21: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 92) + kind = 92; + jjCheckNAddStates(3, 7); break; - case 24: + case 22: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 92) kind = 92; - jjCheckNAdd(24); + jjCheckNAdd(22); break; - case 25: + case 23: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(25, 26); + jjCheckNAddTwoStates(23, 24); break; - case 26: + case 24: if (curChar != 46) break; if (kind > 93) kind = 93; - jjCheckNAddStates(16, 18); - break; - case 27: - if (curChar == 45) - jjCheckNAdd(28); + jjCheckNAddTwoStates(25, 26); break; - case 28: + case 25: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 93) kind = 93; - jjCheckNAddTwoStates(28, 29); + jjCheckNAddTwoStates(25, 26); break; - case 30: - if (curChar == 45) - jjCheckNAdd(31); - break; - case 31: + case 27: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 93) kind = 93; - jjCheckNAdd(31); + jjstateSet[jjnewStateCnt++] = 27; break; - case 32: + case 28: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(32, 33); + jjCheckNAddTwoStates(28, 29); break; - case 34: - if (curChar == 45) - jjCheckNAdd(35); - break; - case 35: + case 30: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 93) kind = 93; - jjCheckNAdd(35); - break; - case 36: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 92) - kind = 92; - jjCheckNAddStates(0, 4); + jjstateSet[jjnewStateCnt++] = 30; break; default : break; } @@ -1187,26 +1139,26 @@ private int jjMoveNfa_0(int startState, int curPos) case 6: jjCheckNAddStates(10, 12); break; - case 11: + case 10: if ((0x2000000020L & l) != 0L) - jjAddStates(19, 20); + jjstateSet[jjnewStateCnt++] = 11; break; + case 14: case 16: - case 18: - jjCheckNAddStates(13, 15); + jjCheckNAddStates(0, 2); break; - case 22: + case 20: if (kind > 3) kind = 3; - jjstateSet[jjnewStateCnt++] = 22; + jjstateSet[jjnewStateCnt++] = 20; break; - case 29: + case 26: if ((0x2000000020L & l) != 0L) - jjAddStates(21, 22); + jjstateSet[jjnewStateCnt++] = 27; break; - case 33: + case 29: if ((0x2000000020L & l) != 0L) - jjAddStates(23, 24); + jjstateSet[jjnewStateCnt++] = 30; break; default : break; } @@ -1225,17 +1177,17 @@ private int jjMoveNfa_0(int startState, int curPos) if ((jjbitVec0[i2] & l2) != 0L) jjCheckNAddStates(10, 12); break; + case 14: case 16: - case 18: if ((jjbitVec0[i2] & l2) != 0L) - jjCheckNAddStates(13, 15); + jjCheckNAddStates(0, 2); break; - case 22: + case 20: if ((jjbitVec0[i2] & l2) == 0L) break; if (kind > 3) kind = 3; - jjstateSet[jjnewStateCnt++] = 22; + jjstateSet[jjnewStateCnt++] = 20; break; default : break; } @@ -1248,15 +1200,14 @@ private int jjMoveNfa_0(int startState, int curPos) kind = 0x7fffffff; } ++curPos; - if ((i = jjnewStateCnt) == (startsAt = 37 - (jjnewStateCnt = startsAt))) + if ((i = jjnewStateCnt) == (startsAt = 31 - (jjnewStateCnt = startsAt))) return curPos; try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return curPos; } } } static final int[] jjnextStates = { - 24, 25, 26, 32, 33, 24, 25, 32, 15, 21, 4, 5, 7, 16, 17, 20, - 27, 28, 29, 12, 13, 30, 31, 34, 35, + 14, 15, 18, 22, 23, 24, 28, 29, 13, 19, 4, 5, 7, }; /** Token literal values. */ @@ -1295,8 +1246,8 @@ static final long[] jjtoSkip = { 0xeL, 0x0L, }; protected SimpleCharStream input_stream; -private final int[] jjrounds = new int[37]; -private final int[] jjstateSet = new int[74]; +private final int[] jjrounds = new int[31]; +private final int[] jjstateSet = new int[62]; private final StringBuilder jjimage = new StringBuilder(); private StringBuilder image = jjimage; private int jjimageLen; @@ -1327,7 +1278,7 @@ private void ReInitRounds() { int i; jjround = 0x80000001; - for (i = 37; i-- > 0;) + for (i = 31; i-- > 0;) jjrounds[i] = 0x80000000; } diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/parser/ModelParserTreeConstants.java b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/parser/ModelParserTreeConstants.java index 39cc66d4..8539a490 100644 --- a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/parser/ModelParserTreeConstants.java +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/parser/ModelParserTreeConstants.java @@ -68,22 +68,23 @@ public interface ModelParserTreeConstants public int JJTTERM = 62; public int JJTMUL_OP = 63; public int JJTFACTOR = 64; - public int JJTDER_INITIAL = 65; - public int JJTSUBSCRIPT_2 = 66; - public int JJTARRAY = 67; - public int JJTPRIMARY = 68; - public int JJTNAME = 69; - public int JJTCOMPONENT_REFERENCE = 70; - public int JJTFUNCTION_CALL_ARGS = 71; - public int JJTFUNCTION_ARGUMENTS = 72; - public int JJTNAMED_ARGUMENTS = 73; - public int JJTNAMED_ARGUMENT = 74; - public int JJTOUTPUT_EXPRESSION_LIST = 75; - public int JJTEXPRESSION_LIST = 76; - public int JJTARRAY_SUBSCRIPTS = 77; - public int JJTSUBSCRIPT = 78; - public int JJTVOID = 79; - public int JJTANNOTATION = 80; + public int JJTFACTOR_OP = 65; + public int JJTDER_INITIAL = 66; + public int JJTSUBSCRIPT_2 = 67; + public int JJTARRAY = 68; + public int JJTPRIMARY = 69; + public int JJTNAME = 70; + public int JJTCOMPONENT_REFERENCE = 71; + public int JJTFUNCTION_CALL_ARGS = 72; + public int JJTFUNCTION_ARGUMENTS = 73; + public int JJTNAMED_ARGUMENTS = 74; + public int JJTNAMED_ARGUMENT = 75; + public int JJTOUTPUT_EXPRESSION_LIST = 76; + public int JJTEXPRESSION_LIST = 77; + public int JJTARRAY_SUBSCRIPTS = 78; + public int JJTSUBSCRIPT = 79; + public int JJTVOID = 80; + public int JJTANNOTATION = 81; public String[] jjtNodeName = { @@ -152,6 +153,7 @@ public interface ModelParserTreeConstants "term", "mul_op", "factor", + "factor_op", "der_initial", "subscript_2", "array", @@ -170,4 +172,4 @@ public interface ModelParserTreeConstants "annotation", }; } -/* JavaCC - OriginalChecksum=2406c3a5da0aa9cd9047b868bc6069b1 (do not edit this line) */ +/* JavaCC - OriginalChecksum=c86e9178ecd31c01eb2447d79ce33b0f (do not edit this line) */ diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/parser/ModelicaParser.jj b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/parser/ModelicaParser.jj index 990cfd10..a6dceb85 100644 --- a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/parser/ModelicaParser.jj +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/parser/ModelicaParser.jj @@ -75,10 +75,10 @@ TOKEN: | "*" | "/" | ".*" | "./" | "^" | ".^" | "=" | ":=" -| +| | { matchedToken.image = matchedToken.image.substring(1,matchedToken.image.length()-1); } -| +| | "." ()? (["e","E"] )? | "." (["e","E"] )? @@ -191,7 +191,7 @@ void class_definition() : {/*@bgen(jjtree) class_definition */ // class_specifier ( "encapsulated" )? ( "partial" )? - ( "class" | "model" | "record" | "block" | ( "expandable" )? "connector" | "type" | + ( "class" { jjtn000.op = "class"; } | "model" { jjtn000.op = "model"; } | "record" | "block" | ( "expandable" )? "connector" | "type" | "package" | "function" { jjtn000.op = "function"; } | "operator" | "operator function" | "operator record" ) class_specifier()/*@bgen(jjtree)*/ } catch (Throwable jjte000) { @@ -235,9 +235,8 @@ void class_specifier() : {/*@bgen(jjtree) class_specifier */ // end IDENT LOOKAHEAD(2) t= { jjtn000.op = t.image; } string_comment() composition() "end" | LOOKAHEAD(2) "=" base_prefix() name() ( array_subscripts() )? ( class_modification() )? comment() - | LOOKAHEAD(3) "=" "enumeration" "(" ( ( enum_list() )? | ":" ) ")" comment() - |LOOKAHEAD(3) "=" "der" "(" name() "," ( "," )* ")" comment() - | "extends" ( class_modification() )? string_comment() composition() "end" /*@bgen(jjtree)*/ + | LOOKAHEAD(3) "=" "der" "(" name() "," ( "," )* ")" comment() + | LOOKAHEAD(3) "=" "enumeration" "(" ( ( enum_list() )? | ":" ) ")" comment()/*@bgen(jjtree)*/ } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); @@ -257,7 +256,8 @@ void class_specifier() : {/*@bgen(jjtree) class_specifier */ jjtree.closeNodeScope(jjtn000, true); } } -/*@egen*/ +/*@egen*/ + //| "extends" ( class_modification() )? string_comment() composition() "end" } void base_prefix() : {/*@bgen(jjtree) base_prefix */ @@ -526,11 +526,21 @@ Node element() : {/*@bgen(jjtree) element */ // ( ( class_definition | component_clause) | // replaceable ( class_definition | component_clause) // [constraining_clause comment]) - import_clause() | - extends_clause() | + import_clause()/*@bgen(jjtree)*/ + { + jjtree.closeNodeScope(jjtn000, true); + jjtc000 = false; + } +/*@egen*/ { return jjtn000; } | + extends_clause()/*@bgen(jjtree)*/ + { + jjtree.closeNodeScope(jjtn000, true); + jjtc000 = false; + } +/*@egen*/ { return jjtn000; } | ( "redeclare" )? ( "final" )? - ( "inner" )? ( "outer" )? + ( "inner" { jjtn000.op = "inner"; } )? ( "outer" { jjtn000.op = "outer"; } )? ( (class_definition() | component_clause()) | "replaceable" (class_definition() | component_clause()) (constraining_clause() comment())?)/*@bgen(jjtree)*/ @@ -2348,7 +2358,12 @@ void mul_op() : {/*@bgen(jjtree) mul_op */ jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; } -/*@egen*/ { jjtn000.op = "/";} | ".*" | "./"/*@bgen(jjtree)*/ +/*@egen*/ { jjtn000.op = "/";} | ".*"/*@bgen(jjtree)*/ + { + jjtree.closeNodeScope(jjtn000, true); + jjtc000 = false; + } +/*@egen*/ { jjtn000.op = ".*";} | "./"/*@bgen(jjtree)*/ } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); @@ -2365,7 +2380,7 @@ void factor() : {/*@bgen(jjtree) factor */ } {/*@bgen(jjtree) factor */ try { /*@egen*/ - primary() ( "^" | ".^" primary() )?/*@bgen(jjtree)*/ + primary() ( factor_op() primary() )?/*@bgen(jjtree)*/ } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); @@ -2388,6 +2403,33 @@ void factor() : {/*@bgen(jjtree) factor */ /*@egen*/ } +void factor_op() : {/*@bgen(jjtree) factor_op */ + SimpleNode jjtn000 = new SimpleNode(JJTFACTOR_OP); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); +/*@egen*/ +} {/*@bgen(jjtree) factor_op */ + try { +/*@egen*/ + "^"/*@bgen(jjtree)*/ + { + jjtree.closeNodeScope(jjtn000, true); + jjtc000 = false; + } +/*@egen*/ { jjtn000.op = "^";} | ".^"/*@bgen(jjtree)*/ + { + jjtree.closeNodeScope(jjtn000, true); + jjtc000 = false; + } +/*@egen*/ { jjtn000.op = ".^";}/*@bgen(jjtree)*/ + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } +/*@egen*/ +} + void der_initial() : {/*@bgen(jjtree) der_initial */ SimpleNode jjtn000 = new SimpleNode(JJTDER_INITIAL); boolean jjtc000 = true; @@ -2650,7 +2692,7 @@ void function_arguments() : {/*@bgen(jjtree) function_arguments */ /*@egen*/ //expression [ "," function_arguments | for for_indices ] //| named_arguments - LOOKAHEAD(2) expression() ( "," function_arguments() | "for" for_indices() )? + LOOKAHEAD(2) expression() ( "," function_arguments() | "for" for_indices() { jjtn000.op = "for"; } )? | named_arguments()/*@bgen(jjtree)*/ } catch (Throwable jjte000) { if (jjtc000) { diff --git a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/parser/ModelicaParser.jjt b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/parser/ModelicaParser.jjt index 793e0cfd..422e38fd 100644 --- a/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/parser/ModelicaParser.jjt +++ b/fi.semantum.sysdyn.solver/src/fi/semantum/sysdyn/solver/parser/ModelicaParser.jjt @@ -71,10 +71,10 @@ TOKEN: | "*" | "/" | ".*" | "./" | "^" | ".^" | "=" | ":=" -| +| | { matchedToken.image = matchedToken.image.substring(1,matchedToken.image.length()-1); } -| +| | "." ()? (["e","E"] )? | "." (["e","E"] )? @@ -119,7 +119,7 @@ void class_definition() : { // class_specifier ( "encapsulated" )? ( "partial" )? - ( "class" | "model" | "record" | "block" | ( "expandable" )? "connector" | "type" | + ( "class" { jjtThis.op = "class"; } | "model" { jjtThis.op = "model"; } | "record" | "block" | ( "expandable" )? "connector" | "type" | "package" | "function" { jjtThis.op = "function"; } | "operator" | "operator function" | "operator record" ) class_specifier() } @@ -137,9 +137,9 @@ void class_specifier() : { Token t; // end IDENT LOOKAHEAD(2) t= { jjtThis.op = t.image; } string_comment() composition() "end" | LOOKAHEAD(2) "=" base_prefix() name() ( array_subscripts() )? ( class_modification() )? comment() + | LOOKAHEAD(3) "=" "der" "(" name() "," ( "," )* ")" comment() | LOOKAHEAD(3) "=" "enumeration" "(" ( ( enum_list() )? | ":" ) ")" comment() - |LOOKAHEAD(3) "=" "der" "(" name() "," ( "," )* ")" comment() - | "extends" ( class_modification() )? string_comment() composition() "end" + //| "extends" ( class_modification() )? string_comment() composition() "end" } void base_prefix() : { @@ -208,11 +208,11 @@ Node element() : { // ( ( class_definition | component_clause) | // replaceable ( class_definition | component_clause) // [constraining_clause comment]) - import_clause() | - extends_clause() | + import_clause() { return jjtThis; } | + extends_clause() { return jjtThis; } | ( "redeclare" )? ( "final" )? - ( "inner" )? ( "outer" )? + ( "inner" { jjtThis.op = "inner"; } )? ( "outer" { jjtThis.op = "outer"; } )? ( (class_definition() | component_clause()) | "replaceable" (class_definition() | component_clause()) (constraining_clause() comment())?) @@ -651,12 +651,17 @@ void term() : { void mul_op() : { } { - "*" { jjtThis.op = "*";} | "/" { jjtThis.op = "/";} | ".*" | "./" + "*" { jjtThis.op = "*";} | "/" { jjtThis.op = "/";} | ".*" { jjtThis.op = ".*";} | "./" } void factor() : { } { - primary() ( "^" | ".^" primary() )? + primary() ( factor_op() primary() )? +} + +void factor_op() : { +} { + "^" { jjtThis.op = "^";} | ".^" { jjtThis.op = ".^";} } void der_initial() : { @@ -717,7 +722,7 @@ void function_arguments() : { } { //expression [ "," function_arguments | for for_indices ] //| named_arguments - LOOKAHEAD(2) expression() ( "," function_arguments() | "for" for_indices() )? + LOOKAHEAD(2) expression() ( "," function_arguments() | "for" for_indices() { jjtThis.op = "for"; } )? | named_arguments() } diff --git a/org.simantics.modelica/src/org/simantics/modelica/ModelicaManager.java b/org.simantics.modelica/src/org/simantics/modelica/ModelicaManager.java index da8f6ba4..7908c7f9 100644 --- a/org.simantics.modelica/src/org/simantics/modelica/ModelicaManager.java +++ b/org.simantics.modelica/src/org/simantics/modelica/ModelicaManager.java @@ -174,7 +174,7 @@ public class ModelicaManager { * * @return Open Modelica home directory */ - private static File getOMHome() { + public static File getOMHome() { Preferences node = ConfigurationScope.INSTANCE.getNode(Activator.PLUGIN_ID); String omHomePath = node.get(OpenModelicaPreferences.OM_HOME, null); if (omHomePath != null) { @@ -298,7 +298,7 @@ public class ModelicaManager { thread.run(); } - public static SimulationLocation createSimulationLocation(File modelDir, String modelName, String modelContent) { + public static SimulationLocation createSimulationLocation(File modelDir, String modelName, String modelContent, File omHome, boolean isOldOMVersion) { if (!modelDir.isDirectory()) { return null; } @@ -323,7 +323,7 @@ public class ModelicaManager { } // full model files are (apparently) only needed for old parameter comparison routines - if (isOldOMVersion()) { + if (isOldOMVersion) { location.fullModelDir = new File(location.getModelDir(), "fullModel"); if (!location.fullModelDir.isDirectory()) { location.fullModelDir.mkdir(); @@ -332,7 +332,7 @@ public class ModelicaManager { location.fullModelScriptFile = new File(location.fullModelDir, location.getModelName() + "_full.mos"); } - location.omHome = getOMHome(); + location.omHome = omHome; return location; } diff --git a/org.simantics.modelica/src/org/simantics/modelica/data/SimulationResult.java b/org.simantics.modelica/src/org/simantics/modelica/data/SimulationResult.java index 315b1fc8..092ea62a 100644 --- a/org.simantics.modelica/src/org/simantics/modelica/data/SimulationResult.java +++ b/org.simantics.modelica/src/org/simantics/modelica/data/SimulationResult.java @@ -410,10 +410,10 @@ public class SimulationResult { */ public DataSet getDataSet(String name) { for(DataSet set : variables) - if(set.name.equalsIgnoreCase(name)) + if(set.name.equals(name)) // Why on earth had these been changed to equalsIgnoreCase??? return set; for(DataSet set : initials) - if(set.name.equalsIgnoreCase(name)) + if(set.name.equals(name)) // Why on earth had these been changed to equalsIgnoreCase??? return set; return null; } diff --git a/org.simantics.sysdyn.feature/rootfiles/molecules/Bathtub.sysdyn b/org.simantics.sysdyn.feature/rootfiles/molecules/Bathtub.sysdyn index cacb3605..39b0dd70 100644 Binary files a/org.simantics.sysdyn.feature/rootfiles/molecules/Bathtub.sysdyn and b/org.simantics.sysdyn.feature/rootfiles/molecules/Bathtub.sysdyn differ diff --git a/org.simantics.sysdyn.feature/rootfiles/molecules/Ceiling.sysdyn b/org.simantics.sysdyn.feature/rootfiles/molecules/Ceiling.sysdyn new file mode 100644 index 00000000..4a253123 Binary files /dev/null and b/org.simantics.sysdyn.feature/rootfiles/molecules/Ceiling.sysdyn differ diff --git a/org.simantics.sysdyn.feature/rootfiles/molecules/Decay.sysdyn b/org.simantics.sysdyn.feature/rootfiles/molecules/Decay.sysdyn index 334ca7e3..0244333a 100644 Binary files a/org.simantics.sysdyn.feature/rootfiles/molecules/Decay.sysdyn and b/org.simantics.sysdyn.feature/rootfiles/molecules/Decay.sysdyn differ diff --git a/org.simantics.sysdyn.feature/rootfiles/molecules/Extrapolation.sysdyn b/org.simantics.sysdyn.feature/rootfiles/molecules/Extrapolation.sysdyn new file mode 100644 index 00000000..beb195cc Binary files /dev/null and b/org.simantics.sysdyn.feature/rootfiles/molecules/Extrapolation.sysdyn differ diff --git a/org.simantics.sysdyn.feature/rootfiles/molecules/Extrapolation.sysdynModule b/org.simantics.sysdyn.feature/rootfiles/molecules/Extrapolation.sysdynModule new file mode 100644 index 00000000..37e17721 Binary files /dev/null and b/org.simantics.sysdyn.feature/rootfiles/molecules/Extrapolation.sysdynModule differ diff --git a/org.simantics.sysdyn.feature/rootfiles/molecules/Floor.sysdyn b/org.simantics.sysdyn.feature/rootfiles/molecules/Floor.sysdyn new file mode 100644 index 00000000..5e0ebb3c Binary files /dev/null and b/org.simantics.sysdyn.feature/rootfiles/molecules/Floor.sysdyn differ diff --git a/org.simantics.sysdyn.feature/rootfiles/molecules/MoleculeFunctions.sysdynFunctions b/org.simantics.sysdyn.feature/rootfiles/molecules/MoleculeFunctions.sysdynFunctions new file mode 100644 index 00000000..9cff2bc1 Binary files /dev/null and b/org.simantics.sysdyn.feature/rootfiles/molecules/MoleculeFunctions.sysdynFunctions differ diff --git a/org.simantics.sysdyn.feature/rootfiles/molecules/Multivariate Anchoring And Adjustment.sysdyn b/org.simantics.sysdyn.feature/rootfiles/molecules/Multivariate Anchoring And Adjustment.sysdyn new file mode 100644 index 00000000..3f021b0f Binary files /dev/null and b/org.simantics.sysdyn.feature/rootfiles/molecules/Multivariate Anchoring And Adjustment.sysdyn differ diff --git a/org.simantics.sysdyn.feature/rootfiles/molecules/Protected Sea Ancoring And Adjustment.sysdyn b/org.simantics.sysdyn.feature/rootfiles/molecules/Protected Sea Ancoring And Adjustment.sysdyn new file mode 100644 index 00000000..709a93a0 Binary files /dev/null and b/org.simantics.sysdyn.feature/rootfiles/molecules/Protected Sea Ancoring And Adjustment.sysdyn differ diff --git a/org.simantics.sysdyn.feature/rootfiles/molecules/Sea Anchoring And Adjustment.sysdyn b/org.simantics.sysdyn.feature/rootfiles/molecules/Sea Anchoring And Adjustment.sysdyn new file mode 100644 index 00000000..0ea99426 Binary files /dev/null and b/org.simantics.sysdyn.feature/rootfiles/molecules/Sea Anchoring And Adjustment.sysdyn differ diff --git a/org.simantics.sysdyn.feature/rootfiles/molecules/Smooth.sysdyn b/org.simantics.sysdyn.feature/rootfiles/molecules/Smooth.sysdyn index 2abde7d6..14ff7532 100644 Binary files a/org.simantics.sysdyn.feature/rootfiles/molecules/Smooth.sysdyn and b/org.simantics.sysdyn.feature/rootfiles/molecules/Smooth.sysdyn differ diff --git a/org.simantics.sysdyn.feature/rootfiles/molecules/Smooth.sysdynModule b/org.simantics.sysdyn.feature/rootfiles/molecules/Smooth.sysdynModule index c4cfc408..450f52c2 100644 Binary files a/org.simantics.sysdyn.feature/rootfiles/molecules/Smooth.sysdynModule and b/org.simantics.sysdyn.feature/rootfiles/molecules/Smooth.sysdynModule differ diff --git a/org.simantics.sysdyn.feature/rootfiles/molecules/SmoothThirdOrder.sysdyn b/org.simantics.sysdyn.feature/rootfiles/molecules/SmoothThirdOrder.sysdyn index caa66cee..bacab113 100644 Binary files a/org.simantics.sysdyn.feature/rootfiles/molecules/SmoothThirdOrder.sysdyn and b/org.simantics.sysdyn.feature/rootfiles/molecules/SmoothThirdOrder.sysdyn differ diff --git a/org.simantics.sysdyn.feature/rootfiles/molecules/SmoothThirdOrder.sysdynModule b/org.simantics.sysdyn.feature/rootfiles/molecules/SmoothThirdOrder.sysdynModule index 1186b743..30c80f39 100644 Binary files a/org.simantics.sysdyn.feature/rootfiles/molecules/SmoothThirdOrder.sysdynModule and b/org.simantics.sysdyn.feature/rootfiles/molecules/SmoothThirdOrder.sysdynModule differ diff --git a/org.simantics.sysdyn.feature/rootfiles/molecules/Tester For Molecules.sysdyn b/org.simantics.sysdyn.feature/rootfiles/molecules/Tester For Molecules.sysdyn index 5a96a7e6..7c98f041 100644 Binary files a/org.simantics.sysdyn.feature/rootfiles/molecules/Tester For Molecules.sysdyn and b/org.simantics.sysdyn.feature/rootfiles/molecules/Tester For Molecules.sysdyn differ diff --git a/org.simantics.sysdyn.feature/rootfiles/molecules/Trend.sysdyn b/org.simantics.sysdyn.feature/rootfiles/molecules/Trend.sysdyn new file mode 100644 index 00000000..79a1c5d6 Binary files /dev/null and b/org.simantics.sysdyn.feature/rootfiles/molecules/Trend.sysdyn differ diff --git a/org.simantics.sysdyn.feature/rootfiles/molecules/Trend.sysdynModule b/org.simantics.sysdyn.feature/rootfiles/molecules/Trend.sysdynModule new file mode 100644 index 00000000..0a195cef Binary files /dev/null and b/org.simantics.sysdyn.feature/rootfiles/molecules/Trend.sysdynModule differ diff --git a/org.simantics.sysdyn.feature/rootfiles/molecules/Univariate Anchoring And Adjustment.sysdyn b/org.simantics.sysdyn.feature/rootfiles/molecules/Univariate Anchoring And Adjustment.sysdyn new file mode 100644 index 00000000..70d58f14 Binary files /dev/null and b/org.simantics.sysdyn.feature/rootfiles/molecules/Univariate Anchoring And Adjustment.sysdyn differ diff --git a/org.simantics.sysdyn.feature/rootfiles/molecules/WeighedAverage.sysdyn b/org.simantics.sysdyn.feature/rootfiles/molecules/WeighedAverage.sysdyn new file mode 100644 index 00000000..c69c7c02 Binary files /dev/null and b/org.simantics.sysdyn.feature/rootfiles/molecules/WeighedAverage.sysdyn differ diff --git a/org.simantics.sysdyn.feature/rootfiles/sampleModels/Discovery And Exploitation Of Resources.sysdyn b/org.simantics.sysdyn.feature/rootfiles/sampleModels/Discovery And Exploitation Of Resources.sysdyn index bcbd16c2..e90a36a4 100644 Binary files a/org.simantics.sysdyn.feature/rootfiles/sampleModels/Discovery And Exploitation Of Resources.sysdyn and b/org.simantics.sysdyn.feature/rootfiles/sampleModels/Discovery And Exploitation Of Resources.sysdyn differ diff --git a/org.simantics.sysdyn.feature/rootfiles/sampleModels/Global Carbon Cycle.sysdyn b/org.simantics.sysdyn.feature/rootfiles/sampleModels/Global Carbon Cycle.sysdyn index 60edfdfa..9afc06ae 100644 Binary files a/org.simantics.sysdyn.feature/rootfiles/sampleModels/Global Carbon Cycle.sysdyn and b/org.simantics.sysdyn.feature/rootfiles/sampleModels/Global Carbon Cycle.sysdyn differ diff --git a/org.simantics.sysdyn.feature/rootfiles/sampleModels/Predator And Limited Prey.sysdyn b/org.simantics.sysdyn.feature/rootfiles/sampleModels/Predator And Limited Prey.sysdyn index 2a8f549d..7d2d2fe2 100644 Binary files a/org.simantics.sysdyn.feature/rootfiles/sampleModels/Predator And Limited Prey.sysdyn and b/org.simantics.sysdyn.feature/rootfiles/sampleModels/Predator And Limited Prey.sysdyn differ diff --git a/org.simantics.sysdyn.feature/rootfiles/sampleModels/Resource Exploitation Use Recycling.sysdyn b/org.simantics.sysdyn.feature/rootfiles/sampleModels/Resource Exploitation Use Recycling.sysdyn index 132c2fc7..33a8815c 100644 Binary files a/org.simantics.sysdyn.feature/rootfiles/sampleModels/Resource Exploitation Use Recycling.sysdyn and b/org.simantics.sysdyn.feature/rootfiles/sampleModels/Resource Exploitation Use Recycling.sysdyn differ diff --git a/org.simantics.sysdyn.feature/rootfiles/sampleModels/Tourists Environments And Hotel Facilities.sysdyn b/org.simantics.sysdyn.feature/rootfiles/sampleModels/Tourists Environments And Hotel Facilities.sysdyn index d82832a4..7af5e567 100644 Binary files a/org.simantics.sysdyn.feature/rootfiles/sampleModels/Tourists Environments And Hotel Facilities.sysdyn and b/org.simantics.sysdyn.feature/rootfiles/sampleModels/Tourists Environments And Hotel Facilities.sysdyn differ diff --git a/org.simantics.sysdyn.ontology/graph.tg b/org.simantics.sysdyn.ontology/graph.tg index 8f3e514e..37bbc783 100644 Binary files a/org.simantics.sysdyn.ontology/graph.tg and b/org.simantics.sysdyn.ontology/graph.tg differ diff --git a/org.simantics.sysdyn.ontology/graph/Sysdyn.pgraph b/org.simantics.sysdyn.ontology/graph/Sysdyn.pgraph index 4fc523d6..1ad68f5d 100644 --- a/org.simantics.sysdyn.ontology/graph/Sysdyn.pgraph +++ b/org.simantics.sysdyn.ontology/graph/Sysdyn.pgraph @@ -91,6 +91,7 @@ SYSDYN.HistoryRealization -- SYSDYN.DelayExpression.order --> L0.Integer -- SYSDYN.DelayExpression.delayTime --> L0.String -- SYSDYN.DelayExpression.initialValue --> L0.String -- SYSDYN.DelayExpression.isInformationDelay --> SYSDYN.DelayExpression -- SYSDYN.StockExpression.useCustomIntegral --> SYSDYN.StockExpression -- SYSDYN.DependencyConnection.strokeWidth --> L0.Float @@ -182,7 +182,7 @@ id="org.simantics.workbench.search.browser" minimized="false" relationship="stack" - relative="org.simantics.browsing.ui.graph.propertyView"> + relative="org.simantics.sysdyn.ui.browser">