]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/branches/simantics-1.4...
authorlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Wed, 4 May 2011 10:09:24 +0000 (10:09 +0000)
committerlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Wed, 4 May 2011 10:09:24 +0000 (10:09 +0000)
18 files changed:
org.simantics.modelica/src/org/simantics/modelica/ModelicaManager.java
org.simantics.modelica/src/org/simantics/modelica/data/CSVSimulationResult.java [new file with mode: 0644]
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/SysdynEditorNamingService.java [new file with mode: 0644]
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/project/SysdynProject.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/FunctionTab.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/expressions/ExpressionFieldConfiguration.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/functions/FunctionCodeWidget.java [new file with mode: 0644]
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/utils/VariableNameUtils.java
org.simantics.sysdyn/META-INF/MANIFEST.MF
org.simantics.sysdyn/src/org/simantics/sysdyn/manager/SysdynModel.java
org.simantics.sysdyn/src/org/simantics/sysdyn/modelParser/ModelParser.java [new file with mode: 0644]
org.simantics.sysdyn/src/org/simantics/sysdyn/modelParser/ModelParserConstants.java [new file with mode: 0644]
org.simantics.sysdyn/src/org/simantics/sysdyn/modelParser/ModelParserTokenManager.java [new file with mode: 0644]
org.simantics.sysdyn/src/org/simantics/sysdyn/modelParser/ModelicaParser.jj [new file with mode: 0644]
org.simantics.sysdyn/src/org/simantics/sysdyn/modelParser/ParseException.java [new file with mode: 0644]
org.simantics.sysdyn/src/org/simantics/sysdyn/modelParser/SimpleCharStream.java [new file with mode: 0644]
org.simantics.sysdyn/src/org/simantics/sysdyn/modelParser/Token.java [new file with mode: 0644]
org.simantics.sysdyn/src/org/simantics/sysdyn/modelParser/TokenMgrError.java [new file with mode: 0644]

index f8e4b18e91772591f6a01fd860fe72aca7bc42b7..ee9e4738f5894f1d34854dbf97e1194e8a0823c3 100644 (file)
@@ -243,7 +243,7 @@ public class ModelicaManager {
                modelName = modelName.replace(" ", "");\r
                File modelFile = new File(simulationDir, modelName + ".mo");\r
                File scriptFile = new File(simulationDir, modelName + ".mos");\r
-\r
+               String outputFormat = inits.containsKey("outputFormat") ? inits.get("outputFormat") : "\"plt\"";\r
                {\r
                        PrintStream s = new PrintStream(modelFile);\r
                        s.print(modelText);\r
@@ -259,7 +259,7 @@ public class ModelicaManager {
                                        ",startTime="+inits.get("start value")+\r
                                        ",stopTime="+inits.get("stop value")+\r
                                        ",method="+inits.get("method")+\r
-                                       ",outputFormat=\"plt\""\r
+                                       ",outputFormat="+ outputFormat\r
                        );\r
                        if(inits.containsKey("tolerance")) {\r
                                s.print(",tolerance="+inits.get("tolerance"));\r
@@ -275,7 +275,7 @@ public class ModelicaManager {
                return new SimulationLocation(\r
                                simulationDir,\r
                                new File(simulationDir, modelName + ".mos"),\r
-                               new File(simulationDir, modelName + "_res.plt"),\r
+                               new File(simulationDir, modelName + "_res." + outputFormat.substring(1, outputFormat.length()-1)),\r
                                new File(simulationDir, modelName + "_init.txt"),\r
                                new File(simulationDir, modelName + suffix)\r
                );\r
diff --git a/org.simantics.modelica/src/org/simantics/modelica/data/CSVSimulationResult.java b/org.simantics.modelica/src/org/simantics/modelica/data/CSVSimulationResult.java
new file mode 100644 (file)
index 0000000..49abb2b
--- /dev/null
@@ -0,0 +1,55 @@
+package org.simantics.modelica.data;\r
+\r
+import java.io.InputStream;\r
+import java.util.ArrayList;\r
+import java.util.HashMap;\r
+import java.util.List;\r
+\r
+\r
+public class CSVSimulationResult extends SimulationResult {\r
+\r
+       HashMap<String, List<Double>> valueMap = new HashMap<String, List<Double>>();\r
+       \r
+       @Override\r
+    public void read(InputStream stream) {\r
+               \r
+               // First line contains the variable names in format "name" (including quotes);\r
+               String line = getLine(stream);\r
+               if(line == null)\r
+                       return;\r
+               \r
+               // FIXME: yks elementti liikaa alusta.\r
+               line = line.substring(1, line.lastIndexOf("\""));\r
+               String[] names = line.split("\",\"");\r
+               \r
+               // Create lists for receiving values for each variable. Names still with quotes.\r
+               for(String name : names) {\r
+                       if(!name.isEmpty())\r
+                               valueMap.put(name, new ArrayList<Double>());\r
+               }\r
+\r
+        // Data sets\r
+               while((line = getLine(stream)) != null) {      \r
+            if(line.isEmpty())\r
+                break;\r
+                       String[] values = line.split(",");\r
+                       for(int i = 0; i<values.length; i++) {\r
+                               if(values[i] != null && !values[i].isEmpty() && i < names.length) {\r
+                                       try {\r
+                                               valueMap.get(names[i]).add(Double.parseDouble(values[i]));\r
+                                       } catch (NumberFormatException e) {\r
+                                               e.printStackTrace();\r
+                                               break;\r
+                                       }\r
+                               }\r
+                       }\r
+               }\r
+        \r
+        // Create datasets for variables. Substring quotes from variable names.\r
+        for(String key : valueMap.keySet()) {\r
+               DataSet ds = new DataSet(key, valueMap.get("time"), valueMap.get(key));\r
+               variables.add(ds);\r
+        }\r
+    }\r
+    \r
+}\r
diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/SysdynEditorNamingService.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/SysdynEditorNamingService.java
new file mode 100644 (file)
index 0000000..261d04d
--- /dev/null
@@ -0,0 +1,62 @@
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2011 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ *     VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.ui.editor;\r
+\r
+import org.eclipse.ui.IEditorInput;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.common.utils.NameUtils;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.layer0.variable.Variable;\r
+import org.simantics.db.layer0.variable.Variables;\r
+import org.simantics.modeling.ui.features.EditorNamingService2;\r
+import org.simantics.simulation.ontology.SimulationResource;\r
+import org.simantics.ui.workbench.IResourceEditorInput2;\r
+\r
+/**\r
+ * SysdynEditorNamingService provides names for diagram viewers. \r
+ * If the viewer shows an instantiated module, the service provides a name of type: "instanceName : instanceOf".\r
+ * Otherwise works as standard EditorNamingService2.\r
+ * \r
+ * @author TLTEEMU\r
+ *\r
+ */\r
+public class SysdynEditorNamingService extends EditorNamingService2 {\r
+       \r
+    @Override\r
+    public String getName(ReadGraph g, String editorId, IEditorInput in) throws DatabaseException {\r
+        if(in instanceof IResourceEditorInput2) {\r
+                IResourceEditorInput2 input = (IResourceEditorInput2) in;\r
+                \r
+                if(!input.getRVI().isEmpty()) {\r
+                        Resource model = g.getPossibleResource(input.getModelURI());\r
+                        if(model != null) {\r
+                                Resource configuration = g.getPossibleObject(model, SimulationResource.getInstance(g).HasConfiguration);\r
+                                String configurationName = NameUtils.getSafeName(g, configuration);\r
+                        String uri = input.getModelURI() + "/" + configurationName + input.getRVI();\r
+                        Variable v = Variables.getPossibleVariable(g, uri);\r
+                        if(v != null) {\r
+                                String name = input.getRVI();\r
+                                if(name.contains("/"))\r
+                                        name = name.substring(name.lastIndexOf("/") + 1);\r
+                                \r
+                                String instanceOf = super.getName(g, editorId, in);\r
+                                return name + " : " + instanceOf;\r
+                        }\r
+                        }\r
+\r
+                }\r
+        }\r
+        return super.getName(g, editorId, in);\r
+    }\r
+\r
+}\r
index 96f7693aa7f443b9105b9fe56ebf3be5a6d9bf52..657a8ff1b88a138b630531cd5b013d262309baab 100644 (file)
@@ -44,7 +44,6 @@ import org.simantics.modeling.ModelingResources;
 import org.simantics.modeling.ModelingUtils;\r
 import org.simantics.modeling.services.CaseInsensitiveComponentNamingStrategy2;\r
 import org.simantics.modeling.services.ComponentNamingStrategy;\r
-import org.simantics.modeling.ui.features.EditorNamingService2;\r
 import org.simantics.project.IProject;\r
 import org.simantics.project.ProjectElementType;\r
 import org.simantics.project.ProjectElements;\r
@@ -57,6 +56,7 @@ import org.simantics.simulation.ontology.SimulationResource;
 import org.simantics.simulation.project.IExperimentManager;\r
 import org.simantics.sysdyn.SysdynResource;\r
 import org.simantics.sysdyn.ui.Activator;\r
+import org.simantics.sysdyn.ui.editor.SysdynEditorNamingService;\r
 import org.simantics.ui.SimanticsUI;\r
 import org.simantics.ui.workbench.IEditorNamingService;\r
 import org.simantics.ui.workbench.action.ChooseActionRequest;\r
@@ -186,7 +186,7 @@ public class SysdynProject extends AbstractProjectFeature {
 \r
         getProjectElement().setHint(ProjectKeys.DEFAULT_PERSPECTIVE, DEFAULT_PERSPECTIVE);\r
 \r
-        getProjectElement().setHint(IEditorNamingService.KEY_EDITOR_NAMING_SERVICE, new EditorNamingService2());\r
+        getProjectElement().setHint(IEditorNamingService.KEY_EDITOR_NAMING_SERVICE, new SysdynEditorNamingService());\r
 \r
         mm = new ModelManager();\r
         getProjectElement().setHint(UIModelManager.KEY_MODEL_MANAGER, mm);\r
index 2d7e2c22e42e9ff719ff763642a7eecff8637267..9d9eec4d3dd53df1f477ec785ff59756e579ae57 100644 (file)
@@ -28,11 +28,14 @@ import org.simantics.db.WriteGraph;
 import org.simantics.db.exception.DatabaseException;\r
 import org.simantics.db.management.ISessionContext;\r
 import org.simantics.layer0.Layer0;\r
-import org.simantics.sysdyn.SysdynResource;\r
 import org.simantics.sysdyn.manager.FunctionUtils;\r
 import org.simantics.sysdyn.ui.properties.widgets.FunctionLabelFactory;\r
+import org.simantics.sysdyn.ui.properties.widgets.expressions.ExpressionField;\r
+import org.simantics.sysdyn.ui.properties.widgets.functions.FunctionCodeWidget;\r
 \r
 public class FunctionTab extends LabelPropertyTabContributor {\r
+       \r
+       ExpressionField modelicaCode;\r
 \r
        @Override\r
        public void createControls(Composite body, IWorkbenchSite site,\r
@@ -64,6 +67,9 @@ public class FunctionTab extends LabelPropertyTabContributor {
         \r
         Label startLabel = new Label(modelicaGroup, support, SWT.NONE);\r
         startLabel.setTextFactory(new FunctionLabelFactory(Layer0.URIs.HasName, false));\r
+        \r
+        new FunctionCodeWidget(modelicaGroup, support, SWT.BORDER);\r
+        /*\r
         TrackedText modelicaCode = new TrackedText(modelicaGroup, support, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.WRAP);\r
         modelicaCode.setTextFactory(new StringPropertyFactory(SysdynResource.URIs.HasModelicaFunctionCode));\r
         modelicaCode.addModifyListener(new StringPropertyModifier(context, SysdynResource.URIs.HasModelicaFunctionCode));\r
@@ -78,6 +84,7 @@ public class FunctionTab extends LabelPropertyTabContributor {
                });\r
         \r
         GridDataFactory.fillDefaults().grab(true, true).applyTo(modelicaCode.getWidget());\r
+        */\r
         Label endLabel = new Label(modelicaGroup, support, SWT.NONE);\r
         endLabel.setTextFactory(new FunctionLabelFactory(Layer0.URIs.HasName, true));\r
 \r
index 000db7bec563e7c9cc14bd2c254704b5be1fe28a..ba5d08be37fe211f291891e5bfe0fa698e4c7dbf 100644 (file)
@@ -94,7 +94,8 @@ public class ExpressionFieldConfiguration extends SourceViewerConfiguration {
 \r
                IRule[] rules = new IRule[] {\r
                                reservedWord,\r
-                               new MultiLineRule("/*", "*/", comment)\r
+                               new MultiLineRule("/*", "*/", comment),\r
+                               new MultiLineRule("\"", "\"", comment)\r
                };\r
                scanner.setRules(rules);\r
 \r
diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/functions/FunctionCodeWidget.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/functions/FunctionCodeWidget.java
new file mode 100644 (file)
index 0000000..7c07e30
--- /dev/null
@@ -0,0 +1,205 @@
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2011 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ *     VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.sysdyn.ui.properties.widgets.functions;\r
+\r
+import java.awt.event.ActionEvent;\r
+import java.awt.event.ActionListener;\r
+import java.io.StringReader;\r
+\r
+import javax.swing.Timer;\r
+\r
+import org.eclipse.jface.layout.GridDataFactory;\r
+import org.eclipse.swt.SWT;\r
+import org.eclipse.swt.custom.StyledText;\r
+import org.eclipse.swt.custom.VerifyKeyListener;\r
+import org.eclipse.swt.events.FocusAdapter;\r
+import org.eclipse.swt.events.FocusEvent;\r
+import org.eclipse.swt.events.ModifyEvent;\r
+import org.eclipse.swt.events.ModifyListener;\r
+import org.eclipse.swt.events.VerifyEvent;\r
+import org.eclipse.swt.widgets.Composite;\r
+import org.eclipse.swt.widgets.Listener;\r
+import org.simantics.browsing.ui.swt.widgets.impl.Widget;\r
+import org.simantics.browsing.ui.swt.widgets.impl.WidgetSupport;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.common.request.WriteRequest;\r
+import org.simantics.db.exception.DatabaseException;\r
+import org.simantics.db.management.ISessionContext;\r
+import org.simantics.db.request.Read;\r
+import org.simantics.layer0.Layer0;\r
+import org.simantics.sysdyn.SysdynResource;\r
+import org.simantics.sysdyn.modelParser.ModelParser;\r
+import org.simantics.sysdyn.modelParser.ParseException;\r
+import org.simantics.sysdyn.modelParser.Token;\r
+import org.simantics.sysdyn.modelParser.TokenMgrError;\r
+import org.simantics.sysdyn.manager.FunctionUtils;\r
+import org.simantics.sysdyn.ui.properties.widgets.expressions.ExpressionField;\r
+import org.simantics.ui.SimanticsUI;\r
+import org.simantics.ui.utils.AdaptionUtils;\r
+\r
+public class FunctionCodeWidget implements Widget {\r
+       \r
+       private ExpressionField modelicaCode;\r
+       private Resource function;\r
+       \r
+    private Timer updateChartTimer;\r
+    private static int VALIDATION_DELAY_TIME = 500;\r
+       \r
+       public FunctionCodeWidget(Composite parent, WidgetSupport support, int style) {\r
+               support.register(this);\r
+               \r
+        modelicaCode = new ExpressionField(parent, SWT.BORDER);\r
+        GridDataFactory.fillDefaults().grab(true, true).applyTo(modelicaCode);\r
+        \r
+\r
+        // Support shift+enter for line change\r
+        modelicaCode.getSourceViewer().getTextWidget().addVerifyKeyListener(new VerifyKeyListener() {\r
+\r
+               @Override\r
+               public void verifyKey(VerifyEvent event) {\r
+                       if(event.keyCode == SWT.CR || event.keyCode == SWT.KEYPAD_CR) {\r
+                               if((event.stateMask & SWT.SHIFT) == 0) {\r
+                                       event.doit = false;\r
+                                       Listener[] listeners = modelicaCode.getSourceViewer().getTextWidget().getListeners(SWT.FocusOut);\r
+                                       for(Listener l : listeners) {\r
+                                               modelicaCode.getSourceViewer().getTextWidget().removeListener(SWT.FocusOut, l);\r
+                                       }\r
+                                       ((StyledText)event.widget).getParent().forceFocus();\r
+                                       save();\r
+                                       for(Listener l : listeners) {\r
+                                               modelicaCode.getSourceViewer().getTextWidget().addListener(SWT.FocusOut, l);\r
+                                       }\r
+                               \r
+                               }\r
+                       }\r
+               }\r
+        });\r
+        \r
+        \r
+        modelicaCode.getSourceViewer().getTextWidget().addModifyListener(new ModifyListener() {\r
+\r
+                       @Override\r
+                       public void modifyText(ModifyEvent e) {\r
+                               validateFieldsTimed();\r
+                       }\r
+               });\r
+        \r
+        modelicaCode.getSourceViewer().getTextWidget().addFocusListener(new FocusAdapter() {\r
+                       @Override\r
+                       public void focusLost(FocusEvent e) {\r
+                               save();\r
+                       }\r
+               });\r
+               \r
+        \r
+        updateChartTimer = new Timer(VALIDATION_DELAY_TIME, new ActionListener() {\r
+\r
+            @Override\r
+            public void actionPerformed(ActionEvent e) {\r
+               if(modelicaCode == null || modelicaCode.isDisposed())\r
+                       return;\r
+               modelicaCode.getDisplay().asyncExec(new Runnable() {\r
+                               \r
+                               @Override\r
+                               public void run() {\r
+                                       validate();\r
+                               }\r
+                       });\r
+            }\r
+        });\r
+        updateChartTimer.setRepeats(false);\r
+       }\r
+\r
+       @Override\r
+       public void setInput(ISessionContext context, Object input) {\r
+               function = AdaptionUtils.adaptToSingle(input, Resource.class);\r
+               \r
+               try {\r
+                       String code = context.getSession().syncRequest(new Read<String>() {\r
+\r
+                               @Override\r
+                               public String perform(ReadGraph graph) throws DatabaseException {\r
+                                       String code = graph.getPossibleRelatedValue(\r
+                                                       function, SysdynResource.getInstance(graph).HasModelicaFunctionCode);\r
+                                       return code;\r
+                               }\r
+                               \r
+                       });\r
+                       if(code != null) {\r
+                               modelicaCode.setExpression(code);\r
+                               validate();\r
+                       }\r
+               } catch (DatabaseException e) {\r
+                       e.printStackTrace();\r
+               }\r
+       }\r
+       \r
+       \r
+    public void validateFieldsTimed() {        \r
+       validateFieldsTimed(VALIDATION_DELAY_TIME);\r
+    }\r
+    \r
+    public void validateFieldsTimed(int delay) {\r
+       updateChartTimer.setDelay(delay);\r
+        if(!updateChartTimer.isRunning())\r
+            updateChartTimer.start();\r
+        else\r
+            updateChartTimer.restart();\r
+    }\r
+    \r
+    public void validate() {\r
+       modelicaCode.resetAnnotations();\r
+       String code = modelicaCode.getExpression();\r
+       StringReader sr = new StringReader(code);\r
+       ModelParser modelParser = new ModelParser(sr);\r
+       try {\r
+                       modelParser.parse_composition();\r
+               } catch (ParseException e1) {\r
+                       Token token = e1.currentToken;\r
+                       modelicaCode.setSyntaxError(token.image, "Syntax error", token.beginLine, token.beginColumn, token.endLine, token.endColumn);\r
+               } catch (TokenMgrError err) {\r
+                       String message = err.getMessage();\r
+                       String line = message.substring(0, message.indexOf(","));\r
+                       line = line.substring(line.lastIndexOf(" ") + 1);\r
+                       String column = message.substring(message.indexOf(",") + 1, message.indexOf("."));\r
+                       column = column.substring(column.lastIndexOf(" ") + 1);\r
+                       try {\r
+                               Integer endLine = Integer.parseInt(line);\r
+                               Integer endColumn = Integer.parseInt(column);\r
+                               Token token = modelParser.token;\r
+                               modelicaCode.setSyntaxError(token.image, "Syntax error", token.endLine, token.endColumn, endLine, endColumn);\r
+                       } catch (NumberFormatException e) {\r
+                               \r
+                       }\r
+                       \r
+               }\r
+       }\r
+    \r
+    private void save() {\r
+       final String code = modelicaCode.getExpression();\r
+       SimanticsUI.getSession().asyncRequest(new WriteRequest() {\r
+                       \r
+                       @Override\r
+                       public void perform(WriteGraph graph) throws DatabaseException {\r
+                               graph.claimLiteral(\r
+                                               function, \r
+                                               SysdynResource.getInstance(graph).HasModelicaFunctionCode, \r
+                                               code);\r
+                               Resource library = graph.getSingleObject(function, Layer0.getInstance(graph).PartOf);\r
+                               FunctionUtils.updateFunctionFileForLibrary(graph, library);\r
+                       }\r
+               });\r
+    }\r
+\r
+}\r
index 3f9459d8ee825a7c37f3a94ebfd80b91ddc1e71b..de42301334d347195377ce179fb699d69178d2be 100644 (file)
@@ -74,7 +74,7 @@ public class VariableNameUtils {
        private static String replaceAllWords(String original, String find, String replacement) {\r
                if(!original.contains(find)) return original;\r
                StringBuilder result = new StringBuilder(original.length());\r
-               String delimiters = "+-*/(){}[],.: ";\r
+               String delimiters = "+-*/(){}[],.: \t\n\r\f";\r
                StringTokenizer st = new StringTokenizer(original, delimiters, true);\r
                while (st.hasMoreTokens()) {\r
                        String w = st.nextToken();\r
index ce7c53a5eeb22780664a2499722071c4ed6c8592..f901e786b98eea95ef57dac5d2e0e5b51f16ce29 100644 (file)
@@ -24,16 +24,17 @@ Require-Bundle: org.simantics.objmap;bundle-version="0.1.0",
  org.simantics.scl.runtime;bundle-version="0.1.3",
  org.simantics.db.layer0;bundle-version="1.1.0"
 Export-Package: org.simantics.sysdyn,
+ org.simantics.sysdyn.adapter,
  org.simantics.sysdyn.expressionParser,
  org.simantics.sysdyn.manager,
  org.simantics.sysdyn.mdlImport,
  org.simantics.sysdyn.mdlImport.mdlElements,
+ org.simantics.sysdyn.modelParser,
  org.simantics.sysdyn.modelica,
  org.simantics.sysdyn.representation,
  org.simantics.sysdyn.representation.visitors,
  org.simantics.sysdyn.simulation,
- org.simantics.sysdyn.tableParser,
- org.simantics.sysdyn.adapter
+ org.simantics.sysdyn.tableParser
 Bundle-Activator: org.simantics.sysdyn.Activator
 Bundle-ActivationPolicy: lazy
 Import-Package: org.eclipse.ui
index 094d29a590bd625260649ef5433930d89e2c4ce8..ed8941b4b31f3a3387a8bcefa9efbede522e8373 100644 (file)
@@ -37,6 +37,7 @@ import org.simantics.modelica.IModelicaMonitor;
 import org.simantics.modelica.ModelicaException;\r
 import org.simantics.modelica.ModelicaManager;\r
 import org.simantics.modelica.SimulationLocation;\r
+import org.simantics.modelica.data.CSVSimulationResult;\r
 import org.simantics.modelica.data.SimulationResult;\r
 import org.simantics.objmap.IMapping;\r
 import org.simantics.objmap.IMappingListener;\r
@@ -172,6 +173,8 @@ public class SysdynModel implements IMappingListener, IModel {
                Double numberOfIntervals = model.getOutputInterval();\r
                inits.put("start value", startTime.toString());\r
                inits.put("stop value", stopTime.toString());\r
+               String outputFormat = "\"csv\"";\r
+               inits.put("outputFormat", outputFormat);\r
                if(numberOfIntervals != null) {\r
                        inits.put("step value", numberOfIntervals.toString());\r
                } else {\r
@@ -213,6 +216,7 @@ public class SysdynModel implements IMappingListener, IModel {
                                previousImportantInits.put("start value", startTime.toString());\r
                                previousImportantInits.put("stop value", stopTime.toString());\r
                                previousImportantInits.put("method", method);\r
+                               previousImportantInits.put("outputFormat", outputFormat);\r
                        } catch (ModelicaException e) {\r
                                if(e.getMessage() != null)\r
                                        monitor.message(e.getMessage());\r
@@ -242,13 +246,12 @@ public class SysdynModel implements IMappingListener, IModel {
                                                if(!canceled) {\r
                                                        progressMonitor.worked(1);\r
                                                        progressMonitor.subTask("Read results");\r
-                                                       result = new SimulationResult();\r
+                                                       result = new CSVSimulationResult();\r
                                                        result.read(simulationLocation.outputFile);\r
                                                        result.readInits(simulationLocation.initFile);\r
                                                        result.filter();\r
                                                        sysdynResult.setResult(result);\r
                                                        progressMonitor.worked(1);\r
-                                                       \r
                                                        resultChanged();\r
                                                        \r
                                                        setExperimentStopped(experiment);\r
diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/modelParser/ModelParser.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/modelParser/ModelParser.java
new file mode 100644 (file)
index 0000000..b069dc0
--- /dev/null
@@ -0,0 +1,3728 @@
+/* Generated By:JavaCC: Do not edit this line. ModelParser.java */\r
+package org.simantics.sysdyn.modelParser;\r
+\r
+public class ModelParser implements ModelParserConstants {\r
+\r
+/*** Parser ********************************************************/\r
+\r
+// https://javacc.dev.java.net/doc/javaccgrm.html\r
+// add_op -> add_op()\r
+// [ add_op ] -> ( add_op() )?\r
+// { add_op term } -> ( add_op() term() )*\r
+  final public void parse() throws ParseException {\r
+    stored_definition();\r
+    jj_consume_token(0);\r
+  }\r
+\r
+/*** Stored Definition - Within ************************************/\r
+  final public void stored_definition() throws ParseException {\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 53:\r
+      jj_consume_token(53);\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 68:\r
+      case IDENT:\r
+        name();\r
+        break;\r
+      default:\r
+        jj_la1[0] = jj_gen;\r
+        ;\r
+      }\r
+      jj_consume_token(70);\r
+      break;\r
+    default:\r
+      jj_la1[1] = jj_gen;\r
+      ;\r
+    }\r
+    label_1:\r
+    while (true) {\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 7:\r
+      case 11:\r
+      case 17:\r
+      case 24:\r
+      case 26:\r
+      case 30:\r
+      case 34:\r
+      case 37:\r
+      case 38:\r
+      case 44:\r
+      case 47:\r
+      case 50:\r
+      case 61:\r
+      case 94:\r
+      case 95:\r
+        ;\r
+        break;\r
+      default:\r
+        jj_la1[2] = jj_gen;\r
+        break label_1;\r
+      }\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 11:\r
+        jj_consume_token(11);\r
+        break;\r
+      default:\r
+        jj_la1[3] = jj_gen;\r
+        ;\r
+      }\r
+      class_definition();\r
+      jj_consume_token(70);\r
+    }\r
+  }\r
+\r
+/*** Class Definition **********************************************/\r
+  final public void class_definition() throws ParseException {\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 30:\r
+      jj_consume_token(30);\r
+      break;\r
+    default:\r
+      jj_la1[4] = jj_gen;\r
+      ;\r
+    }\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 47:\r
+      jj_consume_token(47);\r
+      break;\r
+    default:\r
+      jj_la1[5] = jj_gen;\r
+      ;\r
+    }\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 34:\r
+      jj_consume_token(34);\r
+      break;\r
+    case 7:\r
+      jj_consume_token(7);\r
+      break;\r
+    case 61:\r
+      jj_consume_token(61);\r
+      break;\r
+    case 24:\r
+      jj_consume_token(24);\r
+      break;\r
+    case 44:\r
+    case 50:\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 50:\r
+        jj_consume_token(50);\r
+        break;\r
+      default:\r
+        jj_la1[6] = jj_gen;\r
+        ;\r
+      }\r
+      jj_consume_token(44);\r
+      break;\r
+    case 38:\r
+      jj_consume_token(38);\r
+      break;\r
+    case 37:\r
+      jj_consume_token(37);\r
+      break;\r
+    case 26:\r
+      jj_consume_token(26);\r
+      break;\r
+    case 17:\r
+      jj_consume_token(17);\r
+      break;\r
+    case 94:\r
+      jj_consume_token(94);\r
+      break;\r
+    case 95:\r
+      jj_consume_token(95);\r
+      break;\r
+    default:\r
+      jj_la1[7] = jj_gen;\r
+      jj_consume_token(-1);\r
+      throw new ParseException();\r
+    }\r
+    class_specifier();\r
+  }\r
+\r
+  final public void class_specifier() throws ParseException {\r
+    if (jj_2_1(2)) {\r
+      jj_consume_token(IDENT);\r
+      string_comment();\r
+      composition();\r
+      jj_consume_token(35);\r
+      jj_consume_token(IDENT);\r
+    } else if (jj_2_2(2)) {\r
+      jj_consume_token(IDENT);\r
+      jj_consume_token(88);\r
+      base_prefix();\r
+      name();\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 66:\r
+        array_subscripts();\r
+        break;\r
+      default:\r
+        jj_la1[8] = jj_gen;\r
+        ;\r
+      }\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 62:\r
+        class_modification();\r
+        break;\r
+      default:\r
+        jj_la1[9] = jj_gen;\r
+        ;\r
+      }\r
+      comment();\r
+    } else if (jj_2_3(3)) {\r
+      jj_consume_token(IDENT);\r
+      jj_consume_token(88);\r
+      jj_consume_token(40);\r
+      jj_consume_token(62);\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case IDENT:\r
+        enum_list();\r
+        break;\r
+      default:\r
+        jj_la1[10] = jj_gen;\r
+        ;\r
+      }\r
+      jj_consume_token(63);\r
+      comment();\r
+    } else if (jj_2_4(3)) {\r
+      jj_consume_token(IDENT);\r
+      jj_consume_token(88);\r
+      jj_consume_token(58);\r
+      jj_consume_token(62);\r
+      name();\r
+      jj_consume_token(71);\r
+      jj_consume_token(IDENT);\r
+      label_2:\r
+      while (true) {\r
+        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+        case 71:\r
+          ;\r
+          break;\r
+        default:\r
+          jj_la1[11] = jj_gen;\r
+          break label_2;\r
+        }\r
+        jj_consume_token(71);\r
+        jj_consume_token(IDENT);\r
+      }\r
+      jj_consume_token(63);\r
+      comment();\r
+    } else {\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 55:\r
+        jj_consume_token(55);\r
+        jj_consume_token(IDENT);\r
+        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+        case 62:\r
+          class_modification();\r
+          break;\r
+        default:\r
+          jj_la1[12] = jj_gen;\r
+          ;\r
+        }\r
+        string_comment();\r
+        composition();\r
+        jj_consume_token(35);\r
+        jj_consume_token(IDENT);\r
+        break;\r
+      default:\r
+        jj_la1[13] = jj_gen;\r
+        jj_consume_token(-1);\r
+        throw new ParseException();\r
+      }\r
+    }\r
+  }\r
+\r
+  final public void base_prefix() throws ParseException {\r
+    type_prefix();\r
+  }\r
+\r
+  final public void enum_list() throws ParseException {\r
+    enumeration_literal();\r
+    label_3:\r
+    while (true) {\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 71:\r
+        ;\r
+        break;\r
+      default:\r
+        jj_la1[14] = jj_gen;\r
+        break label_3;\r
+      }\r
+      jj_consume_token(71);\r
+      enumeration_literal();\r
+    }\r
+  }\r
+\r
+  final public void enumeration_literal() throws ParseException {\r
+    jj_consume_token(IDENT);\r
+    comment();\r
+  }\r
+\r
+  final public void parse_composition() throws ParseException {\r
+    composition();\r
+    jj_consume_token(0);\r
+  }\r
+\r
+  final public void composition() throws ParseException {\r
+    element_list();\r
+    label_4:\r
+    while (true) {\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 4:\r
+      case 45:\r
+      case 46:\r
+      case 52:\r
+      case 57:\r
+        ;\r
+        break;\r
+      default:\r
+        jj_la1[15] = jj_gen;\r
+        break label_4;\r
+      }\r
+      if (jj_2_5(2)) {\r
+        jj_consume_token(57);\r
+        element_list();\r
+      } else {\r
+        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+        case 52:\r
+          jj_consume_token(52);\r
+          element_list();\r
+          break;\r
+        case 45:\r
+        case 46:\r
+          equation_section();\r
+          break;\r
+        case 4:\r
+          algorithm_section();\r
+          break;\r
+        default:\r
+          jj_la1[16] = jj_gen;\r
+          jj_consume_token(-1);\r
+          throw new ParseException();\r
+        }\r
+      }\r
+    }\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 59:\r
+      jj_consume_token(59);\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case STRING:\r
+        language_specification();\r
+        break;\r
+      default:\r
+        jj_la1[17] = jj_gen;\r
+        ;\r
+      }\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 68:\r
+      case IDENT:\r
+        external_function_call();\r
+        break;\r
+      default:\r
+        jj_la1[18] = jj_gen;\r
+        ;\r
+      }\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 14:\r
+        annotation();\r
+        break;\r
+      default:\r
+        jj_la1[19] = jj_gen;\r
+        ;\r
+      }\r
+      jj_consume_token(70);\r
+      break;\r
+    default:\r
+      jj_la1[20] = jj_gen;\r
+      ;\r
+    }\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 14:\r
+      annotation();\r
+      jj_consume_token(70);\r
+      break;\r
+    default:\r
+      jj_la1[21] = jj_gen;\r
+      ;\r
+    }\r
+  }\r
+\r
+  final public void language_specification() throws ParseException {\r
+    jj_consume_token(STRING);\r
+  }\r
+\r
+  final public void external_function_call() throws ParseException {\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 68:\r
+    case IDENT:\r
+      component_reference();\r
+      jj_consume_token(88);\r
+      break;\r
+    default:\r
+      jj_la1[22] = jj_gen;\r
+      ;\r
+    }\r
+    jj_consume_token(IDENT);\r
+    jj_consume_token(62);\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 6:\r
+    case 12:\r
+    case 31:\r
+    case 33:\r
+    case 35:\r
+    case 46:\r
+    case 58:\r
+    case 62:\r
+    case 64:\r
+    case 66:\r
+    case 68:\r
+    case 78:\r
+    case 79:\r
+    case 80:\r
+    case 81:\r
+    case IDENT:\r
+    case STRING:\r
+    case UNSIGNED_INTEGER:\r
+    case UNSIGNED_NUMBER:\r
+      expression_list();\r
+      break;\r
+    default:\r
+      jj_la1[23] = jj_gen;\r
+      ;\r
+    }\r
+    jj_consume_token(63);\r
+  }\r
+\r
+  final public void element_list() throws ParseException {\r
+    label_5:\r
+    while (true) {\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 5:\r
+      case 7:\r
+      case 8:\r
+      case 11:\r
+      case 13:\r
+      case 16:\r
+      case 17:\r
+      case 23:\r
+      case 24:\r
+      case 26:\r
+      case 27:\r
+      case 30:\r
+      case 32:\r
+      case 34:\r
+      case 36:\r
+      case 37:\r
+      case 38:\r
+      case 42:\r
+      case 44:\r
+      case 47:\r
+      case 49:\r
+      case 50:\r
+      case 51:\r
+      case 55:\r
+      case 56:\r
+      case 61:\r
+      case 68:\r
+      case IDENT:\r
+      case 94:\r
+      case 95:\r
+        ;\r
+        break;\r
+      default:\r
+        jj_la1[24] = jj_gen;\r
+        break label_5;\r
+      }\r
+      element();\r
+      jj_consume_token(70);\r
+    }\r
+  }\r
+\r
+  final public void element() throws ParseException {\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 36:\r
+      import_clause();\r
+      break;\r
+    case 55:\r
+      extends_clause();\r
+      break;\r
+    case 5:\r
+    case 7:\r
+    case 8:\r
+    case 11:\r
+    case 13:\r
+    case 16:\r
+    case 17:\r
+    case 23:\r
+    case 24:\r
+    case 26:\r
+    case 27:\r
+    case 30:\r
+    case 32:\r
+    case 34:\r
+    case 37:\r
+    case 38:\r
+    case 42:\r
+    case 44:\r
+    case 47:\r
+    case 49:\r
+    case 50:\r
+    case 51:\r
+    case 56:\r
+    case 61:\r
+    case 68:\r
+    case IDENT:\r
+    case 94:\r
+    case 95:\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 8:\r
+        jj_consume_token(8);\r
+        break;\r
+      default:\r
+        jj_la1[25] = jj_gen;\r
+        ;\r
+      }\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 11:\r
+        jj_consume_token(11);\r
+        break;\r
+      default:\r
+        jj_la1[26] = jj_gen;\r
+        ;\r
+      }\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 51:\r
+        jj_consume_token(51);\r
+        break;\r
+      default:\r
+        jj_la1[27] = jj_gen;\r
+        ;\r
+      }\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 27:\r
+        jj_consume_token(27);\r
+        break;\r
+      default:\r
+        jj_la1[28] = jj_gen;\r
+        ;\r
+      }\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 5:\r
+      case 7:\r
+      case 16:\r
+      case 17:\r
+      case 23:\r
+      case 24:\r
+      case 26:\r
+      case 30:\r
+      case 32:\r
+      case 34:\r
+      case 37:\r
+      case 38:\r
+      case 42:\r
+      case 44:\r
+      case 47:\r
+      case 49:\r
+      case 50:\r
+      case 56:\r
+      case 61:\r
+      case 68:\r
+      case IDENT:\r
+      case 94:\r
+      case 95:\r
+        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+        case 7:\r
+        case 17:\r
+        case 24:\r
+        case 26:\r
+        case 30:\r
+        case 34:\r
+        case 37:\r
+        case 38:\r
+        case 44:\r
+        case 47:\r
+        case 50:\r
+        case 61:\r
+        case 94:\r
+        case 95:\r
+          class_definition();\r
+          break;\r
+        case 5:\r
+        case 16:\r
+        case 23:\r
+        case 32:\r
+        case 42:\r
+        case 49:\r
+        case 56:\r
+        case 68:\r
+        case IDENT:\r
+          component_clause();\r
+          break;\r
+        default:\r
+          jj_la1[29] = jj_gen;\r
+          jj_consume_token(-1);\r
+          throw new ParseException();\r
+        }\r
+        break;\r
+      case 13:\r
+        jj_consume_token(13);\r
+        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+        case 7:\r
+        case 17:\r
+        case 24:\r
+        case 26:\r
+        case 30:\r
+        case 34:\r
+        case 37:\r
+        case 38:\r
+        case 44:\r
+        case 47:\r
+        case 50:\r
+        case 61:\r
+        case 94:\r
+        case 95:\r
+          class_definition();\r
+          break;\r
+        case 5:\r
+        case 16:\r
+        case 23:\r
+        case 32:\r
+        case 42:\r
+        case 49:\r
+        case 56:\r
+        case 68:\r
+        case IDENT:\r
+          component_clause();\r
+          break;\r
+        default:\r
+          jj_la1[30] = jj_gen;\r
+          jj_consume_token(-1);\r
+          throw new ParseException();\r
+        }\r
+        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+        case 54:\r
+          constraining_clause();\r
+          comment();\r
+          break;\r
+        default:\r
+          jj_la1[31] = jj_gen;\r
+          ;\r
+        }\r
+        break;\r
+      default:\r
+        jj_la1[32] = jj_gen;\r
+        jj_consume_token(-1);\r
+        throw new ParseException();\r
+      }\r
+      break;\r
+    default:\r
+      jj_la1[33] = jj_gen;\r
+      jj_consume_token(-1);\r
+      throw new ParseException();\r
+    }\r
+  }\r
+\r
+  final public void import_clause() throws ParseException {\r
+    jj_consume_token(36);\r
+    if (jj_2_6(2)) {\r
+      jj_consume_token(IDENT);\r
+      jj_consume_token(88);\r
+      name();\r
+    } else {\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 68:\r
+      case IDENT:\r
+        name();\r
+        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+        case 68:\r
+          jj_consume_token(68);\r
+          jj_consume_token(82);\r
+          break;\r
+        default:\r
+          jj_la1[34] = jj_gen;\r
+          ;\r
+        }\r
+        break;\r
+      default:\r
+        jj_la1[35] = jj_gen;\r
+        jj_consume_token(-1);\r
+        throw new ParseException();\r
+      }\r
+    }\r
+    comment();\r
+  }\r
+\r
+/*** Extends *******************************************************/\r
+  final public void extends_clause() throws ParseException {\r
+    jj_consume_token(55);\r
+    name();\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 62:\r
+      class_modification();\r
+      break;\r
+    default:\r
+      jj_la1[36] = jj_gen;\r
+      ;\r
+    }\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 14:\r
+      annotation();\r
+      break;\r
+    default:\r
+      jj_la1[37] = jj_gen;\r
+      ;\r
+    }\r
+  }\r
+\r
+  final public void constraining_clause() throws ParseException {\r
+    jj_consume_token(54);\r
+    name();\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 62:\r
+      class_modification();\r
+      break;\r
+    default:\r
+      jj_la1[38] = jj_gen;\r
+      ;\r
+    }\r
+  }\r
+\r
+/*** Component Clause **********************************************/\r
+  final public void component_clause() throws ParseException {\r
+    type_prefix();\r
+    type_specifier();\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 66:\r
+      array_subscripts();\r
+      break;\r
+    default:\r
+      jj_la1[39] = jj_gen;\r
+      ;\r
+    }\r
+    component_list();\r
+  }\r
+\r
+  final public void type_prefix() throws ParseException {\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 16:\r
+    case 23:\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 16:\r
+        jj_consume_token(16);\r
+        break;\r
+      case 23:\r
+        jj_consume_token(23);\r
+        break;\r
+      default:\r
+        jj_la1[40] = jj_gen;\r
+        jj_consume_token(-1);\r
+        throw new ParseException();\r
+      }\r
+      break;\r
+    default:\r
+      jj_la1[41] = jj_gen;\r
+      ;\r
+    }\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 5:\r
+    case 42:\r
+    case 49:\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 5:\r
+        jj_consume_token(5);\r
+        break;\r
+      case 42:\r
+        jj_consume_token(42);\r
+        break;\r
+      case 49:\r
+        jj_consume_token(49);\r
+        break;\r
+      default:\r
+        jj_la1[42] = jj_gen;\r
+        jj_consume_token(-1);\r
+        throw new ParseException();\r
+      }\r
+      break;\r
+    default:\r
+      jj_la1[43] = jj_gen;\r
+      ;\r
+    }\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 32:\r
+    case 56:\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 56:\r
+        jj_consume_token(56);\r
+        break;\r
+      case 32:\r
+        jj_consume_token(32);\r
+        break;\r
+      default:\r
+        jj_la1[44] = jj_gen;\r
+        jj_consume_token(-1);\r
+        throw new ParseException();\r
+      }\r
+      break;\r
+    default:\r
+      jj_la1[45] = jj_gen;\r
+      ;\r
+    }\r
+  }\r
+\r
+  final public void type_specifier() throws ParseException {\r
+    name();\r
+  }\r
+\r
+  final public void component_list() throws ParseException {\r
+    component_declaration();\r
+    label_6:\r
+    while (true) {\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 71:\r
+        ;\r
+        break;\r
+      default:\r
+        jj_la1[46] = jj_gen;\r
+        break label_6;\r
+      }\r
+      jj_consume_token(71);\r
+      component_declaration();\r
+    }\r
+  }\r
+\r
+  final public void component_declaration() throws ParseException {\r
+    declaration();\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 31:\r
+      conditional_attribute();\r
+      break;\r
+    default:\r
+      jj_la1[47] = jj_gen;\r
+      ;\r
+    }\r
+    comment();\r
+  }\r
+\r
+  final public void conditional_attribute() throws ParseException {\r
+    jj_consume_token(31);\r
+    expression();\r
+  }\r
+\r
+  final public void declaration() throws ParseException {\r
+    jj_consume_token(IDENT);\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 66:\r
+      array_subscripts();\r
+      break;\r
+    default:\r
+      jj_la1[48] = jj_gen;\r
+      ;\r
+    }\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 62:\r
+    case 88:\r
+    case 89:\r
+      modification();\r
+      break;\r
+    default:\r
+      jj_la1[49] = jj_gen;\r
+      ;\r
+    }\r
+  }\r
+\r
+/*** Modification **********************************************/\r
+  final public void modification() throws ParseException {\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 62:\r
+      class_modification();\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 88:\r
+        jj_consume_token(88);\r
+        expression();\r
+        break;\r
+      default:\r
+        jj_la1[50] = jj_gen;\r
+        ;\r
+      }\r
+      break;\r
+    case 88:\r
+      jj_consume_token(88);\r
+      expression();\r
+      break;\r
+    case 89:\r
+      jj_consume_token(89);\r
+      expression();\r
+      break;\r
+    default:\r
+      jj_la1[51] = jj_gen;\r
+      jj_consume_token(-1);\r
+      throw new ParseException();\r
+    }\r
+  }\r
+\r
+  final public void class_modification() throws ParseException {\r
+    jj_consume_token(62);\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 8:\r
+    case 10:\r
+    case 11:\r
+    case 13:\r
+    case 68:\r
+    case IDENT:\r
+      argument_list();\r
+      break;\r
+    default:\r
+      jj_la1[52] = jj_gen;\r
+      ;\r
+    }\r
+    jj_consume_token(63);\r
+  }\r
+\r
+  final public void argument_list() throws ParseException {\r
+    argument();\r
+    label_7:\r
+    while (true) {\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 71:\r
+        ;\r
+        break;\r
+      default:\r
+        jj_la1[53] = jj_gen;\r
+        break label_7;\r
+      }\r
+      jj_consume_token(71);\r
+      argument();\r
+    }\r
+  }\r
+\r
+  final public void argument() throws ParseException {\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 10:\r
+    case 11:\r
+    case 13:\r
+    case 68:\r
+    case IDENT:\r
+      element_modification_or_replaceable();\r
+      break;\r
+    case 8:\r
+      element_redeclaration();\r
+      break;\r
+    default:\r
+      jj_la1[54] = jj_gen;\r
+      jj_consume_token(-1);\r
+      throw new ParseException();\r
+    }\r
+  }\r
+\r
+  final public void element_modification_or_replaceable() throws ParseException {\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 10:\r
+      jj_consume_token(10);\r
+      break;\r
+    default:\r
+      jj_la1[55] = jj_gen;\r
+      ;\r
+    }\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 11:\r
+      jj_consume_token(11);\r
+      break;\r
+    default:\r
+      jj_la1[56] = jj_gen;\r
+      ;\r
+    }\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 68:\r
+    case IDENT:\r
+      element_modification();\r
+      break;\r
+    case 13:\r
+      element_replaceable();\r
+      break;\r
+    default:\r
+      jj_la1[57] = jj_gen;\r
+      jj_consume_token(-1);\r
+      throw new ParseException();\r
+    }\r
+  }\r
+\r
+  final public void element_modification() throws ParseException {\r
+    name();\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 62:\r
+    case 88:\r
+    case 89:\r
+      modification();\r
+      break;\r
+    default:\r
+      jj_la1[58] = jj_gen;\r
+      ;\r
+    }\r
+    string_comment();\r
+  }\r
+\r
+  final public void element_redeclaration() throws ParseException {\r
+    jj_consume_token(8);\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 10:\r
+      jj_consume_token(10);\r
+      break;\r
+    default:\r
+      jj_la1[59] = jj_gen;\r
+      ;\r
+    }\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 11:\r
+      jj_consume_token(11);\r
+      break;\r
+    default:\r
+      jj_la1[60] = jj_gen;\r
+      ;\r
+    }\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 5:\r
+    case 7:\r
+    case 16:\r
+    case 17:\r
+    case 23:\r
+    case 24:\r
+    case 26:\r
+    case 30:\r
+    case 32:\r
+    case 34:\r
+    case 37:\r
+    case 38:\r
+    case 42:\r
+    case 44:\r
+    case 47:\r
+    case 49:\r
+    case 50:\r
+    case 56:\r
+    case 61:\r
+    case 68:\r
+    case IDENT:\r
+    case 94:\r
+    case 95:\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 7:\r
+      case 17:\r
+      case 24:\r
+      case 26:\r
+      case 30:\r
+      case 34:\r
+      case 37:\r
+      case 38:\r
+      case 44:\r
+      case 47:\r
+      case 50:\r
+      case 61:\r
+      case 94:\r
+      case 95:\r
+        class_definition();\r
+        break;\r
+      case 5:\r
+      case 16:\r
+      case 23:\r
+      case 32:\r
+      case 42:\r
+      case 49:\r
+      case 56:\r
+      case 68:\r
+      case IDENT:\r
+        component_clause1();\r
+        break;\r
+      default:\r
+        jj_la1[61] = jj_gen;\r
+        jj_consume_token(-1);\r
+        throw new ParseException();\r
+      }\r
+      break;\r
+    case 13:\r
+      element_replaceable();\r
+      break;\r
+    default:\r
+      jj_la1[62] = jj_gen;\r
+      jj_consume_token(-1);\r
+      throw new ParseException();\r
+    }\r
+  }\r
+\r
+  final public void element_replaceable() throws ParseException {\r
+    jj_consume_token(13);\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 7:\r
+    case 17:\r
+    case 24:\r
+    case 26:\r
+    case 30:\r
+    case 34:\r
+    case 37:\r
+    case 38:\r
+    case 44:\r
+    case 47:\r
+    case 50:\r
+    case 61:\r
+    case 94:\r
+    case 95:\r
+      class_definition();\r
+      break;\r
+    case 5:\r
+    case 16:\r
+    case 23:\r
+    case 32:\r
+    case 42:\r
+    case 49:\r
+    case 56:\r
+    case 68:\r
+    case IDENT:\r
+      component_clause1();\r
+      break;\r
+    default:\r
+      jj_la1[63] = jj_gen;\r
+      jj_consume_token(-1);\r
+      throw new ParseException();\r
+    }\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 54:\r
+      constraining_clause();\r
+      break;\r
+    default:\r
+      jj_la1[64] = jj_gen;\r
+      ;\r
+    }\r
+  }\r
+\r
+  final public void component_clause1() throws ParseException {\r
+    type_prefix();\r
+    type_specifier();\r
+    component_declaration1();\r
+  }\r
+\r
+  final public void component_declaration1() throws ParseException {\r
+    declaration();\r
+    comment();\r
+  }\r
+\r
+/*** Equations *************************************************/\r
+  final public void equation_section() throws ParseException {\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 46:\r
+      jj_consume_token(46);\r
+      break;\r
+    default:\r
+      jj_la1[65] = jj_gen;\r
+      ;\r
+    }\r
+    jj_consume_token(45);\r
+    label_8:\r
+    while (true) {\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 6:\r
+      case 12:\r
+      case 21:\r
+      case 31:\r
+      case 33:\r
+      case 35:\r
+      case 39:\r
+      case 43:\r
+      case 46:\r
+      case 58:\r
+      case 62:\r
+      case 64:\r
+      case 66:\r
+      case 68:\r
+      case 78:\r
+      case 79:\r
+      case 80:\r
+      case 81:\r
+      case IDENT:\r
+      case STRING:\r
+      case UNSIGNED_INTEGER:\r
+      case UNSIGNED_NUMBER:\r
+        ;\r
+        break;\r
+      default:\r
+        jj_la1[66] = jj_gen;\r
+        break label_8;\r
+      }\r
+      equation();\r
+      jj_consume_token(70);\r
+    }\r
+  }\r
+\r
+  final public void algorithm_section() throws ParseException {\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 46:\r
+      jj_consume_token(46);\r
+      break;\r
+    default:\r
+      jj_la1[67] = jj_gen;\r
+      ;\r
+    }\r
+    jj_consume_token(4);\r
+    label_9:\r
+    while (true) {\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 18:\r
+      case 21:\r
+      case 29:\r
+      case 31:\r
+      case 43:\r
+      case 48:\r
+      case 62:\r
+      case 68:\r
+      case IDENT:\r
+        ;\r
+        break;\r
+      default:\r
+        jj_la1[68] = jj_gen;\r
+        break label_9;\r
+      }\r
+      statement();\r
+      jj_consume_token(70);\r
+    }\r
+  }\r
+\r
+  final public void equation() throws ParseException {\r
+    if (jj_2_7(3)) {\r
+      simple_expression();\r
+      jj_consume_token(88);\r
+      expression();\r
+    } else {\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 31:\r
+        if_equation();\r
+        break;\r
+      case 21:\r
+        for_equation();\r
+        break;\r
+      case 39:\r
+        connect_clause();\r
+        break;\r
+      case 43:\r
+        when_equation();\r
+        break;\r
+      case IDENT:\r
+        jj_consume_token(IDENT);\r
+        function_call_args();\r
+        break;\r
+      default:\r
+        jj_la1[69] = jj_gen;\r
+        jj_consume_token(-1);\r
+        throw new ParseException();\r
+      }\r
+    }\r
+    comment();\r
+  }\r
+\r
+  final public void statement() throws ParseException {\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 68:\r
+    case IDENT:\r
+      component_reference();\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 89:\r
+        jj_consume_token(89);\r
+        expression();\r
+        break;\r
+      case 62:\r
+        function_call_args();\r
+        break;\r
+      default:\r
+        jj_la1[70] = jj_gen;\r
+        jj_consume_token(-1);\r
+        throw new ParseException();\r
+      }\r
+      break;\r
+    case 62:\r
+      jj_consume_token(62);\r
+      output_expression_list();\r
+      jj_consume_token(63);\r
+      jj_consume_token(89);\r
+      component_reference();\r
+      function_call_args();\r
+      break;\r
+    case 29:\r
+      jj_consume_token(29);\r
+      break;\r
+    case 18:\r
+      jj_consume_token(18);\r
+      break;\r
+    case 31:\r
+      if_statement();\r
+      break;\r
+    case 21:\r
+      for_statement();\r
+      break;\r
+    case 48:\r
+      while_statement();\r
+      break;\r
+    case 43:\r
+      when_statement();\r
+      break;\r
+    default:\r
+      jj_la1[71] = jj_gen;\r
+      jj_consume_token(-1);\r
+      throw new ParseException();\r
+    }\r
+    comment();\r
+  }\r
+\r
+  final public void if_equation() throws ParseException {\r
+    jj_consume_token(31);\r
+    expression();\r
+    jj_consume_token(28);\r
+    label_10:\r
+    while (true) {\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 6:\r
+      case 12:\r
+      case 21:\r
+      case 31:\r
+      case 33:\r
+      case 35:\r
+      case 39:\r
+      case 43:\r
+      case 46:\r
+      case 58:\r
+      case 62:\r
+      case 64:\r
+      case 66:\r
+      case 68:\r
+      case 78:\r
+      case 79:\r
+      case 80:\r
+      case 81:\r
+      case IDENT:\r
+      case STRING:\r
+      case UNSIGNED_INTEGER:\r
+      case UNSIGNED_NUMBER:\r
+        ;\r
+        break;\r
+      default:\r
+        jj_la1[72] = jj_gen;\r
+        break label_10;\r
+      }\r
+      equation();\r
+      jj_consume_token(70);\r
+    }\r
+    label_11:\r
+    while (true) {\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 20:\r
+        ;\r
+        break;\r
+      default:\r
+        jj_la1[73] = jj_gen;\r
+        break label_11;\r
+      }\r
+      jj_consume_token(20);\r
+      expression();\r
+      jj_consume_token(28);\r
+      label_12:\r
+      while (true) {\r
+        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+        case 6:\r
+        case 12:\r
+        case 21:\r
+        case 31:\r
+        case 33:\r
+        case 35:\r
+        case 39:\r
+        case 43:\r
+        case 46:\r
+        case 58:\r
+        case 62:\r
+        case 64:\r
+        case 66:\r
+        case 68:\r
+        case 78:\r
+        case 79:\r
+        case 80:\r
+        case 81:\r
+        case IDENT:\r
+        case STRING:\r
+        case UNSIGNED_INTEGER:\r
+        case UNSIGNED_NUMBER:\r
+          ;\r
+          break;\r
+        default:\r
+          jj_la1[74] = jj_gen;\r
+          break label_12;\r
+        }\r
+        equation();\r
+        jj_consume_token(70);\r
+      }\r
+    }\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 15:\r
+      jj_consume_token(15);\r
+      label_13:\r
+      while (true) {\r
+        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+        case 6:\r
+        case 12:\r
+        case 21:\r
+        case 31:\r
+        case 33:\r
+        case 35:\r
+        case 39:\r
+        case 43:\r
+        case 46:\r
+        case 58:\r
+        case 62:\r
+        case 64:\r
+        case 66:\r
+        case 68:\r
+        case 78:\r
+        case 79:\r
+        case 80:\r
+        case 81:\r
+        case IDENT:\r
+        case STRING:\r
+        case UNSIGNED_INTEGER:\r
+        case UNSIGNED_NUMBER:\r
+          ;\r
+          break;\r
+        default:\r
+          jj_la1[75] = jj_gen;\r
+          break label_13;\r
+        }\r
+        equation();\r
+        jj_consume_token(70);\r
+      }\r
+      break;\r
+    default:\r
+      jj_la1[76] = jj_gen;\r
+      ;\r
+    }\r
+    jj_consume_token(35);\r
+    jj_consume_token(31);\r
+  }\r
+\r
+  final public void if_statement() throws ParseException {\r
+    jj_consume_token(31);\r
+    expression();\r
+    jj_consume_token(28);\r
+    label_14:\r
+    while (true) {\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 18:\r
+      case 21:\r
+      case 29:\r
+      case 31:\r
+      case 43:\r
+      case 48:\r
+      case 62:\r
+      case 68:\r
+      case IDENT:\r
+        ;\r
+        break;\r
+      default:\r
+        jj_la1[77] = jj_gen;\r
+        break label_14;\r
+      }\r
+      statement();\r
+      jj_consume_token(70);\r
+    }\r
+    label_15:\r
+    while (true) {\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 20:\r
+        ;\r
+        break;\r
+      default:\r
+        jj_la1[78] = jj_gen;\r
+        break label_15;\r
+      }\r
+      jj_consume_token(20);\r
+      expression();\r
+      jj_consume_token(28);\r
+      label_16:\r
+      while (true) {\r
+        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+        case 18:\r
+        case 21:\r
+        case 29:\r
+        case 31:\r
+        case 43:\r
+        case 48:\r
+        case 62:\r
+        case 68:\r
+        case IDENT:\r
+          ;\r
+          break;\r
+        default:\r
+          jj_la1[79] = jj_gen;\r
+          break label_16;\r
+        }\r
+        statement();\r
+        jj_consume_token(70);\r
+      }\r
+    }\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 15:\r
+      jj_consume_token(15);\r
+      label_17:\r
+      while (true) {\r
+        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+        case 18:\r
+        case 21:\r
+        case 29:\r
+        case 31:\r
+        case 43:\r
+        case 48:\r
+        case 62:\r
+        case 68:\r
+        case IDENT:\r
+          ;\r
+          break;\r
+        default:\r
+          jj_la1[80] = jj_gen;\r
+          break label_17;\r
+        }\r
+        statement();\r
+        jj_consume_token(70);\r
+      }\r
+      break;\r
+    default:\r
+      jj_la1[81] = jj_gen;\r
+      ;\r
+    }\r
+    jj_consume_token(35);\r
+    jj_consume_token(31);\r
+  }\r
+\r
+  final public void for_equation() throws ParseException {\r
+    jj_consume_token(21);\r
+    for_indices();\r
+    jj_consume_token(60);\r
+    label_18:\r
+    while (true) {\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 6:\r
+      case 12:\r
+      case 21:\r
+      case 31:\r
+      case 33:\r
+      case 35:\r
+      case 39:\r
+      case 43:\r
+      case 46:\r
+      case 58:\r
+      case 62:\r
+      case 64:\r
+      case 66:\r
+      case 68:\r
+      case 78:\r
+      case 79:\r
+      case 80:\r
+      case 81:\r
+      case IDENT:\r
+      case STRING:\r
+      case UNSIGNED_INTEGER:\r
+      case UNSIGNED_NUMBER:\r
+        ;\r
+        break;\r
+      default:\r
+        jj_la1[82] = jj_gen;\r
+        break label_18;\r
+      }\r
+      equation();\r
+      jj_consume_token(70);\r
+    }\r
+    jj_consume_token(35);\r
+    jj_consume_token(21);\r
+  }\r
+\r
+  final public void for_statement() throws ParseException {\r
+    jj_consume_token(21);\r
+    for_indices();\r
+    jj_consume_token(60);\r
+    label_19:\r
+    while (true) {\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 18:\r
+      case 21:\r
+      case 29:\r
+      case 31:\r
+      case 43:\r
+      case 48:\r
+      case 62:\r
+      case 68:\r
+      case IDENT:\r
+        ;\r
+        break;\r
+      default:\r
+        jj_la1[83] = jj_gen;\r
+        break label_19;\r
+      }\r
+      statement();\r
+      jj_consume_token(70);\r
+    }\r
+    jj_consume_token(35);\r
+    jj_consume_token(21);\r
+  }\r
+\r
+  final public void for_indices() throws ParseException {\r
+    for_index();\r
+    label_20:\r
+    while (true) {\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 71:\r
+        ;\r
+        break;\r
+      default:\r
+        jj_la1[84] = jj_gen;\r
+        break label_20;\r
+      }\r
+      jj_consume_token(71);\r
+      for_index();\r
+    }\r
+  }\r
+\r
+  final public void for_index() throws ParseException {\r
+    jj_consume_token(IDENT);\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 41:\r
+      jj_consume_token(41);\r
+      expression();\r
+      break;\r
+    default:\r
+      jj_la1[85] = jj_gen;\r
+      ;\r
+    }\r
+  }\r
+\r
+  final public void while_statement() throws ParseException {\r
+    jj_consume_token(48);\r
+    expression();\r
+    jj_consume_token(60);\r
+    label_21:\r
+    while (true) {\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 18:\r
+      case 21:\r
+      case 29:\r
+      case 31:\r
+      case 43:\r
+      case 48:\r
+      case 62:\r
+      case 68:\r
+      case IDENT:\r
+        ;\r
+        break;\r
+      default:\r
+        jj_la1[86] = jj_gen;\r
+        break label_21;\r
+      }\r
+      statement();\r
+      jj_consume_token(70);\r
+    }\r
+    jj_consume_token(35);\r
+    jj_consume_token(48);\r
+  }\r
+\r
+  final public void when_equation() throws ParseException {\r
+    jj_consume_token(43);\r
+    expression();\r
+    jj_consume_token(28);\r
+    label_22:\r
+    while (true) {\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 6:\r
+      case 12:\r
+      case 21:\r
+      case 31:\r
+      case 33:\r
+      case 35:\r
+      case 39:\r
+      case 43:\r
+      case 46:\r
+      case 58:\r
+      case 62:\r
+      case 64:\r
+      case 66:\r
+      case 68:\r
+      case 78:\r
+      case 79:\r
+      case 80:\r
+      case 81:\r
+      case IDENT:\r
+      case STRING:\r
+      case UNSIGNED_INTEGER:\r
+      case UNSIGNED_NUMBER:\r
+        ;\r
+        break;\r
+      default:\r
+        jj_la1[87] = jj_gen;\r
+        break label_22;\r
+      }\r
+      equation();\r
+      jj_consume_token(70);\r
+    }\r
+    label_23:\r
+    while (true) {\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 25:\r
+        ;\r
+        break;\r
+      default:\r
+        jj_la1[88] = jj_gen;\r
+        break label_23;\r
+      }\r
+      jj_consume_token(25);\r
+      expression();\r
+      jj_consume_token(28);\r
+      label_24:\r
+      while (true) {\r
+        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+        case 6:\r
+        case 12:\r
+        case 21:\r
+        case 31:\r
+        case 33:\r
+        case 35:\r
+        case 39:\r
+        case 43:\r
+        case 46:\r
+        case 58:\r
+        case 62:\r
+        case 64:\r
+        case 66:\r
+        case 68:\r
+        case 78:\r
+        case 79:\r
+        case 80:\r
+        case 81:\r
+        case IDENT:\r
+        case STRING:\r
+        case UNSIGNED_INTEGER:\r
+        case UNSIGNED_NUMBER:\r
+          ;\r
+          break;\r
+        default:\r
+          jj_la1[89] = jj_gen;\r
+          break label_24;\r
+        }\r
+        equation();\r
+        jj_consume_token(70);\r
+      }\r
+    }\r
+    jj_consume_token(35);\r
+    jj_consume_token(43);\r
+  }\r
+\r
+  final public void when_statement() throws ParseException {\r
+    jj_consume_token(43);\r
+    expression();\r
+    jj_consume_token(28);\r
+    label_25:\r
+    while (true) {\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 18:\r
+      case 21:\r
+      case 29:\r
+      case 31:\r
+      case 43:\r
+      case 48:\r
+      case 62:\r
+      case 68:\r
+      case IDENT:\r
+        ;\r
+        break;\r
+      default:\r
+        jj_la1[90] = jj_gen;\r
+        break label_25;\r
+      }\r
+      statement();\r
+      jj_consume_token(70);\r
+    }\r
+    label_26:\r
+    while (true) {\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 25:\r
+        ;\r
+        break;\r
+      default:\r
+        jj_la1[91] = jj_gen;\r
+        break label_26;\r
+      }\r
+      jj_consume_token(25);\r
+      expression();\r
+      jj_consume_token(28);\r
+      label_27:\r
+      while (true) {\r
+        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+        case 18:\r
+        case 21:\r
+        case 29:\r
+        case 31:\r
+        case 43:\r
+        case 48:\r
+        case 62:\r
+        case 68:\r
+        case IDENT:\r
+          ;\r
+          break;\r
+        default:\r
+          jj_la1[92] = jj_gen;\r
+          break label_27;\r
+        }\r
+        statement();\r
+        jj_consume_token(70);\r
+      }\r
+    }\r
+    jj_consume_token(35);\r
+    jj_consume_token(43);\r
+  }\r
+\r
+  final public void connect_clause() throws ParseException {\r
+    jj_consume_token(39);\r
+    jj_consume_token(62);\r
+    component_reference();\r
+    jj_consume_token(71);\r
+    component_reference();\r
+    jj_consume_token(63);\r
+  }\r
+\r
+/*** Expressions ***************************************************/\r
+  final public void expr() throws ParseException {\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 6:\r
+    case 12:\r
+    case 33:\r
+    case 35:\r
+    case 46:\r
+    case 58:\r
+    case 62:\r
+    case 64:\r
+    case 66:\r
+    case 68:\r
+    case 78:\r
+    case 79:\r
+    case 80:\r
+    case 81:\r
+    case IDENT:\r
+    case STRING:\r
+    case UNSIGNED_INTEGER:\r
+    case UNSIGNED_NUMBER:\r
+      simple_expression();\r
+      jj_consume_token(0);\r
+      break;\r
+    case 31:\r
+      jj_consume_token(31);\r
+      expression();\r
+      jj_consume_token(28);\r
+      expression();\r
+      label_28:\r
+      while (true) {\r
+        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+        case 20:\r
+          ;\r
+          break;\r
+        default:\r
+          jj_la1[93] = jj_gen;\r
+          break label_28;\r
+        }\r
+        jj_consume_token(20);\r
+        expression();\r
+        jj_consume_token(28);\r
+        expression();\r
+      }\r
+      jj_consume_token(15);\r
+      expression();\r
+      jj_consume_token(0);\r
+      break;\r
+    default:\r
+      jj_la1[94] = jj_gen;\r
+      jj_consume_token(-1);\r
+      throw new ParseException();\r
+    }\r
+  }\r
+\r
+  final public void expression() throws ParseException {\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 6:\r
+    case 12:\r
+    case 33:\r
+    case 35:\r
+    case 46:\r
+    case 58:\r
+    case 62:\r
+    case 64:\r
+    case 66:\r
+    case 68:\r
+    case 78:\r
+    case 79:\r
+    case 80:\r
+    case 81:\r
+    case IDENT:\r
+    case STRING:\r
+    case UNSIGNED_INTEGER:\r
+    case UNSIGNED_NUMBER:\r
+      simple_expression();\r
+      break;\r
+    case 31:\r
+      jj_consume_token(31);\r
+      expression();\r
+      jj_consume_token(28);\r
+      expression();\r
+      label_29:\r
+      while (true) {\r
+        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+        case 20:\r
+          ;\r
+          break;\r
+        default:\r
+          jj_la1[95] = jj_gen;\r
+          break label_29;\r
+        }\r
+        jj_consume_token(20);\r
+        expression();\r
+        jj_consume_token(28);\r
+        expression();\r
+      }\r
+      jj_consume_token(15);\r
+      expression();\r
+      break;\r
+    default:\r
+      jj_la1[96] = jj_gen;\r
+      jj_consume_token(-1);\r
+      throw new ParseException();\r
+    }\r
+  }\r
+\r
+  final public void simple_expression() throws ParseException {\r
+    logical_expression();\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 69:\r
+      jj_consume_token(69);\r
+      logical_expression();\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 69:\r
+        jj_consume_token(69);\r
+        logical_expression();\r
+        break;\r
+      default:\r
+        jj_la1[97] = jj_gen;\r
+        ;\r
+      }\r
+      break;\r
+    default:\r
+      jj_la1[98] = jj_gen;\r
+      ;\r
+    }\r
+  }\r
+\r
+  final public void logical_expression() throws ParseException {\r
+    logical_term();\r
+    label_30:\r
+    while (true) {\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 22:\r
+        ;\r
+        break;\r
+      default:\r
+        jj_la1[99] = jj_gen;\r
+        break label_30;\r
+      }\r
+      jj_consume_token(22);\r
+      logical_term();\r
+    }\r
+  }\r
+\r
+  final public void logical_term() throws ParseException {\r
+    logical_factor();\r
+    label_31:\r
+    while (true) {\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 9:\r
+        ;\r
+        break;\r
+      default:\r
+        jj_la1[100] = jj_gen;\r
+        break label_31;\r
+      }\r
+      jj_consume_token(9);\r
+      logical_factor();\r
+    }\r
+  }\r
+\r
+  final public void logical_factor() throws ParseException {\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 12:\r
+      jj_consume_token(12);\r
+      break;\r
+    default:\r
+      jj_la1[101] = jj_gen;\r
+      ;\r
+    }\r
+    relation();\r
+  }\r
+\r
+  final public void relation() throws ParseException {\r
+    arithmetic_expression();\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 72:\r
+    case 73:\r
+    case 74:\r
+    case 75:\r
+    case 76:\r
+    case 77:\r
+      rel_op();\r
+      arithmetic_expression();\r
+      break;\r
+    default:\r
+      jj_la1[102] = jj_gen;\r
+      ;\r
+    }\r
+  }\r
+\r
+  final public void rel_op() throws ParseException {\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 72:\r
+      jj_consume_token(72);\r
+      break;\r
+    case 73:\r
+      jj_consume_token(73);\r
+      break;\r
+    case 74:\r
+      jj_consume_token(74);\r
+      break;\r
+    case 75:\r
+      jj_consume_token(75);\r
+      break;\r
+    case 76:\r
+      jj_consume_token(76);\r
+      break;\r
+    case 77:\r
+      jj_consume_token(77);\r
+      break;\r
+    default:\r
+      jj_la1[103] = jj_gen;\r
+      jj_consume_token(-1);\r
+      throw new ParseException();\r
+    }\r
+  }\r
+\r
+  final public void arithmetic_expression() throws ParseException {\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 78:\r
+    case 79:\r
+    case 80:\r
+    case 81:\r
+      add_op();\r
+      break;\r
+    default:\r
+      jj_la1[104] = jj_gen;\r
+      ;\r
+    }\r
+    term();\r
+    label_32:\r
+    while (true) {\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 78:\r
+      case 79:\r
+      case 80:\r
+      case 81:\r
+        ;\r
+        break;\r
+      default:\r
+        jj_la1[105] = jj_gen;\r
+        break label_32;\r
+      }\r
+      add_op();\r
+      term();\r
+    }\r
+  }\r
+\r
+  final public void add_op() throws ParseException {\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 78:\r
+      jj_consume_token(78);\r
+      break;\r
+    case 79:\r
+      jj_consume_token(79);\r
+      break;\r
+    case 80:\r
+      jj_consume_token(80);\r
+      break;\r
+    case 81:\r
+      jj_consume_token(81);\r
+      break;\r
+    default:\r
+      jj_la1[106] = jj_gen;\r
+      jj_consume_token(-1);\r
+      throw new ParseException();\r
+    }\r
+  }\r
+\r
+  final public void term() throws ParseException {\r
+    factor();\r
+    label_33:\r
+    while (true) {\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 82:\r
+      case 83:\r
+      case 84:\r
+      case 85:\r
+        ;\r
+        break;\r
+      default:\r
+        jj_la1[107] = jj_gen;\r
+        break label_33;\r
+      }\r
+      mul_op();\r
+      factor();\r
+    }\r
+  }\r
+\r
+  final public void mul_op() throws ParseException {\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 82:\r
+      jj_consume_token(82);\r
+      break;\r
+    case 83:\r
+      jj_consume_token(83);\r
+      break;\r
+    case 84:\r
+      jj_consume_token(84);\r
+      break;\r
+    case 85:\r
+      jj_consume_token(85);\r
+      break;\r
+    default:\r
+      jj_la1[108] = jj_gen;\r
+      jj_consume_token(-1);\r
+      throw new ParseException();\r
+    }\r
+  }\r
+\r
+  final public void factor() throws ParseException {\r
+    primary();\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 86:\r
+    case 87:\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 86:\r
+        jj_consume_token(86);\r
+        break;\r
+      case 87:\r
+        jj_consume_token(87);\r
+        primary();\r
+        break;\r
+      default:\r
+        jj_la1[109] = jj_gen;\r
+        jj_consume_token(-1);\r
+        throw new ParseException();\r
+      }\r
+      break;\r
+    default:\r
+      jj_la1[110] = jj_gen;\r
+      ;\r
+    }\r
+  }\r
+\r
+  final public void primary() throws ParseException {\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case UNSIGNED_NUMBER:\r
+      jj_consume_token(UNSIGNED_NUMBER);\r
+      break;\r
+    case UNSIGNED_INTEGER:\r
+      jj_consume_token(UNSIGNED_INTEGER);\r
+      break;\r
+    case STRING:\r
+      jj_consume_token(STRING);\r
+      break;\r
+    case 6:\r
+      jj_consume_token(6);\r
+      break;\r
+    case 33:\r
+      jj_consume_token(33);\r
+      break;\r
+    default:\r
+      jj_la1[113] = jj_gen;\r
+      if (jj_2_8(2147483647)) {\r
+        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+        case 68:\r
+        case IDENT:\r
+          name();\r
+          break;\r
+        case 58:\r
+          jj_consume_token(58);\r
+          break;\r
+        case 46:\r
+          jj_consume_token(46);\r
+          break;\r
+        default:\r
+          jj_la1[111] = jj_gen;\r
+          jj_consume_token(-1);\r
+          throw new ParseException();\r
+        }\r
+        function_call_args();\r
+      } else {\r
+        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+        case 68:\r
+        case IDENT:\r
+          component_reference();\r
+          break;\r
+        case 62:\r
+          jj_consume_token(62);\r
+          output_expression_list();\r
+          jj_consume_token(63);\r
+          break;\r
+        case 66:\r
+          jj_consume_token(66);\r
+          expression_list();\r
+          label_34:\r
+          while (true) {\r
+            switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+            case 70:\r
+              ;\r
+              break;\r
+            default:\r
+              jj_la1[112] = jj_gen;\r
+              break label_34;\r
+            }\r
+            jj_consume_token(70);\r
+            expression_list();\r
+          }\r
+          jj_consume_token(67);\r
+          break;\r
+        case 64:\r
+          jj_consume_token(64);\r
+          function_arguments();\r
+          jj_consume_token(65);\r
+          break;\r
+        case 35:\r
+          jj_consume_token(35);\r
+          break;\r
+        default:\r
+          jj_la1[114] = jj_gen;\r
+          jj_consume_token(-1);\r
+          throw new ParseException();\r
+        }\r
+      }\r
+    }\r
+  }\r
+\r
+  final public void name() throws ParseException {\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 68:\r
+      jj_consume_token(68);\r
+      break;\r
+    default:\r
+      jj_la1[115] = jj_gen;\r
+      ;\r
+    }\r
+    jj_consume_token(IDENT);\r
+    label_35:\r
+    while (true) {\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 68:\r
+        ;\r
+        break;\r
+      default:\r
+        jj_la1[116] = jj_gen;\r
+        break label_35;\r
+      }\r
+      jj_consume_token(68);\r
+      jj_consume_token(IDENT);\r
+    }\r
+  }\r
+\r
+  final public void component_reference() throws ParseException {\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 68:\r
+      jj_consume_token(68);\r
+      break;\r
+    default:\r
+      jj_la1[117] = jj_gen;\r
+      ;\r
+    }\r
+    jj_consume_token(IDENT);\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 66:\r
+      array_subscripts();\r
+      break;\r
+    default:\r
+      jj_la1[118] = jj_gen;\r
+      ;\r
+    }\r
+    label_36:\r
+    while (true) {\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 68:\r
+        ;\r
+        break;\r
+      default:\r
+        jj_la1[119] = jj_gen;\r
+        break label_36;\r
+      }\r
+      jj_consume_token(68);\r
+      jj_consume_token(IDENT);\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 66:\r
+        array_subscripts();\r
+        break;\r
+      default:\r
+        jj_la1[120] = jj_gen;\r
+        ;\r
+      }\r
+    }\r
+  }\r
+\r
+  final public void function_call_args() throws ParseException {\r
+    jj_consume_token(62);\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 6:\r
+    case 12:\r
+    case 31:\r
+    case 33:\r
+    case 35:\r
+    case 46:\r
+    case 58:\r
+    case 62:\r
+    case 64:\r
+    case 66:\r
+    case 68:\r
+    case 78:\r
+    case 79:\r
+    case 80:\r
+    case 81:\r
+    case IDENT:\r
+    case STRING:\r
+    case UNSIGNED_INTEGER:\r
+    case UNSIGNED_NUMBER:\r
+      function_arguments();\r
+      break;\r
+    default:\r
+      jj_la1[121] = jj_gen;\r
+      ;\r
+    }\r
+    jj_consume_token(63);\r
+  }\r
+\r
+  final public void function_arguments() throws ParseException {\r
+    if (jj_2_9(2)) {\r
+      expression();\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 21:\r
+      case 71:\r
+        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+        case 71:\r
+          jj_consume_token(71);\r
+          function_arguments();\r
+          break;\r
+        case 21:\r
+          jj_consume_token(21);\r
+          for_indices();\r
+          break;\r
+        default:\r
+          jj_la1[122] = jj_gen;\r
+          jj_consume_token(-1);\r
+          throw new ParseException();\r
+        }\r
+        break;\r
+      default:\r
+        jj_la1[123] = jj_gen;\r
+        ;\r
+      }\r
+    } else {\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case IDENT:\r
+        named_arguments();\r
+        break;\r
+      default:\r
+        jj_la1[124] = jj_gen;\r
+        jj_consume_token(-1);\r
+        throw new ParseException();\r
+      }\r
+    }\r
+  }\r
+\r
+  final public void named_arguments() throws ParseException {\r
+    named_argument();\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 71:\r
+      jj_consume_token(71);\r
+      named_arguments();\r
+      break;\r
+    default:\r
+      jj_la1[125] = jj_gen;\r
+      ;\r
+    }\r
+  }\r
+\r
+  final public void named_argument() throws ParseException {\r
+    jj_consume_token(IDENT);\r
+    jj_consume_token(88);\r
+    expression();\r
+  }\r
+\r
+  final public void output_expression_list() throws ParseException {\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 6:\r
+    case 12:\r
+    case 31:\r
+    case 33:\r
+    case 35:\r
+    case 46:\r
+    case 58:\r
+    case 62:\r
+    case 64:\r
+    case 66:\r
+    case 68:\r
+    case 78:\r
+    case 79:\r
+    case 80:\r
+    case 81:\r
+    case IDENT:\r
+    case STRING:\r
+    case UNSIGNED_INTEGER:\r
+    case UNSIGNED_NUMBER:\r
+      expression();\r
+      break;\r
+    default:\r
+      jj_la1[126] = jj_gen;\r
+      ;\r
+    }\r
+    label_37:\r
+    while (true) {\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 71:\r
+        ;\r
+        break;\r
+      default:\r
+        jj_la1[127] = jj_gen;\r
+        break label_37;\r
+      }\r
+      jj_consume_token(71);\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 6:\r
+      case 12:\r
+      case 31:\r
+      case 33:\r
+      case 35:\r
+      case 46:\r
+      case 58:\r
+      case 62:\r
+      case 64:\r
+      case 66:\r
+      case 68:\r
+      case 78:\r
+      case 79:\r
+      case 80:\r
+      case 81:\r
+      case IDENT:\r
+      case STRING:\r
+      case UNSIGNED_INTEGER:\r
+      case UNSIGNED_NUMBER:\r
+        expression();\r
+        break;\r
+      default:\r
+        jj_la1[128] = jj_gen;\r
+        ;\r
+      }\r
+    }\r
+  }\r
+\r
+  final public void expression_list() throws ParseException {\r
+    expression();\r
+    label_38:\r
+    while (true) {\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 71:\r
+        ;\r
+        break;\r
+      default:\r
+        jj_la1[129] = jj_gen;\r
+        break label_38;\r
+      }\r
+      jj_consume_token(71);\r
+      expression();\r
+    }\r
+  }\r
+\r
+  final public void array_subscripts() throws ParseException {\r
+    jj_consume_token(66);\r
+    subscript();\r
+    label_39:\r
+    while (true) {\r
+      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+      case 71:\r
+        ;\r
+        break;\r
+      default:\r
+        jj_la1[130] = jj_gen;\r
+        break label_39;\r
+      }\r
+      jj_consume_token(71);\r
+      subscript();\r
+    }\r
+    jj_consume_token(67);\r
+  }\r
+\r
+  final public void subscript() throws ParseException {\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 69:\r
+      jj_consume_token(69);\r
+      break;\r
+    case 6:\r
+    case 12:\r
+    case 31:\r
+    case 33:\r
+    case 35:\r
+    case 46:\r
+    case 58:\r
+    case 62:\r
+    case 64:\r
+    case 66:\r
+    case 68:\r
+    case 78:\r
+    case 79:\r
+    case 80:\r
+    case 81:\r
+    case IDENT:\r
+    case STRING:\r
+    case UNSIGNED_INTEGER:\r
+    case UNSIGNED_NUMBER:\r
+      expression();\r
+      break;\r
+    default:\r
+      jj_la1[131] = jj_gen;\r
+      jj_consume_token(-1);\r
+      throw new ParseException();\r
+    }\r
+  }\r
+\r
+  final public void comment() throws ParseException {\r
+    string_comment();\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case 14:\r
+      annotation();\r
+      break;\r
+    default:\r
+      jj_la1[132] = jj_gen;\r
+      ;\r
+    }\r
+  }\r
+\r
+  final public void string_comment() throws ParseException {\r
+    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+    case STRING:\r
+      jj_consume_token(STRING);\r
+      label_40:\r
+      while (true) {\r
+        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r
+        case 78:\r
+          ;\r
+          break;\r
+        default:\r
+          jj_la1[133] = jj_gen;\r
+          break label_40;\r
+        }\r
+        jj_consume_token(78);\r
+        jj_consume_token(STRING);\r
+      }\r
+      break;\r
+    default:\r
+      jj_la1[134] = jj_gen;\r
+      ;\r
+    }\r
+  }\r
+\r
+  final public void annotation() throws ParseException {\r
+    jj_consume_token(14);\r
+    class_modification();\r
+  }\r
+\r
+  private boolean jj_2_1(int xla) {\r
+    jj_la = xla; jj_lastpos = jj_scanpos = token;\r
+    try { return !jj_3_1(); }\r
+    catch(LookaheadSuccess ls) { return true; }\r
+    finally { jj_save(0, xla); }\r
+  }\r
+\r
+  private boolean jj_2_2(int xla) {\r
+    jj_la = xla; jj_lastpos = jj_scanpos = token;\r
+    try { return !jj_3_2(); }\r
+    catch(LookaheadSuccess ls) { return true; }\r
+    finally { jj_save(1, xla); }\r
+  }\r
+\r
+  private boolean jj_2_3(int xla) {\r
+    jj_la = xla; jj_lastpos = jj_scanpos = token;\r
+    try { return !jj_3_3(); }\r
+    catch(LookaheadSuccess ls) { return true; }\r
+    finally { jj_save(2, xla); }\r
+  }\r
+\r
+  private boolean jj_2_4(int xla) {\r
+    jj_la = xla; jj_lastpos = jj_scanpos = token;\r
+    try { return !jj_3_4(); }\r
+    catch(LookaheadSuccess ls) { return true; }\r
+    finally { jj_save(3, xla); }\r
+  }\r
+\r
+  private boolean jj_2_5(int xla) {\r
+    jj_la = xla; jj_lastpos = jj_scanpos = token;\r
+    try { return !jj_3_5(); }\r
+    catch(LookaheadSuccess ls) { return true; }\r
+    finally { jj_save(4, xla); }\r
+  }\r
+\r
+  private boolean jj_2_6(int xla) {\r
+    jj_la = xla; jj_lastpos = jj_scanpos = token;\r
+    try { return !jj_3_6(); }\r
+    catch(LookaheadSuccess ls) { return true; }\r
+    finally { jj_save(5, xla); }\r
+  }\r
+\r
+  private boolean jj_2_7(int xla) {\r
+    jj_la = xla; jj_lastpos = jj_scanpos = token;\r
+    try { return !jj_3_7(); }\r
+    catch(LookaheadSuccess ls) { return true; }\r
+    finally { jj_save(6, xla); }\r
+  }\r
+\r
+  private boolean jj_2_8(int xla) {\r
+    jj_la = xla; jj_lastpos = jj_scanpos = token;\r
+    try { return !jj_3_8(); }\r
+    catch(LookaheadSuccess ls) { return true; }\r
+    finally { jj_save(7, xla); }\r
+  }\r
+\r
+  private boolean jj_2_9(int xla) {\r
+    jj_la = xla; jj_lastpos = jj_scanpos = token;\r
+    try { return !jj_3_9(); }\r
+    catch(LookaheadSuccess ls) { return true; }\r
+    finally { jj_save(8, xla); }\r
+  }\r
+\r
+  private boolean jj_3R_72() {\r
+    Token xsp;\r
+    xsp = jj_scanpos;\r
+    if (jj_scan_token(8)) jj_scanpos = xsp;\r
+    xsp = jj_scanpos;\r
+    if (jj_scan_token(11)) jj_scanpos = xsp;\r
+    xsp = jj_scanpos;\r
+    if (jj_scan_token(51)) jj_scanpos = xsp;\r
+    xsp = jj_scanpos;\r
+    if (jj_scan_token(27)) jj_scanpos = xsp;\r
+    xsp = jj_scanpos;\r
+    if (jj_3R_77()) {\r
+    jj_scanpos = xsp;\r
+    if (jj_3R_78()) return true;\r
+    }\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_95() {\r
+    if (jj_3R_101()) return true;\r
+    if (jj_3R_94()) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_71() {\r
+    if (jj_3R_76()) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_64() {\r
+    Token xsp;\r
+    xsp = jj_scanpos;\r
+    if (jj_3R_70()) {\r
+    jj_scanpos = xsp;\r
+    if (jj_3R_71()) {\r
+    jj_scanpos = xsp;\r
+    if (jj_3R_72()) return true;\r
+    }\r
+    }\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_70() {\r
+    if (jj_3R_75()) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_83() {\r
+    if (jj_3R_89()) return true;\r
+    if (jj_3R_82()) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_88() {\r
+    if (jj_3R_93()) return true;\r
+    if (jj_3R_87()) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_101() {\r
+    Token xsp;\r
+    xsp = jj_scanpos;\r
+    if (jj_scan_token(82)) {\r
+    jj_scanpos = xsp;\r
+    if (jj_scan_token(83)) {\r
+    jj_scanpos = xsp;\r
+    if (jj_scan_token(84)) {\r
+    jj_scanpos = xsp;\r
+    if (jj_scan_token(85)) return true;\r
+    }\r
+    }\r
+    }\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_87() {\r
+    if (jj_3R_94()) return true;\r
+    Token xsp;\r
+    while (true) {\r
+      xsp = jj_scanpos;\r
+      if (jj_3R_95()) { jj_scanpos = xsp; break; }\r
+    }\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_52() {\r
+    if (jj_3R_64()) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_43() {\r
+    Token xsp;\r
+    while (true) {\r
+      xsp = jj_scanpos;\r
+      if (jj_3R_52()) { jj_scanpos = xsp; break; }\r
+    }\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_93() {\r
+    Token xsp;\r
+    xsp = jj_scanpos;\r
+    if (jj_scan_token(78)) {\r
+    jj_scanpos = xsp;\r
+    if (jj_scan_token(79)) {\r
+    jj_scanpos = xsp;\r
+    if (jj_scan_token(80)) {\r
+    jj_scanpos = xsp;\r
+    if (jj_scan_token(81)) return true;\r
+    }\r
+    }\r
+    }\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_74() {\r
+    if (jj_scan_token(9)) return true;\r
+    if (jj_3R_73()) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_86() {\r
+    if (jj_3R_93()) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_82() {\r
+    Token xsp;\r
+    xsp = jj_scanpos;\r
+    if (jj_3R_86()) jj_scanpos = xsp;\r
+    if (jj_3R_87()) return true;\r
+    while (true) {\r
+      xsp = jj_scanpos;\r
+      if (jj_3R_88()) { jj_scanpos = xsp; break; }\r
+    }\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_89() {\r
+    Token xsp;\r
+    xsp = jj_scanpos;\r
+    if (jj_scan_token(72)) {\r
+    jj_scanpos = xsp;\r
+    if (jj_scan_token(73)) {\r
+    jj_scanpos = xsp;\r
+    if (jj_scan_token(74)) {\r
+    jj_scanpos = xsp;\r
+    if (jj_scan_token(75)) {\r
+    jj_scanpos = xsp;\r
+    if (jj_scan_token(76)) {\r
+    jj_scanpos = xsp;\r
+    if (jj_scan_token(77)) return true;\r
+    }\r
+    }\r
+    }\r
+    }\r
+    }\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_54() {\r
+    if (jj_scan_token(69)) return true;\r
+    if (jj_3R_53()) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_66() {\r
+    if (jj_scan_token(22)) return true;\r
+    if (jj_3R_65()) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3_7() {\r
+    if (jj_3R_44()) return true;\r
+    if (jj_scan_token(88)) return true;\r
+    if (jj_3R_45()) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_79() {\r
+    if (jj_3R_82()) return true;\r
+    Token xsp;\r
+    xsp = jj_scanpos;\r
+    if (jj_3R_83()) jj_scanpos = xsp;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_51() {\r
+    if (jj_3R_63()) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_50() {\r
+    if (jj_scan_token(59)) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_49() {\r
+    Token xsp;\r
+    xsp = jj_scanpos;\r
+    if (jj_3_5()) {\r
+    jj_scanpos = xsp;\r
+    if (jj_3R_60()) {\r
+    jj_scanpos = xsp;\r
+    if (jj_3R_61()) {\r
+    jj_scanpos = xsp;\r
+    if (jj_3R_62()) return true;\r
+    }\r
+    }\r
+    }\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3_5() {\r
+    if (jj_scan_token(57)) return true;\r
+    if (jj_3R_43()) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_73() {\r
+    Token xsp;\r
+    xsp = jj_scanpos;\r
+    if (jj_scan_token(12)) jj_scanpos = xsp;\r
+    if (jj_3R_79()) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_42() {\r
+    if (jj_3R_43()) return true;\r
+    Token xsp;\r
+    while (true) {\r
+      xsp = jj_scanpos;\r
+      if (jj_3R_49()) { jj_scanpos = xsp; break; }\r
+    }\r
+    xsp = jj_scanpos;\r
+    if (jj_3R_50()) jj_scanpos = xsp;\r
+    xsp = jj_scanpos;\r
+    if (jj_3R_51()) jj_scanpos = xsp;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_65() {\r
+    if (jj_3R_73()) return true;\r
+    Token xsp;\r
+    while (true) {\r
+      xsp = jj_scanpos;\r
+      if (jj_3R_74()) { jj_scanpos = xsp; break; }\r
+    }\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_69() {\r
+    Token xsp;\r
+    xsp = jj_scanpos;\r
+    if (jj_scan_token(46)) jj_scanpos = xsp;\r
+    if (jj_scan_token(4)) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_53() {\r
+    if (jj_3R_65()) return true;\r
+    Token xsp;\r
+    while (true) {\r
+      xsp = jj_scanpos;\r
+      if (jj_3R_66()) { jj_scanpos = xsp; break; }\r
+    }\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_68() {\r
+    Token xsp;\r
+    xsp = jj_scanpos;\r
+    if (jj_scan_token(46)) jj_scanpos = xsp;\r
+    if (jj_scan_token(45)) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_90() {\r
+    Token xsp;\r
+    xsp = jj_scanpos;\r
+    if (jj_scan_token(50)) jj_scanpos = xsp;\r
+    if (jj_scan_token(44)) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_44() {\r
+    if (jj_3R_53()) return true;\r
+    Token xsp;\r
+    xsp = jj_scanpos;\r
+    if (jj_3R_54()) jj_scanpos = xsp;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_56() {\r
+    if (jj_scan_token(31)) return true;\r
+    if (jj_3R_45()) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_55() {\r
+    if (jj_3R_44()) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_45() {\r
+    Token xsp;\r
+    xsp = jj_scanpos;\r
+    if (jj_3R_55()) {\r
+    jj_scanpos = xsp;\r
+    if (jj_3R_56()) return true;\r
+    }\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3_4() {\r
+    if (jj_scan_token(IDENT)) return true;\r
+    if (jj_scan_token(88)) return true;\r
+    if (jj_scan_token(58)) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3_3() {\r
+    if (jj_scan_token(IDENT)) return true;\r
+    if (jj_scan_token(88)) return true;\r
+    if (jj_scan_token(40)) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3_2() {\r
+    if (jj_scan_token(IDENT)) return true;\r
+    if (jj_scan_token(88)) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3_1() {\r
+    if (jj_scan_token(IDENT)) return true;\r
+    if (jj_3R_41()) return true;\r
+    if (jj_3R_42()) return true;\r
+    if (jj_scan_token(35)) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_84() {\r
+    Token xsp;\r
+    xsp = jj_scanpos;\r
+    if (jj_scan_token(30)) jj_scanpos = xsp;\r
+    xsp = jj_scanpos;\r
+    if (jj_scan_token(47)) jj_scanpos = xsp;\r
+    xsp = jj_scanpos;\r
+    if (jj_scan_token(34)) {\r
+    jj_scanpos = xsp;\r
+    if (jj_scan_token(7)) {\r
+    jj_scanpos = xsp;\r
+    if (jj_scan_token(61)) {\r
+    jj_scanpos = xsp;\r
+    if (jj_scan_token(24)) {\r
+    jj_scanpos = xsp;\r
+    if (jj_3R_90()) {\r
+    jj_scanpos = xsp;\r
+    if (jj_scan_token(38)) {\r
+    jj_scanpos = xsp;\r
+    if (jj_scan_token(37)) {\r
+    jj_scanpos = xsp;\r
+    if (jj_scan_token(26)) {\r
+    jj_scanpos = xsp;\r
+    if (jj_scan_token(17)) {\r
+    jj_scanpos = xsp;\r
+    if (jj_scan_token(94)) {\r
+    jj_scanpos = xsp;\r
+    if (jj_scan_token(95)) return true;\r
+    }\r
+    }\r
+    }\r
+    }\r
+    }\r
+    }\r
+    }\r
+    }\r
+    }\r
+    }\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_59() {\r
+    if (jj_scan_token(21)) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_63() {\r
+    if (jj_scan_token(14)) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_48() {\r
+    if (jj_scan_token(STRING)) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_41() {\r
+    Token xsp;\r
+    xsp = jj_scanpos;\r
+    if (jj_3R_48()) jj_scanpos = xsp;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_127() {\r
+    if (jj_3R_45()) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_123() {\r
+    if (jj_3R_45()) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_98() {\r
+    Token xsp;\r
+    xsp = jj_scanpos;\r
+    if (jj_scan_token(56)) {\r
+    jj_scanpos = xsp;\r
+    if (jj_scan_token(32)) return true;\r
+    }\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_119() {\r
+    if (jj_scan_token(71)) return true;\r
+    Token xsp;\r
+    xsp = jj_scanpos;\r
+    if (jj_3R_123()) jj_scanpos = xsp;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_125() {\r
+    Token xsp;\r
+    xsp = jj_scanpos;\r
+    if (jj_scan_token(69)) {\r
+    jj_scanpos = xsp;\r
+    if (jj_3R_127()) return true;\r
+    }\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_120() {\r
+    if (jj_scan_token(71)) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_122() {\r
+    if (jj_scan_token(66)) return true;\r
+    if (jj_3R_125()) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_117() {\r
+    if (jj_scan_token(68)) return true;\r
+    if (jj_scan_token(IDENT)) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_58() {\r
+    if (jj_scan_token(71)) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_47() {\r
+    Token xsp;\r
+    xsp = jj_scanpos;\r
+    if (jj_3R_58()) {\r
+    jj_scanpos = xsp;\r
+    if (jj_3R_59()) return true;\r
+    }\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_118() {\r
+    if (jj_3R_45()) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_112() {\r
+    if (jj_3R_45()) return true;\r
+    Token xsp;\r
+    while (true) {\r
+      xsp = jj_scanpos;\r
+      if (jj_3R_120()) { jj_scanpos = xsp; break; }\r
+    }\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_111() {\r
+    Token xsp;\r
+    xsp = jj_scanpos;\r
+    if (jj_3R_118()) jj_scanpos = xsp;\r
+    while (true) {\r
+      xsp = jj_scanpos;\r
+      if (jj_3R_119()) { jj_scanpos = xsp; break; }\r
+    }\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_62() {\r
+    if (jj_3R_69()) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_126() {\r
+    if (jj_scan_token(IDENT)) return true;\r
+    if (jj_scan_token(88)) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_108() {\r
+    if (jj_3R_57()) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_124() {\r
+    if (jj_3R_126()) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_116() {\r
+    if (jj_3R_122()) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_121() {\r
+    if (jj_3R_124()) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_92() {\r
+    if (jj_3R_57()) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_114() {\r
+    Token xsp;\r
+    xsp = jj_scanpos;\r
+    if (jj_3_9()) {\r
+    jj_scanpos = xsp;\r
+    if (jj_3R_121()) return true;\r
+    }\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3_9() {\r
+    if (jj_3R_45()) return true;\r
+    Token xsp;\r
+    xsp = jj_scanpos;\r
+    if (jj_3R_47()) jj_scanpos = xsp;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_67() {\r
+    if (jj_scan_token(68)) return true;\r
+    if (jj_scan_token(IDENT)) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_115() {\r
+    if (jj_3R_114()) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_97() {\r
+    Token xsp;\r
+    xsp = jj_scanpos;\r
+    if (jj_scan_token(5)) {\r
+    jj_scanpos = xsp;\r
+    if (jj_scan_token(42)) {\r
+    jj_scanpos = xsp;\r
+    if (jj_scan_token(49)) return true;\r
+    }\r
+    }\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_96() {\r
+    Token xsp;\r
+    xsp = jj_scanpos;\r
+    if (jj_scan_token(16)) {\r
+    jj_scanpos = xsp;\r
+    if (jj_scan_token(23)) return true;\r
+    }\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_91() {\r
+    Token xsp;\r
+    xsp = jj_scanpos;\r
+    if (jj_3R_96()) jj_scanpos = xsp;\r
+    xsp = jj_scanpos;\r
+    if (jj_3R_97()) jj_scanpos = xsp;\r
+    xsp = jj_scanpos;\r
+    if (jj_3R_98()) jj_scanpos = xsp;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_113() {\r
+    if (jj_scan_token(70)) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_109() {\r
+    if (jj_scan_token(62)) return true;\r
+    Token xsp;\r
+    xsp = jj_scanpos;\r
+    if (jj_3R_115()) jj_scanpos = xsp;\r
+    if (jj_scan_token(63)) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_61() {\r
+    if (jj_3R_68()) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_85() {\r
+    if (jj_3R_91()) return true;\r
+    if (jj_3R_92()) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_110() {\r
+    Token xsp;\r
+    xsp = jj_scanpos;\r
+    if (jj_scan_token(68)) jj_scanpos = xsp;\r
+    if (jj_scan_token(IDENT)) return true;\r
+    xsp = jj_scanpos;\r
+    if (jj_3R_116()) jj_scanpos = xsp;\r
+    while (true) {\r
+      xsp = jj_scanpos;\r
+      if (jj_3R_117()) { jj_scanpos = xsp; break; }\r
+    }\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_81() {\r
+    if (jj_3R_85()) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_57() {\r
+    Token xsp;\r
+    xsp = jj_scanpos;\r
+    if (jj_scan_token(68)) jj_scanpos = xsp;\r
+    if (jj_scan_token(IDENT)) return true;\r
+    while (true) {\r
+      xsp = jj_scanpos;\r
+      if (jj_3R_67()) { jj_scanpos = xsp; break; }\r
+    }\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_46() {\r
+    if (jj_3R_57()) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3_6() {\r
+    if (jj_scan_token(IDENT)) return true;\r
+    if (jj_scan_token(88)) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3_8() {\r
+    Token xsp;\r
+    xsp = jj_scanpos;\r
+    if (jj_3R_46()) {\r
+    jj_scanpos = xsp;\r
+    if (jj_scan_token(58)) {\r
+    jj_scanpos = xsp;\r
+    if (jj_scan_token(46)) return true;\r
+    }\r
+    }\r
+    if (jj_scan_token(62)) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_107() {\r
+    if (jj_scan_token(87)) return true;\r
+    if (jj_3R_99()) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_76() {\r
+    if (jj_scan_token(55)) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_100() {\r
+    Token xsp;\r
+    xsp = jj_scanpos;\r
+    if (jj_scan_token(86)) {\r
+    jj_scanpos = xsp;\r
+    if (jj_3R_107()) return true;\r
+    }\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_106() {\r
+    if (jj_scan_token(64)) return true;\r
+    if (jj_3R_114()) return true;\r
+    if (jj_scan_token(65)) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_78() {\r
+    if (jj_scan_token(13)) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_105() {\r
+    if (jj_scan_token(66)) return true;\r
+    if (jj_3R_112()) return true;\r
+    Token xsp;\r
+    while (true) {\r
+      xsp = jj_scanpos;\r
+      if (jj_3R_113()) { jj_scanpos = xsp; break; }\r
+    }\r
+    if (jj_scan_token(67)) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_75() {\r
+    if (jj_scan_token(36)) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_104() {\r
+    if (jj_scan_token(62)) return true;\r
+    if (jj_3R_111()) return true;\r
+    if (jj_scan_token(63)) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_102() {\r
+    Token xsp;\r
+    xsp = jj_scanpos;\r
+    if (jj_3R_108()) {\r
+    jj_scanpos = xsp;\r
+    if (jj_scan_token(58)) {\r
+    jj_scanpos = xsp;\r
+    if (jj_scan_token(46)) return true;\r
+    }\r
+    }\r
+    if (jj_3R_109()) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_103() {\r
+    if (jj_3R_110()) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_99() {\r
+    Token xsp;\r
+    xsp = jj_scanpos;\r
+    if (jj_scan_token(93)) {\r
+    jj_scanpos = xsp;\r
+    if (jj_scan_token(92)) {\r
+    jj_scanpos = xsp;\r
+    if (jj_scan_token(91)) {\r
+    jj_scanpos = xsp;\r
+    if (jj_scan_token(6)) {\r
+    jj_scanpos = xsp;\r
+    if (jj_scan_token(33)) {\r
+    jj_scanpos = xsp;\r
+    if (jj_3R_102()) {\r
+    jj_scanpos = xsp;\r
+    if (jj_3R_103()) {\r
+    jj_scanpos = xsp;\r
+    if (jj_3R_104()) {\r
+    jj_scanpos = xsp;\r
+    if (jj_3R_105()) {\r
+    jj_scanpos = xsp;\r
+    if (jj_3R_106()) {\r
+    jj_scanpos = xsp;\r
+    if (jj_scan_token(35)) return true;\r
+    }\r
+    }\r
+    }\r
+    }\r
+    }\r
+    }\r
+    }\r
+    }\r
+    }\r
+    }\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_60() {\r
+    if (jj_scan_token(52)) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_80() {\r
+    if (jj_3R_84()) return true;\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_77() {\r
+    Token xsp;\r
+    xsp = jj_scanpos;\r
+    if (jj_3R_80()) {\r
+    jj_scanpos = xsp;\r
+    if (jj_3R_81()) return true;\r
+    }\r
+    return false;\r
+  }\r
+\r
+  private boolean jj_3R_94() {\r
+    if (jj_3R_99()) return true;\r
+    Token xsp;\r
+    xsp = jj_scanpos;\r
+    if (jj_3R_100()) jj_scanpos = xsp;\r
+    return false;\r
+  }\r
+\r
+  /** Generated Token Manager. */\r
+  public ModelParserTokenManager token_source;\r
+  SimpleCharStream jj_input_stream;\r
+  /** Current token. */\r
+  public Token token;\r
+  /** Next token. */\r
+  public Token jj_nt;\r
+  private int jj_ntk;\r
+  private Token jj_scanpos, jj_lastpos;\r
+  private int jj_la;\r
+  private int jj_gen;\r
+  final private int[] jj_la1 = new int[135];\r
+  static private int[] jj_la1_0;\r
+  static private int[] jj_la1_1;\r
+  static private int[] jj_la1_2;\r
+  static {\r
+      jj_la1_init_0();\r
+      jj_la1_init_1();\r
+      jj_la1_init_2();\r
+   }\r
+   private static void jj_la1_init_0() {\r
+      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,0x80201040,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,};\r
+   }\r
+   private static void jj_la1_init_1() {\r
+      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,0x4400488a,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,};\r
+   }\r
+   private static void jj_la1_init_2() {\r
+      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,0x3c03c015,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,};\r
+   }\r
+  final private JJCalls[] jj_2_rtns = new JJCalls[9];\r
+  private boolean jj_rescan = false;\r
+  private int jj_gc = 0;\r
+\r
+  /** Constructor with InputStream. */\r
+  public ModelParser(java.io.InputStream stream) {\r
+     this(stream, null);\r
+  }\r
+  /** Constructor with InputStream and supplied encoding */\r
+  public ModelParser(java.io.InputStream stream, String encoding) {\r
+    try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }\r
+    token_source = new ModelParserTokenManager(jj_input_stream);\r
+    token = new Token();\r
+    jj_ntk = -1;\r
+    jj_gen = 0;\r
+    for (int i = 0; i < 135; i++) jj_la1[i] = -1;\r
+    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();\r
+  }\r
+\r
+  /** Reinitialise. */\r
+  public void ReInit(java.io.InputStream stream) {\r
+     ReInit(stream, null);\r
+  }\r
+  /** Reinitialise. */\r
+  public void ReInit(java.io.InputStream stream, String encoding) {\r
+    try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }\r
+    token_source.ReInit(jj_input_stream);\r
+    token = new Token();\r
+    jj_ntk = -1;\r
+    jj_gen = 0;\r
+    for (int i = 0; i < 135; i++) jj_la1[i] = -1;\r
+    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();\r
+  }\r
+\r
+  /** Constructor. */\r
+  public ModelParser(java.io.Reader stream) {\r
+    jj_input_stream = new SimpleCharStream(stream, 1, 1);\r
+    token_source = new ModelParserTokenManager(jj_input_stream);\r
+    token = new Token();\r
+    jj_ntk = -1;\r
+    jj_gen = 0;\r
+    for (int i = 0; i < 135; i++) jj_la1[i] = -1;\r
+    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();\r
+  }\r
+\r
+  /** Reinitialise. */\r
+  public void ReInit(java.io.Reader stream) {\r
+    jj_input_stream.ReInit(stream, 1, 1);\r
+    token_source.ReInit(jj_input_stream);\r
+    token = new Token();\r
+    jj_ntk = -1;\r
+    jj_gen = 0;\r
+    for (int i = 0; i < 135; i++) jj_la1[i] = -1;\r
+    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();\r
+  }\r
+\r
+  /** Constructor with generated Token Manager. */\r
+  public ModelParser(ModelParserTokenManager tm) {\r
+    token_source = tm;\r
+    token = new Token();\r
+    jj_ntk = -1;\r
+    jj_gen = 0;\r
+    for (int i = 0; i < 135; i++) jj_la1[i] = -1;\r
+    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();\r
+  }\r
+\r
+  /** Reinitialise. */\r
+  public void ReInit(ModelParserTokenManager tm) {\r
+    token_source = tm;\r
+    token = new Token();\r
+    jj_ntk = -1;\r
+    jj_gen = 0;\r
+    for (int i = 0; i < 135; i++) jj_la1[i] = -1;\r
+    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();\r
+  }\r
+\r
+  private Token jj_consume_token(int kind) throws ParseException {\r
+    Token oldToken;\r
+    if ((oldToken = token).next != null) token = token.next;\r
+    else token = token.next = token_source.getNextToken();\r
+    jj_ntk = -1;\r
+    if (token.kind == kind) {\r
+      jj_gen++;\r
+      if (++jj_gc > 100) {\r
+        jj_gc = 0;\r
+        for (int i = 0; i < jj_2_rtns.length; i++) {\r
+          JJCalls c = jj_2_rtns[i];\r
+          while (c != null) {\r
+            if (c.gen < jj_gen) c.first = null;\r
+            c = c.next;\r
+          }\r
+        }\r
+      }\r
+      return token;\r
+    }\r
+    token = oldToken;\r
+    jj_kind = kind;\r
+    throw generateParseException();\r
+  }\r
+\r
+  static private final class LookaheadSuccess extends java.lang.Error { }\r
+  final private LookaheadSuccess jj_ls = new LookaheadSuccess();\r
+  private boolean jj_scan_token(int kind) {\r
+    if (jj_scanpos == jj_lastpos) {\r
+      jj_la--;\r
+      if (jj_scanpos.next == null) {\r
+        jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();\r
+      } else {\r
+        jj_lastpos = jj_scanpos = jj_scanpos.next;\r
+      }\r
+    } else {\r
+      jj_scanpos = jj_scanpos.next;\r
+    }\r
+    if (jj_rescan) {\r
+      int i = 0; Token tok = token;\r
+      while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; }\r
+      if (tok != null) jj_add_error_token(kind, i);\r
+    }\r
+    if (jj_scanpos.kind != kind) return true;\r
+    if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls;\r
+    return false;\r
+  }\r
+\r
+\r
+/** Get the next Token. */\r
+  final public Token getNextToken() {\r
+    if (token.next != null) token = token.next;\r
+    else token = token.next = token_source.getNextToken();\r
+    jj_ntk = -1;\r
+    jj_gen++;\r
+    return token;\r
+  }\r
+\r
+/** Get the specific Token. */\r
+  final public Token getToken(int index) {\r
+    Token t = token;\r
+    for (int i = 0; i < index; i++) {\r
+      if (t.next != null) t = t.next;\r
+      else t = t.next = token_source.getNextToken();\r
+    }\r
+    return t;\r
+  }\r
+\r
+  private int jj_ntk() {\r
+    if ((jj_nt=token.next) == null)\r
+      return (jj_ntk = (token.next=token_source.getNextToken()).kind);\r
+    else\r
+      return (jj_ntk = jj_nt.kind);\r
+  }\r
+\r
+  private java.util.List<int[]> jj_expentries = new java.util.ArrayList<int[]>();\r
+  private int[] jj_expentry;\r
+  private int jj_kind = -1;\r
+  private int[] jj_lasttokens = new int[100];\r
+  private int jj_endpos;\r
+\r
+  private void jj_add_error_token(int kind, int pos) {\r
+    if (pos >= 100) return;\r
+    if (pos == jj_endpos + 1) {\r
+      jj_lasttokens[jj_endpos++] = kind;\r
+    } else if (jj_endpos != 0) {\r
+      jj_expentry = new int[jj_endpos];\r
+      for (int i = 0; i < jj_endpos; i++) {\r
+        jj_expentry[i] = jj_lasttokens[i];\r
+      }\r
+      jj_entries_loop: for (java.util.Iterator<?> it = jj_expentries.iterator(); it.hasNext();) {\r
+        int[] oldentry = (int[])(it.next());\r
+        if (oldentry.length == jj_expentry.length) {\r
+          for (int i = 0; i < jj_expentry.length; i++) {\r
+            if (oldentry[i] != jj_expentry[i]) {\r
+              continue jj_entries_loop;\r
+            }\r
+          }\r
+          jj_expentries.add(jj_expentry);\r
+          break jj_entries_loop;\r
+        }\r
+      }\r
+      if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind;\r
+    }\r
+  }\r
+\r
+  /** Generate ParseException. */\r
+  public ParseException generateParseException() {\r
+    jj_expentries.clear();\r
+    boolean[] la1tokens = new boolean[96];\r
+    if (jj_kind >= 0) {\r
+      la1tokens[jj_kind] = true;\r
+      jj_kind = -1;\r
+    }\r
+    for (int i = 0; i < 135; i++) {\r
+      if (jj_la1[i] == jj_gen) {\r
+        for (int j = 0; j < 32; j++) {\r
+          if ((jj_la1_0[i] & (1<<j)) != 0) {\r
+            la1tokens[j] = true;\r
+          }\r
+          if ((jj_la1_1[i] & (1<<j)) != 0) {\r
+            la1tokens[32+j] = true;\r
+          }\r
+          if ((jj_la1_2[i] & (1<<j)) != 0) {\r
+            la1tokens[64+j] = true;\r
+          }\r
+        }\r
+      }\r
+    }\r
+    for (int i = 0; i < 96; i++) {\r
+      if (la1tokens[i]) {\r
+        jj_expentry = new int[1];\r
+        jj_expentry[0] = i;\r
+        jj_expentries.add(jj_expentry);\r
+      }\r
+    }\r
+    jj_endpos = 0;\r
+    jj_rescan_token();\r
+    jj_add_error_token(0, 0);\r
+    int[][] exptokseq = new int[jj_expentries.size()][];\r
+    for (int i = 0; i < jj_expentries.size(); i++) {\r
+      exptokseq[i] = jj_expentries.get(i);\r
+    }\r
+    return new ParseException(token, exptokseq, tokenImage);\r
+  }\r
+\r
+  /** Enable tracing. */\r
+  final public void enable_tracing() {\r
+  }\r
+\r
+  /** Disable tracing. */\r
+  final public void disable_tracing() {\r
+  }\r
+\r
+  private void jj_rescan_token() {\r
+    jj_rescan = true;\r
+    for (int i = 0; i < 9; i++) {\r
+    try {\r
+      JJCalls p = jj_2_rtns[i];\r
+      do {\r
+        if (p.gen > jj_gen) {\r
+          jj_la = p.arg; jj_lastpos = jj_scanpos = p.first;\r
+          switch (i) {\r
+            case 0: jj_3_1(); break;\r
+            case 1: jj_3_2(); break;\r
+            case 2: jj_3_3(); break;\r
+            case 3: jj_3_4(); break;\r
+            case 4: jj_3_5(); break;\r
+            case 5: jj_3_6(); break;\r
+            case 6: jj_3_7(); break;\r
+            case 7: jj_3_8(); break;\r
+            case 8: jj_3_9(); break;\r
+          }\r
+        }\r
+        p = p.next;\r
+      } while (p != null);\r
+      } catch(LookaheadSuccess ls) { }\r
+    }\r
+    jj_rescan = false;\r
+  }\r
+\r
+  private void jj_save(int index, int xla) {\r
+    JJCalls p = jj_2_rtns[index];\r
+    while (p.gen > jj_gen) {\r
+      if (p.next == null) { p = p.next = new JJCalls(); break; }\r
+      p = p.next;\r
+    }\r
+    p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla;\r
+  }\r
+\r
+  static final class JJCalls {\r
+    int gen;\r
+    Token first;\r
+    int arg;\r
+    JJCalls next;\r
+  }\r
+\r
+}\r
diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/modelParser/ModelParserConstants.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/modelParser/ModelParserConstants.java
new file mode 100644 (file)
index 0000000..b307d24
--- /dev/null
@@ -0,0 +1,131 @@
+/* Generated By:JavaCC: Do not edit this line. ModelParserConstants.java */\r
+package org.simantics.sysdyn.modelParser;\r
+\r
+\r
+/**\r
+ * Token literal values and constants.\r
+ * Generated by org.javacc.parser.OtherFilesGen#start()\r
+ */\r
+public interface ModelParserConstants {\r
+\r
+  /** End of File. */\r
+  int EOF = 0;\r
+  /** RegularExpression Id. */\r
+  int WHITESPACE = 1;\r
+  /** RegularExpression Id. */\r
+  int COMMENT1 = 2;\r
+  /** RegularExpression Id. */\r
+  int COMMENT2 = 3;\r
+  /** RegularExpression Id. */\r
+  int IDENT = 90;\r
+  /** RegularExpression Id. */\r
+  int STRING = 91;\r
+  /** RegularExpression Id. */\r
+  int UNSIGNED_INTEGER = 92;\r
+  /** RegularExpression Id. */\r
+  int UNSIGNED_NUMBER = 93;\r
+\r
+  /** Lexical state. */\r
+  int DEFAULT = 0;\r
+\r
+  /** Literal token values. */\r
+  String[] tokenImage = {\r
+    "<EOF>",\r
+    "<WHITESPACE>",\r
+    "<COMMENT1>",\r
+    "<COMMENT2>",\r
+    "\"algorithm\"",\r
+    "\"discrete\"",\r
+    "\"false\"",\r
+    "\"model\"",\r
+    "\"redeclare\"",\r
+    "\"and\"",\r
+    "\"each\"",\r
+    "\"final\"",\r
+    "\"not\"",\r
+    "\"replaceable\"",\r
+    "\"annotation\"",\r
+    "\"else\"",\r
+    "\"flow\"",\r
+    "\"operator\"",\r
+    "\"return\"",\r
+    "\"assert\"",\r
+    "\"elseif\"",\r
+    "\"for\"",\r
+    "\"or\"",\r
+    "\"stream\"",\r
+    "\"block\"",\r
+    "\"elsewhen\"",\r
+    "\"function\"",\r
+    "\"outer\"",\r
+    "\"then\"",\r
+    "\"break\"",\r
+    "\"encapsulated\"",\r
+    "\"if\"",\r
+    "\"output\"",\r
+    "\"true\"",\r
+    "\"class\"",\r
+    "\"end\"",\r
+    "\"import\"",\r
+    "\"package\"",\r
+    "\"type\"",\r
+    "\"connect\"",\r
+    "\"enumeration\"",\r
+    "\"in\"",\r
+    "\"parameter\"",\r
+    "\"when\"",\r
+    "\"connector\"",\r
+    "\"equation\"",\r
+    "\"initial\"",\r
+    "\"partial\"",\r
+    "\"while\"",\r
+    "\"constant\"",\r
+    "\"expandable\"",\r
+    "\"inner\"",\r
+    "\"protected\"",\r
+    "\"within\"",\r
+    "\"constrainedby\"",\r
+    "\"extends\"",\r
+    "\"input\"",\r
+    "\"public\"",\r
+    "\"der\"",\r
+    "\"external\"",\r
+    "\"loop\"",\r
+    "\"record\"",\r
+    "\"(\"",\r
+    "\")\"",\r
+    "\"{\"",\r
+    "\"}\"",\r
+    "\"[\"",\r
+    "\"]\"",\r
+    "\".\"",\r
+    "\":\"",\r
+    "\";\"",\r
+    "\",\"",\r
+    "\"<\"",\r
+    "\"<=\"",\r
+    "\">\"",\r
+    "\">=\"",\r
+    "\"==\"",\r
+    "\"<>\"",\r
+    "\"+\"",\r
+    "\"-\"",\r
+    "\".+\"",\r
+    "\".-\"",\r
+    "\"*\"",\r
+    "\"/\"",\r
+    "\".*\"",\r
+    "\"./\"",\r
+    "\"^\"",\r
+    "\".^\"",\r
+    "\"=\"",\r
+    "\":=\"",\r
+    "<IDENT>",\r
+    "<STRING>",\r
+    "<UNSIGNED_INTEGER>",\r
+    "<UNSIGNED_NUMBER>",\r
+    "\"operator function\"",\r
+    "\"operator record\"",\r
+  };\r
+\r
+}\r
diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/modelParser/ModelParserTokenManager.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/modelParser/ModelParserTokenManager.java
new file mode 100644 (file)
index 0000000..5fbdba7
--- /dev/null
@@ -0,0 +1,1434 @@
+/* Generated By:JavaCC: Do not edit this line. ModelParserTokenManager.java */\r
+package org.simantics.sysdyn.modelParser;\r
+\r
+/** Token Manager. */\r
+public class ModelParserTokenManager implements ModelParserConstants\r
+{\r
+\r
+  /** Debug output. */\r
+  public  java.io.PrintStream debugStream = System.out;\r
+  /** Set debug output. */\r
+  public  void setDebugStream(java.io.PrintStream ds) { debugStream = ds; }\r
+private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1)
+{\r
+   switch (pos)
+   {\r
+      case 0:\r
+         if ((active0 & 0x3ffffffffffffff0L) != 0L || (active1 & 0xc0000000L) != 0L)\r
+         {\r
+            jjmatchedKind = 90;\r
+            return 2;\r
+         }\r
+         if ((active1 & 0x80000L) != 0L)\r
+            return 13;\r
+         if ((active1 & 0xb30010L) != 0L)\r
+            return 9;\r
+         return -1;\r
+      case 1:\r
+         if ((active0 & 0x108420080400000L) != 0L)\r
+            return 2;\r
+         if ((active0 & 0x3ef7bdff7fbffff0L) != 0L || (active1 & 0xc0000000L) != 0L)\r
+         {\r
+            if (jjmatchedPos != 1)\r
+            {\r
+               jjmatchedKind = 90;\r
+               jjmatchedPos = 1;\r
+            }\r
+            return 2;\r
+         }\r
+         return -1;\r
+      case 2:\r
+         if ((active0 & 0x400000800201200L) != 0L)\r
+            return 2;\r
+         if ((active0 & 0x3bfffdf77f9fedf0L) != 0L || (active1 & 0xc0000000L) != 0L)\r
+         {\r
+            jjmatchedKind = 90;\r
+            jjmatchedPos = 2;\r
+            return 2;\r
+         }\r
+         return -1;\r
+      case 3:\r
+         if ((active0 & 0x1000084212118400L) != 0L)\r
+            return 2;\r
+         if ((active0 & 0x2bfff5b56d8e69f0L) != 0L || (active1 & 0xc0000000L) != 0L)\r
+         {\r
+            if (jjmatchedPos != 3)\r
+            {\r
+               jjmatchedKind = 90;\r
+               jjmatchedPos = 3;\r
+            }\r
+            return 2;\r
+         }\r
+         return -1;\r
+      case 4:\r
+         if ((active0 & 0x1090004290008c0L) != 0L)\r
+            return 2;\r
+         if ((active0 & 0x2af6f5b1469e6130L) != 0L || (active1 & 0xc0000000L) != 0L)\r
+         {\r
+            jjmatchedKind = 90;\r
+            jjmatchedPos = 4;\r
+            return 2;\r
+         }\r
+         return -1;\r
+      case 5:\r
+         if ((active0 & 0x22200011009c0000L) != 0L)\r
+            return 2;\r
+         if ((active0 & 0x8d6f5a046026130L) != 0L || (active1 & 0xc0000000L) != 0L)\r
+         {\r
+            jjmatchedKind = 90;\r
+            jjmatchedPos = 5;\r
+            return 2;\r
+         }\r
+         return -1;\r
+      case 6:\r
+         if ((active0 & 0x80d0a000000000L) != 0L)\r
+            return 2;\r
+         if ((active0 & 0x856250046026130L) != 0L || (active1 & 0xc0000000L) != 0L)\r
+         {\r
+            if (jjmatchedPos != 6)\r
+            {\r
+               jjmatchedKind = 90;\r
+               jjmatchedPos = 6;\r
+            }\r
+            return 2;\r
+         }\r
+         return -1;\r
+      case 7:\r
+         if ((active0 & 0x54150040006110L) != 0L)\r
+         {\r
+            if (jjmatchedPos != 7)\r
+            {\r
+               jjmatchedKind = 90;\r
+               jjmatchedPos = 7;\r
+            }\r
+            return 2;\r
+         }\r
+         if ((active0 & 0x802200006020020L) != 0L || (active1 & 0xc0000000L) != 0L)\r
+            return 2;\r
+         return -1;\r
+      case 8:\r
+         if ((active0 & 0x10140000000110L) != 0L)\r
+            return 2;\r
+         if ((active0 & 0x44010040006000L) != 0L)\r
+         {\r
+            jjmatchedKind = 90;\r
+            jjmatchedPos = 8;\r
+            return 2;\r
+         }\r
+         return -1;\r
+      case 9:\r
+         if ((active0 & 0x40010040002000L) != 0L)\r
+         {\r
+            jjmatchedKind = 90;\r
+            jjmatchedPos = 9;\r
+            return 2;\r
+         }\r
+         if ((active0 & 0x4000000004000L) != 0L)\r
+            return 2;\r
+         return -1;\r
+      case 10:\r
+         if ((active0 & 0x10000002000L) != 0L)\r
+            return 2;\r
+         if ((active0 & 0x40000040000000L) != 0L)\r
+         {\r
+            jjmatchedKind = 90;\r
+            jjmatchedPos = 10;\r
+            return 2;\r
+         }\r
+         return -1;\r
+      case 11:\r
+         if ((active0 & 0x40000000L) != 0L)\r
+            return 2;\r
+         if ((active0 & 0x40000000000000L) != 0L)\r
+         {\r
+            jjmatchedKind = 90;\r
+            jjmatchedPos = 11;\r
+            return 2;\r
+         }\r
+         return -1;\r
+      case 12:\r
+         if ((active0 & 0x40000000000000L) != 0L)\r
+            return 2;\r
+         return -1;\r
+      default :\r
+         return -1;\r
+   }\r
+}\r
+private final int jjStartNfa_0(int pos, long active0, long active1)
+{\r
+   return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0, active1), pos + 1);\r
+}\r
+private int jjStopAtPos(int pos, int kind)\r
+{\r
+   jjmatchedKind = kind;\r
+   jjmatchedPos = pos;\r
+   return pos + 1;\r
+}\r
+private int jjMoveStringLiteralDfa0_0()\r
+{\r
+   switch(curChar)\r
+   {\r
+      case 40:\r
+         return jjStopAtPos(0, 62);\r
+      case 41:\r
+         return jjStopAtPos(0, 63);\r
+      case 42:\r
+         return jjStopAtPos(0, 82);\r
+      case 43:\r
+         return jjStopAtPos(0, 78);\r
+      case 44:\r
+         return jjStopAtPos(0, 71);\r
+      case 45:\r
+         return jjStopAtPos(0, 79);\r
+      case 46:\r
+         jjmatchedKind = 68;\r
+         return jjMoveStringLiteralDfa1_0(0x0L, 0xb30000L);\r
+      case 47:\r
+         return jjStartNfaWithStates_0(0, 83, 13);\r
+      case 58:\r
+         jjmatchedKind = 69;\r
+         return jjMoveStringLiteralDfa1_0(0x0L, 0x2000000L);\r
+      case 59:\r
+         return jjStopAtPos(0, 70);\r
+      case 60:\r
+         jjmatchedKind = 72;\r
+         return jjMoveStringLiteralDfa1_0(0x0L, 0x2200L);\r
+      case 61:\r
+         jjmatchedKind = 88;\r
+         return jjMoveStringLiteralDfa1_0(0x0L, 0x1000L);\r
+      case 62:\r
+         jjmatchedKind = 74;\r
+         return jjMoveStringLiteralDfa1_0(0x0L, 0x800L);\r
+      case 91:\r
+         return jjStopAtPos(0, 66);\r
+      case 93:\r
+         return jjStopAtPos(0, 67);\r
+      case 94:\r
+         return jjStopAtPos(0, 86);\r
+      case 97:\r
+         return jjMoveStringLiteralDfa1_0(0x84210L, 0x0L);\r
+      case 98:\r
+         return jjMoveStringLiteralDfa1_0(0x21000000L, 0x0L);\r
+      case 99:\r
+         return jjMoveStringLiteralDfa1_0(0x42108400000000L, 0x0L);\r
+      case 100:\r
+         return jjMoveStringLiteralDfa1_0(0x400000000000020L, 0x0L);\r
+      case 101:\r
+         return jjMoveStringLiteralDfa1_0(0x884210842108400L, 0x0L);\r
+      case 102:\r
+         return jjMoveStringLiteralDfa1_0(0x4210840L, 0x0L);\r
+      case 105:\r
+         return jjMoveStringLiteralDfa1_0(0x108421080000000L, 0x0L);\r
+      case 108:\r
+         return jjMoveStringLiteralDfa1_0(0x1000000000000000L, 0x0L);\r
+      case 109:\r
+         return jjMoveStringLiteralDfa1_0(0x80L, 0x0L);\r
+      case 110:\r
+         return jjMoveStringLiteralDfa1_0(0x1000L, 0x0L);\r
+      case 111:\r
+         return jjMoveStringLiteralDfa1_0(0x108420000L, 0xc0000000L);\r
+      case 112:\r
+         return jjMoveStringLiteralDfa1_0(0x210842000000000L, 0x0L);\r
+      case 114:\r
+         return jjMoveStringLiteralDfa1_0(0x2000000000042100L, 0x0L);\r
+      case 115:\r
+         return jjMoveStringLiteralDfa1_0(0x800000L, 0x0L);\r
+      case 116:\r
+         return jjMoveStringLiteralDfa1_0(0x4210000000L, 0x0L);\r
+      case 119:\r
+         return jjMoveStringLiteralDfa1_0(0x21080000000000L, 0x0L);\r
+      case 123:\r
+         return jjStopAtPos(0, 64);\r
+      case 125:\r
+         return jjStopAtPos(0, 65);\r
+      default :\r
+         return jjMoveNfa_0(0, 0);\r
+   }\r
+}\r
+private int jjMoveStringLiteralDfa1_0(long active0, long active1)\r
+{\r
+   try { curChar = input_stream.readChar(); }\r
+   catch(java.io.IOException e) {\r
+      jjStopStringLiteralDfa_0(0, active0, active1);\r
+      return 1;\r
+   }\r
+   switch(curChar)\r
+   {\r
+      case 42:\r
+         if ((active1 & 0x100000L) != 0L)\r
+            return jjStopAtPos(1, 84);\r
+         break;\r
+      case 43:\r
+         if ((active1 & 0x10000L) != 0L)\r
+            return jjStopAtPos(1, 80);\r
+         break;\r
+      case 45:\r
+         if ((active1 & 0x20000L) != 0L)\r
+            return jjStopAtPos(1, 81);\r
+         break;\r
+      case 47:\r
+         if ((active1 & 0x200000L) != 0L)\r
+            return jjStopAtPos(1, 85);\r
+         break;\r
+      case 61:\r
+         if ((active1 & 0x200L) != 0L)\r
+            return jjStopAtPos(1, 73);\r
+         else if ((active1 & 0x800L) != 0L)\r
+            return jjStopAtPos(1, 75);\r
+         else if ((active1 & 0x1000L) != 0L)\r
+            return jjStopAtPos(1, 76);\r
+         else if ((active1 & 0x2000000L) != 0L)\r
+            return jjStopAtPos(1, 89);\r
+         break;\r
+      case 62:\r
+         if ((active1 & 0x2000L) != 0L)\r
+            return jjStopAtPos(1, 77);\r
+         break;\r
+      case 94:\r
+         if ((active1 & 0x800000L) != 0L)\r
+            return jjStopAtPos(1, 87);\r
+         break;\r
+      case 97:\r
+         return jjMoveStringLiteralDfa2_0(active0, 0x842000000440L, active1, 0L);\r
+      case 101:\r
+         return jjMoveStringLiteralDfa2_0(active0, 0x2400000000042100L, active1, 0L);\r
+      case 102:\r
+         if ((active0 & 0x80000000L) != 0L)\r
+            return jjStartNfaWithStates_0(1, 31, 2);\r
+         break;\r
+      case 104:\r
+         return jjMoveStringLiteralDfa2_0(active0, 0x1080010000000L, active1, 0L);\r
+      case 105:\r
+         return jjMoveStringLiteralDfa2_0(active0, 0x20000000000820L, active1, 0L);\r
+      case 108:\r
+         return jjMoveStringLiteralDfa2_0(active0, 0x403118010L, active1, 0L);\r
+      case 109:\r
+         return jjMoveStringLiteralDfa2_0(active0, 0x1000000000L, active1, 0L);\r
+      case 110:\r
+         if ((active0 & 0x20000000000L) != 0L)\r
+         {\r
+            jjmatchedKind = 41;\r
+            jjmatchedPos = 1;\r
+         }\r
+         return jjMoveStringLiteralDfa2_0(active0, 0x108410840004200L, active1, 0L);\r
+      case 111:\r
+         return jjMoveStringLiteralDfa2_0(active0, 0x1042108000201080L, active1, 0L);\r
+      case 112:\r
+         return jjMoveStringLiteralDfa2_0(active0, 0x20000L, active1, 0xc0000000L);\r
+      case 113:\r
+         return jjMoveStringLiteralDfa2_0(active0, 0x200000000000L, active1, 0L);\r
+      case 114:\r
+         if ((active0 & 0x400000L) != 0L)\r
+            return jjStartNfaWithStates_0(1, 22, 2);\r
+         return jjMoveStringLiteralDfa2_0(active0, 0x10000220000000L, active1, 0L);\r
+      case 115:\r
+         return jjMoveStringLiteralDfa2_0(active0, 0x80000L, active1, 0L);\r
+      case 116:\r
+         return jjMoveStringLiteralDfa2_0(active0, 0x800000L, active1, 0L);\r
+      case 117:\r
+         return jjMoveStringLiteralDfa2_0(active0, 0x20000010c000000L, active1, 0L);\r
+      case 120:\r
+         return jjMoveStringLiteralDfa2_0(active0, 0x884000000000000L, active1, 0L);\r
+      case 121:\r
+         return jjMoveStringLiteralDfa2_0(active0, 0x4000000000L, active1, 0L);\r
+      default :\r
+         break;\r
+   }\r
+   return jjStartNfa_0(0, active0, active1);\r
+}\r
+private int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1, long active1)\r
+{\r
+   if (((active0 &= old0) | (active1 &= old1)) == 0L)\r
+      return jjStartNfa_0(0, old0, old1);\r
+   try { curChar = input_stream.readChar(); }\r
+   catch(java.io.IOException e) {\r
+      jjStopStringLiteralDfa_0(1, active0, active1);\r
+      return 2;\r
+   }\r
+   switch(curChar)\r
+   {\r
+      case 97:\r
+         return jjMoveStringLiteralDfa3_0(active0, 0x400000000L, active1, 0L);\r
+      case 98:\r
+         return jjMoveStringLiteralDfa3_0(active0, 0x200000000000000L, active1, 0L);\r
+      case 99:\r
+         return jjMoveStringLiteralDfa3_0(active0, 0x2000002040000400L, active1, 0L);\r
+      case 100:\r
+         if ((active0 & 0x200L) != 0L)\r
+            return jjStartNfaWithStates_0(2, 9, 2);\r
+         else if ((active0 & 0x800000000L) != 0L)\r
+            return jjStartNfaWithStates_0(2, 35, 2);\r
+         return jjMoveStringLiteralDfa3_0(active0, 0x180L, active1, 0L);\r
+      case 101:\r
+         return jjMoveStringLiteralDfa3_0(active0, 0x80030020000L, active1, 0xc0000000L);\r
+      case 103:\r
+         return jjMoveStringLiteralDfa3_0(active0, 0x10L, active1, 0L);\r
+      case 105:\r
+         return jjMoveStringLiteralDfa3_0(active0, 0x1400000000000L, active1, 0L);\r
+      case 108:\r
+         return jjMoveStringLiteralDfa3_0(active0, 0x40L, active1, 0L);\r
+      case 110:\r
+         return jjMoveStringLiteralDfa3_0(active0, 0x4a108004004800L, active1, 0L);\r
+      case 111:\r
+         return jjMoveStringLiteralDfa3_0(active0, 0x1010000001010000L, active1, 0L);\r
+      case 112:\r
+         return jjMoveStringLiteralDfa3_0(active0, 0x104005000002000L, active1, 0L);\r
+      case 114:\r
+         if ((active0 & 0x200000L) != 0L)\r
+            return jjStartNfaWithStates_0(2, 21, 2);\r
+         else if ((active0 & 0x400000000000000L) != 0L)\r
+            return jjStartNfaWithStates_0(2, 58, 2);\r
+         return jjMoveStringLiteralDfa3_0(active0, 0x840000800000L, active1, 0L);\r
+      case 115:\r
+         return jjMoveStringLiteralDfa3_0(active0, 0x2188020L, active1, 0L);\r
+      case 116:\r
+         if ((active0 & 0x1000L) != 0L)\r
+            return jjStartNfaWithStates_0(2, 12, 2);\r
+         return jjMoveStringLiteralDfa3_0(active0, 0x8a0000108040000L, active1, 0L);\r
+      case 117:\r
+         return jjMoveStringLiteralDfa3_0(active0, 0x210200000000L, active1, 0L);\r
+      default :\r
+         break;\r
+   }\r
+   return jjStartNfa_0(1, active0, active1);\r
+}\r
+private int jjMoveStringLiteralDfa3_0(long old0, long active0, long old1, long active1)\r
+{\r
+   if (((active0 &= old0) | (active1 &= old1)) == 0L)\r
+      return jjStartNfa_0(1, old0, old1);\r
+   try { curChar = input_stream.readChar(); }\r
+   catch(java.io.IOException e) {\r
+      jjStopStringLiteralDfa_0(2, active0, active1);\r
+      return 3;\r
+   }\r
+   switch(curChar)\r
+   {\r
+      case 97:\r
+         return jjMoveStringLiteralDfa4_0(active0, 0x4240060000800L, active1, 0L);\r
+      case 99:\r
+         return jjMoveStringLiteralDfa4_0(active0, 0x5000020L, active1, 0L);\r
+      case 101:\r
+         if ((active0 & 0x8000L) != 0L)\r
+         {\r
+            jjmatchedKind = 15;\r
+            jjmatchedPos = 3;\r
+         }\r
+         else if ((active0 & 0x200000000L) != 0L)\r
+            return jjStartNfaWithStates_0(3, 33, 2);\r
+         else if ((active0 & 0x4000000000L) != 0L)\r
+            return jjStartNfaWithStates_0(3, 38, 2);\r
+         return jjMoveStringLiteralDfa4_0(active0, 0x88800000a980180L, active1, 0L);\r
+      case 104:\r
+         if ((active0 & 0x400L) != 0L)\r
+            return jjStartNfaWithStates_0(3, 10, 2);\r
+         return jjMoveStringLiteralDfa4_0(active0, 0x20000000000000L, active1, 0L);\r
+      case 107:\r
+         return jjMoveStringLiteralDfa4_0(active0, 0x2000000000L, active1, 0L);\r
+      case 108:\r
+         return jjMoveStringLiteralDfa4_0(active0, 0x201000000002000L, active1, 0L);\r
+      case 109:\r
+         return jjMoveStringLiteralDfa4_0(active0, 0x10000000000L, active1, 0L);\r
+      case 110:\r
+         if ((active0 & 0x10000000L) != 0L)\r
+            return jjStartNfaWithStates_0(3, 28, 2);\r
+         else if ((active0 & 0x80000000000L) != 0L)\r
+            return jjStartNfaWithStates_0(3, 43, 2);\r
+         return jjMoveStringLiteralDfa4_0(active0, 0x108000000000L, active1, 0L);\r
+      case 111:\r
+         return jjMoveStringLiteralDfa4_0(active0, 0x2000001000004010L, active1, 0L);\r
+      case 112:\r
+         if ((active0 & 0x1000000000000000L) != 0L)\r
+            return jjStartNfaWithStates_0(3, 60, 2);\r
+         return jjMoveStringLiteralDfa4_0(active0, 0x100000000L, active1, 0L);\r
+      case 114:\r
+         return jjMoveStringLiteralDfa4_0(active0, 0x20000L, active1, 0xc0000000L);\r
+      case 115:\r
+         return jjMoveStringLiteralDfa4_0(active0, 0x42000400000040L, active1, 0L);\r
+      case 116:\r
+         return jjMoveStringLiteralDfa4_0(active0, 0x10c00000000000L, active1, 0L);\r
+      case 117:\r
+         return jjMoveStringLiteralDfa4_0(active0, 0x100000000040000L, active1, 0L);\r
+      case 119:\r
+         if ((active0 & 0x10000L) != 0L)\r
+            return jjStartNfaWithStates_0(3, 16, 2);\r
+         break;\r
+      default :\r
+         break;\r
+   }\r
+   return jjStartNfa_0(2, active0, active1);\r
+}\r
+private int jjMoveStringLiteralDfa4_0(long old0, long active0, long old1, long active1)\r
+{\r
+   if (((active0 &= old0) | (active1 &= old1)) == 0L)\r
+      return jjStartNfa_0(2, old0, old1);\r
+   try { curChar = input_stream.readChar(); }\r
+   catch(java.io.IOException e) {\r
+      jjStopStringLiteralDfa_0(3, active0, active1);\r
+      return 4;\r
+   }\r
+   switch(curChar)\r
+   {\r
+      case 97:\r
+         return jjMoveStringLiteralDfa5_0(active0, 0x2000822000L, active1, 0xc0000000L);\r
+      case 99:\r
+         return jjMoveStringLiteralDfa5_0(active0, 0x100L, active1, 0L);\r
+      case 101:\r
+         if ((active0 & 0x40L) != 0L)\r
+            return jjStartNfaWithStates_0(4, 6, 2);\r
+         else if ((active0 & 0x1000000000000L) != 0L)\r
+            return jjStartNfaWithStates_0(4, 48, 2);\r
+         return jjMoveStringLiteralDfa5_0(active0, 0x10118000000000L, active1, 0L);\r
+      case 105:\r
+         return jjMoveStringLiteralDfa5_0(active0, 0x220c00000100000L, active1, 0L);\r
+      case 107:\r
+         if ((active0 & 0x1000000L) != 0L)\r
+            return jjStartNfaWithStates_0(4, 24, 2);\r
+         else if ((active0 & 0x20000000L) != 0L)\r
+            return jjStartNfaWithStates_0(4, 29, 2);\r
+         break;\r
+      case 108:\r
+         if ((active0 & 0x80L) != 0L)\r
+            return jjStartNfaWithStates_0(4, 7, 2);\r
+         else if ((active0 & 0x800L) != 0L)\r
+            return jjStartNfaWithStates_0(4, 11, 2);\r
+         break;\r
+      case 109:\r
+         return jjMoveStringLiteralDfa5_0(active0, 0x40000000000L, active1, 0L);\r
+      case 110:\r
+         return jjMoveStringLiteralDfa5_0(active0, 0x84000000000000L, active1, 0L);\r
+      case 112:\r
+         return jjMoveStringLiteralDfa5_0(active0, 0x40000000L, active1, 0L);\r
+      case 114:\r
+         if ((active0 & 0x8000000L) != 0L)\r
+            return jjStartNfaWithStates_0(4, 27, 2);\r
+         else if ((active0 & 0x8000000000000L) != 0L)\r
+            return jjStartNfaWithStates_0(4, 51, 2);\r
+         return jjMoveStringLiteralDfa5_0(active0, 0x28000010000c0030L, active1, 0L);\r
+      case 115:\r
+         if ((active0 & 0x400000000L) != 0L)\r
+            return jjStartNfaWithStates_0(4, 34, 2);\r
+         break;\r
+      case 116:\r
+         if ((active0 & 0x100000000000000L) != 0L)\r
+            return jjStartNfaWithStates_0(4, 56, 2);\r
+         return jjMoveStringLiteralDfa5_0(active0, 0x42200004004000L, active1, 0L);\r
+      case 117:\r
+         return jjMoveStringLiteralDfa5_0(active0, 0x100000000L, active1, 0L);\r
+      case 119:\r
+         return jjMoveStringLiteralDfa5_0(active0, 0x2000000L, active1, 0L);\r
+      default :\r
+         break;\r
+   }\r
+   return jjStartNfa_0(3, active0, active1);\r
+}\r
+private int jjMoveStringLiteralDfa5_0(long old0, long active0, long old1, long active1)\r
+{\r
+   if (((active0 &= old0) | (active1 &= old1)) == 0L)\r
+      return jjStartNfa_0(3, old0, old1);\r
+   try { curChar = input_stream.readChar(); }\r
+   catch(java.io.IOException e) {\r
+      jjStopStringLiteralDfa_0(4, active0, active1);\r
+      return 5;\r
+   }\r
+   switch(curChar)\r
+   {\r
+      case 97:\r
+         return jjMoveStringLiteralDfa6_0(active0, 0x2c00000004000L, active1, 0L);\r
+      case 99:\r
+         if ((active0 & 0x200000000000000L) != 0L)\r
+            return jjStartNfaWithStates_0(5, 57, 2);\r
+         return jjMoveStringLiteralDfa6_0(active0, 0x10108000002000L, active1, 0L);\r
+      case 100:\r
+         if ((active0 & 0x2000000000000000L) != 0L)\r
+            return jjStartNfaWithStates_0(5, 61, 2);\r
+         return jjMoveStringLiteralDfa6_0(active0, 0x84000000000000L, active1, 0L);\r
+      case 101:\r
+         return jjMoveStringLiteralDfa6_0(active0, 0x40000000020L, active1, 0L);\r
+      case 102:\r
+         if ((active0 & 0x100000L) != 0L)\r
+            return jjStartNfaWithStates_0(5, 20, 2);\r
+         break;\r
+      case 103:\r
+         return jjMoveStringLiteralDfa6_0(active0, 0x2000000000L, active1, 0L);\r
+      case 104:\r
+         return jjMoveStringLiteralDfa6_0(active0, 0x2000000L, active1, 0L);\r
+      case 105:\r
+         return jjMoveStringLiteralDfa6_0(active0, 0x200004000010L, active1, 0L);\r
+      case 108:\r
+         return jjMoveStringLiteralDfa6_0(active0, 0x100L, active1, 0L);\r
+      case 109:\r
+         if ((active0 & 0x800000L) != 0L)\r
+            return jjStartNfaWithStates_0(5, 23, 2);\r
+         break;\r
+      case 110:\r
+         if ((active0 & 0x40000L) != 0L)\r
+            return jjStartNfaWithStates_0(5, 18, 2);\r
+         else if ((active0 & 0x20000000000000L) != 0L)\r
+            return jjStartNfaWithStates_0(5, 53, 2);\r
+         return jjMoveStringLiteralDfa6_0(active0, 0x800000000000000L, active1, 0L);\r
+      case 114:\r
+         return jjMoveStringLiteralDfa6_0(active0, 0x40010000000000L, active1, 0L);\r
+      case 115:\r
+         return jjMoveStringLiteralDfa6_0(active0, 0x40000000L, active1, 0L);\r
+      case 116:\r
+         if ((active0 & 0x80000L) != 0L)\r
+            return jjStartNfaWithStates_0(5, 19, 2);\r
+         else if ((active0 & 0x100000000L) != 0L)\r
+            return jjStartNfaWithStates_0(5, 32, 2);\r
+         else if ((active0 & 0x1000000000L) != 0L)\r
+            return jjStartNfaWithStates_0(5, 36, 2);\r
+         return jjMoveStringLiteralDfa6_0(active0, 0x20000L, active1, 0xc0000000L);\r
+      default :\r
+         break;\r
+   }\r
+   return jjStartNfa_0(4, active0, active1);\r
+}\r
+private int jjMoveStringLiteralDfa6_0(long old0, long active0, long old1, long active1)\r
+{\r
+   if (((active0 &= old0) | (active1 &= old1)) == 0L)\r
+      return jjStartNfa_0(4, old0, old1);\r
+   try { curChar = input_stream.readChar(); }\r
+   catch(java.io.IOException e) {\r
+      jjStopStringLiteralDfa_0(5, active0, active1);\r
+      return 6;\r
+   }\r
+   switch(curChar)\r
+   {\r
+      case 97:\r
+         return jjMoveStringLiteralDfa7_0(active0, 0x844010000000100L, active1, 0L);\r
+      case 101:\r
+         if ((active0 & 0x2000000000L) != 0L)\r
+            return jjStartNfaWithStates_0(6, 37, 2);\r
+         return jjMoveStringLiteralDfa7_0(active0, 0x2002000L, active1, 0L);\r
+      case 108:\r
+         if ((active0 & 0x400000000000L) != 0L)\r
+            return jjStartNfaWithStates_0(6, 46, 2);\r
+         else if ((active0 & 0x800000000000L) != 0L)\r
+            return jjStartNfaWithStates_0(6, 47, 2);\r
+         break;\r
+      case 110:\r
+         return jjMoveStringLiteralDfa7_0(active0, 0x2000000000000L, active1, 0L);\r
+      case 111:\r
+         return jjMoveStringLiteralDfa7_0(active0, 0x200004020000L, active1, 0xc0000000L);\r
+      case 115:\r
+         if ((active0 & 0x80000000000000L) != 0L)\r
+            return jjStartNfaWithStates_0(6, 55, 2);\r
+         break;\r
+      case 116:\r
+         if ((active0 & 0x8000000000L) != 0L)\r
+         {\r
+            jjmatchedKind = 39;\r
+            jjmatchedPos = 6;\r
+         }\r
+         return jjMoveStringLiteralDfa7_0(active0, 0x10140000004030L, active1, 0L);\r
+      case 117:\r
+         return jjMoveStringLiteralDfa7_0(active0, 0x40000000L, active1, 0L);\r
+      default :\r
+         break;\r
+   }\r
+   return jjStartNfa_0(5, active0, active1);\r
+}\r
+private int jjMoveStringLiteralDfa7_0(long old0, long active0, long old1, long active1)\r
+{\r
+   if (((active0 &= old0) | (active1 &= old1)) == 0L)\r
+      return jjStartNfa_0(5, old0, old1);\r
+   try { curChar = input_stream.readChar(); }\r
+   catch(java.io.IOException e) {\r
+      jjStopStringLiteralDfa_0(6, active0, active1);\r
+      return 7;\r
+   }\r
+   switch(curChar)\r
+   {\r
+      case 97:\r
+         return jjMoveStringLiteralDfa8_0(active0, 0x2000L, active1, 0L);\r
+      case 98:\r
+         return jjMoveStringLiteralDfa8_0(active0, 0x4000000000000L, active1, 0L);\r
+      case 101:\r
+         if ((active0 & 0x20L) != 0L)\r
+            return jjStartNfaWithStates_0(7, 5, 2);\r
+         return jjMoveStringLiteralDfa8_0(active0, 0x10040000000000L, active1, 0L);\r
+      case 104:\r
+         return jjMoveStringLiteralDfa8_0(active0, 0x10L, active1, 0L);\r
+      case 105:\r
+         return jjMoveStringLiteralDfa8_0(active0, 0x40000000004000L, active1, 0L);\r
+      case 108:\r
+         if ((active0 & 0x800000000000000L) != 0L)\r
+            return jjStartNfaWithStates_0(7, 59, 2);\r
+         return jjMoveStringLiteralDfa8_0(active0, 0x40000000L, active1, 0L);\r
+      case 110:\r
+         if ((active0 & 0x2000000L) != 0L)\r
+            return jjStartNfaWithStates_0(7, 25, 2);\r
+         else if ((active0 & 0x4000000L) != 0L)\r
+            return jjStartNfaWithStates_0(7, 26, 2);\r
+         else if ((active0 & 0x200000000000L) != 0L)\r
+            return jjStartNfaWithStates_0(7, 45, 2);\r
+         break;\r
+      case 111:\r
+         return jjMoveStringLiteralDfa8_0(active0, 0x100000000000L, active1, 0L);\r
+      case 114:\r
+         if ((active0 & 0x20000L) != 0L)\r
+         {\r
+            jjmatchedKind = 17;\r
+            jjmatchedPos = 7;\r
+         }\r
+         return jjMoveStringLiteralDfa8_0(active0, 0x100L, active1, 0xc0000000L);\r
+      case 116:\r
+         if ((active0 & 0x2000000000000L) != 0L)\r
+            return jjStartNfaWithStates_0(7, 49, 2);\r
+         return jjMoveStringLiteralDfa8_0(active0, 0x10000000000L, active1, 0L);\r
+      default :\r
+         break;\r
+   }\r
+   return jjStartNfa_0(6, active0, active1);\r
+}\r
+private int jjMoveStringLiteralDfa8_0(long old0, long active0, long old1, long active1)\r
+{\r
+   if (((active0 &= old0) | (active1 &= old1)) == 0L)\r
+      return jjStartNfa_0(6, old0, old1);\r
+   try { curChar = input_stream.readChar(); }\r
+   catch(java.io.IOException e) {\r
+      jjStopStringLiteralDfa_0(7, active0, active1);\r
+      return 8;\r
+   }\r
+   switch(curChar)\r
+   {\r
+      case 32:\r
+         return jjMoveStringLiteralDfa9_0(active0, 0L, active1, 0xc0000000L);\r
+      case 97:\r
+         return jjMoveStringLiteralDfa9_0(active0, 0x40000000L, active1, 0L);\r
+      case 98:\r
+         return jjMoveStringLiteralDfa9_0(active0, 0x2000L, active1, 0L);\r
+      case 100:\r
+         if ((active0 & 0x10000000000000L) != 0L)\r
+            return jjStartNfaWithStates_0(8, 52, 2);\r
+         break;\r
+      case 101:\r
+         if ((active0 & 0x100L) != 0L)\r
+            return jjStartNfaWithStates_0(8, 8, 2);\r
+         break;\r
+      case 105:\r
+         return jjMoveStringLiteralDfa9_0(active0, 0x10000000000L, active1, 0L);\r
+      case 108:\r
+         return jjMoveStringLiteralDfa9_0(active0, 0x4000000000000L, active1, 0L);\r
+      case 109:\r
+         if ((active0 & 0x10L) != 0L)\r
+            return jjStartNfaWithStates_0(8, 4, 2);\r
+         break;\r
+      case 110:\r
+         return jjMoveStringLiteralDfa9_0(active0, 0x40000000000000L, active1, 0L);\r
+      case 111:\r
+         return jjMoveStringLiteralDfa9_0(active0, 0x4000L, active1, 0L);\r
+      case 114:\r
+         if ((active0 & 0x40000000000L) != 0L)\r
+            return jjStartNfaWithStates_0(8, 42, 2);\r
+         else if ((active0 & 0x100000000000L) != 0L)\r
+            return jjStartNfaWithStates_0(8, 44, 2);\r
+         break;\r
+      default :\r
+         break;\r
+   }\r
+   return jjStartNfa_0(7, active0, active1);\r
+}\r
+private int jjMoveStringLiteralDfa9_0(long old0, long active0, long old1, long active1)\r
+{\r
+   if (((active0 &= old0) | (active1 &= old1)) == 0L)\r
+      return jjStartNfa_0(7, old0, old1);\r
+   try { curChar = input_stream.readChar(); }\r
+   catch(java.io.IOException e) {\r
+      jjStopStringLiteralDfa_0(8, active0, active1);\r
+      return 9;\r
+   }\r
+   switch(curChar)\r
+   {\r
+      case 101:\r
+         if ((active0 & 0x4000000000000L) != 0L)\r
+            return jjStartNfaWithStates_0(9, 50, 2);\r
+         return jjMoveStringLiteralDfa10_0(active0, 0x40000000000000L, active1, 0L);\r
+      case 102:\r
+         return jjMoveStringLiteralDfa10_0(active0, 0L, active1, 0x40000000L);\r
+      case 108:\r
+         return jjMoveStringLiteralDfa10_0(active0, 0x2000L, active1, 0L);\r
+      case 110:\r
+         if ((active0 & 0x4000L) != 0L)\r
+            return jjStartNfaWithStates_0(9, 14, 2);\r
+         break;\r
+      case 111:\r
+         return jjMoveStringLiteralDfa10_0(active0, 0x10000000000L, active1, 0L);\r
+      case 114:\r
+         return jjMoveStringLiteralDfa10_0(active0, 0L, active1, 0x80000000L);\r
+      case 116:\r
+         return jjMoveStringLiteralDfa10_0(active0, 0x40000000L, active1, 0L);\r
+      default :\r
+         break;\r
+   }\r
+   return jjStartNfa_0(8, active0, active1);\r
+}\r
+private int jjMoveStringLiteralDfa10_0(long old0, long active0, long old1, long active1)\r
+{\r
+   if (((active0 &= old0) | (active1 &= old1)) == 0L)\r
+      return jjStartNfa_0(8, old0, old1);\r
+   try { curChar = input_stream.readChar(); }\r
+   catch(java.io.IOException e) {\r
+      jjStopStringLiteralDfa_0(9, active0, active1);\r
+      return 10;\r
+   }\r
+   switch(curChar)\r
+   {\r
+      case 100:\r
+         return jjMoveStringLiteralDfa11_0(active0, 0x40000000000000L, active1, 0L);\r
+      case 101:\r
+         if ((active0 & 0x2000L) != 0L)\r
+            return jjStartNfaWithStates_0(10, 13, 2);\r
+         return jjMoveStringLiteralDfa11_0(active0, 0x40000000L, active1, 0x80000000L);\r
+      case 110:\r
+         if ((active0 & 0x10000000000L) != 0L)\r
+            return jjStartNfaWithStates_0(10, 40, 2);\r
+         break;\r
+      case 117:\r
+         return jjMoveStringLiteralDfa11_0(active0, 0L, active1, 0x40000000L);\r
+      default :\r
+         break;\r
+   }\r
+   return jjStartNfa_0(9, active0, active1);\r
+}\r
+private int jjMoveStringLiteralDfa11_0(long old0, long active0, long old1, long active1)\r
+{\r
+   if (((active0 &= old0) | (active1 &= old1)) == 0L)\r
+      return jjStartNfa_0(9, old0, old1);\r
+   try { curChar = input_stream.readChar(); }\r
+   catch(java.io.IOException e) {\r
+      jjStopStringLiteralDfa_0(10, active0, active1);\r
+      return 11;\r
+   }\r
+   switch(curChar)\r
+   {\r
+      case 98:\r
+         return jjMoveStringLiteralDfa12_0(active0, 0x40000000000000L, active1, 0L);\r
+      case 99:\r
+         return jjMoveStringLiteralDfa12_0(active0, 0L, active1, 0x80000000L);\r
+      case 100:\r
+         if ((active0 & 0x40000000L) != 0L)\r
+            return jjStartNfaWithStates_0(11, 30, 2);\r
+         break;\r
+      case 110:\r
+         return jjMoveStringLiteralDfa12_0(active0, 0L, active1, 0x40000000L);\r
+      default :\r
+         break;\r
+   }\r
+   return jjStartNfa_0(10, active0, active1);\r
+}\r
+private int jjMoveStringLiteralDfa12_0(long old0, long active0, long old1, long active1)\r
+{\r
+   if (((active0 &= old0) | (active1 &= old1)) == 0L)\r
+      return jjStartNfa_0(10, old0, old1);\r
+   try { curChar = input_stream.readChar(); }\r
+   catch(java.io.IOException e) {\r
+      jjStopStringLiteralDfa_0(11, active0, active1);\r
+      return 12;\r
+   }\r
+   switch(curChar)\r
+   {\r
+      case 99:\r
+         return jjMoveStringLiteralDfa13_0(active0, 0L, active1, 0x40000000L);\r
+      case 111:\r
+         return jjMoveStringLiteralDfa13_0(active0, 0L, active1, 0x80000000L);\r
+      case 121:\r
+         if ((active0 & 0x40000000000000L) != 0L)\r
+            return jjStartNfaWithStates_0(12, 54, 2);\r
+         break;\r
+      default :\r
+         break;\r
+   }\r
+   return jjStartNfa_0(11, active0, active1);\r
+}\r
+private int jjMoveStringLiteralDfa13_0(long old0, long active0, long old1, long active1)\r
+{\r
+   if (((active0 &= old0) | (active1 &= old1)) == 0L)\r
+      return jjStartNfa_0(11, old0, old1);\r
+   try { curChar = input_stream.readChar(); }\r
+   catch(java.io.IOException e) {\r
+      jjStopStringLiteralDfa_0(12, 0L, active1);\r
+      return 13;\r
+   }\r
+   switch(curChar)\r
+   {\r
+      case 114:\r
+         return jjMoveStringLiteralDfa14_0(active1, 0x80000000L);\r
+      case 116:\r
+         return jjMoveStringLiteralDfa14_0(active1, 0x40000000L);\r
+      default :\r
+         break;\r
+   }\r
+   return jjStartNfa_0(12, 0L, active1);\r
+}\r
+private int jjMoveStringLiteralDfa14_0(long old1, long active1)\r
+{\r
+   if (((active1 &= old1)) == 0L)\r
+      return jjStartNfa_0(12, 0L, old1);\r
+   try { curChar = input_stream.readChar(); }\r
+   catch(java.io.IOException e) {\r
+      jjStopStringLiteralDfa_0(13, 0L, active1);\r
+      return 14;\r
+   }\r
+   switch(curChar)\r
+   {\r
+      case 100:\r
+         if ((active1 & 0x80000000L) != 0L)\r
+            return jjStopAtPos(14, 95);\r
+         break;\r
+      case 105:\r
+         return jjMoveStringLiteralDfa15_0(active1, 0x40000000L);\r
+      default :\r
+         break;\r
+   }\r
+   return jjStartNfa_0(13, 0L, active1);\r
+}\r
+private int jjMoveStringLiteralDfa15_0(long old1, long active1)\r
+{\r
+   if (((active1 &= old1)) == 0L)\r
+      return jjStartNfa_0(13, 0L, old1);\r
+   try { curChar = input_stream.readChar(); }\r
+   catch(java.io.IOException e) {\r
+      jjStopStringLiteralDfa_0(14, 0L, active1);\r
+      return 15;\r
+   }\r
+   switch(curChar)\r
+   {\r
+      case 111:\r
+         return jjMoveStringLiteralDfa16_0(active1, 0x40000000L);\r
+      default :\r
+         break;\r
+   }\r
+   return jjStartNfa_0(14, 0L, active1);\r
+}\r
+private int jjMoveStringLiteralDfa16_0(long old1, long active1)\r
+{\r
+   if (((active1 &= old1)) == 0L)\r
+      return jjStartNfa_0(14, 0L, old1);\r
+   try { curChar = input_stream.readChar(); }\r
+   catch(java.io.IOException e) {\r
+      jjStopStringLiteralDfa_0(15, 0L, active1);\r
+      return 16;\r
+   }\r
+   switch(curChar)\r
+   {\r
+      case 110:\r
+         if ((active1 & 0x40000000L) != 0L)\r
+            return jjStopAtPos(16, 94);\r
+         break;\r
+      default :\r
+         break;\r
+   }\r
+   return jjStartNfa_0(15, 0L, active1);\r
+}\r
+private int jjStartNfaWithStates_0(int pos, int kind, int state)\r
+{\r
+   jjmatchedKind = kind;\r
+   jjmatchedPos = pos;\r
+   try { curChar = input_stream.readChar(); }\r
+   catch(java.io.IOException e) { return pos + 1; }\r
+   return jjMoveNfa_0(state, pos + 1);\r
+}\r
+static final long[] jjbitVec0 = {
+   0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL
+};\r
+private int jjMoveNfa_0(int startState, int curPos)\r
+{\r
+   int startsAt = 0;\r
+   jjnewStateCnt = 31;\r
+   int i = 1;\r
+   jjstateSet[0] = startState;\r
+   int kind = 0x7fffffff;\r
+   for (;;)\r
+   {\r
+      if (++jjround == 0x7fffffff)\r
+         ReInitRounds();\r
+      if (curChar < 64)\r
+      {\r
+         long l = 1L << curChar;\r
+         do\r
+         {\r
+            switch(jjstateSet[--i])\r
+            {\r
+               case 13:\r
+                  if (curChar == 47)\r
+                  {\r
+                     if (kind > 3)\r
+                        kind = 3;\r
+                     jjCheckNAdd(20);\r
+                  }\r
+                  else if (curChar == 42)\r
+                     jjCheckNAddStates(0, 2);\r
+                  break;\r
+               case 0:\r
+                  if ((0x3ff000000000000L & l) != 0L)\r
+                  {\r
+                     if (kind > 92)\r
+                        kind = 92;\r
+                     jjCheckNAddStates(3, 7);\r
+                  }\r
+                  else if ((0x100002600L & l) != 0L)\r
+                  {\r
+                     if (kind > 1)\r
+                        kind = 1;\r
+                  }\r
+                  else if (curChar == 47)\r
+                     jjAddStates(8, 9);\r
+                  else if (curChar == 46)\r
+                     jjCheckNAdd(9);\r
+                  else if (curChar == 34)\r
+                     jjCheckNAddStates(10, 12);\r
+                  break;\r
+               case 2:\r
+                  if ((0x3ff000000000000L & l) == 0L)\r
+                     break;\r
+                  if (kind > 90)\r
+                     kind = 90;\r
+                  jjstateSet[jjnewStateCnt++] = 2;\r
+                  break;\r
+               case 3:\r
+                  if (curChar == 34)\r
+                     jjCheckNAddStates(10, 12);\r
+                  break;\r
+               case 4:\r
+                  if ((0xfffffffbfffffbffL & l) != 0L)\r
+                     jjCheckNAddStates(10, 12);\r
+                  break;\r
+               case 6:\r
+                  if ((0xfffffffffffffbffL & l) != 0L)\r
+                     jjCheckNAddStates(10, 12);\r
+                  break;\r
+               case 7:\r
+                  if (curChar == 34 && kind > 91)\r
+                     kind = 91;\r
+                  break;\r
+               case 8:\r
+                  if (curChar == 46)\r
+                     jjCheckNAdd(9);\r
+                  break;\r
+               case 9:\r
+                  if ((0x3ff000000000000L & l) == 0L)\r
+                     break;\r
+                  if (kind > 93)\r
+                     kind = 93;\r
+                  jjCheckNAddTwoStates(9, 10);\r
+                  break;\r
+               case 11:\r
+                  if ((0x3ff000000000000L & l) == 0L)\r
+                     break;\r
+                  if (kind > 93)\r
+                     kind = 93;\r
+                  jjstateSet[jjnewStateCnt++] = 11;\r
+                  break;\r
+               case 12:\r
+                  if (curChar == 47)\r
+                     jjAddStates(8, 9);\r
+                  break;\r
+               case 14:\r
+                  if ((0xfffffbffffffffffL & l) != 0L)\r
+                     jjCheckNAddStates(0, 2);\r
+                  break;\r
+               case 15:\r
+                  if (curChar == 42)\r
+                     jjstateSet[jjnewStateCnt++] = 16;\r
+                  break;\r
+               case 16:\r
+                  if ((0xffff7fffffffffffL & l) != 0L)\r
+                     jjCheckNAddStates(0, 2);\r
+                  break;\r
+               case 17:\r
+                  if (curChar == 47 && kind > 2)\r
+                     kind = 2;\r
+                  break;\r
+               case 18:\r
+                  if (curChar == 42)\r
+                     jjstateSet[jjnewStateCnt++] = 17;\r
+                  break;\r
+               case 19:\r
+                  if (curChar != 47)\r
+                     break;\r
+                  if (kind > 3)\r
+                     kind = 3;\r
+                  jjCheckNAdd(20);\r
+                  break;\r
+               case 20:\r
+                  if ((0xfffffffffffffbffL & l) == 0L)\r
+                     break;\r
+                  if (kind > 3)\r
+                     kind = 3;\r
+                  jjCheckNAdd(20);\r
+                  break;\r
+               case 21:\r
+                  if ((0x3ff000000000000L & l) == 0L)\r
+                     break;\r
+                  if (kind > 92)\r
+                     kind = 92;\r
+                  jjCheckNAddStates(3, 7);\r
+                  break;\r
+               case 22:\r
+                  if ((0x3ff000000000000L & l) == 0L)\r
+                     break;\r
+                  if (kind > 92)\r
+                     kind = 92;\r
+                  jjCheckNAdd(22);\r
+                  break;\r
+               case 23:\r
+                  if ((0x3ff000000000000L & l) != 0L)\r
+                     jjCheckNAddTwoStates(23, 24);\r
+                  break;\r
+               case 24:\r
+                  if (curChar != 46)\r
+                     break;\r
+                  if (kind > 93)\r
+                     kind = 93;\r
+                  jjCheckNAddTwoStates(25, 26);\r
+                  break;\r
+               case 25:\r
+                  if ((0x3ff000000000000L & l) == 0L)\r
+                     break;\r
+                  if (kind > 93)\r
+                     kind = 93;\r
+                  jjCheckNAddTwoStates(25, 26);\r
+                  break;\r
+               case 27:\r
+                  if ((0x3ff000000000000L & l) == 0L)\r
+                     break;\r
+                  if (kind > 93)\r
+                     kind = 93;\r
+                  jjstateSet[jjnewStateCnt++] = 27;\r
+                  break;\r
+               case 28:\r
+                  if ((0x3ff000000000000L & l) != 0L)\r
+                     jjCheckNAddTwoStates(28, 29);\r
+                  break;\r
+               case 30:\r
+                  if ((0x3ff000000000000L & l) == 0L)\r
+                     break;\r
+                  if (kind > 93)\r
+                     kind = 93;\r
+                  jjstateSet[jjnewStateCnt++] = 30;\r
+                  break;\r
+               default : break;\r
+            }\r
+         } while(i != startsAt);\r
+      }\r
+      else if (curChar < 128)\r
+      {\r
+         long l = 1L << (curChar & 077);\r
+         do\r
+         {\r
+            switch(jjstateSet[--i])\r
+            {\r
+               case 0:\r
+               case 2:\r
+                  if ((0x7fffffe87fffffeL & l) == 0L)\r
+                     break;\r
+                  if (kind > 90)\r
+                     kind = 90;\r
+                  jjCheckNAdd(2);\r
+                  break;\r
+               case 4:\r
+                  if ((0xffffffffefffffffL & l) != 0L)\r
+                     jjCheckNAddStates(10, 12);\r
+                  break;\r
+               case 5:\r
+                  if (curChar == 92)\r
+                     jjstateSet[jjnewStateCnt++] = 6;\r
+                  break;\r
+               case 6:\r
+                  jjCheckNAddStates(10, 12);\r
+                  break;\r
+               case 10:\r
+                  if ((0x2000000020L & l) != 0L)\r
+                     jjstateSet[jjnewStateCnt++] = 11;\r
+                  break;\r
+               case 14:\r
+               case 16:\r
+                  jjCheckNAddStates(0, 2);\r
+                  break;\r
+               case 20:\r
+                  if (kind > 3)\r
+                     kind = 3;\r
+                  jjstateSet[jjnewStateCnt++] = 20;\r
+                  break;\r
+               case 26:\r
+                  if ((0x2000000020L & l) != 0L)\r
+                     jjstateSet[jjnewStateCnt++] = 27;\r
+                  break;\r
+               case 29:\r
+                  if ((0x2000000020L & l) != 0L)\r
+                     jjstateSet[jjnewStateCnt++] = 30;\r
+                  break;\r
+               default : break;\r
+            }\r
+         } while(i != startsAt);\r
+      }\r
+      else\r
+      {\r
+         int i2 = (curChar & 0xff) >> 6;\r
+         long l2 = 1L << (curChar & 077);\r
+         do\r
+         {\r
+            switch(jjstateSet[--i])\r
+            {\r
+               case 4:\r
+               case 6:\r
+                  if ((jjbitVec0[i2] & l2) != 0L)\r
+                     jjCheckNAddStates(10, 12);\r
+                  break;\r
+               case 14:\r
+               case 16:\r
+                  if ((jjbitVec0[i2] & l2) != 0L)\r
+                     jjCheckNAddStates(0, 2);\r
+                  break;\r
+               case 20:\r
+                  if ((jjbitVec0[i2] & l2) == 0L)\r
+                     break;\r
+                  if (kind > 3)\r
+                     kind = 3;\r
+                  jjstateSet[jjnewStateCnt++] = 20;\r
+                  break;\r
+               default : break;\r
+            }\r
+         } while(i != startsAt);\r
+      }\r
+      if (kind != 0x7fffffff)\r
+      {\r
+         jjmatchedKind = kind;\r
+         jjmatchedPos = curPos;\r
+         kind = 0x7fffffff;\r
+      }\r
+      ++curPos;\r
+      if ((i = jjnewStateCnt) == (startsAt = 31 - (jjnewStateCnt = startsAt)))\r
+         return curPos;\r
+      try { curChar = input_stream.readChar(); }\r
+      catch(java.io.IOException e) { return curPos; }\r
+   }\r
+}\r
+static final int[] jjnextStates = {
+   14, 15, 18, 22, 23, 24, 28, 29, 13, 19, 4, 5, 7, 
+};\r
+\r
+/** Token literal values. */\r
+public static final String[] jjstrLiteralImages = {\r
+"", null, null, null, "\141\154\147\157\162\151\164\150\155", \r
+"\144\151\163\143\162\145\164\145", "\146\141\154\163\145", "\155\157\144\145\154", \r
+"\162\145\144\145\143\154\141\162\145", "\141\156\144", "\145\141\143\150", "\146\151\156\141\154", "\156\157\164", \r
+"\162\145\160\154\141\143\145\141\142\154\145", "\141\156\156\157\164\141\164\151\157\156", "\145\154\163\145", \r
+"\146\154\157\167", "\157\160\145\162\141\164\157\162", "\162\145\164\165\162\156", \r
+"\141\163\163\145\162\164", "\145\154\163\145\151\146", "\146\157\162", "\157\162", \r
+"\163\164\162\145\141\155", "\142\154\157\143\153", "\145\154\163\145\167\150\145\156", \r
+"\146\165\156\143\164\151\157\156", "\157\165\164\145\162", "\164\150\145\156", "\142\162\145\141\153", \r
+"\145\156\143\141\160\163\165\154\141\164\145\144", "\151\146", "\157\165\164\160\165\164", "\164\162\165\145", \r
+"\143\154\141\163\163", "\145\156\144", "\151\155\160\157\162\164", "\160\141\143\153\141\147\145", \r
+"\164\171\160\145", "\143\157\156\156\145\143\164", \r
+"\145\156\165\155\145\162\141\164\151\157\156", "\151\156", "\160\141\162\141\155\145\164\145\162", "\167\150\145\156", \r
+"\143\157\156\156\145\143\164\157\162", "\145\161\165\141\164\151\157\156", "\151\156\151\164\151\141\154", \r
+"\160\141\162\164\151\141\154", "\167\150\151\154\145", "\143\157\156\163\164\141\156\164", \r
+"\145\170\160\141\156\144\141\142\154\145", "\151\156\156\145\162", "\160\162\157\164\145\143\164\145\144", \r
+"\167\151\164\150\151\156", "\143\157\156\163\164\162\141\151\156\145\144\142\171", \r
+"\145\170\164\145\156\144\163", "\151\156\160\165\164", "\160\165\142\154\151\143", "\144\145\162", \r
+"\145\170\164\145\162\156\141\154", "\154\157\157\160", "\162\145\143\157\162\144", "\50", "\51", "\173", "\175", \r
+"\133", "\135", "\56", "\72", "\73", "\54", "\74", "\74\75", "\76", "\76\75", \r
+"\75\75", "\74\76", "\53", "\55", "\56\53", "\56\55", "\52", "\57", "\56\52", "\56\57", \r
+"\136", "\56\136", "\75", "\72\75", null, null, null, null, \r
+"\157\160\145\162\141\164\157\162\40\146\165\156\143\164\151\157\156", "\157\160\145\162\141\164\157\162\40\162\145\143\157\162\144", };\r
+\r
+/** Lexer state names. */\r
+public static final String[] lexStateNames = {\r
+   "DEFAULT",\r
+};\r
+static final long[] jjtoToken = {
+   0xfffffffffffffff1L, 0xffffffffL, 
+};\r
+static final long[] jjtoSkip = {
+   0xeL, 0x0L, 
+};\r
+protected SimpleCharStream input_stream;\r
+private final int[] jjrounds = new int[31];\r
+private final int[] jjstateSet = new int[62];\r
+private final StringBuilder jjimage = new StringBuilder();\r
+private StringBuilder image = jjimage;\r
+private int jjimageLen;\r
+private int lengthOfMatch;\r
+protected char curChar;\r
+/** Constructor. */\r
+public ModelParserTokenManager(SimpleCharStream stream){\r
+   if (SimpleCharStream.staticFlag)\r
+      throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");\r
+   input_stream = stream;\r
+}\r
+\r
+/** Constructor. */\r
+public ModelParserTokenManager(SimpleCharStream stream, int lexState){\r
+   this(stream);\r
+   SwitchTo(lexState);\r
+}\r
+\r
+/** Reinitialise parser. */\r
+public void ReInit(SimpleCharStream stream)\r
+{\r
+   jjmatchedPos = jjnewStateCnt = 0;\r
+   curLexState = defaultLexState;\r
+   input_stream = stream;\r
+   ReInitRounds();\r
+}\r
+private void ReInitRounds()\r
+{\r
+   int i;\r
+   jjround = 0x80000001;\r
+   for (i = 31; i-- > 0;)\r
+      jjrounds[i] = 0x80000000;\r
+}\r
+\r
+/** Reinitialise parser. */\r
+public void ReInit(SimpleCharStream stream, int lexState)\r
+{\r
+   ReInit(stream);\r
+   SwitchTo(lexState);\r
+}\r
+\r
+/** Switch to specified lex state. */\r
+public void SwitchTo(int lexState)\r
+{\r
+   if (lexState >= 1 || lexState < 0)\r
+      throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);\r
+   else\r
+      curLexState = lexState;\r
+}\r
+\r
+protected Token jjFillToken()\r
+{\r
+   final Token t;\r
+   final String curTokenImage;\r
+   final int beginLine;\r
+   final int endLine;\r
+   final int beginColumn;\r
+   final int endColumn;\r
+   String im = jjstrLiteralImages[jjmatchedKind];\r
+   curTokenImage = (im == null) ? input_stream.GetImage() : im;\r
+   beginLine = input_stream.getBeginLine();\r
+   beginColumn = input_stream.getBeginColumn();\r
+   endLine = input_stream.getEndLine();\r
+   endColumn = input_stream.getEndColumn();\r
+   t = Token.newToken(jjmatchedKind, curTokenImage);\r
+\r
+   t.beginLine = beginLine;\r
+   t.endLine = endLine;\r
+   t.beginColumn = beginColumn;\r
+   t.endColumn = endColumn;\r
+\r
+   return t;\r
+}\r
+\r
+int curLexState = 0;\r
+int defaultLexState = 0;\r
+int jjnewStateCnt;\r
+int jjround;\r
+int jjmatchedPos;\r
+int jjmatchedKind;\r
+\r
+/** Get the next Token. */\r
+public Token getNextToken() \r
+{\r
+  Token matchedToken;\r
+  int curPos = 0;\r
+\r
+  EOFLoop :
+  for (;;)\r
+  {\r
+   try\r
+   {\r
+      curChar = input_stream.BeginToken();\r
+   }\r
+   catch(java.io.IOException e)\r
+   {\r
+      jjmatchedKind = 0;\r
+      matchedToken = jjFillToken();\r
+      return matchedToken;\r
+   }\r
+   image = jjimage;\r
+   image.setLength(0);\r
+   jjimageLen = 0;\r
+\r
+   jjmatchedKind = 0x7fffffff;\r
+   jjmatchedPos = 0;\r
+   curPos = jjMoveStringLiteralDfa0_0();\r
+   if (jjmatchedKind != 0x7fffffff)\r
+   {\r
+      if (jjmatchedPos + 1 < curPos)\r
+         input_stream.backup(curPos - jjmatchedPos - 1);\r
+      if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)\r
+      {\r
+         matchedToken = jjFillToken();\r
+         TokenLexicalActions(matchedToken);\r
+         return matchedToken;\r
+      }\r
+      else\r
+      {\r
+         continue EOFLoop;\r
+      }\r
+   }\r
+   int error_line = input_stream.getEndLine();\r
+   int error_column = input_stream.getEndColumn();\r
+   String error_after = null;\r
+   boolean EOFSeen = false;\r
+   try { input_stream.readChar(); input_stream.backup(1); }\r
+   catch (java.io.IOException e1) {\r
+      EOFSeen = true;\r
+      error_after = curPos <= 1 ? "" : input_stream.GetImage();\r
+      if (curChar == '\n' || curChar == '\r') {\r
+         error_line++;\r
+         error_column = 0;\r
+      }\r
+      else\r
+         error_column++;\r
+   }\r
+   if (!EOFSeen) {\r
+      input_stream.backup(1);\r
+      error_after = curPos <= 1 ? "" : input_stream.GetImage();\r
+   }\r
+   throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);\r
+  }\r
+}\r
+\r
+void TokenLexicalActions(Token matchedToken)\r
+{\r
+   switch(jjmatchedKind)\r
+   {\r
+      case 91 :\r
+        image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1)));\r
+      matchedToken.image = matchedToken.image.substring(1,matchedToken.image.length()-1);\r
+         break;\r
+      default :\r
+         break;\r
+   }\r
+}\r
+private void jjCheckNAdd(int state)\r
+{\r
+   if (jjrounds[state] != jjround)\r
+   {\r
+      jjstateSet[jjnewStateCnt++] = state;\r
+      jjrounds[state] = jjround;\r
+   }\r
+}\r
+private void jjAddStates(int start, int end)\r
+{\r
+   do {\r
+      jjstateSet[jjnewStateCnt++] = jjnextStates[start];\r
+   } while (start++ != end);\r
+}\r
+private void jjCheckNAddTwoStates(int state1, int state2)\r
+{\r
+   jjCheckNAdd(state1);\r
+   jjCheckNAdd(state2);\r
+}\r
+\r
+private void jjCheckNAddStates(int start, int end)\r
+{\r
+   do {\r
+      jjCheckNAdd(jjnextStates[start]);\r
+   } while (start++ != end);\r
+}\r
+\r
+}\r
diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/modelParser/ModelicaParser.jj b/org.simantics.sysdyn/src/org/simantics/sysdyn/modelParser/ModelicaParser.jj
new file mode 100644 (file)
index 0000000..cc155d0
--- /dev/null
@@ -0,0 +1,634 @@
+options {\r
+  JDK_VERSION = "1.6";\r
+  STATIC = false;\r
+}\r
+\r
+PARSER_BEGIN(ModelParser)\r
+package org.simantics.sysdyn.modelParser;\r
+\r
+public class ModelParser {    \r
+    \r
+}\r
+\r
+PARSER_END(ModelParser)\r
+\r
+/*** Lexer *********************************************************/\r
+\r
+SKIP:\r
+{ <WHITESPACE: " " | "\n" | "\r" | "\t" > \r
+| <COMMENT1: "/*" (~["*"] | "*" ~["/"])* "*/" >  \r
+| <COMMENT2: "//" (~["\n"])* >\r
+}\r
+\r
+TOKEN:\r
+{\r
+"algorithm"    | "discrete"    | "false"       | "model"       | "redeclare"\r
+| "and"                | "each"                | "final"       | "not"         | "replaceable"\r
+| "annotation" | "else"                | "flow"        | "operator" | "return"\r
+|"assert"              | "elseif"              | "for"         | "or"          | "stream"\r
+| "block"              | "elsewhen"    | "function" | "outer"  | "then"\r
+| "break"              | "encapsulated" | "if"         | "output"      | "true"\r
+| "class"              | "end"                 | "import"      | "package" | "type"\r
+| "connect"    | "enumeration" | "in"          | "parameter" | "when"\r
+| "connector"  | "equation"    | "initial" | "partial" | "while"\r
+| "constant"   | "expandable"  | "inner"       | "protected" | "within"\r
+| "constrainedby" | "extends"  | "input"       | "public"\r
+| "der"                | "external"    | "loop"        | "record"\r
+| "(" | ")" | "{" | "}" | "[" | "]" | "." | ":" | ";" | ","\r
+| "<" | "<=" | ">" | ">=" | "==" | "<>"\r
+| "+" | "-" | ".+" | ".-"\r
+| "*" | "/" | ".*" | "./"\r
+| "^" | ".^"\r
+| "=" | ":=" \r
+| <IDENT: ["a"-"z","A"-"Z","_"] (["a"-"z","A"-"Z","_","0"-"9"])* >\r
+| <STRING: "\"" (~["\"", "\\", "\n"] | "\\" ~["\n"])* "\"">\r
+    { matchedToken.image = matchedToken.image.substring(1,matchedToken.image.length()-1); }\r
+| <UNSIGNED_INTEGER: (["0"-"9"])+ >\r
+| <UNSIGNED_NUMBER:  \r
+    ( <UNSIGNED_INTEGER> "." (<UNSIGNED_INTEGER>)? (["e","E"] <UNSIGNED_INTEGER>)?\r
+    | "." <UNSIGNED_INTEGER> (["e","E"] <UNSIGNED_INTEGER>)?\r
+    | <UNSIGNED_INTEGER> ["e","E"] <UNSIGNED_INTEGER>\r
+    ) >\r
+}\r
+\r
+/*** Parser ********************************************************/\r
+\r
+// https://javacc.dev.java.net/doc/javaccgrm.html\r
+// add_op -> add_op()\r
+// [ add_op ] -> ( add_op() )?\r
+// { add_op term } -> ( add_op() term() )*\r
+\r
+void parse() : {\r} {\r  stored_definition() <EOF>\r
+}\r
+\r
+/*** Stored Definition - Within ************************************/\r
+\r
+void stored_definition() : {\r
+} {\r
+//  stored_definition:\r
+//     [ within [ name ] ";" ]\r
+//     { [ final ] class_definition ";" }\r
+       ( "within" ( name() )? ";" )?\r
+       ( ( "final" )? class_definition() ";" )*\r}\r\r
+/*** Class Definition **********************************************/\r
+  \r
+void class_definition() : {\r
+} {\r
+//     class_definition :\r
+//     [ encapsulated ]\r
+//     [ partial\r
+//     ] ( class modelrecordblock expandableconnectortype\r
+//     | | | | [ ] | | package | function | operator | operator function | operator record )\r
+//     class_specifier\r
+       ( "encapsulated" )?\r
+       ( "partial" )?\r
+       ( "class" | "model" | "record" | "block" | ( "expandable" )? "connector" | "type" |\r
+       "package" | "function" | "operator" | "operator function" | "operator record" )\r
+       class_specifier()\r}\r
+\r
+\r
+void class_specifier() : {\r
+} {\r
+//     class_specifier :\r
+//     IDENT string_comment composition end IDENT\r
+//     | IDENT "=" base_prefix name [ array_subscripts ]\r
+//     [ class_modification ] comment\r
+//     | IDENT "=" enumeration "(" ( [enum_list] | ":" ) ")" comment\r
+//     | IDENT "=" der "(" name "," IDENT { "," IDENT } ")" comment\r
+//     | extends IDENT [ class_modification ] string_comment composition\r
+//     end IDENT  \r
+       LOOKAHEAD(2) <IDENT> string_comment() composition() "end" <IDENT>\r
+       | LOOKAHEAD(2) <IDENT> "=" base_prefix() name() ( array_subscripts() )? ( class_modification() )? comment()\r
+       | LOOKAHEAD(3) <IDENT> "=" "enumeration" "(" ( ( enum_list() )? | ":" ) ")" comment()\r
+       |LOOKAHEAD(3)  <IDENT> "=" "der" "(" name() "," <IDENT> ( "," <IDENT> )* ")" comment()\r
+       | "extends" <IDENT> ( class_modification() )? string_comment() composition() "end" <IDENT> \r
+}\r
+\r
+void base_prefix() : {\r
+} {\r
+       type_prefix()\r
+}\r
+\r
+void enum_list() : {\r
+} {\r
+//     enumeration_literal { "," enumeration_literal}\r
+       enumeration_literal() ( "," enumeration_literal() )* \r
+}\r
+\r
+void enumeration_literal() : {\r
+} {\r
+       <IDENT> comment()\r
+}\r
+\r
+void parse_composition() : {\r
+} {\r
+       composition() <EOF>\r
+}\r
+\r
+void composition() : {\r
+} {\r
+//     element_list\r
+//     { public element_list |\r
+//     protected element_list |\r
+//     equation_section |\r
+//     algorithm_section\r
+//     }\r
+//     [ external [ language_specification ]\r
+//     [ external_function_call ] [ annotation ] ";" ]\r
+//     [ annotation ";" ]\r
+       element_list()\r
+       ( LOOKAHEAD(2) "public" element_list() | "protected" element_list() | equation_section() | algorithm_section() )*\r
+       ( "external" ( language_specification() )? ( external_function_call() )? ( annotation() )? ";" )?\r
+       ( annotation() ";" )?\r}\r
+\r
+void language_specification() : {\r
+} {\r
+       <STRING>\r
+}\r
+\r
+void external_function_call() : {\r
+} {\r
+//     [ component_reference "=" ]\r
+//     IDENT "(" [ expression_list ] ")"\r
+       ( component_reference() "=" )?\r
+       <IDENT> "(" ( expression_list() )? ")"\r}\r
+\r
+void element_list() : {\r
+} {\r
+       ( element() ";" )*\r}\r
+\r
+void element() : {\r
+} {\r
+//     import_clause |\r
+//     extends_clause |\r
+//     [ redeclare ]\r
+//     [ final ]\r
+//     [ inner ] [ outer ]\r
+//     ( ( class_definition | component_clause) |\r
+//     replaceable ( class_definition | component_clause)\r
+//     [constraining_clause comment])\r
+       import_clause() |\r
+       extends_clause() |\r
+       ( "redeclare" )?\r
+       ( "final" )?\r
+       ( "inner" )? ( "outer" )?\r
+       ( (class_definition() | component_clause()) |\r
+               "replaceable" (class_definition() | component_clause())\r
+               (constraining_clause() comment())?)\r}\r
+\r
+void import_clause() : {\r
+} {\r
+//     import ( IDENT "=" name | name ["." "*"] ) comment\r
+       "import" (LOOKAHEAD(2) <IDENT> "=" name() | name() ("." "*")? ) comment()\r
+}\r
+\r
+/*** Extends *******************************************************/\r
+void extends_clause() : {\r
+} {\r
+//     extends name [ class_modification ] [annotation]\r
+       "extends" name() ( class_modification() )? ( annotation() )?\r
+}\r
+\r
+void constraining_clause() : {\r
+} {\r
+//     constrainedby name [ class_modification ]\r
+       "constrainedby" name() ( class_modification() )?\r
+}\r
+\r
+/*** Component Clause **********************************************/\r
+void component_clause() : {\r
+} {\r
+//     type_prefix type_specifier [ array_subscripts ] component_list\r
+       type_prefix() type_specifier() ( array_subscripts() )? component_list()\r
+}\r
+\r
+void type_prefix() : {\r
+} {\r
+//     [ flow | stream ]\r
+//     [ discrete | parameter | constant ] [ input | output ]\r
+       ( "flow" | "stream" )?\r
+       ( "discrete" | "parameter" | "constant" )? ( "input" | "output" )?\r}\r
+\r
+void type_specifier() : {\r
+} {\r
+       name()\r
+}\r
+\r
+void component_list() : {\r
+} {\r
+//     component_declaration { "," component_declaration }\r
+       component_declaration() ( "," component_declaration() )*\r
+}\r
+\r
+void component_declaration() : {\r
+} {\r
+//     declaration [ conditional_attribute ] comment\r
+       declaration() ( conditional_attribute() )? comment()\r
+}\r
+\r
+void conditional_attribute() : {\r
+} {\r
+       "if" expression()\r
+}\r
+\r
+void declaration() : {\r
+} {\r
+//     IDENT [ array_subscripts ] [ modification ]\r
+       <IDENT> ( array_subscripts() )? ( modification() )?\r
+}\r
+\r
+/*** Modification **********************************************/\r
+void modification() : {\r
+} {\r
+//     class_modification [ "=" expression ]\r
+//     | "=" expression\r
+//     | ":=" expression\r
+       class_modification() ( "=" expression() )?\r
+       | "=" expression()\r
+       | ":=" expression()  \r
+}\r
+\r
+void class_modification() : {\r
+} {\r
+//     "(" [ argument_list ] ")"\r
+       "(" ( argument_list() )? ")"\r
+}\r
+\r
+void argument_list() : {\r
+} {\r
+// argument { "," argument }\r
+       argument() ( "," argument() )*\r
+}\r
+\r
+void argument() : {\r
+} {\r
+//     element_modification_or_replaceable\r
+//     | element_redeclaration\r
+       element_modification_or_replaceable() |\r
+       element_redeclaration()\r
+}\r
+\r
+void element_modification_or_replaceable() : {\r
+} {\r
+//     [ each ] [ final ] ( element_modification | element_replaceable)\r
+       ( "each" )? ( "final" )? ( element_modification() | element_replaceable() )\r}\r
+\r
+void element_modification() : {\r
+} {\r
+//     name [ modification ] string_comment\r
+       name() ( modification() )? string_comment()\r
+}\r
+\r
+void element_redeclaration() : {\r
+} {\r
+//     redeclare [ each ] [ final ]\r
+//     ( ( class_definition | component_clause1) | element_replaceable )\r
+       "redeclare" ( "each" )? ( "final" )?\r
+       ( ( class_definition() | component_clause1() ) | element_replaceable() )\r}\r
+\r
+void element_replaceable() : {\r
+} {\r
+//     replaceable ( class_definition | component_clause1)\r
+//     [constraining_clause]\r
+       "replaceable" ( class_definition() | component_clause1() ) ( constraining_clause() )?\r
+}\r
+\r
+void component_clause1() : {\r
+} {\r
+//     type_prefix type_specifier component_declaration1\r
+       type_prefix() type_specifier() component_declaration1()\r
+}\r
+\r
+void component_declaration1() : {\r
+} {\r
+       declaration() comment()\r
+}\r
+\r
+\r
+/*** Equations *************************************************/\r
+void equation_section() : {\r
+} {\r
+//     [ initial ] equation { equation ";" }\r
+       ( "initial" )? "equation" ( equation() ";" )*\r
+}\r
+\r
+void algorithm_section() : {\r
+} {\r
+//     [ initial ] algorithm { statement ";" }\r
+       ( "initial" )? "algorithm" ( statement() ";" )*\r}\r
+\r
+void equation() : {\r
+} {\r
+//     ( simple_expression "=" expression\r
+//     | if_equation\r
+//     | for_equation\r
+//     | connect_clause\r
+//     | when_equation\r
+//     | IDENT function_call_args )\r
+//     comment\r
+       ( LOOKAHEAD(3) simple_expression() "=" expression()\r
+               | if_equation()\r
+               | for_equation()\r
+               | connect_clause()\r
+               | when_equation()\r
+               | <IDENT> function_call_args() )\r
+       comment()\r}\r
+\r
+void statement() : {\r
+} {\r
+//     ( component_reference ( ":=" expression | function_call_args )\r
+//     | "(" output_expression_list ")" ":=" component_reference function_call_args\r
+//     | break\r
+//     | return\r
+//     | if_statement\r
+//     | for_statement\r
+//     | while_statement\r
+//     | when_statement )\r
+//     comment\r
+       ( component_reference() ( ":=" expression() | function_call_args() )\r
+               | "(" output_expression_list() ")" ":=" component_reference() function_call_args()\r
+               | "break"\r
+               | "return"\r
+               | if_statement()\r
+               | for_statement()\r
+               | while_statement()\r
+               | when_statement() )\r
+       comment() \r       \r
+}\r
+\r
+void if_equation() : {\r
+} {\r
+//     if expression then\r
+//     { equation ";" }\r
+//     { elseif expression then\r
+//     { equation ";" }\r
+//     }\r
+//     [ else\r
+//     { equation ";" }\r
+//     ]\r
+//     end if\r
+       "if" expression() "then"\r
+               ( equation() ";" )*\r
+       ( "elseif" expression() "then"\r
+               ( equation() ";" )*\r
+       )*\r
+       ( "else"\r
+               ( equation() ";" )*\r
+       )?\r
+       "end" "if"\r}\r
+\r
+void if_statement() : {\r
+} {\r
+//     if expression then\r
+//     { statement ";" }\r
+//     { elseif expression then\r
+//     { statement ";" }\r
+//     }\r
+//     [ else\r
+//     { statement ";" }\r
+//     ]\r
+//     end if\r
+       "if" expression() "then"\r
+               ( statement() ";" )*\r
+       ( "elseif" expression() "then"\r
+               ( statement() ";" )*\r
+       )*\r
+       ( "else"\r
+               ( statement() ";" )*\r
+       )?\r
+       "end" "if"\r}\r
+\r
+void for_equation() : {\r
+} {\r
+//     for for_indices loop\r
+//     { equation ";" }\r
+//     end for\r
+       "for" for_indices() "loop"\r
+               ( equation() ";" )*\r
+       "end" "for"\r}\r
+\r
+void for_statement() : {\r
+} {\r
+//     for for_indices loop\r
+//     { equation ";" }\r
+//     end for\r
+       "for" for_indices() "loop"\r
+               ( statement() ";" )*\r
+       "end" "for"\r}\r
+\r
+void for_indices() : {\r
+} {\r
+       //for_index {"," for_index}\r
+       for_index() ("," for_index())*\r
+}\r
+\r
+void for_index() : {\r
+} {\r
+       //IDENT [ in expression ]\r
+       <IDENT> ( "in" expression()     )?\r
+}\r
+\r
+void while_statement() : {\r
+} {\r
+//     while expression loop\r
+//     { statement ";" }\r
+//     end while\r
+       "while" expression() "loop"\r
+               ( statement() ";" )*\r
+       "end" "while"\r}\r
+\r
+void when_equation() : {\r
+} {\r
+//     when expression then\r
+//     { equation ";" }\r
+//     { elsewhen expression then\r
+//     { equation ";" } }\r
+//     end when\r
+       "when" expression() "then"\r
+               ( equation() ";" )*\r
+       ( "elsewhen" expression() "then"\r
+               ( equation() ";" )*\r
+       )*\r
+       "end" "when"\r}\r
+\r
+void when_statement() : {\r
+} {\r
+//     when expression then\r
+//     { statement ";" }\r
+//     { elsewhen expression then\r
+//     { statement ";" } }\r
+//     end when\r
+       "when" expression() "then"\r
+               ( statement() ";" )*\r
+       ( "elsewhen" expression() "then"\r
+               ( statement() ";" )*\r
+       )*\r
+       "end" "when"\r}\r
+\r
+void connect_clause() : {\r
+} {\r
+//     connect "(" component_reference "," component_reference ")"\r
+       "connect" "(" component_reference() "," component_reference() ")"\r
+}\r
+\r
+/*** Expressions ***************************************************/\r
+void expr() : {\r
+} {\r
+       simple_expression() <EOF>\r
+       |\r
+       "if" expression() "then" expression() ( "elseif" expression() "then" expression() )*\r
+       "else" expression() <EOF>\r
+}\r
+\r
+void expression() : {\r
+} {\r
+       simple_expression()\r
+       | "if" expression() "then" expression() ( "elseif" expression() "then" expression() )*\r
+       "else" expression()\r
+}\r
+\r
+void simple_expression() : {\r
+} {\r
+       logical_expression() ( ":" logical_expression() ( ":" logical_expression() )? )?\r
+}      \r
+\r
+void logical_expression() : {\r
+} {\r
+       logical_term() ( "or" logical_term() )*\r
+}      \r
+\r
+void logical_term() : {\r
+} {\r
+       logical_factor() ( "and" logical_factor() )*\r
+}\r
+\r
+void logical_factor() : {\r
+} {\r
+       ( "not" )? relation()\r
+}\r
+\r
+void relation() : {\r
+} {\r
+       arithmetic_expression() ( rel_op() arithmetic_expression() )?\r
+}\r
+\r
+void rel_op() : {\r
+} {\r
+       "<" | "<=" | ">" | ">=" | "==" | "<>"\r
+}\r
+\r
+void arithmetic_expression() : {\r
+} {\r
+    (add_op())? term() (add_op() term())*\r
+}\r
+\r
+void add_op() : {\r
+} {\r
+    "+" | "-" | ".+" | ".-"\r
+}\r
+\r
+void term() : {\r
+} {\r
+    factor() ( mul_op() factor() )*\r
+}\r
+\r
+void mul_op() : {\r
+} {\r
+    "*" | "/" | ".*" | "./"\r
+}\r
+\r
+void factor() : {\r
+} {\r
+       primary() ( "^" | ".^" primary() )?\r
+}\r
+\r
+void primary() : {\r
+} {\r
+       <UNSIGNED_NUMBER>\r
+  | <UNSIGNED_INTEGER>\r
+  | <STRING>\r
+  | "false"\r
+  | "true"\r
+  |   LOOKAHEAD( (name()|"der"|"initial") "(" ) (name()|"der"|"initial") function_call_args()\r
+  | component_reference()\r
+  | "(" output_expression_list() ")"\r
+  | "[" expression_list() ( ";" expression_list() )* "]"\r
+  | "{" function_arguments() "}"\r
+  | "end"\r
+}\r
+\r
+void name() : {\r
+} {\r
+//     [ "." ] IDENT { "." IDENT }\r
+       ( "." )? <IDENT> ( "." <IDENT> )*\r
+}\r
+\r
+void component_reference() : {\r
+} {\r
+//     [ "." ] IDENT [ array_subscripts ] { "." IDENT [ array_subscripts ] }\r
+       ( "." )? <IDENT> ( array_subscripts() )? ( "." <IDENT> ( array_subscripts() )? )*\r
+}\r
+\r
+void function_call_args() : {\r
+} {\r
+//     "(" [ function_arguments ] ")"\r
+       "(" ( function_arguments() )? ")"\r
+}\r
+\r
+void function_arguments() : {\r
+} {\r
+       //expression [ "," function_arguments | for for_indices ]\r
+       //| named_arguments\r
+        LOOKAHEAD(2) expression() ( "," function_arguments() | "for" for_indices() )?\r
+       | named_arguments()\r
+}\r
+\r
+void named_arguments() : {\r
+} {\r
+//     named_argument [ "," named_arguments ]  \r
+       named_argument() ( "," named_arguments() )?\r
+}\r
+\r
+void named_argument() : {\r
+} {    \r
+       <IDENT> "=" expression()\r
+}\r
+\r
+void output_expression_list() : {\r
+} {\r
+//     [ expression ] { "," [ expression ] }  \r
+       ( expression() )? ( "," ( expression() )? )*\r
+}\r
+\r
+void expression_list() : {\r
+} {\r
+//     expression { "," expression }\r
+    expression() ( "," expression() )*\r
+}\r
+\r
+void array_subscripts() : {\r
+} {\r
+//     "[" subscript { "," subscript } "]" \r
+       "[" subscript() ( "," subscript() )* "]"\r
+}\r
+\r
+void subscript() : {\r
+} {\r
+//     ":" | expression  \r     ":"     | expression()\r
+}\r
+\r
+void comment() : {\r} {\r//      string_comment [ annotation ]\r
+       string_comment() ( annotation() )?\r
+}\r
+\r
+void string_comment() : {\r
+} {\r
+//     [ STRING { "+" STRING } ]  \r
+       ( <STRING> ( "+" <STRING> )* )? \r}\r
+\r
+void annotation() : {\r
+} {\r
+//     annotation class_modification\r
+       "annotation" class_modification()  \r
+}\r  \r
+\r
diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/modelParser/ParseException.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/modelParser/ParseException.java
new file mode 100644 (file)
index 0000000..86734a7
--- /dev/null
@@ -0,0 +1,187 @@
+/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 5.0 */\r
+/* JavaCCOptions:KEEP_LINE_COL=null */\r
+package org.simantics.sysdyn.modelParser;\r
+\r
+/**\r
+ * This exception is thrown when parse errors are encountered.\r
+ * You can explicitly create objects of this exception type by\r
+ * calling the method generateParseException in the generated\r
+ * parser.\r
+ *\r
+ * You can modify this class to customize your error reporting\r
+ * mechanisms so long as you retain the public fields.\r
+ */\r
+public class ParseException extends Exception {\r
+\r
+  /**\r
+   * The version identifier for this Serializable class.\r
+   * Increment only if the <i>serialized</i> form of the\r
+   * class changes.\r
+   */\r
+  private static final long serialVersionUID = 1L;\r
+\r
+  /**\r
+   * This constructor is used by the method "generateParseException"\r
+   * in the generated parser.  Calling this constructor generates\r
+   * a new object of this type with the fields "currentToken",\r
+   * "expectedTokenSequences", and "tokenImage" set.\r
+   */\r
+  public ParseException(Token currentTokenVal,\r
+                        int[][] expectedTokenSequencesVal,\r
+                        String[] tokenImageVal\r
+                       )\r
+  {\r
+    super(initialise(currentTokenVal, expectedTokenSequencesVal, tokenImageVal));\r
+    currentToken = currentTokenVal;\r
+    expectedTokenSequences = expectedTokenSequencesVal;\r
+    tokenImage = tokenImageVal;\r
+  }\r
+\r
+  /**\r
+   * The following constructors are for use by you for whatever\r
+   * purpose you can think of.  Constructing the exception in this\r
+   * manner makes the exception behave in the normal way - i.e., as\r
+   * documented in the class "Throwable".  The fields "errorToken",\r
+   * "expectedTokenSequences", and "tokenImage" do not contain\r
+   * relevant information.  The JavaCC generated code does not use\r
+   * these constructors.\r
+   */\r
+\r
+  public ParseException() {\r
+    super();\r
+  }\r
+\r
+  /** Constructor with message. */\r
+  public ParseException(String message) {\r
+    super(message);\r
+  }\r
+\r
+\r
+  /**\r
+   * This is the last token that has been consumed successfully.  If\r
+   * this object has been created due to a parse error, the token\r
+   * followng this token will (therefore) be the first error token.\r
+   */\r
+  public Token currentToken;\r
+\r
+  /**\r
+   * Each entry in this array is an array of integers.  Each array\r
+   * of integers represents a sequence of tokens (by their ordinal\r
+   * values) that is expected at this point of the parse.\r
+   */\r
+  public int[][] expectedTokenSequences;\r
+\r
+  /**\r
+   * This is a reference to the "tokenImage" array of the generated\r
+   * parser within which the parse error occurred.  This array is\r
+   * defined in the generated ...Constants interface.\r
+   */\r
+  public String[] tokenImage;\r
+\r
+  /**\r
+   * It uses "currentToken" and "expectedTokenSequences" to generate a parse\r
+   * error message and returns it.  If this object has been created\r
+   * due to a parse error, and you do not catch it (it gets thrown\r
+   * from the parser) the correct error message\r
+   * gets displayed.\r
+   */\r
+  private static String initialise(Token currentToken,\r
+                           int[][] expectedTokenSequences,\r
+                           String[] tokenImage) {\r
+    String eol = System.getProperty("line.separator", "\n");\r
+    StringBuffer expected = new StringBuffer();\r
+    int maxSize = 0;\r
+    for (int i = 0; i < expectedTokenSequences.length; i++) {\r
+      if (maxSize < expectedTokenSequences[i].length) {\r
+        maxSize = expectedTokenSequences[i].length;\r
+      }\r
+      for (int j = 0; j < expectedTokenSequences[i].length; j++) {\r
+        expected.append(tokenImage[expectedTokenSequences[i][j]]).append(' ');\r
+      }\r
+      if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) {\r
+        expected.append("...");\r
+      }\r
+      expected.append(eol).append("    ");\r
+    }\r
+    String retval = "Encountered \"";\r
+    Token tok = currentToken.next;\r
+    for (int i = 0; i < maxSize; i++) {\r
+      if (i != 0) retval += " ";\r
+      if (tok.kind == 0) {\r
+        retval += tokenImage[0];\r
+        break;\r
+      }\r
+      retval += " " + tokenImage[tok.kind];\r
+      retval += " \"";\r
+      retval += add_escapes(tok.image);\r
+      retval += " \"";\r
+      tok = tok.next;\r
+    }\r
+    retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn;\r
+    retval += "." + eol;\r
+    if (expectedTokenSequences.length == 1) {\r
+      retval += "Was expecting:" + eol + "    ";\r
+    } else {\r
+      retval += "Was expecting one of:" + eol + "    ";\r
+    }\r
+    retval += expected.toString();\r
+    return retval;\r
+  }\r
+\r
+  /**\r
+   * The end of line string for this machine.\r
+   */\r
+  protected String eol = System.getProperty("line.separator", "\n");\r
+\r
+  /**\r
+   * Used to convert raw characters to their escaped version\r
+   * when these raw version cannot be used as part of an ASCII\r
+   * string literal.\r
+   */\r
+  static String add_escapes(String str) {\r
+      StringBuffer retval = new StringBuffer();\r
+      char ch;\r
+      for (int i = 0; i < str.length(); i++) {\r
+        switch (str.charAt(i))\r
+        {\r
+           case 0 :\r
+              continue;\r
+           case '\b':\r
+              retval.append("\\b");\r
+              continue;\r
+           case '\t':\r
+              retval.append("\\t");\r
+              continue;\r
+           case '\n':\r
+              retval.append("\\n");\r
+              continue;\r
+           case '\f':\r
+              retval.append("\\f");\r
+              continue;\r
+           case '\r':\r
+              retval.append("\\r");\r
+              continue;\r
+           case '\"':\r
+              retval.append("\\\"");\r
+              continue;\r
+           case '\'':\r
+              retval.append("\\\'");\r
+              continue;\r
+           case '\\':\r
+              retval.append("\\\\");\r
+              continue;\r
+           default:\r
+              if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {\r
+                 String s = "0000" + Integer.toString(ch, 16);\r
+                 retval.append("\\u" + s.substring(s.length() - 4, s.length()));\r
+              } else {\r
+                 retval.append(ch);\r
+              }\r
+              continue;\r
+        }\r
+      }\r
+      return retval.toString();\r
+   }\r
+\r
+}\r
+/* JavaCC - OriginalChecksum=e46c56bfa832359193465f81e8a2147e (do not edit this line) */\r
diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/modelParser/SimpleCharStream.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/modelParser/SimpleCharStream.java
new file mode 100644 (file)
index 0000000..102b285
--- /dev/null
@@ -0,0 +1,471 @@
+/* Generated By:JavaCC: Do not edit this line. SimpleCharStream.java Version 5.0 */\r
+/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */\r
+package org.simantics.sysdyn.modelParser;\r
+\r
+/**\r
+ * An implementation of interface CharStream, where the stream is assumed to\r
+ * contain only ASCII characters (without unicode processing).\r
+ */\r
+\r
+public class SimpleCharStream\r
+{\r
+/** Whether parser is static. */\r
+  public static final boolean staticFlag = false;\r
+  int bufsize;\r
+  int available;\r
+  int tokenBegin;\r
+/** Position in buffer. */\r
+  public int bufpos = -1;\r
+  protected int bufline[];\r
+  protected int bufcolumn[];\r
+\r
+  protected int column = 0;\r
+  protected int line = 1;\r
+\r
+  protected boolean prevCharIsCR = false;\r
+  protected boolean prevCharIsLF = false;\r
+\r
+  protected java.io.Reader inputStream;\r
+\r
+  protected char[] buffer;\r
+  protected int maxNextCharInd = 0;\r
+  protected int inBuf = 0;\r
+  protected int tabSize = 8;\r
+\r
+  protected void setTabSize(int i) { tabSize = i; }\r
+  protected int getTabSize(int i) { return tabSize; }\r
+\r
+\r
+  protected void ExpandBuff(boolean wrapAround)\r
+  {\r
+    char[] newbuffer = new char[bufsize + 2048];\r
+    int newbufline[] = new int[bufsize + 2048];\r
+    int newbufcolumn[] = new int[bufsize + 2048];\r
+\r
+    try\r
+    {\r
+      if (wrapAround)\r
+      {\r
+        System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);\r
+        System.arraycopy(buffer, 0, newbuffer, bufsize - tokenBegin, bufpos);\r
+        buffer = newbuffer;\r
+\r
+        System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);\r
+        System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos);\r
+        bufline = newbufline;\r
+\r
+        System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);\r
+        System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos);\r
+        bufcolumn = newbufcolumn;\r
+\r
+        maxNextCharInd = (bufpos += (bufsize - tokenBegin));\r
+      }\r
+      else\r
+      {\r
+        System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);\r
+        buffer = newbuffer;\r
+\r
+        System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);\r
+        bufline = newbufline;\r
+\r
+        System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);\r
+        bufcolumn = newbufcolumn;\r
+\r
+        maxNextCharInd = (bufpos -= tokenBegin);\r
+      }\r
+    }\r
+    catch (Throwable t)\r
+    {\r
+      throw new Error(t.getMessage());\r
+    }\r
+\r
+\r
+    bufsize += 2048;\r
+    available = bufsize;\r
+    tokenBegin = 0;\r
+  }\r
+\r
+  protected void FillBuff() throws java.io.IOException\r
+  {\r
+    if (maxNextCharInd == available)\r
+    {\r
+      if (available == bufsize)\r
+      {\r
+        if (tokenBegin > 2048)\r
+        {\r
+          bufpos = maxNextCharInd = 0;\r
+          available = tokenBegin;\r
+        }\r
+        else if (tokenBegin < 0)\r
+          bufpos = maxNextCharInd = 0;\r
+        else\r
+          ExpandBuff(false);\r
+      }\r
+      else if (available > tokenBegin)\r
+        available = bufsize;\r
+      else if ((tokenBegin - available) < 2048)\r
+        ExpandBuff(true);\r
+      else\r
+        available = tokenBegin;\r
+    }\r
+\r
+    int i;\r
+    try {\r
+      if ((i = inputStream.read(buffer, maxNextCharInd, available - maxNextCharInd)) == -1)\r
+      {\r
+        inputStream.close();\r
+        throw new java.io.IOException();\r
+      }\r
+      else\r
+        maxNextCharInd += i;\r
+      return;\r
+    }\r
+    catch(java.io.IOException e) {\r
+      --bufpos;\r
+      backup(0);\r
+      if (tokenBegin == -1)\r
+        tokenBegin = bufpos;\r
+      throw e;\r
+    }\r
+  }\r
+\r
+/** Start. */\r
+  public char BeginToken() throws java.io.IOException\r
+  {\r
+    tokenBegin = -1;\r
+    char c = readChar();\r
+    tokenBegin = bufpos;\r
+\r
+    return c;\r
+  }\r
+\r
+  protected void UpdateLineColumn(char c)\r
+  {\r
+    column++;\r
+\r
+    if (prevCharIsLF)\r
+    {\r
+      prevCharIsLF = false;\r
+      line += (column = 1);\r
+    }\r
+    else if (prevCharIsCR)\r
+    {\r
+      prevCharIsCR = false;\r
+      if (c == '\n')\r
+      {\r
+        prevCharIsLF = true;\r
+      }\r
+      else\r
+        line += (column = 1);\r
+    }\r
+\r
+    switch (c)\r
+    {\r
+      case '\r' :\r
+        prevCharIsCR = true;\r
+        break;\r
+      case '\n' :\r
+        prevCharIsLF = true;\r
+        break;\r
+      case '\t' :\r
+        column--;\r
+        column += (tabSize - (column % tabSize));\r
+        break;\r
+      default :\r
+        break;\r
+    }\r
+\r
+    bufline[bufpos] = line;\r
+    bufcolumn[bufpos] = column;\r
+  }\r
+\r
+/** Read a character. */\r
+  public char readChar() throws java.io.IOException\r
+  {\r
+    if (inBuf > 0)\r
+    {\r
+      --inBuf;\r
+\r
+      if (++bufpos == bufsize)\r
+        bufpos = 0;\r
+\r
+      return buffer[bufpos];\r
+    }\r
+\r
+    if (++bufpos >= maxNextCharInd)\r
+      FillBuff();\r
+\r
+    char c = buffer[bufpos];\r
+\r
+    UpdateLineColumn(c);\r
+    return c;\r
+  }\r
+\r
+  @Deprecated\r
+  /**\r
+   * @deprecated\r
+   * @see #getEndColumn\r
+   */\r
+\r
+  public int getColumn() {\r
+    return bufcolumn[bufpos];\r
+  }\r
+\r
+  @Deprecated\r
+  /**\r
+   * @deprecated\r
+   * @see #getEndLine\r
+   */\r
+\r
+  public int getLine() {\r
+    return bufline[bufpos];\r
+  }\r
+\r
+  /** Get token end column number. */\r
+  public int getEndColumn() {\r
+    return bufcolumn[bufpos];\r
+  }\r
+\r
+  /** Get token end line number. */\r
+  public int getEndLine() {\r
+     return bufline[bufpos];\r
+  }\r
+\r
+  /** Get token beginning column number. */\r
+  public int getBeginColumn() {\r
+    return bufcolumn[tokenBegin];\r
+  }\r
+\r
+  /** Get token beginning line number. */\r
+  public int getBeginLine() {\r
+    return bufline[tokenBegin];\r
+  }\r
+\r
+/** Backup a number of characters. */\r
+  public void backup(int amount) {\r
+\r
+    inBuf += amount;\r
+    if ((bufpos -= amount) < 0)\r
+      bufpos += bufsize;\r
+  }\r
+\r
+  /** Constructor. */\r
+  public SimpleCharStream(java.io.Reader dstream, int startline,\r
+  int startcolumn, int buffersize)\r
+  {\r
+    inputStream = dstream;\r
+    line = startline;\r
+    column = startcolumn - 1;\r
+\r
+    available = bufsize = buffersize;\r
+    buffer = new char[buffersize];\r
+    bufline = new int[buffersize];\r
+    bufcolumn = new int[buffersize];\r
+  }\r
+\r
+  /** Constructor. */\r
+  public SimpleCharStream(java.io.Reader dstream, int startline,\r
+                          int startcolumn)\r
+  {\r
+    this(dstream, startline, startcolumn, 4096);\r
+  }\r
+\r
+  /** Constructor. */\r
+  public SimpleCharStream(java.io.Reader dstream)\r
+  {\r
+    this(dstream, 1, 1, 4096);\r
+  }\r
+\r
+  /** Reinitialise. */\r
+  public void ReInit(java.io.Reader dstream, int startline,\r
+  int startcolumn, int buffersize)\r
+  {\r
+    inputStream = dstream;\r
+    line = startline;\r
+    column = startcolumn - 1;\r
+\r
+    if (buffer == null || buffersize != buffer.length)\r
+    {\r
+      available = bufsize = buffersize;\r
+      buffer = new char[buffersize];\r
+      bufline = new int[buffersize];\r
+      bufcolumn = new int[buffersize];\r
+    }\r
+    prevCharIsLF = prevCharIsCR = false;\r
+    tokenBegin = inBuf = maxNextCharInd = 0;\r
+    bufpos = -1;\r
+  }\r
+\r
+  /** Reinitialise. */\r
+  public void ReInit(java.io.Reader dstream, int startline,\r
+                     int startcolumn)\r
+  {\r
+    ReInit(dstream, startline, startcolumn, 4096);\r
+  }\r
+\r
+  /** Reinitialise. */\r
+  public void ReInit(java.io.Reader dstream)\r
+  {\r
+    ReInit(dstream, 1, 1, 4096);\r
+  }\r
+  /** Constructor. */\r
+  public SimpleCharStream(java.io.InputStream dstream, String encoding, int startline,\r
+  int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException\r
+  {\r
+    this(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);\r
+  }\r
+\r
+  /** Constructor. */\r
+  public SimpleCharStream(java.io.InputStream dstream, int startline,\r
+  int startcolumn, int buffersize)\r
+  {\r
+    this(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);\r
+  }\r
+\r
+  /** Constructor. */\r
+  public SimpleCharStream(java.io.InputStream dstream, String encoding, int startline,\r
+                          int startcolumn) throws java.io.UnsupportedEncodingException\r
+  {\r
+    this(dstream, encoding, startline, startcolumn, 4096);\r
+  }\r
+\r
+  /** Constructor. */\r
+  public SimpleCharStream(java.io.InputStream dstream, int startline,\r
+                          int startcolumn)\r
+  {\r
+    this(dstream, startline, startcolumn, 4096);\r
+  }\r
+\r
+  /** Constructor. */\r
+  public SimpleCharStream(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException\r
+  {\r
+    this(dstream, encoding, 1, 1, 4096);\r
+  }\r
+\r
+  /** Constructor. */\r
+  public SimpleCharStream(java.io.InputStream dstream)\r
+  {\r
+    this(dstream, 1, 1, 4096);\r
+  }\r
+\r
+  /** Reinitialise. */\r
+  public void ReInit(java.io.InputStream dstream, String encoding, int startline,\r
+                          int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException\r
+  {\r
+    ReInit(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);\r
+  }\r
+\r
+  /** Reinitialise. */\r
+  public void ReInit(java.io.InputStream dstream, int startline,\r
+                          int startcolumn, int buffersize)\r
+  {\r
+    ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);\r
+  }\r
+\r
+  /** Reinitialise. */\r
+  public void ReInit(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException\r
+  {\r
+    ReInit(dstream, encoding, 1, 1, 4096);\r
+  }\r
+\r
+  /** Reinitialise. */\r
+  public void ReInit(java.io.InputStream dstream)\r
+  {\r
+    ReInit(dstream, 1, 1, 4096);\r
+  }\r
+  /** Reinitialise. */\r
+  public void ReInit(java.io.InputStream dstream, String encoding, int startline,\r
+                     int startcolumn) throws java.io.UnsupportedEncodingException\r
+  {\r
+    ReInit(dstream, encoding, startline, startcolumn, 4096);\r
+  }\r
+  /** Reinitialise. */\r
+  public void ReInit(java.io.InputStream dstream, int startline,\r
+                     int startcolumn)\r
+  {\r
+    ReInit(dstream, startline, startcolumn, 4096);\r
+  }\r
+  /** Get token literal value. */\r
+  public String GetImage()\r
+  {\r
+    if (bufpos >= tokenBegin)\r
+      return new String(buffer, tokenBegin, bufpos - tokenBegin + 1);\r
+    else\r
+      return new String(buffer, tokenBegin, bufsize - tokenBegin) +\r
+                            new String(buffer, 0, bufpos + 1);\r
+  }\r
+\r
+  /** Get the suffix. */\r
+  public char[] GetSuffix(int len)\r
+  {\r
+    char[] ret = new char[len];\r
+\r
+    if ((bufpos + 1) >= len)\r
+      System.arraycopy(buffer, bufpos - len + 1, ret, 0, len);\r
+    else\r
+    {\r
+      System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0,\r
+                                                        len - bufpos - 1);\r
+      System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1);\r
+    }\r
+\r
+    return ret;\r
+  }\r
+\r
+  /** Reset buffer when finished. */\r
+  public void Done()\r
+  {\r
+    buffer = null;\r
+    bufline = null;\r
+    bufcolumn = null;\r
+  }\r
+\r
+  /**\r
+   * Method to adjust line and column numbers for the start of a token.\r
+   */\r
+  public void adjustBeginLineColumn(int newLine, int newCol)\r
+  {\r
+    int start = tokenBegin;\r
+    int len;\r
+\r
+    if (bufpos >= tokenBegin)\r
+    {\r
+      len = bufpos - tokenBegin + inBuf + 1;\r
+    }\r
+    else\r
+    {\r
+      len = bufsize - tokenBegin + bufpos + 1 + inBuf;\r
+    }\r
+\r
+    int i = 0, j = 0, k = 0;\r
+    int nextColDiff = 0, columnDiff = 0;\r
+\r
+    while (i < len && bufline[j = start % bufsize] == bufline[k = ++start % bufsize])\r
+    {\r
+      bufline[j] = newLine;\r
+      nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j];\r
+      bufcolumn[j] = newCol + columnDiff;\r
+      columnDiff = nextColDiff;\r
+      i++;\r
+    }\r
+\r
+    if (i < len)\r
+    {\r
+      bufline[j] = newLine++;\r
+      bufcolumn[j] = newCol + columnDiff;\r
+\r
+      while (i++ < len)\r
+      {\r
+        if (bufline[j = start % bufsize] != bufline[++start % bufsize])\r
+          bufline[j] = newLine++;\r
+        else\r
+          bufline[j] = newLine;\r
+      }\r
+    }\r
+\r
+    line = bufline[j];\r
+    column = bufcolumn[j];\r
+  }\r
+\r
+}\r
+/* JavaCC - OriginalChecksum=7ab7faca15b64bda32c7a4effb209066 (do not edit this line) */\r
diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/modelParser/Token.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/modelParser/Token.java
new file mode 100644 (file)
index 0000000..25d3618
--- /dev/null
@@ -0,0 +1,131 @@
+/* Generated By:JavaCC: Do not edit this line. Token.java Version 5.0 */\r
+/* JavaCCOptions:TOKEN_EXTENDS=,KEEP_LINE_COL=null,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */\r
+package org.simantics.sysdyn.modelParser;\r
+\r
+/**\r
+ * Describes the input token stream.\r
+ */\r
+\r
+public class Token implements java.io.Serializable {\r
+\r
+  /**\r
+   * The version identifier for this Serializable class.\r
+   * Increment only if the <i>serialized</i> form of the\r
+   * class changes.\r
+   */\r
+  private static final long serialVersionUID = 1L;\r
+\r
+  /**\r
+   * An integer that describes the kind of this token.  This numbering\r
+   * system is determined by JavaCCParser, and a table of these numbers is\r
+   * stored in the file ...Constants.java.\r
+   */\r
+  public int kind;\r
+\r
+  /** The line number of the first character of this Token. */\r
+  public int beginLine;\r
+  /** The column number of the first character of this Token. */\r
+  public int beginColumn;\r
+  /** The line number of the last character of this Token. */\r
+  public int endLine;\r
+  /** The column number of the last character of this Token. */\r
+  public int endColumn;\r
+\r
+  /**\r
+   * The string image of the token.\r
+   */\r
+  public String image;\r
+\r
+  /**\r
+   * A reference to the next regular (non-special) token from the input\r
+   * stream.  If this is the last token from the input stream, or if the\r
+   * token manager has not read tokens beyond this one, this field is\r
+   * set to null.  This is true only if this token is also a regular\r
+   * token.  Otherwise, see below for a description of the contents of\r
+   * this field.\r
+   */\r
+  public Token next;\r
+\r
+  /**\r
+   * This field is used to access special tokens that occur prior to this\r
+   * token, but after the immediately preceding regular (non-special) token.\r
+   * If there are no such special tokens, this field is set to null.\r
+   * When there are more than one such special token, this field refers\r
+   * to the last of these special tokens, which in turn refers to the next\r
+   * previous special token through its specialToken field, and so on\r
+   * until the first special token (whose specialToken field is null).\r
+   * The next fields of special tokens refer to other special tokens that\r
+   * immediately follow it (without an intervening regular token).  If there\r
+   * is no such token, this field is null.\r
+   */\r
+  public Token specialToken;\r
+\r
+  /**\r
+   * An optional attribute value of the Token.\r
+   * Tokens which are not used as syntactic sugar will often contain\r
+   * meaningful values that will be used later on by the compiler or\r
+   * interpreter. This attribute value is often different from the image.\r
+   * Any subclass of Token that actually wants to return a non-null value can\r
+   * override this method as appropriate.\r
+   */\r
+  public Object getValue() {\r
+    return null;\r
+  }\r
+\r
+  /**\r
+   * No-argument constructor\r
+   */\r
+  public Token() {}\r
+\r
+  /**\r
+   * Constructs a new token for the specified Image.\r
+   */\r
+  public Token(int kind)\r
+  {\r
+    this(kind, null);\r
+  }\r
+\r
+  /**\r
+   * Constructs a new token for the specified Image and Kind.\r
+   */\r
+  public Token(int kind, String image)\r
+  {\r
+    this.kind = kind;\r
+    this.image = image;\r
+  }\r
+\r
+  /**\r
+   * Returns the image.\r
+   */\r
+  public String toString()\r
+  {\r
+    return image;\r
+  }\r
+\r
+  /**\r
+   * Returns a new Token object, by default. However, if you want, you\r
+   * can create and return subclass objects based on the value of ofKind.\r
+   * Simply add the cases to the switch for all those special cases.\r
+   * For example, if you have a subclass of Token called IDToken that\r
+   * you want to create if ofKind is ID, simply add something like :\r
+   *\r
+   *    case MyParserConstants.ID : return new IDToken(ofKind, image);\r
+   *\r
+   * to the following switch statement. Then you can cast matchedToken\r
+   * variable to the appropriate type and use sit in your lexical actions.\r
+   */\r
+  public static Token newToken(int ofKind, String image)\r
+  {\r
+    switch(ofKind)\r
+    {\r
+      default : return new Token(ofKind, image);\r
+    }\r
+  }\r
+\r
+  public static Token newToken(int ofKind)\r
+  {\r
+    return newToken(ofKind, null);\r
+  }\r
+\r
+}\r
+/* JavaCC - OriginalChecksum=8584b8a0988c627589640a007dbfe0bb (do not edit this line) */\r
diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/modelParser/TokenMgrError.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/modelParser/TokenMgrError.java
new file mode 100644 (file)
index 0000000..60c6745
--- /dev/null
@@ -0,0 +1,147 @@
+/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 5.0 */\r
+/* JavaCCOptions: */\r
+package org.simantics.sysdyn.modelParser;\r
+\r
+/** Token Manager Error. */\r
+public class TokenMgrError extends Error\r
+{\r
+\r
+  /**\r
+   * The version identifier for this Serializable class.\r
+   * Increment only if the <i>serialized</i> form of the\r
+   * class changes.\r
+   */\r
+  private static final long serialVersionUID = 1L;\r
+\r
+  /*\r
+   * Ordinals for various reasons why an Error of this type can be thrown.\r
+   */\r
+\r
+  /**\r
+   * Lexical error occurred.\r
+   */\r
+  static final int LEXICAL_ERROR = 0;\r
+\r
+  /**\r
+   * An attempt was made to create a second instance of a static token manager.\r
+   */\r
+  static final int STATIC_LEXER_ERROR = 1;\r
+\r
+  /**\r
+   * Tried to change to an invalid lexical state.\r
+   */\r
+  static final int INVALID_LEXICAL_STATE = 2;\r
+\r
+  /**\r
+   * Detected (and bailed out of) an infinite loop in the token manager.\r
+   */\r
+  static final int LOOP_DETECTED = 3;\r
+\r
+  /**\r
+   * Indicates the reason why the exception is thrown. It will have\r
+   * one of the above 4 values.\r
+   */\r
+  int errorCode;\r
+\r
+  /**\r
+   * Replaces unprintable characters by their escaped (or unicode escaped)\r
+   * equivalents in the given string\r
+   */\r
+  protected static final String addEscapes(String str) {\r
+    StringBuffer retval = new StringBuffer();\r
+    char ch;\r
+    for (int i = 0; i < str.length(); i++) {\r
+      switch (str.charAt(i))\r
+      {\r
+        case 0 :\r
+          continue;\r
+        case '\b':\r
+          retval.append("\\b");\r
+          continue;\r
+        case '\t':\r
+          retval.append("\\t");\r
+          continue;\r
+        case '\n':\r
+          retval.append("\\n");\r
+          continue;\r
+        case '\f':\r
+          retval.append("\\f");\r
+          continue;\r
+        case '\r':\r
+          retval.append("\\r");\r
+          continue;\r
+        case '\"':\r
+          retval.append("\\\"");\r
+          continue;\r
+        case '\'':\r
+          retval.append("\\\'");\r
+          continue;\r
+        case '\\':\r
+          retval.append("\\\\");\r
+          continue;\r
+        default:\r
+          if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {\r
+            String s = "0000" + Integer.toString(ch, 16);\r
+            retval.append("\\u" + s.substring(s.length() - 4, s.length()));\r
+          } else {\r
+            retval.append(ch);\r
+          }\r
+          continue;\r
+      }\r
+    }\r
+    return retval.toString();\r
+  }\r
+\r
+  /**\r
+   * Returns a detailed message for the Error when it is thrown by the\r
+   * token manager to indicate a lexical error.\r
+   * Parameters :\r
+   *    EOFSeen     : indicates if EOF caused the lexical error\r
+   *    curLexState : lexical state in which this error occurred\r
+   *    errorLine   : line number when the error occurred\r
+   *    errorColumn : column number when the error occurred\r
+   *    errorAfter  : prefix that was seen before this error occurred\r
+   *    curchar     : the offending character\r
+   * Note: You can customize the lexical error message by modifying this method.\r
+   */\r
+  protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) {\r
+    return("Lexical error at line " +\r
+          errorLine + ", column " +\r
+          errorColumn + ".  Encountered: " +\r
+          (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar + "), ") +\r
+          "after : \"" + addEscapes(errorAfter) + "\"");\r
+  }\r
+\r
+  /**\r
+   * You can also modify the body of this method to customize your error messages.\r
+   * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not\r
+   * of end-users concern, so you can return something like :\r
+   *\r
+   *     "Internal Error : Please file a bug report .... "\r
+   *\r
+   * from this method for such cases in the release version of your parser.\r
+   */\r
+  public String getMessage() {\r
+    return super.getMessage();\r
+  }\r
+\r
+  /*\r
+   * Constructors of various flavors follow.\r
+   */\r
+\r
+  /** No arg constructor. */\r
+  public TokenMgrError() {\r
+  }\r
+\r
+  /** Constructor with message and reason. */\r
+  public TokenMgrError(String message, int reason) {\r
+    super(message);\r
+    errorCode = reason;\r
+  }\r
+\r
+  /** Full Constructor. */\r
+  public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) {\r
+    this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);\r
+  }\r
+}\r
+/* JavaCC - OriginalChecksum=d047fc9c0c00c40e4d34a354929bb60c (do not edit this line) */\r