[jboss-svn-commits] JBL Code SVN: r23471 - in labs/jbosstm/workspace/adinn/orchestration: dd/grammar and 9 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Thu Oct 16 03:28:18 EDT 2008
Author: adinn
Date: 2008-10-16 03:28:17 -0400 (Thu, 16 Oct 2008)
New Revision: 23471
Added:
labs/jbosstm/workspace/adinn/orchestration/dd/grammar/cup/
labs/jbosstm/workspace/adinn/orchestration/dd/grammar/cup/ECAGrammar.cup
labs/jbosstm/workspace/adinn/orchestration/dd/grammar/flex/
labs/jbosstm/workspace/adinn/orchestration/dd/grammar/flex/ECAToken.flex
labs/jbosstm/workspace/adinn/orchestration/ext/JFlex.jar
labs/jbosstm/workspace/adinn/orchestration/ext/javacup.jar
labs/jbosstm/workspace/adinn/orchestration/ext/javacuprt.jar
labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/MinusExpression.java
labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/grammar/ParseNode.java
labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/grammar/sym.java
Removed:
labs/jbosstm/workspace/adinn/orchestration/dd/grammar/ECAGrammar.g
labs/jbosstm/workspace/adinn/orchestration/dd/grammar/ECAToken.g
labs/jbosstm/workspace/adinn/orchestration/ext/antlr-2.7.7.jar
labs/jbosstm/workspace/adinn/orchestration/ext/antlr-3.0.1.jar
labs/jbosstm/workspace/adinn/orchestration/ext/antlr-runtime-3.0.1.jar
labs/jbosstm/workspace/adinn/orchestration/ext/junit.jar
labs/jbosstm/workspace/adinn/orchestration/ext/stringtemplate-3.1b1.jar
labs/jbosstm/workspace/adinn/orchestration/src/TestJar.java
labs/jbosstm/workspace/adinn/orchestration/src/TestParse.java
labs/jbosstm/workspace/adinn/orchestration/src/TestRule.java
Modified:
labs/jbosstm/workspace/adinn/orchestration/README
labs/jbosstm/workspace/adinn/orchestration/build.xml
labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/agent/RuleAdapter.java
labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/agent/RuleCheckAdapter.java
labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/Action.java
labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/Condition.java
labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/Event.java
labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/Rule.java
labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/binding/Binding.java
labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/ArithmeticExpression.java
labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/ArrayExpression.java
labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/BinaryOperExpression.java
labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/BitExpression.java
labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/BooleanExpression.java
labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/BooleanLiteral.java
labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/ComparisonExpression.java
labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/ConditionalEvalExpression.java
labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/DollarExpression.java
labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/Expression.java
labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/ExpressionHelper.java
labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/FieldExpression.java
labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/LogicalExpression.java
labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/MethodExpression.java
labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/NotExpression.java
labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/NumericLiteral.java
labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/OperExpression.java
labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/PlusExpression.java
labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/ReturnExpression.java
labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/StaticExpression.java
labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/StringLiteral.java
labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/StringPlusExpression.java
labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/TernaryOperExpression.java
labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/ThrowExpression.java
labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/TwiddleExpression.java
labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/UnaryOperExpression.java
labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/Variable.java
labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/grammar/ECAGrammarParser.java
labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/grammar/ECATokenLexer.java
Log:
added a new parser which should accept most Java syntax and does nifty stuff like operator precedence. also fixed a few bugs
Modified: labs/jbosstm/workspace/adinn/orchestration/README
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/README 2008-10-16 05:58:54 UTC (rev 23470)
+++ labs/jbosstm/workspace/adinn/orchestration/README 2008-10-16 07:28:17 UTC (rev 23471)
@@ -53,7 +53,7 @@
assignment, new operations and throw operations are not allowed in
expressions.
-Rule definitiosn specify a target class, a target method and a target
+Rule definitions specify a target class, a target method and a target
line number (default is -1) in the method source code. The agent code
identifies classes and methods at load time which match the target
class and name and inserts a trigger call at the specified line which
Modified: labs/jbosstm/workspace/adinn/orchestration/build.xml
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/build.xml 2008-10-16 05:58:54 UTC (rev 23470)
+++ labs/jbosstm/workspace/adinn/orchestration/build.xml 2008-10-16 07:28:17 UTC (rev 23471)
@@ -52,7 +52,9 @@
<property name="build.classes.dir" value="${build.dir}/classes"/>
<property name="build.lib.dir" value="${build.dir}/lib"/>
- <property name="ext.antlr.jars" value="antlr-3.0.1.jar antlr-2.7.7.jar antlr-runtime-3.0.1.jar stringtemplate-3.1b1.jar"/>
+ <property name="ext.jflex.jars" value="JFlex.jar"/>
+ <property name="ext.javacup.jars" value="javacup.jar"/>
+ <property name="ext.javacup.rt.jars" value="javacuprt.jar"/>
<!-- we need to add the XTS, TS and various jboss jars to the test code path so we can
load XTS code -->
@@ -83,45 +85,70 @@
<mkdir dir="${build.classes.dir}/META-INF"/>
</target>
- <!-- ??? parser is not automatically remade ??? -->
+ <!-- parser is not automatically remade -->
<target name="parser" depends="init">
- <java classname="org.antlr.Tool">
+ <java classname="JFlex.Main">
<classpath>
- <fileset dir="${ext.lib.dir}" includes="${ext.antlr.jars}"/>
+ <fileset dir="${ext.lib.dir}" includes="${ext.jflex.jars}"/>
</classpath>
- <arg value="${dd.grammar.dir}/ECAToken.g"/>
+ <arg value="-q"/>
+ <arg value="${dd.grammar.dir}/flex/ECAToken.flex"/>
</java>
- <java classname="org.antlr.Tool">
+<!--
+ <java classname="java_cup.Main">
<classpath>
- <fileset dir="${ext.lib.dir}" includes="${ext.antlr.jars}"/>
+ <fileset dir="${ext.lib.dir}" includes="${ext.javacup.jars}"/>
+ <fileset dir="${ext.lib.dir}" includes="${ext.javacup.rt.jars}"/>
</classpath>
- <arg value="-lib" />
- <arg value="${dd.grammar.dir}"/>
- <arg value="${dd.grammar.dir}/ECAGrammar.g"/>
+ <arg value="-parser" />
+ <arg value="ECAGrammarParser" />
+ <arg value="-nonterms"/>
+ <arg value="-dump_grammar"/>
+ <arg value="-dump_states"/>
+ <arg value="-dump_tables"/>
+ <arg value="-dump"/>
+ <arg value="${dd.grammar.dir}/cup/ECAGrammar.cup"/>
</java>
- <copy file="${dd.grammar.dir}/ECATokenLexer.java"
+-->
+ <java classname="java_cup.Main">
+ <classpath>
+ <fileset dir="${ext.lib.dir}" includes="${ext.javacup.jars}"/>
+ <fileset dir="${ext.lib.dir}" includes="${ext.javacup.rt.jars}"/>
+ </classpath>
+ <arg value="-package"/>
+ <arg value="org.jboss.jbossts.orchestration.rule.grammar"/>
+ <arg value="-parser" />
+ <arg value="ECAGrammarParser" />
+ <arg value="-nonterms"/>
+ <arg value="${dd.grammar.dir}/cup/ECAGrammar.cup"/>
+ </java>
+ <delete file="${src.dir}/org/jboss/jbossts/orchestration/rule/grammar/ECATokenLexer.java"/>
+ <delete file="${src.dir}/org/jboss/jbossts/orchestration/rule/grammar/ECAGrammarParser.java"/>
+ <delete file="${src.dir}/org/jboss/jbossts/orchestration/rule/grammar/sym.java"/>
+ <move file="${dd.grammar.dir}/flex/ECATokenLexer.java"
tofile="${src.dir}/org/jboss/jbossts/orchestration/rule/grammar/ECATokenLexer.java"/>
- <copy file="${dd.grammar.dir}/ECAGrammarParser.java"
+ <move file="ECAGrammarParser.java"
tofile="${src.dir}/org/jboss/jbossts/orchestration/rule/grammar/ECAGrammarParser.java"/>
+ <move file="sym.java"
+ tofile="${src.dir}/org/jboss/jbossts/orchestration/rule/grammar/sym.java"/>
</target>
- <!-- ?? we should maybe always remake the parser and not include the generate code in SVN ??? -->
+
<target name="compile" depends="init">
<javac srcdir="${src.dir}" destdir="${build.classes.dir}" debug="${javac.debug}">
<classpath>
<pathelement location="${asm.home}/${asm.jar}"/>
- <fileset dir="${ext.lib.dir}" includes="${ext.antlr.jars}"/>
+ <fileset dir="${ext.lib.dir}" includes="${ext.javacup.jars}"/>
+ <fileset dir="${ext.lib.dir}" includes="${ext.javacup.rt.jars}"/>
</classpath>
</javac>
</target>
<target name="jar" depends="compile">
- <!-- until we know better include all the antlr runtime in our deployed jar -->
- <unjar src="${ext.lib.dir}/antlr-3.0.1.jar" dest="${build.classes.dir}"/>
- <unjar src="${ext.lib.dir}/antlr-runtime-3.0.1.jar" dest="${build.classes.dir}"/>
- <unjar src="${ext.lib.dir}/antlr-2.7.7.jar" dest="${build.classes.dir}"/>
- <unjar src="${ext.lib.dir}/stringtemplate-3.1b1.jar" dest="${build.classes.dir}"/>
+ <!--
<unjar src="${ext.lib.dir}/junit.jar" dest="${build.classes.dir}"/>
+ -->
+ <unjar src="${ext.lib.dir}/javacuprt.jar" dest="${build.classes.dir}"/>
<unjar src="${ext.lib.dir}/asm-all-3.0.jar" dest="${build.classes.dir}"/>
<jar jarfile="${build.lib.dir}/orchestration.jar" manifest="${dd.dir}/META-INF/MANIFEST.MF">
<fileset dir="${build.classes.dir}" includes="**/*"/>
@@ -133,233 +160,6 @@
<delete dir="${dd.grammar.dir}" includes="*.java *.tokens"/>
</target>
- <target name="TestParse.compile">
- <!-- build the TestParse class and then run it to check parsing of rule elements -->
- <javac srcdir="${src.dir}" destdir="${build.classes.dir}" debug="${javac.debug}" includes="TestParse.java">
- <classpath>
- <pathelement location="${asm.home}/${asm.jar}"/>
- <fileset dir="${ext.lib.dir}" includes="${ext.antlr.jars}"/>
- </classpath>
- </javac>
- </target>
-
- <target name="TestParse" depends="TestParse.compile">
- <java classname="TestParse">
- <classpath>
- <fileset dir="${build.lib.dir}" includes="orchestration.jar"/>
- <pathelement location="${asm.home}/${asm.jar}"/>
- <fileset dir="${ext.lib.dir}" includes="${ext.antlr.jars}"/>
- </classpath>
- <arg value='WHEN coordinator:Coordinator = $1, recovered : boolean = coordinator.recovered, identifier : String = coordinator.getInstanceIdentifier()'/>
- <arg value='IF recovered AND getCounter(identifier)'/>
- <arg value='DO debug("killing prepare"), killThread()'/>
- </java>
- </target>
-
- <target name="TestRule.compile">
- <!-- build the TestRule class and then run it to check parsing of rule elements -->
- <javac srcdir="${src.dir}" destdir="${build.classes.dir}" debug="${javac.debug}" includes="TestRule.java">
- <classpath>
- <pathelement location="${asm.home}/${asm.jar}"/>
- <fileset dir="${ext.lib.dir}" includes="${ext.antlr.jars}"/>
- </classpath>
- </javac>
- </target>
-
- <target name="TestRule" depends="TestRule.compile">
- <java classname="TestRule" fork="true">
- <classpath>
- <fileset dir="${build.lib.dir}" includes="orchestration.jar"/>
- <pathelement location="${asm.home}/${asm.jar}"/>
- <fileset dir="${ext.lib.dir}" includes="${ext.antlr.jars}"/>
- <!-- xts, jta and jboss as jars-->
- <fileset dir="${xts.lib.dir}" includes="${xts.lib.jars}"/>
- <fileset dir="${xts.sar.dir}" includes="${xts.sar.jars}"/>
- <fileset dir="${jboss.lib.dir}" includes="${jboss.lib.jars}"/>
- <fileset dir="${jboss.client.dir}" includes="${jboss.client.jars}"/>
- <fileset dir="${jboss.server.lib.dir}" includes="${jboss.server.lib.jars}"/>
- <fileset dir="${jboss.server.deploy.dir}" includes="${jboss.server.deploy.jars}"/>
- </classpath>
- <arg value='-event'/>
- <arg value='coordinator:Coordinator = $1, recovered : boolean = coordinator.recovered, identifier : String = coordinator.getInstanceIdentifier()'/>
- <arg value='-condition'/>
- <arg value='recovered AND getCounter(identifier)'/>
- <arg value='-action'/>
- <arg value='debug("killing prepare"), killThread()'/>
- <arg value = "-rule"/>
- <arg value='WHEN coordinator:Coordinator = $1, recovered : boolean = coordinator.recovered, identifier : String = coordinator.getInstanceIdentifier() IF recovered AND getCounter(identifier) DO debug("killing prepare"), killThread()'/>
- </java>
- </target>
-
- <target name="TestRuleDebug" depends="TestRule.compile">
- <java classname="TestRule" fork="true">
- <classpath>
- <fileset dir="${build.lib.dir}" includes="orchestration.jar"/>
- <pathelement location="${asm.home}/${asm.jar}"/>
- <fileset dir="${ext.lib.dir}" includes="${ext.antlr.jars}"/>
- <!-- xts, jta and jboss as jars-->
- <fileset dir="${xts.lib.dir}" includes="${xts.lib.jars}"/>
- <fileset dir="${xts.sar.dir}" includes="${xts.sar.jars}"/>
- <fileset dir="${jboss.lib.dir}" includes="${jboss.lib.jars}"/>
- <fileset dir="${jboss.client.dir}" includes="${jboss.client.jars}"/>
- <fileset dir="${jboss.server.lib.dir}" includes="${jboss.server.lib.jars}"/>
- <fileset dir="${jboss.server.deploy.dir}" includes="${jboss.server.deploy.jars}"/>
- </classpath>
- <jvmarg value="-Xdebug"/>
- <jvmarg value="-Xrunjdwp:transport=dt_socket,server=n,address=5005,suspend=y"/>
- <arg value='-event'/>
- <arg value='coordinator:Coordinator = $1, recovered : boolean = coordinator.recovered, identifier : String = coordinator.getInstanceIdentifier()'/>
- <arg value='-condition'/>
- <arg value='recovered AND getCounter(identifier)'/>
- <arg value='-action'/>
- <arg value='debug("killing prepare"), killThread()'/>
- <arg value = "-rule"/>
- <arg value='WHEN coordinator:Coordinator = $1, recovered : boolean = coordinator.recovered, identifier : String = coordinator.getInstanceIdentifier() IF recovered AND getCounter(identifier) DO debug("killing prepare"), killThread()'/>
- </java>
- </target>
-
- <target name="TestRuleFile" depends="TestRule.compile">
- <java classname="TestRule" fork="true">
- <classpath>
- <fileset dir="${build.lib.dir}" includes="orchestration.jar"/>
- <pathelement location="${asm.home}/${asm.jar}"/>
- <fileset dir="${ext.lib.dir}" includes="${ext.antlr.jars}"/>
- <!-- xts, jta and jboss as jars-->
- <fileset dir="${xts.lib.dir}" includes="${xts.lib.jars}"/>
- <fileset dir="${xts.sar.dir}" includes="${xts.sar.jars}"/>
- <fileset dir="${jboss.lib.dir}" includes="${jboss.lib.jars}"/>
- <fileset dir="${jboss.client.dir}" includes="${jboss.client.jars}"/>
- <fileset dir="${jboss.server.lib.dir}" includes="${jboss.server.lib.jars}"/>
- <fileset dir="${jboss.server.deploy.dir}" includes="${jboss.server.deploy.jars}"/>
- </classpath>
- <arg value='-class'/>
- <arg value='com.arjuna.wst11.messaging.engines.CoordinatorEngine'/>
- <arg value='-method'/>
- <arg value='commit'/>
- <arg value='-file'/>
- <arg value='testrule.txt'/>
- </java>
- </target>
-
- <target name="TestRuleFileDebug" depends="TestRule.compile">
- <java classname="TestRule" fork="true">
- <classpath>
- <fileset dir="${build.lib.dir}" includes="orchestration.jar"/>
- <pathelement location="${asm.home}/${asm.jar}"/>
- <fileset dir="${ext.lib.dir}" includes="${ext.antlr.jars}"/>
- <!-- xts, jta and jboss as jars-->
- <fileset dir="${xts.lib.dir}" includes="${xts.lib.jars}"/>
- <fileset dir="${xts.sar.dir}" includes="${xts.sar.jars}"/>
- <fileset dir="${jboss.lib.dir}" includes="${jboss.lib.jars}"/>
- <fileset dir="${jboss.client.dir}" includes="${jboss.client.jars}"/>
- <fileset dir="${jboss.server.lib.dir}" includes="${jboss.server.lib.jars}"/>
- <fileset dir="${jboss.server.deploy.dir}" includes="${jboss.server.deploy.jars}"/>
- </classpath>
- <jvmarg value="-Xdebug"/>
- <jvmarg value="-Xrunjdwp:transport=dt_socket,server=n,address=5005,suspend=y"/>
- <arg value='-class'/>
- <arg value='com.arjuna.wst11.messaging.engines.CoordinatorEngine'/>
- <arg value='-method'/>
- <arg value='commit'/>
- <arg value='-file'/>
- <arg value='testrule.txt'/>
- </java>
- </target>
- <target name="TestRuleFile2" depends="TestRule.compile">
- <java classname="TestRule" fork="true">
- <classpath>
- <fileset dir="${build.lib.dir}" includes="orchestration.jar"/>
- <pathelement location="${asm.home}/${asm.jar}"/>
- <fileset dir="${ext.lib.dir}" includes="${ext.antlr.jars}"/>
- <!-- xts, jta and jboss as jars-->
- <fileset dir="${xts.lib.dir}" includes="${xts.lib.jars}"/>
- <fileset dir="${xts.sar.dir}" includes="${xts.sar.jars}"/>
- <fileset dir="${jboss.lib.dir}" includes="${jboss.lib.jars}"/>
- <fileset dir="${jboss.client.dir}" includes="${jboss.client.jars}"/>
- <fileset dir="${jboss.server.lib.dir}" includes="${jboss.server.lib.jars}"/>
- <fileset dir="${jboss.server.deploy.dir}" includes="${jboss.server.deploy.jars}"/>
- </classpath>
- <arg value='-class'/>
- <arg value='com.arjuna.wst11.messaging.CoordinatorProcessorImpl'/>
- <arg value='-method'/>
- <arg value='committed(Notification, AddressingProperties, ArjunaContext)'/>
- <arg value='-file'/>
- <arg value='testrule2.txt'/>
- </java>
- </target>
- <target name="TestRuleFileDebug2" depends="TestRule.compile">
- <java classname="TestRule" fork="true">
- <classpath>
- <fileset dir="${build.lib.dir}" includes="orchestration.jar"/>
- <pathelement location="${asm.home}/${asm.jar}"/>
- <fileset dir="${ext.lib.dir}" includes="${ext.antlr.jars}"/>
- <!-- xts, jta and jboss as jars-->
- <fileset dir="${xts.lib.dir}" includes="${xts.lib.jars}"/>
- <fileset dir="${xts.sar.dir}" includes="${xts.sar.jars}"/>
- <fileset dir="${jboss.lib.dir}" includes="${jboss.lib.jars}"/>
- <fileset dir="${jboss.client.dir}" includes="${jboss.client.jars}"/>
- <fileset dir="${jboss.server.lib.dir}" includes="${jboss.server.lib.jars}"/>
- <fileset dir="${jboss.server.deploy.dir}" includes="${jboss.server.deploy.jars}"/>
- </classpath>
- <jvmarg value="-Xdebug"/>
- <jvmarg value="-Xrunjdwp:transport=dt_socket,server=n,address=5005,suspend=y"/>
- <arg value='-class'/>
- <arg value='com.arjuna.wst11.messaging.CoordinatorProcessorImpl'/>
- <arg value='-method'/>
- <arg value='committed(Notification, AddressingProperties, ArjunaContext)'/>
- <arg value='-file'/>
- <arg value='testrule2.txt'/>
- </java>
- </target>
-
- <target name="TestJar.compile">
- <!-- build the TestJar class and then run it to check parsing of rule elements -->
- <javac srcdir="${src.dir}" destdir="${build.classes.dir}" debug="${javac.debug}" includes="TestJar.java">
- <classpath>
- <pathelement location="${asm.home}/${asm.jar}"/>
- <fileset dir="${ext.lib.dir}" includes="${ext.antlr.jars}"/>
- </classpath>
- </javac>
- </target>
-
- <target name="TestJar" depends="TestJar.compile">
- <java classname="TestJar" fork="true">
- <classpath>
- <fileset dir="${build.lib.dir}" includes="orchestration.jar"/>
- <pathelement location="${asm.home}/${asm.jar}"/>
- <fileset dir="${ext.lib.dir}" includes="${ext.antlr.jars}"/>
- <!-- xts, jta and jboss as jars-->
- <fileset dir="${xts.lib.dir}" includes="${xts.lib.jars}"/>
- <fileset dir="${xts.sar.dir}" includes="${xts.sar.jars}"/>
- <fileset dir="${jboss.lib.dir}" includes="${jboss.lib.jars}"/>
- <fileset dir="${jboss.client.dir}" includes="${jboss.client.jars}"/>
- <fileset dir="${jboss.server.lib.dir}" includes="${jboss.server.lib.jars}"/>
- <fileset dir="${jboss.server.deploy.dir}" includes="${jboss.server.deploy.jars}"/>
- </classpath>
- <arg value="${build.lib.dir}/orchestration.jar"/>
- </java>
- </target>
-
- <target name="TestJarDebug" depends="TestJar.compile">
- <java classname="TestJar" fork="true">
- <classpath>
- <fileset dir="${build.lib.dir}" includes="orchestration.jar"/>
- <pathelement location="${asm.home}/${asm.jar}"/>
- <fileset dir="${ext.lib.dir}" includes="${ext.antlr.jars}"/>
- <!-- xts, jta and jboss as jars-->
- <fileset dir="${xts.lib.dir}" includes="${xts.lib.jars}"/>
- <fileset dir="${xts.sar.dir}" includes="${xts.sar.jars}"/>
- <fileset dir="${jboss.lib.dir}" includes="${jboss.lib.jars}"/>
- <fileset dir="${jboss.client.dir}" includes="${jboss.client.jars}"/>
- <fileset dir="${jboss.server.lib.dir}" includes="${jboss.server.lib.jars}"/>
- <fileset dir="${jboss.server.deploy.dir}" includes="${jboss.server.deploy.jars}"/>
- </classpath>
- <jvmarg value="-Xdebug"/>
- <jvmarg value="-Xrunjdwp:transport=dt_socket,server=n,address=5005,suspend=y"/>
- <arg value="${build.lib.dir}/orchestration.jar"/>
- </java>
- </target>
-
<target name="TestScript.compile">
<!-- build the TestScript class and then run it to check parsing of rule elements -->
<javac srcdir="${src.dir}" destdir="${build.classes.dir}" debug="${javac.debug}" includes="TestScript.java">
Deleted: labs/jbosstm/workspace/adinn/orchestration/dd/grammar/ECAGrammar.g
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/dd/grammar/ECAGrammar.g 2008-10-16 05:58:54 UTC (rev 23470)
+++ labs/jbosstm/workspace/adinn/orchestration/dd/grammar/ECAGrammar.g 2008-10-16 07:28:17 UTC (rev 23471)
@@ -1,191 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2008, Red Hat Middleware LLC, and individual contributors
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*
-* @authors Andrew Dinn
-*/
-parser grammar ECAGrammar;
-options {
- // use AST output
- output = AST;
- // We're going to use the tokens defined in our ECALexer grammar.
- tokenVocab = ECAToken;
- // enable backtracking
- backtrack = true;
-}
-
-// we need some synthetic tokens for the AST
-tokens {
- UNOP;
- BINOP;
- TERNOP;
- METH;
- ARRAY;
- NUM_LIT;
- STRING_LIT;
-}
-
- at header {
-package org.jboss.jbossts.orchestration.rule.grammar;
-}
-
-eca_script_rule : rule=eca_script_rule_one EOF -> ^($rule)
- ;
-eca_script_rule_one
- : RULE n=SYMBOL
- CLASS cl=SYMBOL
- METHOD m=SYMBOL
- LINE l=NUMBER
- BIND e=event
- IF c=condition
- DO a=action
- ENDRULE -> ^(RULE $n $cl $m $l $e $c $a)
- ;
-eca_rule : eca EOF -> ^(eca)
- ;
-
-eca_event : event EOF -> ^(event)
- ;
-
-eca_condition : condition EOF -> ^(condition)
- ;
-
-eca_action : action EOF -> ^(action)
- ;
-
-eca : BIND e=event
- IF c=condition
- DO a=action -> ^(BIND $e $c $a)
- ;
-
-// event specifications -- for now events are just a list of bindings
-
-event : bindings
- ;
-
-// zero event bindings is specified by an empty event string so we always expect at least one binding
-
-bindings : binding SEPR bindings -> ^(SEPR binding bindings)
- | binding
- ;
-
-binding : bind_sym ASSIGN expr -> ^(ASSIGN bind_sym expr)
- ;
-
-// a bound symbol can be specified to be of a particular type
-bind_sym : v=SYMBOL COLON t=SYMBOL -> ^(COLON $v $t)
- | SYMBOL
- ;
-
-// a condition is simply an expression. it not type-constrained by the grammar -- it's easier to do
-// the type checking after parsing n.b. we always have at least one condition as an empty (i.e.
-// vacuously true) condition is defined by an empty input string.
-
-condition : TRUE -> ^(TRUE)
- | FALSE -> ^(FALSE)
- | expr
- ;
-
-// actions area defined as a sequence of expressions.it not type-constrained by the grammar -- it's
-// easier to do the type checking after parsing n.b. we always have at least one action as
-// an empty (i.e. do nothing) action is defined by an empty action string
-
-action : NOTHING -> ^(NOTHING)
- | action_expr_list
- ;
-
-action_expr_list
- : action_expr SEPR action_expr_list -> ^(SEPR action_expr action_expr_list)
- | action_expr
- ;
-
-action_expr : RETURN -> ^(RETURN)
- | RETURN expr -> ^(RETURN expr)
- | THROW e=SYMBOL LPAREN RPAREN -> ^(THROW $e)
- | THROW e=SYMBOL LPAREN args=expr_list RPAREN -> ^(THROW $e $args)
- | expr
- ;
-
-expr : simple_expr infix_oper expr -> ^(BINOP infix_oper simple_expr expr)
- | simple_expr
- | unary_oper expr -> ^(UNOP unary_oper expr)
- | cond=simple_expr TERN_IF iftrue=expr COLON iffalse=expr -> ^(TERNOP $cond $iftrue $iffalse)
- ;
-
-simple_expr : v=DOLLARSYM
- | v=SYMBOL idx=array_idx -> ^(ARRAY $v $idx)
- | v=SYMBOL LPAREN RPAREN -> ^(METH $v)
- | v=SYMBOL
- | v=SYMBOL LPAREN args=expr_list RPAREN -> ^(METH $v $args)
- | NUMBER
- | STRING
- | LPAREN expr RPAREN -> ^(expr)
- ;
-
-expr_list
- : expr SEPR expr_list -> ^(SEPR expr expr_list)
- | expr
- ;
-
-array_idx_list
- : array_idx array_idx_list -> ^(SEPR array_idx array_idx_list)
- | array_idx
- ;
-
-array_idx
- : LSQUARE expr RSQUARE -> ^(expr)
- ;
-
-infix_oper : infix_bit_oper
- | infix_arith_oper
- | infix_bool_oper
- | infix_cmp_oper
- ;
-
-infix_bit_oper
- : BAND
- | BOR
- | BXOR
- ;
-
-infix_arith_oper
- : MUL
- | DIV
- | PLUS
- | MINUS
- ;
-
-infix_bool_oper
- : AND
- | OR
- ;
-
-infix_cmp_oper
- : EQ
- | NEQ
- | GT
- | LT
- | GEQ
- | LEQ
- ;
-
-unary_oper : NOT
- | TWIDDLE
- ;
Deleted: labs/jbosstm/workspace/adinn/orchestration/dd/grammar/ECAToken.g
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/dd/grammar/ECAToken.g 2008-10-16 05:58:54 UTC (rev 23470)
+++ labs/jbosstm/workspace/adinn/orchestration/dd/grammar/ECAToken.g 2008-10-16 07:28:17 UTC (rev 23471)
@@ -1,305 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2008, Red Hat Middleware LLC, and individual contributors
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*
-* @authors Andrew Dinn
-*/
-lexer grammar ECAToken;
-
- at header {
-package org.jboss.jbossts.orchestration.rule.grammar;
-}
-
-// integers or floats
-
-fragment
-DIGIT : '0'..'9'
- ;
-
-fragment
-POSDIGIT : '1'..'9'
- ;
-
-fragment
-SIGN : '+'|'-'
- ;
-
-fragment
-BAREINT : '0' | (POSDIGIT (DIGIT)*)
- ;
-fragment
-INTEGER : SIGN? BAREINT
- ;
-
-fragment
-POINT : '.'
- ;
-
-fragment
-EXPPART : ('e'|'E') INTEGER
- ;
-
-
-fragment
-FLOAT : INTEGER POINT BAREINT? EXPPART?
- ;
-
-NUMBER : INTEGER | FLOAT
- ;
-
-// builtin symbols -- need to add these before addign the rules for adding any old symbol
-
-BIND : 'BIND'
- ;
-
-IF : 'IF'
- ;
-
-DO : 'DO'
- ;
-
-RULE : 'RULE'
- ;
-
-CLASS : 'CLASS'
- ;
-
-METHOD : 'METHOD'
- ;
-
-LINE : 'LINE'
- ;
-
-ENDRULE : 'ENDRULE'
- ;
-
-NOTHING : 'NOTHING'
- ;
-
-TRUE : 'TRUE' | 'true'
- ;
-
-FALSE : 'FALSE'|'false'
- ;
-
-RETURN : 'RETURN'|'return'
- ;
-
-THROW : 'THROW'|'throw'
- ;
-
-// various bracket pairs
-
-LPAREN : '('
- ;
-
-RPAREN : ')'
- ;
-
-LSQUARE : '\['
- ;
-
-RSQUARE : '\]'
- ;
-
-LBRACE : '{'
- ;
-
-RBRACE : '}'
- ;
-
-// statement or expression separator -- we don't care
-
-SEPR : ';'
- | ','
- ;
-
-// symbol punctuator
-
-DOT : '.'
- ;
-
-// binding for events and assignment for exprs
-
-ASSIGN : '='
- | '<--'
- ;
-
-// logical operators
-
-OR : '||'
- | 'OR'
- | 'or'
- ;
-
-AND : '&&'
- | 'AND'
- | 'and'
- ;
-
-NOT : '!'
- | 'NOT'
- | 'not'
- ;
-
-// comparison operators
-
-EQ : '=='
- | 'EQ'
- | 'eq'
- ;
-
-NEQ : '!='
- | 'NEQ'
- | 'neq'
- ;
-
-GT : '>'
- | 'GT'
- | 'gt'
- ;
-
-LT : '<'
- | 'LT'
- | 'lt'
- ;
-
-GEQ : '>='
- | 'EQ'
- | 'geq'
- ;
-
-LEQ : '<='
- | 'LEQ'
- | 'leq'
- ;
-
-// bitwise operators
-
-BOR : '|'
- ;
-
-BAND : '&'
- ;
-
-BXOR : '^'
- ;
-
-TWIDDLE : '~'
- ;
-
-// arithmetic operators
-
-MUL : '*'
- | 'TIMES'
- | 'times'
- ;
-
-DIV : '/'
- | 'DIVIDE'
- | 'divide'
- ;
-
-PLUS : '+'
- | 'PLUS'
- | 'plus'
- ;
-
-MINUS : '-'
- | 'MINUS'
- | 'minus'
- ;
-
-MOD : '%'
- | 'MOD'
- | 'mod'
- ;
-
-// ternary condition operator
-
-TERN_IF : '?'
- ;
-
-COLON : ':'
- ;
-
-// "strings" and symbols, the latter possibly with leading or embedded '_' and possibly 'quoted_inlcuding_punctuation_@#$_!!!'
-
-fragment
-LETTER : 'a'..'z' | 'A'..'Z'
- ;
-
-fragment
-UNDERSCORE : '_'
- ;
-
-QUOTE : '\''
- ;
-
-DQUOTE : '"'
- ;
-
-fragment
-SPACE : ' '|'\t'|'\r'
- ;
-
-fragment
-NEWLINE : '\n'
- ;
-
-fragment
-PUNCT : '!'|'$'|'%'|'^'|'&'|'*'|'('|')'|'-'|'+'|'='|'{'|'}'|'['|']'|':'|';'|'@'|'~'|'#'|'|'|'\\'|'`'|','|'<'|'.'|'>'|'/'|'?'
- ;
-
-STRING : DQUOTE (SPACE | PUNCT | LETTER | UNDERSCORE | DIGIT | QUOTE )* DQUOTE
- ;
-
-fragment
-BARESYM : (LETTER | UNDERSCORE) (LETTER | DIGIT | UNDERSCORE)*
- ;
-fragment
-QUOTSYM : QUOTE (PUNCT |LETTER | UNDERSCORE | DIGIT | DQUOTE |SPACE)* QUOTE
- ;
-
-// n.b. dot separated symbol can contain zero or more dot separators
-fragment
-DOTSYM : BARESYM DOT DOTSYM
- | BARESYM
- ;
-
-SYMBOL : DOTSYM
- | QUOTSYM
- ;
-
-// dollar is not allowed except in fromt of number or id or in quotes
-fragment
-DOLLAR : '$'
- ;
-
-// dollar symbols have dollar followed by a trailing non-signed integer or unquoted string
-
-DOLLARSYM : DOLLAR (BAREINT | BARESYM)
- ;
-
-// ignore any other white space
-
-// WS : (' ' | '\t' | '\n' | '\r') { setType(Token.SKIP); }
-WS : (SPACE | NEWLINE) { skip(); }
- ;
Added: labs/jbosstm/workspace/adinn/orchestration/dd/grammar/cup/ECAGrammar.cup
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/dd/grammar/cup/ECAGrammar.cup (rev 0)
+++ labs/jbosstm/workspace/adinn/orchestration/dd/grammar/cup/ECAGrammar.cup 2008-10-16 07:28:17 UTC (rev 23471)
@@ -0,0 +1,417 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*
+* @authors Andrew Dinn
+*/
+
+import java_cup.runtime.*;
+
+import org.jboss.jbossts.orchestration.rule.grammar.ParseNode;
+// cannot do this!
+// import static org.jboss.jbossts.orchestration.rule.grammar.ParseNode.*;
+
+/* parser methods to make it easier to access the ParseNode package */
+
+action code {:
+ /*
+ private ParseNode node(int tag)
+ {
+ return ParseNode.node(tag);
+ }
+ */
+
+ private ParseNode node(int tag, int line, int column)
+ {
+ return ParseNode.node(tag, line, column);
+ }
+
+ private ParseNode node(int tag, int line, int column, Object child0)
+ {
+ return ParseNode.node(tag, line, column, child0);
+ }
+
+ private ParseNode node(int tag, int line, int column, Object child0, Object child1)
+ {
+ return ParseNode.node(tag, line, column, child0, child1);
+ }
+
+ private ParseNode node(int tag, int line, int column, Object child0, Object child1, Object child2)
+ {
+ return ParseNode.node(tag, line, column, child0, child1, child2);
+ }
+
+ /*
+ private ParseNode node(int tag, int line, int column, Object child0, Object child1, Object child2, Object child3)
+ {
+ return ParseNode.node(tag, line, column, child0, child1, child2, child3);
+ }
+ */
+:}
+
+/* Preliminaries to set up and use the scanner. */
+/* not needed
+init with {: scanner.init(); :}
+*/
+scan with {: Symbol token = getScanner().next_token();
+ return token;
+ :};
+/*
+*/
+
+/* Terminals (tokens returned by the scanner). */
+
+/* rule definition keywords */
+/* first the redundant ones */
+/*
+terminal RULE, CLASS, METHOD, LINE, ENDRULE;
+*/
+/* now the required ones */
+
+terminal BIND, IF, DO;
+
+/* keywords ocurring in bindings, conditions and actions */
+terminal NOTHING, RETURN, THROW;
+
+/* brackets */
+/* don't need braces yet */
+/* terminal LBRACE, RBRACE; */
+terminal LPAREN, RPAREN, LSQUARE, RSQUARE;
+
+/* separators */
+terminal SEMI, COMMA, DOT;
+
+/* assignment */
+terminal ASSIGN;
+
+/* operators of various flavours */
+
+/* ternary operators */
+
+/* condition operator -- also sepr for var and type in decl */
+terminal TERN_IF, COLON;
+
+/* binary operators */
+
+/* logical operators */
+terminal OR, AND;
+
+/* comparison operators */
+terminal LT, LE, EQ, NE, GE, GT;
+
+/* bitwise operators */
+terminal BOR, BAND, BXOR;
+
+/* arithmetic operators */
+terminal MUL, DIV, PLUS, MINUS, MOD;
+
+/* unary operators */
+
+/* logical operator */
+terminal NOT;
+
+/* bitwise operators */
+terminal TWIDDLE;
+
+/* pseudo operator for minus as prefix */
+terminal UMINUS;
+
+/* dollar prefix operator for dereferencing rule params */
+terminal DOLLAR;
+
+/* literals. strings and identifiers */
+
+terminal Float FLOAT_LITERAL;
+
+terminal Integer INTEGER_LITERAL;
+
+terminal Boolean BOOLEAN_LITERAL;
+
+terminal String STRING_LITERAL;
+
+terminal String IDENTIFIER;
+
+/* non terminals */
+
+non terminal ParseNode eca_rule;
+non terminal ParseNode eca;
+
+non terminal ParseNode event;
+non terminal ParseNode bindings;
+non terminal ParseNode binding;
+non terminal ParseNode bind_sym;
+
+non terminal ParseNode condition;
+
+non terminal ParseNode actions;
+non terminal ParseNode action_expr_list;
+non terminal ParseNode action_expr;
+
+non terminal ParseNode expr_list;
+
+non terminal ParseNode expr;
+non terminal ParseNode ternary_oper_expr;
+non terminal ParseNode binary_oper_expr;
+non terminal ParseNode unary_oper_expr;
+non terminal ParseNode array_expr;
+non terminal ParseNode field_expr;
+non terminal ParseNode expr_field_expr;
+non terminal ParseNode meth_expr;
+non terminal ParseNode expr_meth_expr;
+non terminal ParseNode simple_expr;
+
+non terminal ParseNode array_idx_list;
+non terminal ParseNode array_idx;
+
+/* names and paths */
+
+non terminal ParseNode name;
+non terminal ParseNode simple_name;
+non terminal ParseNode path;
+
+/* precedences from weakest to tightest binding */
+
+precedence left SEMI;
+precedence left COMMA;
+precedence left ASSIGN;
+precedence left COLON;
+precedence left TERN_IF;
+precedence left OR, AND, NOT;
+precedence nonassoc EQ, NE;
+precedence left LT, LE, GE, GT;
+precedence left PLUS, MINUS;
+precedence left MUL, DIV, MOD;
+precedence left BOR, BAND, BXOR;
+precedence left TWIDDLE;
+precedence left UMINUS;
+precedence left DOT;
+precedence left DOLLAR;
+
+
+eca_rule
+ ::= eca:rule {: RESULT = rule; :}
+ ;
+
+eca ::= BIND event:e
+ IF condition:c
+ DO actions:a {: RESULT = node(ParseNode.BIND, eleft, eright, e, c, a); :}
+ ;
+
+// event specifications -- for now events are just a list of bindings
+
+event ::= NOTHING:n {: RESULT = node(ParseNode.NOTHING, nleft, nright); :}
+ | bindings:b {: RESULT = b; :}
+ ;
+
+// zero event bindings is specified by an empty event string so we always expect at least one binding
+
+bindings
+ ::= binding:b COMMA bindings:bs {: RESULT = node(ParseNode.COMMA, bleft, bright, b, bs); :}
+ | binding:b SEMI bindings:bs {: RESULT = node(ParseNode.COMMA, bleft, bright, b, bs); :}
+ | binding:b {: RESULT = b; :}
+ ;
+
+binding ::= bind_sym:s ASSIGN expr:e {: RESULT = node(ParseNode.ASSIGN, sleft, sright, s, e); :}
+ ;
+
+// a bound symbol can optionally be specified to be of a particular type
+
+bind_sym
+ ::= simple_name:var COLON name:type {: RESULT = node(ParseNode.COLON, varleft, varright, var, type); :}
+ | simple_name:var {: RESULT = var; :}
+ ;
+
+// a condition is simply an expression. it not type-constrained by the grammar.
+// it's easier to do the type checking after parsing n.b. we always have at
+// least one condition as an empty (i.e. vacuously true) condition is defined
+// by an empty input string.
+
+condition
+ ::= expr:e {: RESULT = e; :}
+ ;
+
+// actions area defined as a sequence of expressions.it not type-constrained
+// by the grammar -- it's easier to do the type checking after parsing n.b.
+// we always have at least one action as an empty (i.e. do nothing) action
+// is defined by an empty action string
+
+actions ::= NOTHING:n {: RESULT = node(ParseNode.NOTHING, nleft, nright); :}
+ | action_expr_list:ael {: RESULT = ael; :}
+ ;
+
+action_expr_list
+ ::= expr:e SEMI action_expr_list:ael
+ {: RESULT = node(ParseNode.SEMI, eleft, eright, e, ael); :}
+ | expr:e COMMA action_expr_list:ael
+ {: RESULT = node(ParseNode.SEMI, eleft, eright, e, ael); :}
+ | action_expr:ae {: RESULT = ae; :}
+ ;
+
+action_expr
+ ::= expr:e {: RESULT = e; :}
+ | RETURN:r
+ {: RESULT = node(ParseNode.RETURN, rleft, rright, null); :}
+ | RETURN:r expr:e
+ {: RESULT = node(ParseNode.RETURN, rleft, rright, e); :}
+ | THROW name:i LPAREN RPAREN
+ {: RESULT = node(ParseNode.THROW, ileft, iright, i, null); :}
+ | THROW name:i LPAREN expr_list:args RPAREN
+ {: RESULT = node(ParseNode.THROW, ileft, iright, i, args); :}
+ ;
+
+expr_list
+ ::= expr:e {: RESULT = e; :}
+ | expr:e COMMA expr_list:el
+ {: RESULT = node(ParseNode.COMMA, eleft, eright, e, el); :}
+ ;
+
+expr ::= ternary_oper_expr:e {: RESULT = e; :}
+ | binary_oper_expr:e {: RESULT = e; :}
+ | unary_oper_expr:e {: RESULT = e; :}
+ | array_expr:e {: RESULT = e; :}
+ | field_expr:e {: RESULT = e; :}
+ | meth_expr:e {: RESULT = e; :}
+ | simple_expr:e {: RESULT = e; :}
+ | simple_name:n {: RESULT = n; :}
+ ;
+
+ternary_oper_expr
+ ::= expr:cond TERN_IF expr:iftrue COLON expr:iffalse
+ {: RESULT = node(ParseNode.TERNOP, condleft, condright, cond, iftrue, iffalse); :}
+ ;
+
+binary_oper_expr
+ // logical operators
+ ::= expr:e1 OR:o expr:e2 {: RESULT = node(ParseNode.BINOP, e1left, e1right, node(ParseNode.OR, oleft, oright), e1, e2); :}
+ | expr:e1 AND:o expr:e2 {: RESULT = node(ParseNode.BINOP, e1left, e1right, node(ParseNode.AND, oleft, oright), e1, e2); :}
+ // comparison operators
+ | expr:e1 LT:o expr:e2 {: RESULT = node(ParseNode.BINOP, e1left, e1right, node(ParseNode.LT, oleft, oright), e1, e2); :}
+ | expr:e1 LE:o expr:e2 {: RESULT = node(ParseNode.BINOP, e1left, e1right, node(ParseNode.LE, oleft, oright), e1, e2); :}
+ | expr:e1 EQ:o expr:e2 {: RESULT = node(ParseNode.BINOP, e1left, e1right, node(ParseNode.EQ, oleft, oright), e1, e2); :}
+ | expr:e1 NE:o expr:e2 {: RESULT = node(ParseNode.BINOP, e1left, e1right, node(ParseNode.NE, oleft, oright), e1, e2); :}
+ | expr:e1 GE:o expr:e2 {: RESULT = node(ParseNode.BINOP, e1left, e1right, node(ParseNode.GE, oleft, oright), e1, e2); :}
+ | expr:e1 GT:o expr:e2 {: RESULT = node(ParseNode.BINOP, e1left, e1right, node(ParseNode.GT, oleft, oright), e1, e2); :}
+ // bitwise operators
+ | expr:e1 BOR:o expr:e2 {: RESULT = node(ParseNode.BINOP, e1left, e1right, node(ParseNode.BOR, oleft, oright), e1, e2); :}
+ | expr:e1 BAND:o expr:e2 {: RESULT = node(ParseNode.BINOP, e1left, e1right, node(ParseNode.BAND, oleft, oright), e1, e2); :}
+ | expr:e1 BXOR:o expr:e2 {: RESULT = node(ParseNode.BINOP, e1left, e1right, node(ParseNode.BXOR, oleft, oright), e1, e2); :}
+ // arithmetic operators
+ | expr:e1 PLUS:o expr:e2 {: RESULT = node(ParseNode.BINOP, e1left, e1right, node(ParseNode.PLUS, oleft, oright), e1, e2); :}
+ | expr:e1 MINUS:o expr:e2 {: RESULT = node(ParseNode.BINOP, e1left, e1right, node(ParseNode.MINUS, oleft, oright), e1, e2); :}
+ | expr:e1 MUL:o expr:e2 {: RESULT = node(ParseNode.BINOP, e1left, e1right, node(ParseNode.MUL, oleft, oright), e1, e2); :}
+ | expr:e1 DIV:o expr:e2 {: RESULT = node(ParseNode.BINOP, e1left, e1right, node(ParseNode.DIV, oleft, oright), e1, e2); :}
+ | expr:e1 MOD:o expr:e2 {: RESULT = node(ParseNode.BINOP, e1left, e1right, node(ParseNode.MOD, oleft, oright), e1, e2); :}
+ ;
+
+unary_oper_expr
+ /* logical operators */
+ ::= NOT:o expr:e {: RESULT = node(ParseNode.UNOP, eleft, eright, node(ParseNode.NOT, oleft, oright), e); :}
+ /* bitwise operators */
+ | TWIDDLE:o expr:e {: RESULT = node(ParseNode.UNOP, eleft, eright, node(ParseNode.TWIDDLE, oleft, oright), e); :}
+ | MINUS:o expr:e {: RESULT = node(ParseNode.UNOP, eleft, eright, node(ParseNode.UMINUS, oleft, oright), e); :} %prec UMINUS
+ ;
+
+array_expr
+ ::= simple_expr:se array_idx_list:ail
+ {: RESULT = node(ParseNode.ARRAY, seleft, seright, se, ail); :}
+ | field_expr:fe array_idx_list:ail
+ {: RESULT = node(ParseNode.ARRAY, feleft, feright, fe, ail); :}
+ | meth_expr:me array_idx_list:ail
+ {: RESULT = node(ParseNode.ARRAY, meleft, meright, me, ail); :}
+ ;
+
+array_idx_list
+ ::= array_idx:ai {: RESULT = ai; :}
+ | array_idx:ai array_idx_list:ail
+ {: RESULT = node(ParseNode.SEMI, aileft, airight, ai, ail); :}
+ ;
+
+array_idx
+ ::= LSQUARE expr:e RSQUARE {: RESULT = e; :}
+ ;
+
+field_expr
+ ::= path:p DOT simple_name:f
+ {: RESULT = node(ParseNode.FIELD, fleft, fright, f, p); :}
+ | expr_field_expr:efe {: RESULT = efe; :}
+ ;
+
+expr_field_expr
+ ::= simple_expr:se DOT simple_name:f
+ {: RESULT = node(ParseNode.FIELD, fleft, fright, f, se); :}
+ | expr_field_expr:efe DOT simple_name:f
+ {: RESULT = node(ParseNode.FIELD, fleft, fright, f, efe); :}
+ ;
+
+meth_expr
+ ::= simple_name:m LPAREN RPAREN
+ {: RESULT = node(ParseNode.METH, mleft, mright, m, null, null); :}
+ | simple_name:m LPAREN expr_list:args RPAREN
+ {: RESULT = node(ParseNode.METH, mleft, mright, m, null, args); :}
+ | path:p DOT simple_name:m LPAREN RPAREN
+ {: RESULT = node(ParseNode.METH, mleft, mright, m, p, null); :}
+ | path:p DOT simple_name:m LPAREN expr_list:args RPAREN
+ {: RESULT = node(ParseNode.METH, mleft, mright, m, p, args); :}
+ | expr_meth_expr:eme {: RESULT = eme; :}
+ ;
+
+expr_meth_expr
+ ::= simple_expr:se DOT simple_name:m LPAREN RPAREN
+ {: RESULT = node(ParseNode.METH, mleft, mright, m, se, null); :}
+ | simple_expr:se DOT simple_name:m LPAREN expr_list:args RPAREN
+ {: RESULT = node(ParseNode.METH, mleft, mright, m, se, args); :}
+ | meth_expr:eme DOT simple_name:m LPAREN RPAREN
+ {: RESULT = node(ParseNode.METH, mleft, mright, m, eme, null); :}
+ | meth_expr:eme DOT simple_name:m LPAREN expr_list:args RPAREN
+ {: RESULT = node(ParseNode.METH, mleft, mright, m, eme, args); :}
+ ;
+
+simple_expr
+ ::= INTEGER_LITERAL:i
+ {: RESULT = node(ParseNode.INTEGER_LITERAL, ileft, iright, i); :}
+ | FLOAT_LITERAL:f
+ {: RESULT = node(ParseNode.FLOAT_LITERAL, fleft, fright, f); :}
+ | BOOLEAN_LITERAL:b
+ {: RESULT = node(ParseNode.BOOLEAN_LITERAL, bleft, bright, b); :}
+ | STRING_LITERAL:s
+ {: RESULT = node(ParseNode.STRING_LITERAL, sleft, sright, s); :}
+ | DOLLAR:o simple_name:sn
+ {: RESULT = node(ParseNode.UNOP, snleft, snright, node(ParseNode.DOLLAR, oleft, oright), sn); :}
+ | DOLLAR:o INTEGER_LITERAL:i
+ {: RESULT = node(ParseNode.UNOP, ileft, iright, node(ParseNode.DOLLAR, oleft, oright), node(ParseNode.INTEGER_LITERAL, ileft, iright, i)); :}
+ | LPAREN expr:e RPAREN
+ {: RESULT = e; :}
+ ;
+name ::= simple_name:n
+ {: RESULT = n; :}
+ | path:p DOT IDENTIFIER:i
+ {: RESULT = node(ParseNode.IDENTIFIER, ileft, iright, i, p); :}
+ ;
+
+simple_name
+ ::= IDENTIFIER:i
+ {: RESULT = node(ParseNode.IDENTIFIER, ileft, iright, i, null); :}
+ ;
+
+path ::= IDENTIFIER:i
+ {: RESULT = node(ParseNode.PATH, ileft, iright, i, null); :}
+ | path:p DOT IDENTIFIER:i
+ {: RESULT = node(ParseNode.PATH, ileft, iright, i, p); :}
+ ;
Added: labs/jbosstm/workspace/adinn/orchestration/dd/grammar/flex/ECAToken.flex
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/dd/grammar/flex/ECAToken.flex (rev 0)
+++ labs/jbosstm/workspace/adinn/orchestration/dd/grammar/flex/ECAToken.flex 2008-10-16 07:28:17 UTC (rev 23471)
@@ -0,0 +1,264 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*
+* @authors Andrew Dinn
+*/
+
+package org.jboss.jbossts.orchestration.rule.grammar;
+
+import java_cup.runtime.*;
+
+%%
+
+%class ECATokenLexer
+%unicode
+%cup
+%line
+%column
+%public
+// %debug
+
+%{
+ StringBuffer string = new StringBuffer();
+
+ private Symbol symbol(int type) {
+ return new Symbol(type, yyline, yycolumn);
+ }
+ private Symbol symbol(int type, Object value) {
+ return new Symbol(type, yyline, yycolumn, value);
+ }
+%}
+
+LineTerminator = \r|\n|\r\n
+
+WhiteSpace = {LineTerminator} | [ \t\f]
+
+Identifier = ([A-Za-z_]) ([A-Za-z0-9$_])*
+
+PosInteger = 0 | [1-9][0-9]*
+
+Sign = [+-]
+
+Exp = [Ee]
+
+Dot = "."
+
+DotTrailing = {Dot} {PosInteger}?
+ExpTrailing = {Exp} {Sign}? {PosInteger}
+FloatTrailing = {ExpTrailing} | {DotTrailing} {ExpTrailing}?
+PosFloat = {PosInteger} {FloatTrailing}
+
+Integer = {Sign}? {PosInteger}
+
+Float = {Sign}? {PosFloat}
+
+%state STRING
+
+%state QUOTEDIDENT
+
+%state COMMENT
+
+%%
+
+/* keywords */
+
+<YYINITIAL> {
+
+"BIND"|"bind" { return symbol(sym.BIND); }
+
+"IF"|"if" { return symbol(sym.IF); }
+
+"DO"|"do" { return symbol(sym.DO); }
+
+/* rule and rule header keywords are not required
+
+"RULE" { return symbol(sym.RULE); }
+
+"CLASS" { return symbol(sym.CLASS); }
+
+"METHOD" { return symbol(sym.METHOD); }
+
+"LINE" { return symbol(sym.LINE); }
+
+"ENDRULE" { return symbol(sym.ENDRULE); }
+
+*/
+
+"NOTHING"|"nothing"
+ { return symbol(sym.NOTHING); }
+
+"TRUE"|"true" { return symbol(sym.BOOLEAN_LITERAL, Boolean.TRUE); }
+
+"FALSE"|"false" { return symbol(sym.BOOLEAN_LITERAL, Boolean.FALSE); }
+
+"RETURN"|"return"
+ { return symbol(sym.RETURN); }
+
+"THROW"|"throw" { return symbol(sym.THROW); }
+
+/* various bracket pairs */
+
+"(" { return symbol(sym.LPAREN); }
+
+")" { return symbol(sym.RPAREN); }
+
+"[" { return symbol(sym.LSQUARE); }
+
+"]" { return symbol(sym.RSQUARE); }
+
+/* braces are not required
+
+"{" { return symbol(sym.LBRACE); }
+
+"}" { return symbol(sym.RBRACE); }
+
+*/
+
+/* expression separator */
+
+";" { return symbol(sym.SEMI); }
+
+/* bindings separator */
+
+"," { return symbol(sym.COMMA); }
+
+
+/* identifier punctuator */
+
+"." { return symbol(sym.DOT); }
+
+/* binding for events */
+
+"=" | "<--" { return symbol(sym.ASSIGN); }
+
+/* logical operators */
+
+"||" | "OR" | "or" { return symbol(sym.OR); }
+
+"&&" | "AND" | "and" { return symbol(sym.AND); }
+
+"!" | "NOT" | "not" { return symbol(sym.NOT); }
+
+/* comparison operators */
+
+"<" | "LT" | "lt" { return symbol(sym.LT); }
+
+"<=" | "LE" | "le" { return symbol(sym.LE); }
+
+"==" | "EQ" | "eq" { return symbol(sym.EQ); }
+
+"!=" | "NE" | "ne" { return symbol(sym.NE); }
+
+">=" | "GE" | "ge" { return symbol(sym.GE); }
+
+">" | "GT" | "gt" { return symbol(sym.GT); }
+
+/* bitwise operators */
+
+"|" { return symbol(sym.BOR); }
+
+"&" { return symbol(sym.BAND); }
+
+"^" { return symbol(sym.BXOR); }
+
+"~" { return symbol(sym.TWIDDLE); }
+
+/* arithmetic operators */
+
+
+"*" | "TIMES" | "times" { return symbol(sym.MUL); }
+
+"/" | "DIVIDE" | "divide" { return symbol(sym.DIV); }
+
+"+" | "PLUS" | "plus" { return symbol(sym.PLUS); }
+
+"-" | "MINUS" | "minus" { return symbol(sym.MINUS); }
+
+"%" | "MOD" | "mod" { return symbol(sym.MOD); }
+
+/* ternary condition operator -- also sepr for var and type in decl */
+
+"?" { return symbol(sym.TERN_IF); }
+
+":" { return symbol(sym.COLON); }
+
+/* dollar prefix operator */
+
+"$" { return symbol(sym.DOLLAR); }
+
+/* identifiers */
+
+{Identifier} { return symbol(sym.IDENTIFIER, yytext()); }
+
+/* numbers */
+
+{Integer} { return symbol(sym.INTEGER_LITERAL, Integer.valueOf(yytext())); }
+
+{Float} { return symbol(sym.FLOAT_LITERAL, Float.valueOf(yytext())); }
+
+/* strings */
+
+\" { string.setLength(0); yybegin(STRING); }
+
+\' { string.setLength(0); yybegin(QUOTEDIDENT); }
+
+# { yybegin(COMMENT); }
+
+/* whitespace */
+
+{WhiteSpace} { /* ignore */ }
+
+/* anything else is an error! */
+
+. { throw new Error("Illegal character <"+ yytext()+">"); }
+
+}
+
+<STRING> {
+\" { yybegin(YYINITIAL);
+ return symbol(sym.STRING_LITERAL,
+ string.toString()); }
+
+[^\n\r\"\\]+ { string.append( yytext() ); }
+\\t { string.append('\t'); }
+\\n { string.append('\n'); }
+\\r { string.append('\r'); }
+\\\" { string.append('\"'); }
+\\ { string.append('\\'); }
+
+/* anything else is an error! */
+\n { throw new Error("Newline in string <"+ yytext()+">"); }
+. { throw new Error("Illegal character in string <"+ yytext()+">"); }
+}
+
+<QUOTEDIDENT> {
+[^\n\r']+ { string.append( yytext() ); }
+' { yybegin(YYINITIAL);
+ return symbol(sym.IDENTIFIER,
+ string.toString()); }
+/* anything else is an error! */
+{LineTerminator} { throw new Error("Newline in quoted identifier <"+ yytext()+">"); }
+}
+
+<COMMENT> {
+[^\n\r] { /*ignore */ }
+{LineTerminator} { yybegin(YYINITIAL); }
+}
Added: labs/jbosstm/workspace/adinn/orchestration/ext/JFlex.jar
===================================================================
(Binary files differ)
Property changes on: labs/jbosstm/workspace/adinn/orchestration/ext/JFlex.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: labs/jbosstm/workspace/adinn/orchestration/ext/antlr-2.7.7.jar
===================================================================
(Binary files differ)
Deleted: labs/jbosstm/workspace/adinn/orchestration/ext/antlr-3.0.1.jar
===================================================================
(Binary files differ)
Deleted: labs/jbosstm/workspace/adinn/orchestration/ext/antlr-runtime-3.0.1.jar
===================================================================
(Binary files differ)
Added: labs/jbosstm/workspace/adinn/orchestration/ext/javacup.jar
===================================================================
(Binary files differ)
Property changes on: labs/jbosstm/workspace/adinn/orchestration/ext/javacup.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: labs/jbosstm/workspace/adinn/orchestration/ext/javacuprt.jar
===================================================================
(Binary files differ)
Property changes on: labs/jbosstm/workspace/adinn/orchestration/ext/javacuprt.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: labs/jbosstm/workspace/adinn/orchestration/ext/junit.jar
===================================================================
(Binary files differ)
Deleted: labs/jbosstm/workspace/adinn/orchestration/ext/stringtemplate-3.1b1.jar
===================================================================
(Binary files differ)
Deleted: labs/jbosstm/workspace/adinn/orchestration/src/TestJar.java
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/src/TestJar.java 2008-10-16 05:58:54 UTC (rev 23470)
+++ labs/jbosstm/workspace/adinn/orchestration/src/TestJar.java 2008-10-16 07:28:17 UTC (rev 23471)
@@ -1,253 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2008, Red Hat Middleware LLC, and individual contributors
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*
-* @authors Andrew Dinn
-*/
-import org.jboss.jbossts.orchestration.annotation.EventHandlerClass;
-import org.jboss.jbossts.orchestration.annotation.EventHandler;
-import org.jboss.jbossts.orchestration.rule.type.TypeHelper;
-import org.jboss.jbossts.orchestration.rule.type.Type;
-import org.jboss.jbossts.orchestration.rule.Rule;
-import org.jboss.jbossts.orchestration.rule.exception.ParseException;
-import org.jboss.jbossts.orchestration.rule.exception.TypeException;
-import org.jboss.jbossts.orchestration.rule.exception.CompileException;
-import org.objectweb.asm.Opcodes;
-
-import java.util.jar.JarFile;
-import java.util.jar.JarEntry;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.ArrayList;
-import java.io.File;
-import java.io.IOException;
-import java.net.URLClassLoader;
-import java.net.URL;
-import java.net.MalformedURLException;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.lang.reflect.Constructor;
-
-public class TestJar
-{
- public static void main(String[] args)
- {
- TestJar testJar = new TestJar();
- testJar.testJar(args);
- }
-
- public void testJar(String[] jarFiles)
- {
- for (String ruleJarPath : jarFiles) {
- try {
- JarFile jarFile = new JarFile(new File(ruleJarPath));
- List<Class> ruleClasses = processRules(jarFile);
- System.out.println("checking classes in " + ruleJarPath);
- checkRules(ruleClasses);
- } catch (IOException ioe) {
- System.err.println("TestJar: unable to open rule jar file : " + ruleJarPath);
- }
- }
- }
-
-
-
- private List<Class> processRules(JarFile jarFile)
- {
- try {
- URLClassLoader classLoader = new URLClassLoader(new URL[] { new URL("file:" + jarFile.getName()) });
- Enumeration<JarEntry> jarEntries = jarFile.entries();
- List<Class> ruleClasses = new ArrayList<Class>();
-
- while (jarEntries.hasMoreElements()) {
- JarEntry jarEntry = jarEntries.nextElement();
- String entryName = jarEntry.getName();
-
- if (entryName.endsWith(CLASS_FILE_SUFFIX)) {
- // try to load the rule class
- int classNameLength = entryName.length() - CLASS_FILE_SUFFIX.length();
- String className = entryName.substring(0, classNameLength).replaceAll("/", ".");
- try {
- Class clazz = classLoader.loadClass(className);
- Annotation a = clazz.getAnnotation(EventHandlerClass.class);
- if (a != null) {
- ruleClasses.add(clazz);
- }
- } catch (ClassNotFoundException e) {
- System.err.println("org.jboss.jbossts.orchestration.agent.Main: unable to load class " + className + " from : " + jarFile.getName());
- }
- }
- }
- return ruleClasses;
- } catch (MalformedURLException mue) {
- System.err.println("org.jboss.jbossts.orchestration.agent.Main: unable to load classes from : " + jarFile.getName());
- }
-
- return null;
- }
-
- private void checkRules(List<Class> ruleClasses)
- {
- ClassLoader loader = this.getClass().getClassLoader();
-
- for (Class ruleClass : ruleClasses) {
- Annotation classAnnotation = ruleClass.getAnnotation(EventHandlerClass.class);
- for (Method method : ruleClass.getDeclaredMethods()) {
- EventHandler eventHandler = method.getAnnotation(EventHandler.class);
- if (eventHandler != null) {
- String targetClassName = eventHandler.targetClass();
- String targetMethodName = eventHandler.targetMethod();
- int targetLine = eventHandler.targetLine();
- String ruleName = targetClassName + "::" + targetMethodName + (targetLine < 0 ? "" : "@" + targetLine);
- try {
- Class targetClass = loader.loadClass(targetClassName);
- Method[] candidates = targetClass.getDeclaredMethods();
- boolean found = false;
- boolean multiple = false;
- for (Method candidate : candidates) {
- String targetName = TypeHelper.parseMethodName(targetMethodName);
- String targetDesc = TypeHelper.parseMethodDescriptor(targetMethodName);
- String candidateName = candidate.getName();
- String candidateDesc = makeDescriptor(candidate);
- if (targetName.equals(candidateName)) {
- if (targetDesc.equals("") || TypeHelper.equalDescriptors(targetDesc, candidateDesc)) {
- System.err.println("TestJar: checking rule " + ruleName);
- if (found) {
- multiple = true;
- }
- found = true;
- int access = 0;
- Class<?>[] exceptionClasses = method.getExceptionTypes();
- int l = exceptionClasses.length;
- String[] exceptionNames = new String[l];
- for (int i = 0; i < l; i++) {
- exceptionNames[i] = exceptionClasses[i].getCanonicalName();
- }
- if ((candidate.getModifiers() & Modifier.STATIC) != 0) {
- access = Opcodes.ACC_STATIC;
- }
- String event = eventHandler.event();
- String condition = eventHandler.condition();
- String action = eventHandler.action();
- Rule rule = Rule.create(ruleName, targetClassName, targetMethodName, targetLine, event, condition, action, loader);
- System.err.println("TestJar: parsed rule " + ruleName);
- System.err.println(rule);
- rule.setTypeInfo(targetClassName, access, candidateName, candidateDesc, exceptionNames);
- rule.typeCheck();
- System.err.println("TestJar: type checked rule " + ruleName);
- }
- }
- }
- if (!found) {
- Constructor[] constructors = targetClass.getConstructors();
- for (Constructor constructor : constructors) {
- String targetName = TypeHelper.parseMethodName(targetMethodName);
- String targetDesc = TypeHelper.parseMethodDescriptor(targetMethodName);
- String candidateName = constructor.getName();
- String candidateDesc = makeDescriptor(constructor);
- if (targetName.equals("<init>")) {
- if (targetDesc.equals("") || TypeHelper.equalDescriptors(targetDesc, candidateDesc)) {
- System.err.println("TestJar: checking rule " + ruleName);
- if (found) {
- multiple = true;
- }
- found = true;
- int access = 0;
- Class<?>[] exceptionClasses = constructor.getExceptionTypes();
- int l = exceptionClasses.length;
- String[] exceptionNames = new String[l];
- for (int i = 0; i < l; i++) {
- exceptionNames[i] = exceptionClasses[i].getCanonicalName();
- }
- if ((constructor.getModifiers() & Modifier.STATIC) != 0) {
- access = Opcodes.ACC_STATIC;
- }
- String event = eventHandler.event();
- String condition = eventHandler.condition();
- String action = eventHandler.action();
- Rule rule = Rule.create(ruleName, targetClassName, targetMethodName, targetLine, event, condition, action, loader);
- System.err.println("TestJar: parsed rule " + ruleName);
- System.err.println(rule);
- rule.setTypeInfo(targetClassName, access, candidateName, candidateDesc, exceptionNames);
- rule.typeCheck();
- System.err.println("TestJar: type checked rule " + ruleName);
- }
- }
- }
- }
- if (!found) {
- System.err.println("TestJar: no matching method for rule " + ruleName);
- } else if (multiple) {
- System.err.println("TestJar: multiple matching methods for rule " + ruleName);
- }
- } catch (ParseException e) {
- System.err.println("TestJar: parse exception for rule " + ruleName + " : " + e);
- e.printStackTrace(System.err);
- } catch (TypeException e) {
- System.err.println("TestJar: type exception for rule " + ruleName + " : " + e);
- e.printStackTrace(System.err);
- } catch (CompileException e) {
- System.err.println("TestJar: compile exception for rule " + " : " + ruleName + e);
- e.printStackTrace(System.err);
- } catch(ClassNotFoundException cfe) {
- System.err.println("TestJar: unable to load class " + targetClassName);
- }
- }
- }
- }
- }
-
- static String makeDescriptor(Method method)
- {
- Class<?> paramTypes[] = method.getParameterTypes();
- Class<?> retType = method.getReturnType();
- String desc = "(";
-
- for (Class<?> paramType : paramTypes) {
- String name = paramType.getCanonicalName();
- desc += TypeHelper.externalizeType(name);
- }
- desc += ")";
- desc += TypeHelper.externalizeType(retType.getCanonicalName());
-
- return desc;
- }
-
- static String makeDescriptor(Constructor constructor)
- {
- Class<?> paramTypes[] = constructor.getParameterTypes();
- String desc = "(";
-
- for (Class<?> paramType : paramTypes) {
- String name = paramType.getCanonicalName();
- desc += TypeHelper.externalizeType(name);
- }
- desc += ")";
-
- return desc;
- }
-
- /**
- * suffix found on end of .class files (doh :-)
- */
-
- private static final String CLASS_FILE_SUFFIX = ".class";
-}
\ No newline at end of file
Deleted: labs/jbosstm/workspace/adinn/orchestration/src/TestParse.java
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/src/TestParse.java 2008-10-16 05:58:54 UTC (rev 23470)
+++ labs/jbosstm/workspace/adinn/orchestration/src/TestParse.java 2008-10-16 07:28:17 UTC (rev 23471)
@@ -1,50 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2008, Red Hat Middleware LLC, and individual contributors
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*
-* @authors Andrew Dinn
-*/
-import org.antlr.runtime.tree.CommonTree;
-import org.antlr.runtime.ANTLRStringStream;
-import org.antlr.runtime.CommonTokenStream;
-import org.antlr.runtime.RecognitionException;
-import org.jboss.jbossts.orchestration.rule.grammar.ECATokenLexer;
-import org.jboss.jbossts.orchestration.rule.grammar.ECAGrammarParser;
-
-public class TestParse
-{
- public static void main(String[] args)
- {
- CommonTree result = null;
- for (String arg : args) {
- System.out.println("Parsing : " + arg);
- try {
- ECATokenLexer lexer = new ECATokenLexer(new ANTLRStringStream(arg));
- CommonTokenStream tokenStream = new CommonTokenStream(lexer);
- ECAGrammarParser parser = new ECAGrammarParser(tokenStream);
- ECAGrammarParser.eca_rule_return eca_rule = parser.eca_rule();
- result = (CommonTree) eca_rule.getTree();
- } catch (RecognitionException e) {
- // bad rule event
- System.err.println(": error parsing arg");
- }
- }
- }
-}
Deleted: labs/jbosstm/workspace/adinn/orchestration/src/TestRule.java
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/src/TestRule.java 2008-10-16 05:58:54 UTC (rev 23470)
+++ labs/jbosstm/workspace/adinn/orchestration/src/TestRule.java 2008-10-16 07:28:17 UTC (rev 23471)
@@ -1,219 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2008, Red Hat Middleware LLC, and individual contributors
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*
-* @authors Andrew Dinn
-*/
-import org.jboss.jbossts.orchestration.rule.Condition;
-import org.jboss.jbossts.orchestration.rule.Event;
-import org.jboss.jbossts.orchestration.rule.Action;
-import org.jboss.jbossts.orchestration.rule.Rule;
-import org.jboss.jbossts.orchestration.rule.exception.TypeException;
-import org.jboss.jbossts.orchestration.rule.type.Type;
-import org.jboss.jbossts.orchestration.rule.type.TypeHelper;
-import org.objectweb.asm.Opcodes;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-
-public class TestRule
-{
- public static void main(String[] args)
- {
- ClassLoader loader = TestRule.class.getClassLoader();
- Event event = null;
- Condition condition = null;
- Action action = null;
- Rule rule = null;
- String className = null;
- String methodName = null;
- String descriptor = null;
- for (int i = 0; i < args.length ; i++) {
- if ("-class".equals(args[i])) {
- System.out.println("Using class name " + args[++i]);
- className = args[i];
- } else if ("-method".equals(args[i])) {
- System.out.println("Using method name " + args[++i]);
- methodName = args[i];
- } else if ("-descriptor".equals(args[i])) {
- System.out.println("Using method descriptor " + args[++i]);
- descriptor = args[i];
- } else if ("-rule".equals(args[i])) {
- System.out.println("Creating rule from " + args[++i]);
- try {
- rule = Rule.create("TestRule" + i, className, methodName, -1, args[i], loader);
- System.out.print(rule);
- if (methodName != null &&
- className != null) {
- maybeTypeCheck(rule, className, methodName, descriptor);
- }
- } catch (Throwable th) {
- // bad rule event
- System.err.println(": error " + th);
- th.printStackTrace(System.err);
- }
- } else if ("-event".equals(args[i])) {
- System.out.println("Creating event from " + args[++i]);
- try {
- rule = Rule.create("TestRule" + i, className, methodName, -1, null, loader);
- rule.setEvent(args[i]);
- System.out.print(rule);
- } catch (Throwable th) {
- // bad rule event
- System.err.println(": error " + th);
- th.printStackTrace(System.err);
- }
- } else if ("-condition".equals(args[i])) {
- System.out.println("Creating condition from " + args[++i]);
- try {
- if (rule == null || rule.getCondition() != null) {
- rule = Rule.create("TestRule" + i, className, methodName, -1, null, loader);
- }
- if (rule.getEvent() == null) {
- rule.setEvent("");
- }
- rule.setCondition(args[i]);
- System.out.print(rule);
- } catch (Throwable th) {
- // bad rule event
- System.err.println(": error " + th);
- th.printStackTrace(System.err);
- }
- } else if ("-action".equals(args[i])) {
- System.out.println("Creating action from " + args[++i]);
- try {
- if (rule == null || rule.getAction() != null) {
- rule = Rule.create("TestRule" + i, className, methodName, -1, null, loader);
- }
- if (rule.getEvent() == null) {
- rule.setEvent("");
- }
- if (rule.getCondition() == null) {
- rule.setCondition("");
- }
- rule.setAction(args[i]);
- System.out.print(rule);
- if (methodName != null &&
- className != null) {
- maybeTypeCheck(rule, className, methodName, descriptor);
- }
- } catch (Throwable th) {
- // bad rule event
- System.err.println(": error " + th);
- th.printStackTrace(System.err);
- }
- } else if ("-file".equals(args[i])) {
- String fileName = args[++i];
- System.out.println("Creating rule from file " + fileName);
- try {
- byte[] bytes;
- String text;
- FileInputStream fis = new FileInputStream(fileName);
- bytes = new byte[fis.available()];
- fis.read(bytes);
- text = new String(bytes);
- rule = Rule.create("TestRule" + i, className, methodName, -1, text, loader);
- System.out.print(rule);
- if (methodName != null &&
- className != null) {
- maybeTypeCheck(rule, className, methodName, descriptor);
- }
- } catch (Throwable th) {
- // bad rule event
- System.err.println(": error " + th);
- th.printStackTrace(System.err);
- }
- }
- }
- }
-
- public static void maybeTypeCheck(Rule rule, String className, String methodName, String descriptor)
- {
- Type type = rule.getTypeGroup().create(className);
-
- if (type != null && !type.isUndefined()) {
- Class clazz = type.getClass();
- Method[] methods = type.getTargetClass().getMethods();
- Method method = null;
-
- for (int i = 0; i < methods.length; i++) {
- if (methods[i].getName().equals(methodName)) {
- if (descriptor != null) {
- Class<?>[] paramTypes = methods[i].getParameterTypes();
- Class<?> retType = methods[i].getReturnType();
- String methDescriptor = makeDescriptor(paramTypes, retType);
- if (TypeHelper.equalDescriptors(descriptor, methDescriptor)) {
- method = methods[i];
- break;
- }
- } else if (method != null) {
- // hmm, cannot resolve alternatives
- System.out.println("ambiguous method name " + className + "." + methodName);
- method = null;
- break;
- } else {
- method = methods[i];
- // carry on in case the method name is ambiguous
- }
- }
- }
- if (method != null) {
- if (descriptor == null) {
- Class<?>[] paramTypes = method.getParameterTypes();
- Class<?> retType = method.getReturnType();
- descriptor = makeDescriptor(paramTypes, retType);
- }
- try {
- int modifiers = method.getModifiers();
- int access = 0;
- Class<?>[] exceptionClasses = method.getExceptionTypes();
- int l = exceptionClasses.length;
- String[] exceptionNames = new String[l];
- for (int i = 0; i < l; i++) {
- exceptionNames[i] = exceptionClasses[i].getCanonicalName();
- }
- if ((modifiers & Modifier.STATIC) != 0) {
- access |= Opcodes.ACC_STATIC;
- }
- rule.setTypeInfo(className, access, methodName, descriptor, exceptionNames);
- rule.typeCheck();
- } catch (TypeException te) {
- System.out.println("error typechecking against " + className + "." + methodName + " : " + te);
- }
- }
- }
- }
-
- public static String makeDescriptor(Class<?>[] paramTypes, Class<?> retType)
- {
- String descriptor = "(";
-
- for (int i = 0; i < paramTypes.length; i++) {
- descriptor += TypeHelper.externalizeType(paramTypes[i].getCanonicalName());
- }
- descriptor += ") ";
-
- descriptor += TypeHelper.externalizeType(retType.getCanonicalName());
-
- return descriptor;
- }
-}
\ No newline at end of file
Modified: labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/agent/RuleAdapter.java
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/agent/RuleAdapter.java 2008-10-16 05:58:54 UTC (rev 23470)
+++ labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/agent/RuleAdapter.java 2008-10-16 07:28:17 UTC (rev 23471)
@@ -24,7 +24,6 @@
package org.jboss.jbossts.orchestration.agent;
import org.jboss.jbossts.orchestration.rule.Rule;
-import org.jboss.jbossts.orchestration.rule.exception.TypeException;
import org.jboss.jbossts.orchestration.rule.type.TypeHelper;
import org.objectweb.asm.*;
import org.objectweb.asm.commons.GeneratorAdapter;
@@ -79,7 +78,11 @@
if (targetMethod.equals(name)) {
if (targetDescriptor.equals("") || TypeHelper.equalDescriptors(targetDescriptor, desc))
{
- return new RuleMethodAdapter(mv, access, name, desc, signature, exceptions);
+ if (name == "<init>") {
+ return new RuleConstructorAdapter(mv, access, name, desc, signature, exceptions);
+ } else {
+ return new RuleMethodAdapter(mv, access, name, desc, signature, exceptions);
+ }
}
}
@@ -116,7 +119,7 @@
// super.catchException(startLabel, endLabel, new Type("org.jboss.jbossts.orchestration.rule.exception.ExecuteException")));
public void visitLineNumber(final int line, final Label start) {
- if (!visitedLine && (targetLine < 0 || targetLine == line)) {
+ if (!visitedLine && (targetLine < line)) {
rule.setTypeInfo(targetClass, access, name, descriptor, exceptions);
String key = rule.getKey();
Type ruleType = Type.getType(TypeHelper.externalizeType("org.jboss.jbossts.orchestration.rule.Rule"));
@@ -205,6 +208,40 @@
}
+ /**
+ * a method visitor used to add a rule event trigger call to a constructor -- this has to make sure
+ * the super constructor has been called before allowing a trigger call to be compiled
+ */
+
+ private class RuleConstructorAdapter extends RuleMethodAdapter
+ {
+ private boolean superCalled;
+
+ RuleConstructorAdapter(MethodVisitor mv, int access, String name, String descriptor, String signature, String[] exceptions)
+ {
+ super(mv, access, name, descriptor, signature, exceptions);
+ this.superCalled = false;
+ }
+
+ // don't pass on line visits until we have seen an INVOKESPECIAL
+ public void visitLineNumber(final int line, final Label start) {
+ if (superCalled) {
+ super.visitLineNumber(line, start);
+ }
+ }
+
+ public void visitMethodInsn(
+ final int opcode,
+ final String owner,
+ final String name,
+ final String desc)
+ {
+ super.visitMethodInsn(opcode, owner, name, desc);
+ // hmm, this probably means the super constructor has been invoked :-)
+ superCalled &= (opcode == Opcodes.INVOKESPECIAL);
+ }
+ }
+
private Rule rule;
private String targetClass;
private String targetMethod;
Modified: labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/agent/RuleCheckAdapter.java
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/agent/RuleCheckAdapter.java 2008-10-16 05:58:54 UTC (rev 23470)
+++ labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/agent/RuleCheckAdapter.java 2008-10-16 07:28:17 UTC (rev 23471)
@@ -91,7 +91,7 @@
}
public void visitLineNumber(final int line, final Label start) {
- if (!visited && (targetLine < 0 || targetLine == line)) {
+ if (!visited && (targetLine < line)) {
// the relevant line occurs in the called method
visited = true;
visitOk = true;
Modified: labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/Action.java
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/Action.java 2008-10-16 05:58:54 UTC (rev 23470)
+++ labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/Action.java 2008-10-16 07:28:17 UTC (rev 23471)
@@ -23,15 +23,13 @@
*/
package org.jboss.jbossts.orchestration.rule;
-import org.antlr.runtime.tree.CommonTree;
-import org.antlr.runtime.ANTLRStringStream;
-import org.antlr.runtime.CommonTokenStream;
-import org.antlr.runtime.RecognitionException;
import org.jboss.jbossts.orchestration.rule.type.Type;
import org.jboss.jbossts.orchestration.rule.expression.ExpressionHelper;
import org.jboss.jbossts.orchestration.rule.expression.Expression;
import org.jboss.jbossts.orchestration.rule.grammar.ECATokenLexer;
import org.jboss.jbossts.orchestration.rule.grammar.ECAGrammarParser;
+import org.jboss.jbossts.orchestration.rule.grammar.ParseNode;
+import static org.jboss.jbossts.orchestration.rule.grammar.ParseNode.*;
import org.jboss.jbossts.orchestration.rule.exception.ParseException;
import org.jboss.jbossts.orchestration.rule.exception.TypeException;
import org.jboss.jbossts.orchestration.rule.exception.ExecuteException;
@@ -39,13 +37,16 @@
import java.util.List;
import java.util.ArrayList;
import java.io.StringWriter;
+import java.io.StringReader;
+import java_cup.runtime.Symbol;
+
/**
* class which represents a rule action comprising a void expression
*/
public class Action extends RuleElement
{
- public static Action create(Rule rule, CommonTree actionTree)
+ public static Action create(Rule rule, ParseNode actionTree)
throws TypeException
{
Action action = new Action(rule, actionTree);
@@ -58,22 +59,23 @@
if ("".equals(text)) {
return new Action(rule);
}
+ String fullText = "BIND NOTHING IF TRUE DO \n" + text;
try {
- ECATokenLexer lexer = new ECATokenLexer(new ANTLRStringStream(text));
- CommonTokenStream tokenStream = new CommonTokenStream(lexer);
- ECAGrammarParser parser = new ECAGrammarParser(tokenStream);
- ECAGrammarParser.eca_action_return parse = parser.eca_action();
- CommonTree actionTree = (CommonTree) parse.getTree();
+ ECATokenLexer lexer = new ECATokenLexer(new StringReader(text));
+ ECAGrammarParser parser = new ECAGrammarParser(lexer);
+ Symbol parse = parser.parse();
+ ParseNode parseTree = (ParseNode)parse.value;
+ ParseNode actionTree = (ParseNode)parseTree.getChild(3);
Action action = new Action(rule, actionTree);
return action;
- } catch (RecognitionException e) {
+ } catch (Exception e) {
throw new ParseException("org.jboss.jbossts.orchestration.rule.Action : error parsing action " + text);
}
}
- protected Action(Rule rule, CommonTree actionTree) throws TypeException
+ protected Action(Rule rule, ParseNode actionTree) throws TypeException
{
super(rule);
- if (actionTree.getToken().getType() == ECAGrammarParser.NOTHING) {
+ if (actionTree.getTag() == NOTHING) {
this.action = new ArrayList<Expression>();
} else {
this.action = ExpressionHelper.createExpressionList(rule, this.getBindings(), actionTree, Type.VOID);
@@ -108,14 +110,14 @@
public void writeTo(StringWriter stringWriter)
{
- if (action == null) {
+ if (action == null || action.size() == 0) {
stringWriter.write("DO NOTHING");
} else {
String prefix = "DO ";
for (Expression expr : action) {
stringWriter.write(prefix);
expr.writeTo(stringWriter);
- prefix = ",\n ";
+ prefix = ";\n ";
}
}
stringWriter.write("\n");
Modified: labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/Condition.java
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/Condition.java 2008-10-16 05:58:54 UTC (rev 23470)
+++ labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/Condition.java 2008-10-16 07:28:17 UTC (rev 23471)
@@ -23,11 +23,6 @@
*/
package org.jboss.jbossts.orchestration.rule;
-import org.antlr.runtime.tree.CommonTree;
-import org.antlr.runtime.ANTLRStringStream;
-import org.antlr.runtime.CommonTokenStream;
-import org.antlr.runtime.RecognitionException;
-import org.antlr.runtime.Token;
import org.jboss.jbossts.orchestration.rule.type.TypeGroup;
import org.jboss.jbossts.orchestration.rule.type.Type;
import org.jboss.jbossts.orchestration.rule.binding.Bindings;
@@ -37,18 +32,22 @@
import org.jboss.jbossts.orchestration.rule.expression.BooleanLiteral;
import org.jboss.jbossts.orchestration.rule.grammar.ECATokenLexer;
import org.jboss.jbossts.orchestration.rule.grammar.ECAGrammarParser;
+import org.jboss.jbossts.orchestration.rule.grammar.ParseNode;
import org.jboss.jbossts.orchestration.rule.exception.ParseException;
import org.jboss.jbossts.orchestration.rule.exception.TypeException;
import org.jboss.jbossts.orchestration.rule.exception.ExecuteException;
import java.io.StringWriter;
+import java.io.StringReader;
+import java_cup.runtime.Symbol;
+
/**
* class which represents a rule condition comprising a boolean expression
*/
public class Condition extends RuleElement
{
- public static Condition create(Rule rule, CommonTree conditionTree) throws TypeException
+ public static Condition create(Rule rule, ParseNode conditionTree) throws TypeException
{
Condition condition = new Condition(rule, conditionTree);
return condition;
@@ -59,31 +58,25 @@
if ("".equals(text)) {
return new Condition(rule);
}
+ String fulltext = "BIND NOTHING IF \n" + text + "\n DO NOTHING";
try {
- ECATokenLexer lexer = new ECATokenLexer(new ANTLRStringStream(text));
- CommonTokenStream tokenStream = new CommonTokenStream(lexer);
- ECAGrammarParser parser = new ECAGrammarParser(tokenStream);
- ECAGrammarParser.eca_condition_return parse = parser.eca_condition();
- CommonTree conditionTree = (CommonTree) parse.getTree();
+ ECATokenLexer lexer = new ECATokenLexer(new StringReader(text));
+ ECAGrammarParser parser = new ECAGrammarParser(lexer);
+ Symbol condition_parse = parser.parse();
+ ParseNode conditionTree = (ParseNode) condition_parse.value;
Condition condition = new Condition(rule, conditionTree);
return condition;
- } catch (RecognitionException e) {
+ } catch (Exception e) {
throw new ParseException("org.jboss.jbossts.orchestration.rule.Condition : error parsing condition " + text, e);
}
}
- protected Condition(Rule rule, CommonTree conditionTree)
+ protected Condition(Rule rule, ParseNode conditionTree)
throws TypeException
{
super(rule);
- Token token = conditionTree.getToken();
- if (token.getType() == ECAGrammarParser.TRUE) {
- this.condition = new BooleanLiteral(rule, token, true);
- } else if (token.getType() == ECAGrammarParser.FALSE) {
- this.condition = new BooleanLiteral(rule, token, false);
- } else {
- this.condition = ExpressionHelper.createExpression(rule, rule.getBindings(), conditionTree, Type.BOOLEAN);
- }
+ int tag = conditionTree.getTag();
+ this.condition = ExpressionHelper.createExpression(rule, rule.getBindings(), conditionTree, Type.BOOLEAN);
}
protected Condition(Rule rule)
Modified: labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/Event.java
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/Event.java 2008-10-16 05:58:54 UTC (rev 23470)
+++ labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/Event.java 2008-10-16 07:28:17 UTC (rev 23471)
@@ -23,14 +23,10 @@
*/
package org.jboss.jbossts.orchestration.rule;
-import org.antlr.runtime.tree.CommonTree;
-import org.antlr.runtime.Token;
-import org.antlr.runtime.ANTLRStringStream;
-import org.antlr.runtime.CommonTokenStream;
-import org.antlr.runtime.RecognitionException;
import org.jboss.jbossts.orchestration.rule.binding.Bindings;
import org.jboss.jbossts.orchestration.rule.binding.Binding;
-import static org.jboss.jbossts.orchestration.rule.grammar.ECAGrammarParser.*;
+import org.jboss.jbossts.orchestration.rule.grammar.ParseNode;
+import static org.jboss.jbossts.orchestration.rule.grammar.ParseNode.*;
import org.jboss.jbossts.orchestration.rule.grammar.ECATokenLexer;
import org.jboss.jbossts.orchestration.rule.grammar.ECAGrammarParser;
import org.jboss.jbossts.orchestration.rule.expression.Expression;
@@ -44,14 +40,17 @@
import java.util.ArrayList;
import java.util.Iterator;
import java.io.StringWriter;
+import java.io.StringReader;
+import java_cup.runtime.Symbol;
+
/**
* class which represents a rule event comprising of a set of abstract bindings of event variables to
* evaluable expressions.
*/
public class Event extends RuleElement {
- public static Event create(Rule rule, CommonTree eventTree)
+ public static Event create(Rule rule, ParseNode eventTree)
throws TypeException
{
Event event = new Event(rule, eventTree);
@@ -65,20 +64,20 @@
return new Event(rule);
}
+ String fullText = "BIND\n" + text + "\nIF TRUE DO NOTHING";
try {
- ECATokenLexer lexer = new ECATokenLexer(new ANTLRStringStream(text));
- CommonTokenStream tokenStream = new CommonTokenStream(lexer);
- ECAGrammarParser parser = new ECAGrammarParser(tokenStream);
- ECAGrammarParser.eca_event_return event_parse = parser.eca_event();
- CommonTree eventTree = (CommonTree) event_parse.getTree();
+ ECATokenLexer lexer = new ECATokenLexer(new StringReader(fullText));
+ ECAGrammarParser parser = new ECAGrammarParser(lexer);
+ Symbol event_parse = parser.parse();
+ ParseNode eventTree = (ParseNode)event_parse.value;
Event event = new Event(rule, eventTree);
return event;
- } catch (RecognitionException e) {
+ } catch (Exception e) {
throw new ParseException("org.jboss.jbossts.orchestration.rule.Event : error parsing event " + text, e);
}
}
- protected Event(Rule rule, CommonTree eventTree) throws TypeException
+ protected Event(Rule rule, ParseNode eventTree) throws TypeException
{
super(rule);
createBindings(eventTree);
@@ -116,7 +115,7 @@
binding.typeCheck(Type.UNDEFINED);
}
- private void createBindings(CommonTree eventTree) throws TypeException
+ private void createBindings(ParseNode eventTree) throws TypeException
{
Bindings bindings = getBindings();
@@ -124,34 +123,37 @@
List<TypeException> exceptions = new ArrayList<TypeException>();
- // we expect BINDINGS = (SEPR BINDING BINDINGS) | BINDING
+ // we expect BINDINGS = NOTHING | BINDING | (COMMA BINDING BINDINGS)
// where BINDING = (BIND BINDSYM EXPR)
+ if (eventTree.getTag() == NOTHING) {
+ return;
+ }
+
while (eventTree != null) {
try {
- Token token = eventTree.getToken();
- int tokenType = token.getType();
- switch (tokenType) {
- case SEPR:
+ int tag = eventTree.getTag();
+ switch (tag) {
+ case COMMA:
{
// update before we risk an exception
- CommonTree child0 = (CommonTree)eventTree.getChild(0);
- eventTree = (CommonTree)eventTree.getChild(1);
+ ParseNode child0 = (ParseNode)eventTree.getChild(0);
+ eventTree = (ParseNode)eventTree.getChild(1);
addBinding(bindings, child0);
}
break;
case ASSIGN:
{
// update before we risk an exception
- CommonTree saveTree = eventTree;
+ ParseNode saveTree = eventTree;
eventTree = null;
addBinding(bindings, saveTree);
}
break;
default:
{
+ String message = "Event.createBindings : unexpected token Type in binding list " + tag + " for token " + eventTree.getText() + eventTree.getPos();
eventTree = null;
- String message = "Event.createBindings : unexpected token Type in binding list " + tokenType + " for token " + token.getText() + " @ " + token.getLine() + "." + token.getCharPositionInLine();
throw new TypeException(message);
}
}
@@ -175,18 +177,17 @@
}
}
- private void addBinding(Bindings bindings, CommonTree bindingTree) throws TypeException
+ private void addBinding(Bindings bindings, ParseNode bindingTree) throws TypeException
{
- Token token = bindingTree.getToken();
- int tokenType = token.getType();
+ int tag = bindingTree.getTag();
- if (tokenType != ASSIGN) {
- String message = "Event.createBindings : unexpected token Type in binding " + tokenType + " for token " + token.getText() + " @ " + token.getLine() + "." + token.getCharPositionInLine();
+ if (tag != ASSIGN) {
+ String message = "Event.createBindings : unexpected token Type in binding " + tag + " for token " + bindingTree.getText() + bindingTree.getPos();
throw new TypeException(message);
}
- CommonTree varTree = (CommonTree)bindingTree.getChild(0);
- CommonTree exprTree = (CommonTree)bindingTree.getChild(1);
+ ParseNode varTree = (ParseNode)bindingTree.getChild(0);
+ ParseNode exprTree = (ParseNode)bindingTree.getChild(1);
Binding binding;
binding = createBinding(varTree);
@@ -197,10 +198,11 @@
Expression expr;
expr = ExpressionHelper.createExpression(rule, bindings, exprTree, binding.getType());
+ String name = binding.getName();
- if (bindings.lookup(binding.getName()) != null) {
+ if (bindings.lookup(name) != null) {
// oops rebinding not allowed
- String message = "Event.createBindings : rebinding disallowed for variable " + token.getText() + " @ " + token.getLine() + "." + token.getCharPositionInLine();
+ String message = "Event.createBindings : rebinding disallowed for variable " + name + varTree.getPos();
throw new TypeException(message);
}
// if the binding type is undefined and the expression type is defined propagate the
@@ -212,36 +214,35 @@
bindings.append(binding);
}
- public Binding createBinding(CommonTree varTree) throws TypeException
+ public Binding createBinding(ParseNode varTree) throws TypeException
{
- Token token = varTree.getToken();
- int tokenType = token.getType();
+ int tag = varTree.getTag();
- // we expect either (COLON SYMBOL SYMBOL) or SYMBOL
- switch (tokenType) {
- case SYMBOL:
+ // we expect either (COLON IDENTIFIER IDENTIFIER) or IDENTIFIER
+ switch (tag) {
+ case IDENTIFIER:
{
- return new Binding(rule, token.getText());
+ return new Binding(rule, varTree.getText());
}
case COLON:
{
- CommonTree child0 = (CommonTree)varTree.getChild(0);
- CommonTree child1 = (CommonTree)varTree.getChild(1);
- if (child0.getToken().getType() != SYMBOL) {
- throw new TypeException("Event.createBindings : unexpected token Type in variable declaration" + child0.getToken().getType() + " for token " + child0.getToken().getText() + " @ " + token.getLine() + "." + token.getCharPositionInLine());
- } else if (child1.getToken().getType() != SYMBOL) {
- throw new TypeException("Event.createBindings : unexpected token Type in variable type declaration" + child1.getToken().getType() + " for token " + child1.getToken().getText() + " @ " + token.getLine() + "." + token.getCharPositionInLine());
+ ParseNode child0 = (ParseNode)varTree.getChild(0);
+ ParseNode child1 = (ParseNode)varTree.getChild(1);
+ if (child0.getTag() != IDENTIFIER) {
+ throw new TypeException("Event.createBindings : unexpected token type in variable declaration" + child0.getTag() + " for token " + child0.getText() + child0.getPos());
+ } else if (child1.getTag() != IDENTIFIER) {
+ throw new TypeException("Event.createBindings : unexpected token Type in variable type declaration" + child1.getTag() + " for token " + child1.getText() + child1.getPos());
}
String typeName = child1.getText();
Type type = getTypeGroup().create(typeName);
if (type == null) {
- throw new TypeException("Event.createBindings : incompatible type in declaration of variable " + child1.getToken().getText() + " @ " + token.getLine() + "." + token.getCharPositionInLine());
+ throw new TypeException("Event.createBindings : incompatible type in declaration of variable " + child1.getText() + child1.getPos());
}
return new Binding(rule, child0.getText(), type);
}
default:
{
- throw new TypeException("Event.createBindings : unexpected token Type in binding variable declaration" + tokenType + " for token " + token.getText() + " @ " + token.getLine() + "." + token.getCharPositionInLine());
+ throw new TypeException("Event.createBindings : unexpected token type in binding variable declaration" + tag + " for token " + varTree.getText() + varTree.getPos());
}
}
}
@@ -264,13 +265,17 @@
public void writeTo(StringWriter stringWriter)
{
- String prefix = "BIND ";
Iterator<Binding> iter = getBindings().iterator();
- while (iter.hasNext()) {
- Binding binding = iter.next();
- stringWriter.write(prefix);
- binding.writeTo(stringWriter);
- prefix = ",\n ";
+ if (!iter.hasNext()) {
+ stringWriter.write("BIND NOTHING");
+ } else {
+ String prefix = "BIND ";
+ while (iter.hasNext()) {
+ Binding binding = iter.next();
+ stringWriter.write(prefix);
+ binding.writeTo(stringWriter);
+ prefix = ",\n ";
+ }
}
stringWriter.write("\n");
}
Modified: labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/Rule.java
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/Rule.java 2008-10-16 05:58:54 UTC (rev 23470)
+++ labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/Rule.java 2008-10-16 07:28:17 UTC (rev 23471)
@@ -33,19 +33,17 @@
import org.jboss.jbossts.orchestration.rule.binding.Binding;
import org.jboss.jbossts.orchestration.rule.grammar.ECATokenLexer;
import org.jboss.jbossts.orchestration.rule.grammar.ECAGrammarParser;
+import org.jboss.jbossts.orchestration.rule.grammar.ParseNode;
import org.jboss.jbossts.orchestration.synchronization.CountDown;
import org.jboss.jbossts.orchestration.synchronization.Waiter;
-import org.antlr.runtime.ANTLRStringStream;
-import org.antlr.runtime.CommonTokenStream;
-import org.antlr.runtime.RecognitionException;
-import org.antlr.runtime.tree.CommonTree;
import org.objectweb.asm.Opcodes;
-import static org.jboss.jbossts.orchestration.rule.grammar.ECAGrammarParser.*;
-
import java.io.StringWriter;
+import java.io.StringReader;
import java.util.*;
+import java_cup.runtime.Symbol;
+
/**
* A rule ties together an event, condition and action. It also maintains a TypeGroup
* identifying type information derived from these components.
@@ -139,52 +137,25 @@
private Rule(String script, ClassLoader loader)
throws ParseException, TypeException, CompileException
{
- CommonTree ruleTree;
-
+ ParseNode ruleTree;
+ // TODO -- need to parse off the class, method and line number!
typeGroup = new TypeGroup(loader);
bindings = new Bindings();
try {
- ECATokenLexer lexer = new ECATokenLexer(new ANTLRStringStream(script));
- CommonTokenStream tokenStream = new CommonTokenStream(lexer);
- ECAGrammarParser parser = new ECAGrammarParser(tokenStream);
- ECAGrammarParser.eca_script_rule_return eca_script_rule = parser.eca_script_rule();
- ruleTree = (CommonTree) eca_script_rule.getTree();
- } catch (RecognitionException e) {
+ // ensure line numbers start at 1
+ String fullScript = "\n" + script;
+ ECATokenLexer lexer = new ECATokenLexer(new StringReader(fullScript));
+ ECAGrammarParser parser = new ECAGrammarParser(lexer);
+ Symbol parse = parser.parse();
+ ruleTree = (ParseNode) parse.value;
+ } catch (Exception e) {
throw new ParseException("org.jboss.jbossts.orchestration.rule.Rule : error parsing rule " + script, e);
}
- // format is ^(RULE name class method line event condition action)
+ // format is ^(BIND event condition action)
- CommonTree nameTree = (CommonTree)ruleTree.getChild(0);
- CommonTree classTree = (CommonTree)ruleTree.getChild(1);
- CommonTree methodTree = (CommonTree)ruleTree.getChild(2);
- CommonTree lineTree = (CommonTree)ruleTree.getChild(3);
- CommonTree eventTree = (CommonTree)ruleTree.getChild(4);
- CommonTree conditionTree = (CommonTree)ruleTree.getChild(5);
- CommonTree actionTree = (CommonTree)ruleTree.getChild(6);
- if (nameTree.getToken().getType() != SYMBOL) {
- throw new ParseException("org.jboss.jbossts.orchestration.rule.Rule : invalid rule name " + script);
- } else {
- name = nameTree.getToken().getText();
- }
- if (classTree.getToken().getType() != SYMBOL) {
- throw new ParseException("org.jboss.jbossts.orchestration.rule.Rule : invalid class name " + script);
- } else {
- targetClass = classTree.getToken().getText();
- }
- if (methodTree.getToken().getType() != SYMBOL) {
- throw new ParseException("org.jboss.jbossts.orchestration.rule.Rule : invalid method name " + script);
- } else {
- targetMethod = methodTree.getToken().getText();
- }
- if (lineTree.getToken().getType() != NUMBER) {
- throw new ParseException("org.jboss.jbossts.orchestration.rule.Rule : invalid line number" + script);
- } else {
- try {
- targetLine = Integer.valueOf(lineTree.getToken().getText());
- } catch (NumberFormatException ne) {
- throw new ParseException("org.jboss.jbossts.orchestration.rule.Rule : invalid format for line number" + script);
- }
- }
+ ParseNode eventTree = (ParseNode)ruleTree.getChild(0);
+ ParseNode conditionTree = (ParseNode)ruleTree.getChild(1);
+ ParseNode actionTree = (ParseNode)ruleTree.getChild(2);
event = Event.create(this, eventTree);
condition = Condition.create(this, conditionTree);
action = Action.create(this, actionTree);
@@ -218,24 +189,25 @@
private Rule(String name, String targetClass, String targetMethod, int targetLine, String ruleSpec, ClassLoader loader)
throws ParseException, TypeException, CompileException
{
- CommonTree ruleTree;
+ ParseNode ruleTree;
this.name = name;
typeGroup = new TypeGroup(loader);
bindings = new Bindings();
if (ruleSpec != null) {
+ // ensure line numbers start at 1
+ String fullSpec = "\n" + ruleSpec;
try {
- ECATokenLexer lexer = new ECATokenLexer(new ANTLRStringStream(ruleSpec));
- CommonTokenStream tokenStream = new CommonTokenStream(lexer);
- ECAGrammarParser parser = new ECAGrammarParser(tokenStream);
- ECAGrammarParser.eca_rule_return rule_parse = parser.eca_rule();
- ruleTree = (CommonTree) rule_parse.getTree();
- } catch (RecognitionException e) {
+ ECATokenLexer lexer = new ECATokenLexer(new StringReader(fullSpec));
+ ECAGrammarParser parser = new ECAGrammarParser(lexer);
+ Symbol parse = parser.parse();
+ ruleTree = (ParseNode) parse.value;
+ } catch (Exception e) {
throw new ParseException("org.jboss.jbossts.orchestration.rule.Rule : error parsing rule " + ruleSpec, e);
}
- CommonTree eventTree = (CommonTree)ruleTree.getChild(0);
- CommonTree conditionTree = (CommonTree)ruleTree.getChild(1);
- CommonTree actionTree = (CommonTree)ruleTree.getChild(2);
+ ParseNode eventTree = (ParseNode)ruleTree.getChild(0);
+ ParseNode conditionTree = (ParseNode)ruleTree.getChild(1);
+ ParseNode actionTree = (ParseNode)ruleTree.getChild(2);
event = Event.create(this, eventTree);
condition = Condition.create(this, conditionTree);
action = Action.create(this, actionTree);
@@ -388,7 +360,7 @@
Type type;
// add a binding for the rule so we can call builting static methods
type = typeGroup.create("org.jboss.jbossts.orchestration.rule.Rule$Helper");
- Binding ruleBinding = new Binding(this, "-1", type);
+ Binding ruleBinding = new Binding(this, "$", type);
parameterBindings.add(ruleBinding);
if (!isStatic) {
@@ -537,12 +509,12 @@
if (event != null) {
event.writeTo(stringWriter);
} else {
- stringWriter.write("BIND NONE\n");
+ stringWriter.write("BIND NOTHING\n");
}
if (condition != null) {
condition.writeTo(stringWriter);
} else {
- stringWriter.write("IF TRUE\n");
+ stringWriter.write("COND TRUE\n");
}
if (action != null) {
action.writeTo(stringWriter);
Modified: labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/binding/Binding.java
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/binding/Binding.java 2008-10-16 05:58:54 UTC (rev 23470)
+++ labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/binding/Binding.java 2008-10-16 07:28:17 UTC (rev 23471)
@@ -54,7 +54,7 @@
this.name = name;
this.type = (type != null ? type : Type.UNDEFINED);
this.value = value;
- if (name.equals("-1")) {
+ if (name.equals("$")) {
index = -1;
} else if (name.matches("[0-9].*")) {
index = Integer.valueOf(name);
@@ -145,7 +145,7 @@
{
if (isHelper()) {
stringWriter.write("$$");
- } else if (isParam()) {
+ } else if (isParam() || isRecipient()) {
stringWriter.write("$" + name);
if (type != null && (type.isDefined() || type.isObject())) {
stringWriter.write(" : ");
Modified: labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/ArithmeticExpression.java
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/ArithmeticExpression.java 2008-10-16 05:58:54 UTC (rev 23470)
+++ labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/ArithmeticExpression.java 2008-10-16 07:28:17 UTC (rev 23471)
@@ -24,20 +24,17 @@
package org.jboss.jbossts.orchestration.rule.expression;
import org.jboss.jbossts.orchestration.rule.type.Type;
-import org.jboss.jbossts.orchestration.rule.type.TypeGroup;
-import org.jboss.jbossts.orchestration.rule.type.TypeHelper;
import org.jboss.jbossts.orchestration.rule.exception.TypeException;
import org.jboss.jbossts.orchestration.rule.exception.ExecuteException;
-import org.jboss.jbossts.orchestration.rule.binding.Bindings;
import org.jboss.jbossts.orchestration.rule.Rule;
-import org.antlr.runtime.Token;
+import org.jboss.jbossts.orchestration.rule.grammar.ParseNode;
/**
* A binary arithmetic operator expression
*/
public class ArithmeticExpression extends BinaryOperExpression
{
- public ArithmeticExpression(Rule rule, int oper, Token token, Expression left, Expression right)
+ public ArithmeticExpression(Rule rule, int oper, ParseNode token, Expression left, Expression right)
{
super(rule, oper, Type.promote(left.getType(), right.getType()), token, left, right);
}
Modified: labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/ArrayExpression.java
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/ArrayExpression.java 2008-10-16 05:58:54 UTC (rev 23470)
+++ labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/ArrayExpression.java 2008-10-16 07:28:17 UTC (rev 23471)
@@ -24,13 +24,10 @@
package org.jboss.jbossts.orchestration.rule.expression;
import org.jboss.jbossts.orchestration.rule.type.Type;
-import org.jboss.jbossts.orchestration.rule.type.TypeGroup;
-import org.jboss.jbossts.orchestration.rule.binding.Bindings;
import org.jboss.jbossts.orchestration.rule.exception.TypeException;
import org.jboss.jbossts.orchestration.rule.exception.ExecuteException;
import org.jboss.jbossts.orchestration.rule.Rule;
-import org.antlr.runtime.Token;
-import org.antlr.runtime.tree.CommonTree;
+import org.jboss.jbossts.orchestration.rule.grammar.ParseNode;
import java.util.List;
import java.util.Iterator;
@@ -44,7 +41,7 @@
public class ArrayExpression extends Expression
{
- public ArrayExpression(Rule rule, Type type, Token token, Expression arrayRef, List<Expression> idxList)
+ public ArrayExpression(Rule rule, Type type, ParseNode token, Expression arrayRef, List<Expression> idxList)
{
super(rule, type, token);
this.arrayRef = arrayRef;
Modified: labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/BinaryOperExpression.java
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/BinaryOperExpression.java 2008-10-16 05:58:54 UTC (rev 23470)
+++ labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/BinaryOperExpression.java 2008-10-16 07:28:17 UTC (rev 23471)
@@ -24,17 +24,15 @@
package org.jboss.jbossts.orchestration.rule.expression;
import org.jboss.jbossts.orchestration.rule.type.Type;
-import org.jboss.jbossts.orchestration.rule.binding.Bindings;
-import org.jboss.jbossts.orchestration.rule.exception.TypeException;
import org.jboss.jbossts.orchestration.rule.Rule;
-import org.antlr.runtime.Token;
+import org.jboss.jbossts.orchestration.rule.grammar.ParseNode;
/**
* binary operators includes arithmetic and comparison operators
*/
public abstract class BinaryOperExpression extends OperExpression
{
- public BinaryOperExpression(Rule rule, int oper, Type type, Token token, Expression operand1, Expression operand2)
+ public BinaryOperExpression(Rule rule, int oper, Type type, ParseNode token, Expression operand1, Expression operand2)
{
super(rule, oper, type, token);
this.operand1 = operand1;
Modified: labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/BitExpression.java
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/BitExpression.java 2008-10-16 05:58:54 UTC (rev 23470)
+++ labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/BitExpression.java 2008-10-16 07:28:17 UTC (rev 23471)
@@ -24,19 +24,17 @@
package org.jboss.jbossts.orchestration.rule.expression;
import org.jboss.jbossts.orchestration.rule.type.Type;
-import org.jboss.jbossts.orchestration.rule.type.TypeGroup;
-import org.jboss.jbossts.orchestration.rule.binding.Bindings;
import org.jboss.jbossts.orchestration.rule.exception.TypeException;
import org.jboss.jbossts.orchestration.rule.exception.ExecuteException;
import org.jboss.jbossts.orchestration.rule.Rule;
-import org.antlr.runtime.Token;
+import org.jboss.jbossts.orchestration.rule.grammar.ParseNode;
/**
* A binary arithmetic operator expression
*/
public class BitExpression extends BinaryOperExpression
{
- public BitExpression(Rule rule, int oper, Token token, Expression left, Expression right)
+ public BitExpression(Rule rule, int oper, ParseNode token, Expression left, Expression right)
{
// n.b. left and right must be of integral type
Modified: labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/BooleanExpression.java
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/BooleanExpression.java 2008-10-16 05:58:54 UTC (rev 23470)
+++ labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/BooleanExpression.java 2008-10-16 07:28:17 UTC (rev 23471)
@@ -25,14 +25,14 @@
import org.jboss.jbossts.orchestration.rule.type.Type;
import org.jboss.jbossts.orchestration.rule.Rule;
-import org.antlr.runtime.Token;
+import org.jboss.jbossts.orchestration.rule.grammar.ParseNode;
/**
* A binary arithmetic operator expression
*/
public abstract class BooleanExpression extends BinaryOperExpression
{
- public BooleanExpression(Rule rule, int oper, Token token, Expression left, Expression right)
+ public BooleanExpression(Rule rule, int oper, ParseNode token, Expression left, Expression right)
{
super(rule, oper, Type.Z, token, left, right);
}
Modified: labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/BooleanLiteral.java
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/BooleanLiteral.java 2008-10-16 05:58:54 UTC (rev 23470)
+++ labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/BooleanLiteral.java 2008-10-16 07:28:17 UTC (rev 23471)
@@ -24,12 +24,10 @@
package org.jboss.jbossts.orchestration.rule.expression;
import org.jboss.jbossts.orchestration.rule.type.Type;
-import org.jboss.jbossts.orchestration.rule.type.TypeGroup;
-import org.jboss.jbossts.orchestration.rule.binding.Bindings;
import org.jboss.jbossts.orchestration.rule.exception.TypeException;
import org.jboss.jbossts.orchestration.rule.exception.ExecuteException;
import org.jboss.jbossts.orchestration.rule.Rule;
-import org.antlr.runtime.Token;
+import org.jboss.jbossts.orchestration.rule.grammar.ParseNode;
import java.io.StringWriter;
@@ -40,10 +38,10 @@
{
private boolean value;
- public BooleanLiteral(Rule rule, Token token, Boolean value)
+ public BooleanLiteral(Rule rule, ParseNode token)
{
super(rule, Type.Z, token);
- this.value = value;
+ this.value = (Boolean)token.getChild(0) ;
}
@@ -56,7 +54,7 @@
* been detected during inference/validation.
*/
public boolean bind() {
- return false;
+ return true;
}
public Type typeCheck(Type expected) throws TypeException {
Modified: labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/ComparisonExpression.java
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/ComparisonExpression.java 2008-10-16 05:58:54 UTC (rev 23470)
+++ labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/ComparisonExpression.java 2008-10-16 07:28:17 UTC (rev 23471)
@@ -24,29 +24,44 @@
package org.jboss.jbossts.orchestration.rule.expression;
import org.jboss.jbossts.orchestration.rule.type.Type;
-import org.jboss.jbossts.orchestration.rule.type.TypeGroup;
-import org.jboss.jbossts.orchestration.rule.binding.Bindings;
import org.jboss.jbossts.orchestration.rule.exception.TypeException;
import org.jboss.jbossts.orchestration.rule.exception.ExecuteException;
import org.jboss.jbossts.orchestration.rule.Rule;
-import org.antlr.runtime.Token;
+import org.jboss.jbossts.orchestration.rule.grammar.ParseNode;
/**
* A binary comparison operator expression
*/
public class ComparisonExpression extends BooleanExpression
{
- public ComparisonExpression(Rule rule, int oper, Token token, Expression left, Expression right)
+ public ComparisonExpression(Rule rule, int oper, ParseNode token, Expression left, Expression right)
{
super(rule, oper, token, left, right);
comparisonType = Type.UNDEFINED;
+ comparable = false;
}
public Type typeCheck(Type expected) throws TypeException {
// TODO allow comparison of non-numeric values
- Type type1 = getOperand(0).typeCheck(Type.N);
- Type type2 = getOperand(1).typeCheck(Type.N);
- comparisonType = Type.promote(type1, type2);
+ Type type1 = getOperand(0).typeCheck(Type.UNDEFINED);
+ Type type2 = getOperand(1).typeCheck(Type.UNDEFINED);
+ if (type1.isNumeric() || type2.isNumeric()) {
+ comparisonType = Type.promote(type1, type2);
+ comparable = true;
+ } else if (type1.isAssignableFrom(type2)) {
+ comparisonType = type1;
+ comparable = Comparable.class.isAssignableFrom(comparisonType.getTargetClass());
+ } else if (type2.isAssignableFrom(type1)) {
+ comparisonType = type2;
+ comparable = Comparable.class.isAssignableFrom(comparisonType.getTargetClass());
+ } else {
+ throw new TypeException("ComparisonExpression.typeCheck : incomparable argument types " + type1.getName() + " and " + type2.getName() + " for comparison expression" + getPos());
+ }
+
+ if (oper != EQ && oper != NE && !comparable) {
+ throw new TypeException("ComparisonExpression.typeCheck : cannot compare instances of class " + comparisonType.getName() + getPos());
+ }
+
type = Type.Z;
if (Type.dereference(expected).isDefined() && !expected.isAssignableFrom(type)) {
throw new TypeException("ComparisonExpression.typeCheck : invalid expected result type " + expected.getName() + getPos());
@@ -58,156 +73,198 @@
public Object interpret(Rule.BasicHelper helper) throws ExecuteException
{
try {
+ if (comparisonType.isNumeric()) {
// n.b. be careful with characters here
- Number value1 = (Number)getOperand(0).interpret(helper);
- Number value2 = (Number)getOperand(1).interpret(helper);
- // type is the result of promoting one or other or both of the operands
- // and they should be converted to this type before doing the compare operation
- if (comparisonType == type.B || comparisonType == type.S || comparisonType == type.I) {
- int i1 = value1.intValue();
- int i2 = value2.intValue();
- boolean result;
- switch (oper)
- {
- case LT:
- result = (i1 < i2);
- break;
- case LEQ:
- result = (i1 <= i2);
- break;
- case GT:
- result = (i1 > i2);
- break;
- case GEQ:
- result = (i1 >= i2);
- break;
- case EQ:
- result = (i1 == i2);
- break;
- case NEQ:
- result = (i1 != i2);
- break;
- default:
- result = false;
- break;
+ Number value1 = (Number)getOperand(0).interpret(helper);
+ Number value2 = (Number)getOperand(1).interpret(helper);
+ // type is the result of promoting one or other or both of the operands
+ // and they should be converted to this type before doing the compare operation
+ if (comparisonType == type.B || comparisonType == type.S || comparisonType == type.I) {
+ int i1 = value1.intValue();
+ int i2 = value2.intValue();
+ boolean result;
+ switch (oper)
+ {
+ case LT:
+ result = (i1 < i2);
+ break;
+ case LE:
+ result = (i1 <= i2);
+ break;
+ case GT:
+ result = (i1 > i2);
+ break;
+ case GE:
+ result = (i1 >= i2);
+ break;
+ case EQ:
+ result = (i1 == i2);
+ break;
+ case NE:
+ result = (i1 != i2);
+ break;
+ default:
+ result = false;
+ break;
+ }
+ return result;
+ } else if (comparisonType == type.J) {
+ long l1 = value1.longValue();
+ long l2 = value2.longValue();
+ boolean result;
+ switch (oper)
+ {
+ case LT:
+ result = (l1 < l2);
+ break;
+ case LE:
+ result = (l1 <= l2);
+ break;
+ case GT:
+ result = (l1 > l2);
+ break;
+ case GE:
+ result = (l1 >= l2);
+ break;
+ case EQ:
+ result = (l1 == l2);
+ break;
+ case NE:
+ result = (l1 != l2);
+ break;
+ default:
+ result = false;
+ break;
+ }
+ return result;
+ } else if (comparisonType == type.F) {
+ float f1 = value1.floatValue();
+ float f2 = value2.floatValue();
+ boolean result;
+ switch (oper)
+ {
+ case LT:
+ result = (f1 < f2);
+ break;
+ case LE:
+ result = (f1 <= f2);
+ break;
+ case GT:
+ result = (f1 > f2);
+ break;
+ case GE:
+ result = (f1 >= f2);
+ break;
+ case EQ:
+ result = (f1 == f2);
+ break;
+ case NE:
+ result = (f1 != f2);
+ break;
+ default:
+ result = false;
+ break;
+ }
+ return result;
+ } else if (comparisonType == type.D) {
+ double d1 = value1.doubleValue();
+ double d2 = value2.doubleValue();
+ boolean result;
+ switch (oper)
+ {
+ case LT:
+ result = (d1 < d2);
+ break;
+ case LE:
+ result = (d1 <= d2);
+ break;
+ case GT:
+ result = (d1 > d2);
+ break;
+ case GE:
+ result = (d1 >= d2);
+ break;
+ case EQ:
+ result = (d1 == d2);
+ break;
+ case NE:
+ result = (d1 != d2);
+ break;
+ default:
+ result = false;
+ break;
+ }
+ return result;
+ } else { // comparisonType == Type.C
+ char c1 = (char)value1.intValue();
+ char c2 = (char)value2.intValue();
+ boolean result;
+ switch (oper)
+ {
+ case LT:
+ result = (c1 < c2);
+ break;
+ case LE:
+ result = (c1 <= c2);
+ break;
+ case GT:
+ result = (c1 > c2);
+ break;
+ case GE:
+ result = (c1 >= c2);
+ break;
+ case EQ:
+ result = (c1 == c2);
+ break;
+ case NE:
+ result = (c1 != c2);
+ break;
+ default:
+ result = false;
+ break;
+ }
+ return result;
}
- return result;
- } else if (comparisonType == type.J) {
- long l1 = value1.longValue();
- long l2 = value2.longValue();
+ } else if (comparable) {
+ Comparable value1 = (Comparable)getOperand(0).interpret(helper);
+ Comparable value2 = (Comparable)getOperand(1).interpret(helper);
+ int cmp = value1.compareTo(value2);
boolean result;
switch (oper)
{
case LT:
- result = (l1 < l2);
+ result = (cmp < 0);
break;
- case LEQ:
- result = (l1 <= l2);
+ case LE:
+ result = (cmp <= 0);
break;
case GT:
- result = (l1 > l2);
+ result = (cmp > 0);
break;
- case GEQ:
- result = (l1 >= l2);
+ case GE:
+ result = (cmp >= 0);
break;
case EQ:
- result = (l1 == l2);
+ result = (cmp == 0);
break;
- case NEQ:
- result = (l1 != l2);
+ case NE:
+ result = (cmp != 0);
break;
default:
result = false;
break;
}
return result;
- } else if (comparisonType == type.F) {
- float f1 = value1.floatValue();
- float f2 = value2.floatValue();
+ } else {
+ Object value1 = getOperand(0).interpret(helper);
+ Object value2 = getOperand(1).interpret(helper);
boolean result;
- switch (oper)
- {
- case LT:
- result = (f1 < f2);
- break;
- case LEQ:
- result = (f1 <= f2);
- break;
- case GT:
- result = (f1 > f2);
- break;
- case GEQ:
- result = (f1 >= f2);
- break;
- case EQ:
- result = (f1 == f2);
- break;
- case NEQ:
- result = (f1 != f2);
- break;
- default:
- result = false;
- break;
+ if (oper == EQ) {
+ result = (value1 == value2);
+ } else {
+ result = (value1 != value2);
}
return result;
- } else if (comparisonType == type.D) {
- double d1 = value1.doubleValue();
- double d2 = value2.doubleValue();
- boolean result;
- switch (oper)
- {
- case LT:
- result = (d1 < d2);
- break;
- case LEQ:
- result = (d1 <= d2);
- break;
- case GT:
- result = (d1 > d2);
- break;
- case GEQ:
- result = (d1 >= d2);
- break;
- case EQ:
- result = (d1 == d2);
- break;
- case NEQ:
- result = (d1 != d2);
- break;
- default:
- result = false;
- break;
- }
- return result;
- } else { // (comparisonType == type.C)
- char c1 = (char)value1.intValue();
- char c2 = (char)value2.intValue();
- boolean result;
- switch (oper)
- {
- case LT:
- result = (c1 < c2);
- break;
- case LEQ:
- result = (c1 <= c2);
- break;
- case GT:
- result = (c1 > c2);
- break;
- case GEQ:
- result = (c1 >= c2);
- break;
- case EQ:
- result = (c1 == c2);
- break;
- case NEQ:
- result = (c1 != c2);
- break;
- default:
- result = false;
- break;
- }
- return result;
}
} catch (ExecuteException e) {
throw e;
@@ -216,4 +273,5 @@
}
}
private Type comparisonType;
+ private boolean comparable;
}
\ No newline at end of file
Modified: labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/ConditionalEvalExpression.java
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/ConditionalEvalExpression.java 2008-10-16 05:58:54 UTC (rev 23470)
+++ labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/ConditionalEvalExpression.java 2008-10-16 07:28:17 UTC (rev 23471)
@@ -24,19 +24,17 @@
package org.jboss.jbossts.orchestration.rule.expression;
import org.jboss.jbossts.orchestration.rule.type.Type;
-import org.jboss.jbossts.orchestration.rule.type.TypeGroup;
-import org.jboss.jbossts.orchestration.rule.binding.Bindings;
import org.jboss.jbossts.orchestration.rule.exception.TypeException;
import org.jboss.jbossts.orchestration.rule.exception.ExecuteException;
import org.jboss.jbossts.orchestration.rule.Rule;
-import org.antlr.runtime.Token;
+import org.jboss.jbossts.orchestration.rule.grammar.ParseNode;
/**
* expression representing a ternary conditional evaluation (cond ? if_expr : else_expr)
*/
public class ConditionalEvalExpression extends TernaryOperExpression
{
- public ConditionalEvalExpression(Rule rule, Type type, Token token, Expression cond, Expression if_expr, Expression else_expr)
+ public ConditionalEvalExpression(Rule rule, Type type, ParseNode token, Expression cond, Expression if_expr, Expression else_expr)
{
super(rule, TERNARY, type, token, cond, if_expr, else_expr);
}
Modified: labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/DollarExpression.java
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/DollarExpression.java 2008-10-16 05:58:54 UTC (rev 23470)
+++ labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/DollarExpression.java 2008-10-16 07:28:17 UTC (rev 23471)
@@ -23,14 +23,12 @@
*/
package org.jboss.jbossts.orchestration.rule.expression;
-import org.jboss.jbossts.orchestration.rule.binding.Bindings;
import org.jboss.jbossts.orchestration.rule.binding.Binding;
import org.jboss.jbossts.orchestration.rule.type.Type;
-import org.jboss.jbossts.orchestration.rule.type.TypeGroup;
import org.jboss.jbossts.orchestration.rule.exception.TypeException;
import org.jboss.jbossts.orchestration.rule.exception.ExecuteException;
import org.jboss.jbossts.orchestration.rule.Rule;
-import org.antlr.runtime.Token;
+import org.jboss.jbossts.orchestration.rule.grammar.ParseNode;
import java.io.StringWriter;
@@ -48,32 +46,24 @@
*/
public class DollarExpression extends Expression
{
- public DollarExpression(Rule rule, Type type, Token token)
+ public DollarExpression(Rule rule, Type type, ParseNode token, int index)
{
super(rule, type, token);
String text = token.getText();
- this.name = text.substring(1, text.length());
- char first = name.charAt(0);
- if ('0' <= first && first <= '9') {
- try {
- index = Integer.decode(name);
- } catch (NumberFormatException nfe) {
- // oops should not be possible according to tokenizer rules
- index = -1;
- }
+ if (index < 0) {
+ name = "$";
+ } else {
+ name = Integer.toString(index);
}
+ this.index = index;
}
- public DollarExpression(Rule rule, Type type, Token token, String text)
+ public DollarExpression(Rule rule, Type type, ParseNode token, String name)
{
super(rule, type, token);
- this.name = text.substring(1, text.length());
- try {
- index = Integer.decode(name);
- } catch (NumberFormatException nfe) {
- // oops should not be possible according to tokenizer rules
- index = -1;
- }
+ String text = token.getText();
+ this.index = -2;
+ this.name = name;
}
/**
@@ -98,7 +88,12 @@
public Type typeCheck(Type expected) throws TypeException {
// ensure there is a parameter with the relevant name in the bindings
- Binding binding = getBindings().lookup(Integer.toString(index));
+ Binding binding;
+ if (index >= 0) {
+ binding = getBindings().lookup(Integer.toString(index));
+ } else {
+ binding = getBindings().lookup(name);
+ }
if (binding == null) {
throw new TypeException("DollarExpression.typeCheck : invalid bound parameter $" + name + getPos());
}
@@ -115,11 +110,7 @@
}
public void writeTo(StringWriter stringWriter) {
- if (name.equals("-1")) {
- stringWriter.write("$$");
- } else {
- stringWriter.write("$" + name);
- }
+ stringWriter.write("$" + name);
}
private String name;
Modified: labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/Expression.java
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/Expression.java 2008-10-16 05:58:54 UTC (rev 23470)
+++ labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/Expression.java 2008-10-16 07:28:17 UTC (rev 23471)
@@ -23,13 +23,8 @@
*/
package org.jboss.jbossts.orchestration.rule.expression;
-import org.antlr.runtime.tree.CommonTree;
-import org.antlr.runtime.Token;
-import static org.jboss.jbossts.orchestration.rule.grammar.ECAGrammarParser.*;
-import org.jboss.jbossts.orchestration.rule.binding.Bindings;
-import org.jboss.jbossts.orchestration.rule.expression.*;
+import org.jboss.jbossts.orchestration.rule.grammar.ParseNode;
import org.jboss.jbossts.orchestration.rule.type.Type;
-import org.jboss.jbossts.orchestration.rule.type.TypeGroup;
import org.jboss.jbossts.orchestration.rule.exception.TypeException;
import org.jboss.jbossts.orchestration.rule.exception.ExecuteException;
import org.jboss.jbossts.orchestration.rule.Rule;
@@ -49,14 +44,14 @@
* Create a new expression.
* @param type the current type for this expression.
*/
- protected Expression(Rule rule, Type type, Token token)
+ protected Expression(Rule rule, Type type, ParseNode token)
{
super(rule);
this.rule = rule;
this.type = type;
this.token = token;
if (token != null) {
- this.charPos = token.getCharPositionInLine();
+ this.charPos = token.getColumn();
this.line = token.getLine();
} else {
this.charPos = 0;
@@ -112,5 +107,5 @@
protected Type type;
protected int charPos;
protected int line;
- protected Token token;
+ protected ParseNode token;
}
Modified: labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/ExpressionHelper.java
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/ExpressionHelper.java 2008-10-16 05:58:54 UTC (rev 23470)
+++ labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/ExpressionHelper.java 2008-10-16 07:28:17 UTC (rev 23471)
@@ -24,13 +24,11 @@
package org.jboss.jbossts.orchestration.rule.expression;
import org.jboss.jbossts.orchestration.rule.binding.Bindings;
-import org.jboss.jbossts.orchestration.rule.binding.Binding;
-import static org.jboss.jbossts.orchestration.rule.grammar.ECAGrammarParser.*;
+import org.jboss.jbossts.orchestration.rule.grammar.ParseNode;
+import static org.jboss.jbossts.orchestration.rule.grammar.ParseNode.*;
import org.jboss.jbossts.orchestration.rule.type.Type;
import org.jboss.jbossts.orchestration.rule.exception.TypeException;
import org.jboss.jbossts.orchestration.rule.Rule;
-import org.antlr.runtime.tree.CommonTree;
-import org.antlr.runtime.Token;
import java.util.List;
import java.util.ArrayList;
@@ -40,182 +38,135 @@
*/
public class ExpressionHelper
{
- public static Expression createExpression(Rule rule, Bindings bindings, CommonTree exprTree)
+ public static Expression createExpression(Rule rule, Bindings bindings, ParseNode exprTree)
throws TypeException
{
return createExpression(rule, bindings, exprTree, Type.UNDEFINED);
}
- public static Expression createExpression(Rule rule, Bindings bindings, CommonTree exprTree, Type type)
+ public static Expression createExpression(Rule rule, Bindings bindings, ParseNode exprTree, Type type)
throws TypeException
{
- // we expect expr = simple_expr |
- // (UNARYOP unary_oper expr) |
- // (BINOP infix_oper simple_expr exp) |
- // (TERNOP simple_expr expr expr)
- //
- // where simple_expr = (DOLLARSYM) |
- // (SYMBOL)
- // (ARRAY SYMBOL idx_list)
- // (METH SYMBOL)
- // (METH SYMBOL expr_list)
- // (THROW SYMBOL)
- // (THROW SYMBOL expr_list)
- // (NUMBER)
- // (STRING)
- // (RETURN)
- // (RETURN expr)
- // expr
+ // we expect expr = (RETURN)
+ // (RETURN expr)
+ // (THROW)
+ // (THROW expr)
+ // (UNARYOP unary_oper expr) |
+ // (BINOP infix_oper expr exp) |
+ // (TERNOP simple_expr expr expr)
+ // (ARRAY expr expr_list)
+ // (FIELD expr simple_name)
+ // (METH simple_name expr expr_list)
+ // (BOOLEAN_LITERAL)
+ // (INTEGER_LITERAL)
+ // (FLOAT_LITERAL)
+ // (STRING_LITERAL)
+ // (PATH simple_name)
+ // (PATH simple_name path)
+ // (IDENTIFIER simple_name)
+ // (IDENTIFIER simple_name path)
- Token token = exprTree.getToken();
- int tokenType = token.getType();
+ int tag = exprTree.getTag();
Expression expr;
- switch (tokenType) {
- case DOLLARSYM:
+ switch (tag) {
+ case IDENTIFIER:
{
- expr = new DollarExpression(rule, type, token);
- }
- break;
- case SYMBOL:
- {
- // check for embedded dots
+ // check for path qualifier
- String text = token.getText();
- int length = text.length();
- // strip off any surrounding single quotes
- if (length > 1 && text.charAt(0) == '\'' && text.charAt(length - 1) == '\'') {
- text = text.substring(1, length - 1);
- }
- int dotIdx = text.lastIndexOf('.');
- if (dotIdx < 0) {
- // direct variable reference
- expr = new Variable(rule, type, token);
+ String name = (String)exprTree.getChild(0);
+ ParseNode child1 = (ParseNode)exprTree.getChild(1);
+
+ if (child1 == null && bindings.lookup(name) != null) {
+ // a clear cut direct variable reference
+ expr = new Variable(rule, type, exprTree);
} else {
- // field reference either to an instance named by a binding or or a static
+ // we should only get these as identifiers for binding types or throw types which are
+ // explicitly caught by the bindings or throw processing case handlers so this is an error
- String[] parts = text.split("\\.");
- if (parts.length < 2) {
- // oops malformed symbol either "." ro "foo." or ".foo"
- // should not happen but ...
- throw new TypeException("ExpressionHelper.createExpression : unexpected symbol " + token.getText() + " @ " + token.getLine() + "." + token.getCharPositionInLine());
- } else {
- String prefix = parts[0];
-
- if (bindings.lookup(prefix) != null) {
- // intitial segment of text identifies a bound variable so treat as
- // instance field access
- int l = parts.length - 1;
- String[] fields = new String[l];
- System.arraycopy(parts, 1, fields, 0, l);
- expr = new FieldExpression(rule, type, token, prefix, fields);
- } else {
- expr = new StaticExpression(rule, type, token, parts);
- }
- }
+ throw new TypeException("ExpressionHelper.createExpression : unexpected occurence of IDENTIFIER in parse tree " + exprTree.getText() + exprTree.getPos());
}
}
break;
case ARRAY:
{
- CommonTree child0 = (CommonTree) exprTree.getChild(0);
- CommonTree child1 = (CommonTree) exprTree.getChild(1);
- token = child0.getToken();
- if (token.getType() != SYMBOL) {
- throw new TypeException("ExpressionHelper.createExpression : unexpected token Type in array expression tree " + tokenType + " for token " + token.getText() + " @ " + token.getLine() + "." + token.getCharPositionInLine());
- }
- Expression arrayRef;
- // check for embedded dots
+ ParseNode child0 = (ParseNode) exprTree.getChild(0);
+ ParseNode child1 = (ParseNode) exprTree.getChild(1);
- String text = token.getText();
- int dotIdx = text.lastIndexOf('.');
- if (dotIdx < 0) {
- // array name is direct variable reference
- arrayRef = new Variable(rule, type, token);
- } else {
- // field reference either to an instance named by a binding or or a static
+ Expression arrayRef = createExpression(rule, bindings, child0, Type.UNDEFINED);
- String[] parts = text.split("\\.");
- if (parts.length < 2) {
- // oops malformed symbol either "." ro "foo." or ".foo"
- // should not happen but ...
- throw new TypeException("ExpressionHelper.createExpression : unexpected symbol " + token.getText() + " @ " + token.getLine() + "." + token.getCharPositionInLine());
- } else {
- String prefix = parts[0];
-
- if (bindings.lookup(prefix) != null) {
- // intitial segment of text identifies a bound variable so treat as
- // instance field access
- int l = parts.length - 1;
- String[] fields = new String[l];
- System.arraycopy(parts, 1, fields, 0, l);
- arrayRef = new FieldExpression(rule, type, token, prefix, fields);
- } else {
- arrayRef = new StaticExpression(rule, type, token, parts);
- }
- }
- }
List<Expression> indices = createExpressionList(rule, bindings, child1, Type.INTEGER);
+
if (indices != null) {
- expr = new ArrayExpression(rule, type, token, arrayRef, indices);
+ expr = new ArrayExpression(rule, type, exprTree, arrayRef, indices);
} else {
- throw new TypeException("ExpressionHelper.createExpression : invalid array index expression @ " + token.getLine() + "." + token.getCharPositionInLine());
+ throw new TypeException("ExpressionHelper.createExpression : invalid array index expression " + exprTree.getPos());
}
}
break;
+ case FIELD:
+ {
+ ParseNode child0 = (ParseNode) exprTree.getChild(0);
+ ParseNode child1 = (ParseNode) exprTree.getChild(1);
+ expr = createFieldExpression(rule, bindings, child0, child1, type);
+ }
+ break;
case METH:
{
- CommonTree child0 = (CommonTree) exprTree.getChild(0);
- CommonTree child1;
- if (exprTree.getChildCount() > 1) {
- child1 = (CommonTree) exprTree.getChild(1);
- } else {
- child1 = null;
+ ParseNode child0 = (ParseNode) exprTree.getChild(0);
+ ParseNode child1 = (ParseNode) exprTree.getChild(1);
+ ParseNode child2 = (ParseNode) exprTree.getChild(2);
+ int tag0 = child0.getTag();
+ if (tag0 != IDENTIFIER) {
+ // uurgh we expected a method name
+ throw new TypeException("ExpressionHelper.createExpression : invalid unexpected type tag for method selector " + tag + " for expression " + child0.getText() + child0.getPos());
}
- token = child0.getToken();
- if (token.getType() != SYMBOL) {
- throw new TypeException("ExpressionHelper.createExpression : unexpected token Type in method expression tree " + tokenType + " for token " + token.getText() + " @ " + token.getLine() + "." + token.getCharPositionInLine());
- } else {
- expr = createCallExpression(rule, bindings, token, child1, type);
- }
+
+ expr = createCallExpression(rule, bindings, child0, child1, child2, type);
}
break;
case THROW:
{
- CommonTree child0 = (CommonTree) exprTree.getChild(0);
- CommonTree child1;
- if (exprTree.getChildCount() > 1) {
- child1 = (CommonTree) exprTree.getChild(1);
+ ParseNode child0 = (ParseNode) exprTree.getChild(0);
+ ParseNode child1 = (ParseNode) exprTree.getChild(1);
+ int tag0 = child0.getTag();
+
+ if (tag0 != IDENTIFIER) {
+ throw new TypeException("ExpressionHelper.createExpression : unexpected type tag in throw expression tree " + tag + " for expression " + child0.getText() + child0.getPos());
} else {
- child1 = null;
+ expr = createThrowExpression(rule, bindings, child0, child1);
}
- token = child0.getToken();
- if (token.getType() != SYMBOL) {
- throw new TypeException("ExpressionHelper.createExpression : unexpected token Type in throw expression tree " + tokenType + " for token " + token.getText() + " @ " + token.getLine() + "." + token.getCharPositionInLine());
- } else {
- expr = createThrowExpression(rule, bindings, token, child1, type);
- }
}
break;
- case NUMBER:
+ case INTEGER_LITERAL:
{
- expr = new NumericLiteral(rule, token);
+ expr = new NumericLiteral(rule, Type.INTEGER, exprTree);
}
break;
- case STRING:
+ case FLOAT_LITERAL:
{
- expr = new StringLiteral(rule, token);
+ expr = new NumericLiteral(rule, Type.FLOAT, exprTree);
}
break;
+ case STRING_LITERAL:
+ {
+ expr = new StringLiteral(rule, exprTree);
+ }
+ break;
+ case BOOLEAN_LITERAL:
+ {
+ expr = new BooleanLiteral(rule, exprTree);
+ }
+ break;
case RETURN:
{
Expression returnValue;
- if (exprTree.getChildCount() > 0) {
- CommonTree child0 = (CommonTree) exprTree.getChild(0);
- returnValue = createExpression(rule, bindings,child0);
+ ParseNode child0 = (ParseNode) exprTree.getChild(0);
+ if (child0 != null) {
+ returnValue = createExpression(rule, bindings, child0);
} else {
returnValue = null;
}
- expr = new ReturnExpression(rule, token, returnValue);
+ expr = new ReturnExpression(rule, exprTree, returnValue);
}
break;
case UNOP:
@@ -235,7 +186,7 @@
break;
default:
{
- throw new TypeException("ExpressionHelper.createExpression : unexpected token Type in expression tree " + tokenType + " for token " + token.getText() + " @ " + token.getLine() + "." + token.getCharPositionInLine());
+ throw new TypeException("ExpressionHelper.createExpression : unexpected type tag in expression tree " + tag + " for expression " + exprTree.getPos());
}
}
@@ -243,158 +194,184 @@
Type targetType = Type.dereference(type);
if (exprType.isDefined() && targetType.isDefined() && !targetType.isAssignableFrom(exprType)) {
// we already know this is an invalid type so notify an error and return null
- throw new TypeException("ExpressionHelper.createExpression : invalid expression type " + exprType.getName() + " expecting " + targetType.getName() + " @ " + token.getLine() + "." + token.getCharPositionInLine());
+ throw new TypeException("ExpressionHelper.createExpression : invalid expression type " + exprType.getName() + " expecting " + targetType.getName() + exprTree.getPos());
} else if (targetType.isNumeric() && !exprType.isNumeric()) {
// we already know this is an invalid type so notify an error and return null
- throw new TypeException("ExpressionHelper.createExpression : invalid expression type " + exprType.getName() + " expecting " + targetType.getName() + " @ " + token.getLine() + "." + token.getCharPositionInLine());
+ throw new TypeException("ExpressionHelper.createExpression : invalid expression type " + exprType.getName() + " expecting " + targetType.getName() + exprTree.getPos());
}
if (!expr.bind()) {
- throw new TypeException("ExpressionHelper.createExpression : unknown reference in expression @ " + token.getLine() + "." + token.getCharPositionInLine());
+ throw new TypeException("ExpressionHelper.createExpression : unknown reference in expression" + exprTree.getPos());
}
return expr;
}
- public static Expression createCallExpression(Rule rule, Bindings bindings, Token token, CommonTree argTree, Type type)
- throws TypeException
- {
- Expression expr;
- String callName;
- Expression recipient;
- List<Expression> args;
+ public static Expression createFieldExpression(Rule rule, Bindings bindings, ParseNode fieldTree, ParseNode targetTree, Type type)
+ throws TypeException
+ {
+ Expression expr;
+ Expression target;
+ String[] pathList;
- // we need to factor off the path from the method/builtin name
+ // the recipient tree may be a path or some other form of expression
+ // in the former case we don't construct the recipient until type check time
- String text = token.getText();
- int dotIdx = text.lastIndexOf('.');
- if (dotIdx < 0) {
- // a builtin call
+ if (targetTree.getTag() == PATH) {
+ target = null;
+ pathList = createPathList(targetTree);
+ } else {
+ target = createExpression(rule, bindings, targetTree, Type.UNDEFINED);
+ pathList = null;
+ }
+ expr = new FieldExpression(rule, type, fieldTree, fieldTree.getText(), target, pathList);
- recipient = null;
- callName = text;
- } else {
- // prefix must be either a bound varibale, a field reference via a bound
- // variable, or a static field reference
+ return expr;
+ }
- String[] path = text.split("\\.");
- if (path.length < 2) {
- // oops malformed symbol either "." ro "foo." or ".foo"
- // should not happen but ...
- throw new TypeException("ExpressionHelper.createCallExpression : unexpected symbol " + token.getText() + " @ " + token.getLine() + "." + token.getCharPositionInLine());
- } else {
- // save the method name and only consider path preceding it
- int pathLength = path.length - 1;
- callName = path[pathLength];
+ public static Expression createCallExpression(Rule rule, Bindings bindings, ParseNode selectorTree, ParseNode recipientTree, ParseNode argTree, Type type)
+ throws TypeException
+ {
+ Expression expr;
+ Expression recipient;
+ String[] pathList;
+ List<Expression> args;
- // see if the path starts with a bound variable
- String prefix = path[0];
- Binding binding = bindings.lookup(prefix);
+ // the recipient tree may be a path or some other form of expression
+ // in the former case we don't construct the recipient until type check time
- if (binding != null) {
- // intitial segment of text identifies a bound variable so treat as
- // a variable access or an instance field access depending upon how
- // many extra path elenments there are
- if (pathLength == 1) {
- // method call on bound variable
- recipient = new Variable(rule, binding.getType(), token, binding.getName());
- } else {
- // method call on field of bound variable
- String[] fields = new String[pathLength - 1];
- System.arraycopy(path, 1, fields, 0, pathLength - 1);
- recipient = new FieldExpression(rule, Type.UNDEFINED, token, prefix, fields);
- }
- } else {
- // ok, we need a version of the path without the method name on the end
- String[] realPath = new String[pathLength];
- System.arraycopy(path, 0, realPath, 0, pathLength);
- recipient = new StaticExpression(rule, Type.UNDEFINED, token, realPath);
- }
- }
- }
+ if (recipientTree == null) {
+ recipient = null;
+ pathList = null;
+ } else if (recipientTree.getTag() == PATH) {
+ recipient = null;
+ pathList = createPathList(recipientTree);
+ } else {
+ recipient = createExpression(rule, bindings, recipientTree, Type.UNDEFINED);
+ pathList = null;
+ }
+ if (argTree == null) {
+ args = new ArrayList<Expression>();
+ } else {
+ args = createExpressionList(rule, bindings, argTree);
+ }
- if (argTree == null) {
- args = new ArrayList<Expression>();
- } else {
- args = createExpressionList(rule, bindings, argTree);
- }
+ expr = new MethodExpression(rule, type, selectorTree, recipient, args, pathList);
- expr = new MethodExpression(rule, type, token, callName, recipient, args);
+ return expr;
+ }
- return expr;
- }
+ public static String[] createPathList(ParseNode pathTree)
+ {
+ int l = 0;
+ ParseNode p = pathTree;
- public static Expression createThrowExpression(Rule rule, Bindings bindings, Token token, CommonTree argTree, Type type)
+ while (p != null) {
+ l++;
+ p = (ParseNode)p.getChild(1);
+ }
+
+ String[] pathList = new String[l];
+
+ p = pathTree;
+ while (p != null) {
+ l--;
+ pathList[l] = (String)p.getText();
+ p = (ParseNode)p.getChild(1);
+ }
+
+ return pathList;
+ }
+
+ public static Expression createThrowExpression(Rule rule, Bindings bindings, ParseNode typeNameTree, ParseNode argTree)
throws TypeException
{
Expression expr;
- String className;
List<Expression> args;
- String typeName = token.getText();
-
if (argTree == null) {
args = new ArrayList<Expression>();
} else {
args = createExpressionList(rule, bindings, argTree);
}
- expr = new ThrowExpression(rule, typeName, token, args);
+ expr = new ThrowExpression(rule, typeNameTree, args);
return expr;
}
- public static Expression createUnaryExpression(Rule rule, Bindings bindings, CommonTree exprTree, Type type)
+ public static Expression createUnaryExpression(Rule rule, Bindings bindings, ParseNode exprTree, Type type)
throws TypeException
{
// we expect ^(UNOP unary_oper expr)
- CommonTree child0 = (CommonTree) exprTree.getChild(0);
- CommonTree child1 = (CommonTree) exprTree.getChild(1);
+ ParseNode child0 = (ParseNode) exprTree.getChild(0);
+ ParseNode child1 = (ParseNode) exprTree.getChild(1);
Expression expr;
- Token token = child0.getToken();
+ int tag = child0.getTag();
- switch (token.getType())
+ switch (tag)
{
case TWIDDLE:
{
// the argument must be a numeric expression
if (!type.isUndefined() && !type.isVoid() && !type.isNumeric()) {
- throw new TypeException("ExpressionHelper.createUnaryExpression : invalid numeric expression @ " + token.getLine() + "." + token.getCharPositionInLine());
+ throw new TypeException("ExpressionHelper.createUnaryExpression : invalid numeric expression" + exprTree.getPos());
}
Expression operand = createExpression(rule, bindings, child1, Type.NUMBER);
- expr = new TwiddleExpression(rule, token, operand);
+ expr = new TwiddleExpression(rule, exprTree, operand);
}
break;
case NOT:
{
// the argument must be a boolean expression
if (!type.isUndefined() && !type.isVoid() && !type.isBoolean()) {
- throw new TypeException("ExpressionHelper.createUnaryExpression : invalid boolean expression @ " + token.getLine() + "." + token.getCharPositionInLine());
+ throw new TypeException("ExpressionHelper.createUnaryExpression : invalid boolean expression" + exprTree.getPos());
}
Expression operand = createExpression(rule, bindings, child1, Type.BOOLEAN);
- expr = new NotExpression(rule, token, operand);
+ expr = new NotExpression(rule, exprTree, operand);
}
break;
+ case UMINUS:
+ {
+ // the argument must be a numeric expression
+ if (!type.isUndefined() && !type.isVoid() && !type.isBoolean()) {
+ throw new TypeException("ExpressionHelper.createUnaryExpression : invalid boolean expression" + exprTree.getPos());
+ }
+ Expression operand = createExpression(rule, bindings, child1, Type.NUMBER);
+ expr = new MinusExpression(rule, exprTree, operand);
+ }
+ break;
+ case DOLLAR:
+ {
+ if (child1.getTag() == IDENTIFIER) {
+ expr = new DollarExpression(rule, type, exprTree, child1.getText());
+ } else if (child1.getTag() == INTEGER_LITERAL) {
+ Integer intObject = (Integer) child1.getChild(0);
+ expr = new DollarExpression(rule, type, exprTree, intObject.intValue());
+ } else {
+ throw new TypeException("ExpressionHelper.createUnaryExpression : unexpected type tag " + child1.getTag() + " for dollar expression tree " + child1.getText() + "" + child1.getPos());
+ }
+ }
+ break;
default:
{
- throw new TypeException("ExpressionHelper.createUnaryExpression : unexpected token Type in expression tree " + token.getType() + " for token " + token.getText() + " @ " + token.getLine() + "." + token.getCharPositionInLine());
+ throw new TypeException("ExpressionHelper.createUnaryExpression : unexpected type tag " + exprTree.getTag() + " for expression tree " + exprTree.getText() + "" + exprTree.getPos());
}
}
return expr;
}
- public static Expression createBinaryExpression(Rule rule, Bindings bindings, CommonTree exprTree, Type type)
+ public static Expression createBinaryExpression(Rule rule, Bindings bindings, ParseNode exprTree, Type type)
throws TypeException
{
// we expect ^(BINOP infix_oper simple_expr expr)
- CommonTree child0 = (CommonTree) exprTree.getChild(0);
- CommonTree child1 = (CommonTree) exprTree.getChild(1);
- CommonTree child2 = (CommonTree) exprTree.getChild(2);
+ ParseNode child0 = (ParseNode) exprTree.getChild(0);
+ ParseNode child1 = (ParseNode) exprTree.getChild(1);
+ ParseNode child2 = (ParseNode) exprTree.getChild(2);
Expression expr;
- Token token = child0.getToken();
- int oper = token.getType();
+ int oper = child0.getTag();
switch (oper)
{
@@ -403,32 +380,33 @@
// this is a special case since we may be doing String concatenation
Expression operand1;
Expression operand2;
- if (type == Type.STRING) {
+ /* if (type == Type.STRING) {
// must be doing String concatenation
+ // TODO hmm, not sure this is right e.g. ("value " + a + b) might give "value 12" instead of "value 3"
operand1 = createExpression(rule, bindings, child1, Type.STRING);
operand2 = createExpression(rule, bindings, child2, Type.UNDEFINED);
- expr = new StringPlusExpression(rule, token, operand1, operand2);
- } else if (type.isNumeric()) {
+ expr = new StringPlusExpression(rule, exprTree, operand1, operand2);
+ } else */ if (type.isNumeric()) {
// must be doing arithmetic
operand1 = createExpression(rule, bindings, child1, Type.NUMBER);
operand2 = createExpression(rule, bindings, child2, Type.NUMBER);
int convertedOper = OperExpression.convertOper(oper);
- expr = new ArithmeticExpression(rule, convertedOper, token, operand1, operand2);
+ expr = new ArithmeticExpression(rule, convertedOper, exprTree, operand1, operand2);
} else {
// see if the operand gives us any type info
operand1 = createExpression(rule, bindings, child1, Type.UNDEFINED);
if (operand1.getType().isNumeric()) {
operand2 = createExpression(rule, bindings, child2, Type.NUMBER);
int convertedOper = OperExpression.convertOper(oper);
- expr = new ArithmeticExpression(rule, convertedOper, token, operand1, operand2);
+ expr = new ArithmeticExpression(rule, convertedOper, exprTree, operand1, operand2);
} else if (operand1.getType() == Type.STRING) {
operand2 = createExpression(rule, bindings, child2, Type.UNDEFINED);
- expr = new StringPlusExpression(rule, token, operand1, operand2);
+ expr = new StringPlusExpression(rule, exprTree, operand1, operand2);
} else {
operand2 = createExpression(rule, bindings, child2, Type.UNDEFINED);
// create as generic plus expression which we will replace later during type
// checking
- expr = new PlusExpression(rule, token, operand1, operand2);
+ expr = new PlusExpression(rule, exprTree, operand1, operand2);
}
}
}
@@ -442,7 +420,7 @@
Expression operand2 = createExpression(rule, bindings, child2, Type.NUMBER);
int convertedOper = OperExpression.convertOper(oper);
- expr = new ArithmeticExpression(rule, convertedOper, token, operand1, operand2);
+ expr = new ArithmeticExpression(rule, convertedOper, exprTree, operand1, operand2);
}
break;
case BAND:
@@ -453,7 +431,7 @@
Expression operand2 = createExpression(rule, bindings, child2, Type.NUMBER);
int convertedOper = OperExpression.convertOper(oper);
- expr = new BitExpression(rule, convertedOper, token, operand1, operand2);
+ expr = new BitExpression(rule, convertedOper, exprTree, operand1, operand2);
}
break;
case AND:
@@ -463,47 +441,47 @@
Expression operand2 = createExpression(rule, bindings, child2, Type.BOOLEAN);
int convertedOper = OperExpression.convertOper(oper);
- expr = new LogicalExpression(rule, convertedOper, token, operand1, operand2);
+ expr = new LogicalExpression(rule, convertedOper, exprTree, operand1, operand2);
}
break;
case EQ:
- case NEQ:
+ case NE:
case GT:
case LT:
- case GEQ:
- case LEQ:
+ case GE:
+ case LE:
{
- Expression operand1 = createExpression(rule, bindings, child1, Type.NUMBER);
- Expression operand2 = createExpression(rule, bindings, child2, Type.NUMBER);
+ Expression operand1 = createExpression(rule, bindings, child1, Type.UNDEFINED);
+ Expression operand2 = createExpression(rule, bindings, child2, Type.UNDEFINED);
int convertedOper = OperExpression.convertOper(oper);
- expr = new ComparisonExpression(rule, convertedOper, token, operand1, operand2);
+ expr = new ComparisonExpression(rule, convertedOper, exprTree, operand1, operand2);
}
break;
default:
{
- throw new TypeException("ExpressionHelper.createBinaryExpression : unexpected token Type in expression tree " + token.getType() + " for token " + token.getText() + " @ " + token.getLine() + "." + token.getCharPositionInLine());
+ throw new TypeException("ExpressionHelper.createBinaryExpression : unexpected type tag in expression tree " + exprTree.getTag() + " for expression " + exprTree.getText() + "" + exprTree.getPos());
}
}
return expr;
}
- public static Expression createTernaryExpression(Rule rule, Bindings bindings, CommonTree exprTree, Type type)
+ public static Expression createTernaryExpression(Rule rule, Bindings bindings, ParseNode exprTree, Type type)
throws TypeException
{
// we expect ^(TERNOP ternary_oper simple_expr expr expr)
- CommonTree child0 = (CommonTree) exprTree.getChild(0);
- CommonTree child1 = (CommonTree) exprTree.getChild(1);
- CommonTree child2 = (CommonTree) exprTree.getChild(2);
- CommonTree child3 = (CommonTree) exprTree.getChild(3);
+ ParseNode child0 = (ParseNode) exprTree.getChild(0);
+ ParseNode child1 = (ParseNode) exprTree.getChild(1);
+ ParseNode child2 = (ParseNode) exprTree.getChild(2);
+ ParseNode child3 = (ParseNode) exprTree.getChild(3);
Expression expr;
- Token token = child0.getToken();
+ int oper = child0.getTag();
- switch (token.getType())
+ switch (oper)
{
- case TERN_IF:
+ case COND:
{
// the argument must be a numeric expression
Expression operand1 = createExpression(rule, bindings, child1, Type.BOOLEAN);
@@ -513,44 +491,45 @@
Type type3 = Type.dereference(operand3.getType());
if (type2.isNumeric() || type3.isNumeric()) {
if (!type.isUndefined() && !type.isVoid() && !type.isNumeric()) {
- throw new TypeException("ExpressionHelper.createUnaryExpression : invalid numeric expression @ " + token.getLine() + "." + token.getCharPositionInLine());
+ throw new TypeException("ExpressionHelper.createUnaryExpression : invalid numeric expression" + exprTree.getPos());
}
- expr = new ConditionalEvalExpression(rule, Type.promote(type2, type3), token, operand1, operand2, operand3);
+ expr = new ConditionalEvalExpression(rule, Type.promote(type2, type3), exprTree, operand1, operand2, operand3);
} else if (type2.isDefined() && type3.isDefined()) {
// since they are not numeric we have to have the same type
if (type2 == type3) {
// use this type
- expr = new ConditionalEvalExpression(rule, type2, token, operand1, operand2, operand3);
+ expr = new ConditionalEvalExpression(rule, type2, exprTree, operand1, operand2, operand3);
} else {
// mismatched types so don't generate a result
- throw new TypeException("ExpressionHelper.createTernaryExpression : mismatched types " + type2.getName() + " and " + type3.getName() + " in conditional expression " + token.getType() + " for token " + token.getText() + " @ " + token.getLine() + "." + token.getCharPositionInLine());
+ throw new TypeException("ExpressionHelper.createTernaryExpression : mismatched types " + type2.getName() + " and " + type3.getName() + " in conditional expression " + exprTree.getText() + exprTree.getPos());
}
} else {
// have to wait for type check to resolve types
- expr = new ConditionalEvalExpression(rule, Type.UNDEFINED, token, operand1, operand2, operand3);
+ expr = new ConditionalEvalExpression(rule, Type.UNDEFINED, exprTree, operand1, operand2, operand3);
}
}
break;
default:
{
- throw new TypeException("ExpressionHelper.createTernaryExpression : unexpected token Type in expression tree " + token.getType() + " for token " + token.getText() + " @ " + token.getLine() + "." + token.getCharPositionInLine());
+ throw new TypeException("ExpressionHelper.createTernaryExpression : unexpected type tag in expression tree " + exprTree.getTag() + " for expression " + exprTree.getText() + "" + exprTree.getPos());
}
}
return expr;
}
- public static List<Expression> createExpressionList(Rule rule, Bindings bindings, CommonTree exprTree)
+ public static List<Expression> createExpressionList(Rule rule, Bindings bindings, ParseNode exprTree)
throws TypeException
{
return createExpressionList(rule, bindings, exprTree, Type.UNDEFINED);
}
- public static List<Expression> createExpressionList(Rule rule, Bindings bindings, CommonTree exprTree, Type type)
+ public static List<Expression> createExpressionList(Rule rule, Bindings bindings, ParseNode exprTree, Type type)
throws TypeException
{
// we expect expr_list = ^(EXPR) |
- // ^(SEPR expr expr_list)
+ // ^(SEMI expr expr_list)
+ // ^(COMMA expr expr_list)
List<Expression> exprList = new ArrayList<Expression>();
List<TypeException> exceptions = new ArrayList<TypeException>();
@@ -558,13 +537,14 @@
while (exprTree != null)
{
try {
- switch (exprTree.getToken().getType())
+ switch (exprTree.getTag())
{
- case SEPR:
+ case SEMI:
+ case COMMA:
{
- CommonTree child0 = (CommonTree) exprTree.getChild(0);
+ ParseNode child0 = (ParseNode) exprTree.getChild(0);
// assign tree before we risk an exception
- exprTree = (CommonTree) exprTree.getChild(1);
+ exprTree = (ParseNode) exprTree.getChild(1);
Expression expr = createExpression(rule, bindings, child0, type);
exprList.add(expr);
}
@@ -572,7 +552,7 @@
default:
{
// assign tree before we risk an exception
- CommonTree saveTree = exprTree;
+ ParseNode saveTree = exprTree;
exprTree = null;
Expression expr = createExpression(rule, bindings, saveTree, type);
exprList.add(expr);
Modified: labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/FieldExpression.java
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/FieldExpression.java 2008-10-16 05:58:54 UTC (rev 23470)
+++ labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/FieldExpression.java 2008-10-16 07:28:17 UTC (rev 23471)
@@ -23,14 +23,13 @@
*/
package org.jboss.jbossts.orchestration.rule.expression;
-import org.jboss.jbossts.orchestration.rule.binding.Bindings;
import org.jboss.jbossts.orchestration.rule.binding.Binding;
import org.jboss.jbossts.orchestration.rule.type.Type;
import org.jboss.jbossts.orchestration.rule.type.TypeGroup;
import org.jboss.jbossts.orchestration.rule.exception.TypeException;
import org.jboss.jbossts.orchestration.rule.exception.ExecuteException;
import org.jboss.jbossts.orchestration.rule.Rule;
-import org.antlr.runtime.Token;
+import org.jboss.jbossts.orchestration.rule.grammar.ParseNode;
import java.io.StringWriter;
import java.lang.reflect.Field;
@@ -40,18 +39,14 @@
*/
public class FieldExpression extends Expression
{
- public FieldExpression(Rule rule, Type type, Token token, String ref, String[] fieldNames) {
- // type is the type of last field
- // ownerType[i] is the type of the owner of field[i]
- // so ownerType[0] is the type of ref;
- super(rule, type, token);
- this.ref = ref;
- this.fieldNames = fieldNames;
- int len = fieldNames.length;
- this.ownerType = new Type[len];
- for (int i = 0; i < len; i++) {
- ownerType[i] = Type.UNDEFINED;
- }
+ public FieldExpression(Rule rule, Type type, ParseNode fieldTree, String fieldName, Expression owner, String[] pathList) {
+ // we cannot process the pathlist until typecheck time
+ super(rule, type, fieldTree);
+ this.fieldName = fieldName;
+ this.owner = owner;
+ this.pathList = pathList;
+ this.ownerType = null;
+ this.indirectStatic = true;
}
/**
@@ -63,96 +58,175 @@
* been detected during inference/validation.
*/
public boolean bind() {
- // ensure that there is a binding with this name
- Binding binding = getBindings().lookup(ref);
+ if (owner != null) {
+ // ensure the owner is bound
+ owner.bind();
+ } else {
+ // see if the path starts with a bound variable and, if so, treat the path as a series
+ // of field references and construct a owner expression from it. if not we will have to
+ // wait until runtime in order to resolve this as a static field reference
+ String leading = pathList[0];
+ Binding binding = getBindings().lookup(leading);
+ if (binding != null) {
+ // create a sequence of field expressions and make it the owner
- if (binding == null) {
- System.err.println("FieldExpresssion.bind : unbound instance " + ref + getPos());
- return false;
+ int l = pathList.length;
+ Expression owner = new Variable(rule, binding.getType(), token, binding.getName());
+ for (int idx = 1; idx < l; idx++) {
+ owner = new FieldExpression(rule, Type.UNDEFINED, token, pathList[idx], owner, null);
+ }
+ this.owner = owner;
+ this.pathList = null;
+ // not strictly necessary?
+ this.owner.bind();
+ }
}
return true;
}
public Type typeCheck(Type expected) throws TypeException {
- // check the owner type is defined and then start searching for
- // the types of each field referenced from it
+ if (owner == null && pathList != null) {
+ // factor off a typename from the path
+ TypeGroup typeGroup = getTypeGroup();
+ Type rootType = typeGroup.match(pathList);
+ if (rootType == null) {
+ throw new TypeException("FieldExpression.typeCheck : invalid path " + getPath(pathList.length) + " to static field " + fieldName + getPos());
+ }
- Binding binding = getBindings().lookup(ref);
- Type bindingType = binding.getType();
- ownerType[0] = Type.dereference(bindingType);
-
- if (ownerType[0].isUndefined()) {
- throw new TypeException("FieldExpresssion.typeCheck : unbound instance " + ref + getPos());
+ // find out how many of the path elements are included in the type name
+
+ String rootTypeName = rootType.getName();
+
+ int idx = getPathCount(rootTypeName);
+
+ if (idx < pathList.length) {
+ // create a static field reference using the type name and the first field name and wrap it with
+ // enough field references to use up all the path
+ String fieldName = pathList[idx++];
+ Expression owner = new StaticExpression(rule, Type.UNDEFINED, token, fieldName, rootTypeName);
+ while (idx < pathList.length) {
+ owner = new FieldExpression(rule, Type.UNDEFINED, token, pathList[idx++], owner, null);
+ }
+ this.owner = owner;
+ } else {
+ // ok this field reference is actually a static reference -- install the one we just created as
+ // owner and mark this one so it sidesteps any further requests to the owner
+ this.owner = new StaticExpression(rule, Type.UNDEFINED, token, this.fieldName, rootTypeName);
+ this.indirectStatic = true;
+ }
+ // get rid of the path list now
+ this.pathList = null;
+ // not strictly necessary?
+ this.owner.bind();
}
- Class ownerClazz = ownerType[0].getTargetClass();
- Class valueClass = null;
- Type valueType = null;
- int fieldCount = fieldNames.length;
+ if (indirectStatic) {
+ // this is really a static field reference pointed to by owner so get it to type check
+ type = ownerType = Type.dereference(owner.typeCheck(expected));
+ return type;
+ } else {
- fields = new Field[fieldCount];
+ // ok, type check the owner and then use it to derive the field type
- for (int i = 0; i < fieldCount; i++) {
- if (i != 0) {
- ownerType[i] = valueType;
- ownerClazz = valueType.getTargetClass();
+ ownerType = Type.dereference(owner.typeCheck(Type.UNDEFINED));
+
+ if (ownerType.isUndefined()) {
+ throw new TypeException("FieldExpresssion.typeCheck : unbound owner type for field " + fieldName + getPos());
}
- String fieldName = fieldNames[i];
+
+ Class ownerClazz = ownerType.getTargetClass();
+ Class valueClass = null;
+
try {
- fields[i] = ownerClazz.getField(fieldName);
+ field = ownerClazz.getField(fieldName);
} catch (NoSuchFieldException e) {
throw new TypeException("FieldExpresssion.typeCheck : invalid field reference " + fieldName + getPos());
}
- valueClass = fields[i].getType();
- valueType = getTypeGroup().ensureType(valueClass);
- }
+ valueClass = field.getType();
+ type = getTypeGroup().ensureType(valueClass);
- type = valueType;
+ if (Type.dereference(expected).isDefined() && !expected.isAssignableFrom(type)) {
+ throw new TypeException("FieldExpresssion.typeCheck : invalid expected type " + expected.getName() + getPos());
+ }
- if (Type.dereference(expected).isDefined() && !expected.isAssignableFrom(type)) {
- throw new TypeException("FieldExpresssion.typeCheck : invalid expected type " + expected.getName() + getPos());
+ return type;
}
-
- return type;
}
public Object interpret(Rule.BasicHelper helper) throws ExecuteException
{
- try {
- // TODO the reference should really be an expression?
- Object value = helper.getBinding(ref);
+ if (indirectStatic) {
+ return owner.interpret(helper);
+ } else {
+ try {
+ // TODO the reference should really be an expression?
+ Object value = owner.interpret(helper);
- int fieldCount = fields.length;
- for (int i = 0; i < fieldCount; i++) {
if (value == null) {
throw new ExecuteException("FieldExpression.interpret : attempted field indirection through null value " + token.getText() + getPos());
}
- value = fields[i].get(value);
+
+ return field.get(value);
+ } catch (ExecuteException e) {
+ throw e;
+ } catch (IllegalAccessException e) {
+ throw new ExecuteException("FieldExpression.interpret : error accessing field " + fieldName + getPos(), e);
+ } catch (Exception e) {
+ throw new ExecuteException("FieldExpression.interpret : unexpected exception accessing field " + fieldName + getPos(), e);
}
+ }
+ }
- return value;
- } catch (ExecuteException e) {
- throw e;
- } catch (IllegalAccessException e) {
- throw new ExecuteException("FieldExpression.interpret : error accessing field " + token.getText() + getPos(), e);
- } catch (Exception e) {
- throw new ExecuteException("FieldExpression.interpret : unexpected exception accessing field " + token.getText() + getPos(), e);
+ public String getPath(int len)
+ {
+ StringBuffer buffer = new StringBuffer();
+ buffer.append(pathList[0]);
+
+ for (int i = 1; i < len; i++) {
+ buffer.append(".");
+ buffer.append(pathList[i]);
}
+ return buffer.toString();
}
+ public int getPathCount(String name)
+ {
+ int charMax = name.length();
+ int charCount = 0;
+ int dotExtra = 0;
+ int idx;
+ for (idx = 0; idx < pathList.length; idx++) {
+ charCount += (dotExtra + pathList[idx].length());
+ if (charCount > charMax) {
+ break;
+ }
+ }
+ return idx;
+ }
+
public void writeTo(StringWriter stringWriter) {
- stringWriter.write(ref);
- for (String field : fieldNames) {
- stringWriter.write(".");
- stringWriter.write(field);
+ // we normally have a owner expression but before binding we have a path
+ if (owner != null) {
+ owner.writeTo(stringWriter);
+ } else {
+ String sepr = "";
+ for (String field : pathList) {
+ stringWriter.write(sepr);
+ stringWriter.write(field);
+ sepr =".";
+ }
}
+ stringWriter.write(".");
+ stringWriter.write(fieldName);
}
- private String ref;
- private String[] fieldNames;
- private Type[] ownerType;
- private Field[] fields;
+ private Expression owner;
+ private String[] pathList;
+ private String fieldName;
+ private Type ownerType;
+ private Field field;
+ private boolean indirectStatic;
}
\ No newline at end of file
Modified: labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/LogicalExpression.java
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/LogicalExpression.java 2008-10-16 05:58:54 UTC (rev 23470)
+++ labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/LogicalExpression.java 2008-10-16 07:28:17 UTC (rev 23471)
@@ -24,19 +24,17 @@
package org.jboss.jbossts.orchestration.rule.expression;
import org.jboss.jbossts.orchestration.rule.type.Type;
-import org.jboss.jbossts.orchestration.rule.type.TypeGroup;
-import org.jboss.jbossts.orchestration.rule.binding.Bindings;
import org.jboss.jbossts.orchestration.rule.exception.TypeException;
import org.jboss.jbossts.orchestration.rule.exception.ExecuteException;
import org.jboss.jbossts.orchestration.rule.Rule;
-import org.antlr.runtime.Token;
+import org.jboss.jbossts.orchestration.rule.grammar.ParseNode;
/**
* A binary logical operator expression
*/
public class LogicalExpression extends BooleanExpression
{
- public LogicalExpression(Rule rule, int oper, Token token, Expression left, Expression right)
+ public LogicalExpression(Rule rule, int oper, ParseNode token, Expression left, Expression right)
{
super(rule, oper, token, left, right);
}
Modified: labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/MethodExpression.java
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/MethodExpression.java 2008-10-16 05:58:54 UTC (rev 23470)
+++ labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/MethodExpression.java 2008-10-16 07:28:17 UTC (rev 23471)
@@ -25,29 +25,31 @@
import org.jboss.jbossts.orchestration.rule.type.Type;
import org.jboss.jbossts.orchestration.rule.type.TypeGroup;
-import org.jboss.jbossts.orchestration.rule.binding.Bindings;
+import org.jboss.jbossts.orchestration.rule.binding.Binding;
import org.jboss.jbossts.orchestration.rule.exception.TypeException;
import org.jboss.jbossts.orchestration.rule.exception.ExecuteException;
import org.jboss.jbossts.orchestration.rule.Rule;
-import org.antlr.runtime.Token;
+import org.jboss.jbossts.orchestration.rule.grammar.ParseNode;
import java.util.List;
import java.util.Iterator;
import java.util.ArrayList;
import java.io.StringWriter;
import java.lang.reflect.Method;
-import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Modifier;
/**
* an expression which identifies a method invocation
*/
public class MethodExpression extends Expression
{
- public MethodExpression(Rule rule, Type type, Token token, String name, Expression recipient, List<Expression> arguments) {
+ public MethodExpression(Rule rule, Type type, ParseNode token, Expression recipient, List<Expression> arguments, String[] pathList) {
super(rule, type, token);
- this.name = name;
+ this.name = token.getText();
this.recipient = recipient;
this.arguments = arguments;
this.argumentTypes = null;
+ this.rootType = null;
+ this.pathList = pathList;
}
/**
@@ -63,7 +65,26 @@
boolean valid = true;
if (recipient != null) {
+ // ok, we have a supplied recipient
valid &= recipient.bind();
+ } else if (pathList != null) {
+ // see if the path starts with a bound variable and, if so, treat the path as a series
+ // of field references and construct a owner expression from it.
+ String leading = pathList[0];
+ Binding binding = getBindings().lookup(leading);
+ if (binding != null) {
+ // create a sequence of field expressions and make it the recipient
+
+ int l = pathList.length;
+ Expression recipient = new Variable(rule, binding.getType(), token, binding.getName());
+ for (int idx = 1; idx < l; idx++) {
+ recipient = new FieldExpression(rule, Type.UNDEFINED, token, pathList[idx], recipient, null);
+ }
+ this.recipient = recipient;
+ this.pathList = null;
+ // not strictly necessary?
+ this.recipient.bind();
+ }
}
Iterator<Expression> iterator = arguments.iterator();
@@ -81,14 +102,66 @@
// without having to do any special case processing.
TypeGroup typeGroup = getTypeGroup();
+
+ if (recipient == null && pathList != null) {
+ // treat the pathlist as a typename or a static field dereference possibly combined with
+ // further field dereferences
+
+ // factor off a typename from the path
+ Type rootType = typeGroup.match(pathList);
+ if (rootType == null) {
+ throw new TypeException("FieldExpression.typeCheck : invalid path " + getPath(pathList.length) + " to static method " + name + getPos());
+ }
+
+ // find out how many of the path elements are included in the type name
+
+ String rootTypeName = rootType.getName();
+
+ int idx = getPathCount(rootTypeName);
+
+ if (idx < pathList.length) {
+ // create a static field reference using the type name and the first field name and wrap it with
+ // enough field references to use up all the path
+
+ String fieldName = pathList[idx++];
+ Expression recipient = new StaticExpression(rule, Type.UNDEFINED, token, fieldName, rootTypeName);
+ while (idx < pathList.length) {
+ recipient = new FieldExpression(rule, Type.UNDEFINED, token, pathList[idx++], recipient, null);
+ }
+ this.recipient = recipient;
+ } else {
+ // ok, this method reference is actually a static method call -- record the root type for later
+ this.recipient = null;
+ this.rootType = rootType;
+ }
+ // get rid of the path list now
+ this.pathList = null;
+ // not strictly necessary?
+ if (this.recipient != null) {
+ this.recipient.bind();
+ }
+ }
+
+ // if we don't have a recipient and we didn't find a static class for the method then this is
+ // a builtin
+
if (recipient == null) {
- Type ruleType = typeGroup.create("org.jboss.jbossts.orchestration.rule.Rule$Helper");
- recipient = new DollarExpression(rule, ruleType, token, "$-1");
+ if (rootType == null) {
+ Type ruleType = typeGroup.create("org.jboss.jbossts.orchestration.rule.Rule$Helper");
+ recipient = new DollarExpression(rule, ruleType, token, -1);
+
+ rootType = recipient.typeCheck(Type.UNDEFINED);
+ }
+ } else {
+ rootType = recipient.typeCheck(Type.UNDEFINED);
}
- // check the recipient type is defined and then look for a relevant method
- Type recipientType = recipient.typeCheck(Type.UNDEFINED);
- Class clazz = recipientType.getTargetClass();
+ // ok the only way we fail to have a recipient now is because this is a static call
+
+ boolean isStatic = (recipient == null);
+
+ Class clazz = rootType.getTargetClass();
+
// if we can find a unique method then we can use it to type the parameters
// otherwise we do it the hard way
int arity = arguments.size();
@@ -97,9 +170,13 @@
boolean duplicates = false;
for (Method method : methods) {
- if (method.getName().equals(name) &&
- method.getParameterTypes().length == arity) {
- candidates.add(method);
+ int modifiers = method.getModifiers();
+ // ensure we only look at static or non static methods as appropriate
+ if (Modifier.isStatic(modifiers) == isStatic) {
+ if (method.getName().equals(name) &&
+ method.getParameterTypes().length == arity) {
+ candidates.add(method);
+ }
}
}
@@ -109,7 +186,7 @@
// use that as the type to check against
for (int i = 0; i < arguments.size() ; i++) {
if (candidates.isEmpty()) {
- throw new TypeException("MethodExpression.typeCheck : invalid method " + name + " for target class " + recipientType.getName() + getPos());
+ throw new TypeException("MethodExpression.typeCheck : invalid method " + name + " for target class " + rootType.getName() + getPos());
}
// TODO get and prune operations do not allow for coercion but type check does!
@@ -133,11 +210,11 @@
}
if (candidates.isEmpty()) {
- throw new TypeException("MethodExpression.typeCheck : invalid method " + name + " for target class " + recipientType.getName() + getPos());
+ throw new TypeException("MethodExpression.typeCheck : invalid method " + name + " for target class " + rootType.getName() + getPos());
}
if (candidates.size() > 1) {
- throw new TypeException("MethodExpression.typeCheck : ambiguous method signature " + name + " for target class " + recipientType.getName() + getPos());
+ throw new TypeException("MethodExpression.typeCheck : ambiguous method signature " + name + " for target class " + rootType.getName() + getPos());
}
method = candidates.get(0);
@@ -205,6 +282,33 @@
return candidates;
}
+ public String getPath(int len)
+ {
+ StringBuffer buffer = new StringBuffer();
+ buffer.append(pathList[0]);
+
+ for (int i = 1; i < len; i++) {
+ buffer.append(".");
+ buffer.append(pathList[i]);
+ }
+ return buffer.toString();
+ }
+
+ public int getPathCount(String name)
+ {
+ int charMax = name.length();
+ int charCount = 0;
+ int dotExtra = 0;
+ int idx;
+ for (idx = 0; idx < pathList.length; idx++) {
+ charCount += (dotExtra + pathList[idx].length());
+ if (charCount > charMax) {
+ break;
+ }
+ }
+ return idx;
+ }
+
public void writeTo(StringWriter stringWriter) {
if (recipient != null) {
recipient.writeTo(stringWriter);
@@ -225,5 +329,7 @@
private List<Expression> arguments;
private List<Type> argumentTypes;
private Expression recipient;
+ private Type rootType;
private Method method;
+ String[] pathList;
}
Copied: labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/MinusExpression.java (from rev 23243, labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/TwiddleExpression.java)
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/MinusExpression.java (rev 0)
+++ labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/MinusExpression.java 2008-10-16 07:28:17 UTC (rev 23471)
@@ -0,0 +1,75 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*
+* @authors Andrew Dinn
+*/
+package org.jboss.jbossts.orchestration.rule.expression;
+
+import org.jboss.jbossts.orchestration.rule.type.Type;
+import org.jboss.jbossts.orchestration.rule.exception.TypeException;
+import org.jboss.jbossts.orchestration.rule.exception.ExecuteException;
+import org.jboss.jbossts.orchestration.rule.Rule;
+import org.jboss.jbossts.orchestration.rule.grammar.ParseNode;
+
+/**
+ */
+public class MinusExpression extends UnaryOperExpression
+{
+ public MinusExpression(Rule rule, ParseNode token, Expression operand)
+ {
+ super(rule, UMINUS, operand.getType(), token, operand);
+ }
+
+ public Type typeCheck(Type expected)
+ throws TypeException {
+ type = getOperand(0).typeCheck(Type.N);
+ if (Type.dereference(expected).isDefined() && !expected.isAssignableFrom(type)) {
+ throw new TypeException("MinusExpression.typeCheck() : invalid result type : " + expected.getName() + getPos());
+ }
+ return type;
+ }
+
+ public Object interpret(Rule.BasicHelper helper) throws ExecuteException {
+ try {
+ Number value = (Number)getOperand(0).interpret(helper);
+
+ if (type == Type.B) {
+ return (byte)-value.intValue();
+ } else if (type == Type.S) {
+ return (short)-value.intValue();
+ } else if (type == Type.I) {
+ return -value.intValue();
+ } else if (type == Type.J) {
+ return -value.longValue();
+ } else if (type == Type.F) {
+ return -value.longValue();
+ } else if (type == Type.D) {
+ return -value.longValue();
+ } else { // (type == Type.C)
+ return -value.intValue();
+ }
+ } catch (ExecuteException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new ExecuteException("MinusExpression.typeCheck() : unexpected exception : " + token.getText() + getPos(), e);
+ }
+ }
+}
\ No newline at end of file
Modified: labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/NotExpression.java
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/NotExpression.java 2008-10-16 05:58:54 UTC (rev 23470)
+++ labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/NotExpression.java 2008-10-16 07:28:17 UTC (rev 23471)
@@ -24,18 +24,16 @@
package org.jboss.jbossts.orchestration.rule.expression;
import org.jboss.jbossts.orchestration.rule.type.Type;
-import org.jboss.jbossts.orchestration.rule.type.TypeGroup;
-import org.jboss.jbossts.orchestration.rule.binding.Bindings;
import org.jboss.jbossts.orchestration.rule.exception.TypeException;
import org.jboss.jbossts.orchestration.rule.exception.ExecuteException;
import org.jboss.jbossts.orchestration.rule.Rule;
-import org.antlr.runtime.Token;
+import org.jboss.jbossts.orchestration.rule.grammar.ParseNode;
/**
*/
public class NotExpression extends UnaryOperExpression
{
- public NotExpression(Rule rule, Token token, Expression operand)
+ public NotExpression(Rule rule, ParseNode token, Expression operand)
{
super(rule, NOT, Type.BOOLEAN, token, operand);
}
Modified: labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/NumericLiteral.java
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/NumericLiteral.java 2008-10-16 05:58:54 UTC (rev 23470)
+++ labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/NumericLiteral.java 2008-10-16 07:28:17 UTC (rev 23471)
@@ -24,12 +24,10 @@
package org.jboss.jbossts.orchestration.rule.expression;
import org.jboss.jbossts.orchestration.rule.type.Type;
-import org.jboss.jbossts.orchestration.rule.type.TypeGroup;
-import org.jboss.jbossts.orchestration.rule.binding.Bindings;
import org.jboss.jbossts.orchestration.rule.exception.TypeException;
import org.jboss.jbossts.orchestration.rule.exception.ExecuteException;
import org.jboss.jbossts.orchestration.rule.Rule;
-import org.antlr.runtime.Token;
+import org.jboss.jbossts.orchestration.rule.grammar.ParseNode;
import java.io.StringWriter;
@@ -38,10 +36,10 @@
public class NumericLiteral extends Expression
{
- public NumericLiteral(Rule rule, Token token) {
- super(rule, check(token.getText()), token);
+ public NumericLiteral(Rule rule, Type type, ParseNode token) {
+ super(rule, type, token);
- this.text = token.getText();
+ this.value = token.getChild(0);
}
/**
@@ -53,21 +51,7 @@
* been detected during inference/validation.
*/
public boolean bind() {
- // no bindings to check but stash a valid value to help with type checking
- if (type == Type.FLOAT) {
- value = Float.valueOf(text);
- } else if (type == Type.DOUBLE) {
- value = Float.valueOf(text);
- } else if (type == Type.INTEGER) {
- value = Integer.valueOf(text);
- } else if (type == Type.LONG) {
- value = Long.valueOf(text);
- } else {
- // should not happen!
- value = Integer.valueOf("0");
- System.err.println("NumericLiteral.bind : invalid number format " + text + getPos());
- return false;
- }
+ // no bindings to check
return true;
}
@@ -83,54 +67,8 @@
}
public void writeTo(StringWriter stringWriter) {
- stringWriter.write(text);
+ stringWriter.write(value.toString());
}
- private static Type check(String text)
- {
- if (text.contains("e") | text.contains("E") | text.contains(".")) {
- return checkFloat(text);
- } else {
- return checkInt(text);
- }
- }
-
- private static Type checkFloat(String text)
- {
- try {
- Float.valueOf(text);
- return Type.FLOAT;
- } catch (NumberFormatException e) {
- // ok retry as Double
- try {
- Double.valueOf(text);
- return Type.DOUBLE;
- } catch (NumberFormatException e1) {
- // should not happen!
- System.err.println("NumericLiteral.checkFloat : invalid float format " + text);
- return Type.NUMBER;
- }
- }
- }
-
- private static Type checkInt(String text)
- {
- try {
- Integer.decode(text);
- return Type.INTEGER;
- } catch (NumberFormatException e) {
- // ok retry as Double
- try {
- Long.decode(text);
- return Type.LONG;
- } catch (NumberFormatException e1) {
- // should not happen!
- System.err.println("NumericLiteral.checkInt : invalid integer format " + text);
- return Type.NUMBER;
- }
- }
- }
-
- private String text;
private Object value;
}
Modified: labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/OperExpression.java
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/OperExpression.java 2008-10-16 05:58:54 UTC (rev 23470)
+++ labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/OperExpression.java 2008-10-16 07:28:17 UTC (rev 23471)
@@ -23,13 +23,10 @@
*/
package org.jboss.jbossts.orchestration.rule.expression;
-import org.antlr.runtime.Token;
import org.jboss.jbossts.orchestration.rule.type.Type;
-import org.jboss.jbossts.orchestration.rule.exception.TypeException;
-import org.jboss.jbossts.orchestration.rule.exception.ParseException;
import org.jboss.jbossts.orchestration.rule.Rule;
+import org.jboss.jbossts.orchestration.rule.grammar.ParseNode;
-import java.util.Iterator;
import java.io.StringWriter;
/**
@@ -37,7 +34,7 @@
*/
public abstract class OperExpression extends Expression
{
- OperExpression(Rule rule, int oper, Type type, Token token)
+ OperExpression(Rule rule, int oper, Type type, ParseNode token)
{
super(rule, type, token);
@@ -67,7 +64,7 @@
stringWriter.write(" ");
getOperand(1).writeTo(stringWriter);
stringWriter.write(")");
- } else if (oper == IF) {
+ } else if (oper == COND) {
// we only have one ternary operator
stringWriter.write("(");
getOperand(0).writeTo(stringWriter);
@@ -115,23 +112,25 @@
final public static int AND = 0x0041 | BINARY;
final public static int EQ = 0x0080 | BINARY;
- final public static int NEQ = 0x0081 | BINARY;
+ final public static int NE = 0x0081 | BINARY;
final public static int GT = 0x0082 | BINARY;
final public static int LT = 0x0083 | BINARY;
- final public static int GEQ = 0x0084 | BINARY;
- final public static int LEQ = 0x0085 | BINARY;
+ final public static int GE = 0x0084 | BINARY;
+ final public static int LE = 0x0085 | BINARY;
final public static int BOR = 0x0100 | BINARY;
final public static int BAND = 0x0101 | BINARY;
final public static int BXOR = 0x0102 | BINARY;
+ final public static int UMINUS = 0x0200 | UNARY;
+
final public static int MUL = 0x0201 | BINARY;
final public static int DIV = 0x0202 | BINARY;
final public static int PLUS = 0x0203| BINARY;
final public static int MINUS = 0x0204 | BINARY;
final public static int MOD = 0x0205 | BINARY;
- final public static int IF = 0x0400 | TERNARY;
+ final public static int COND = 0x0400 | TERNARY;
final private static int[] operands = {
NOT,
@@ -139,44 +138,46 @@
OR,
AND,
EQ,
- NEQ,
+ NE,
GT,
LT,
- GEQ,
- LEQ,
+ GE,
+ LE,
BOR,
BAND,
BXOR,
+ UMINUS,
MUL,
DIV,
PLUS,
MINUS,
MOD,
- IF
+ COND
};
- /* parser operands ar enot allocated rationally so we convert usingthis table */
+ /* parser operands are not allocated rationally so we convert using this table */
final private static int[] parserOperands = {
- org.jboss.jbossts.orchestration.rule.grammar.ECAGrammarParser.NOT,
- org.jboss.jbossts.orchestration.rule.grammar.ECAGrammarParser.TWIDDLE,
- org.jboss.jbossts.orchestration.rule.grammar.ECAGrammarParser.OR,
- org.jboss.jbossts.orchestration.rule.grammar.ECAGrammarParser.AND,
- org.jboss.jbossts.orchestration.rule.grammar.ECAGrammarParser.EQ,
- org.jboss.jbossts.orchestration.rule.grammar.ECAGrammarParser.NEQ,
- org.jboss.jbossts.orchestration.rule.grammar.ECAGrammarParser.GT,
- org.jboss.jbossts.orchestration.rule.grammar.ECAGrammarParser.LT,
- org.jboss.jbossts.orchestration.rule.grammar.ECAGrammarParser.GEQ,
- org.jboss.jbossts.orchestration.rule.grammar.ECAGrammarParser.LEQ,
- org.jboss.jbossts.orchestration.rule.grammar.ECAGrammarParser.BOR,
- org.jboss.jbossts.orchestration.rule.grammar.ECAGrammarParser.BAND,
- org.jboss.jbossts.orchestration.rule.grammar.ECAGrammarParser.BXOR,
- org.jboss.jbossts.orchestration.rule.grammar.ECAGrammarParser.MUL,
- org.jboss.jbossts.orchestration.rule.grammar.ECAGrammarParser.DIV,
- org.jboss.jbossts.orchestration.rule.grammar.ECAGrammarParser.PLUS,
- org.jboss.jbossts.orchestration.rule.grammar.ECAGrammarParser.MINUS,
- org.jboss.jbossts.orchestration.rule.grammar.ECAGrammarParser.MOD,
- org.jboss.jbossts.orchestration.rule.grammar.ECAGrammarParser.IF
+ org.jboss.jbossts.orchestration.rule.grammar.ParseNode.NOT,
+ org.jboss.jbossts.orchestration.rule.grammar.ParseNode.TWIDDLE,
+ org.jboss.jbossts.orchestration.rule.grammar.ParseNode.OR,
+ org.jboss.jbossts.orchestration.rule.grammar.ParseNode.AND,
+ org.jboss.jbossts.orchestration.rule.grammar.ParseNode.EQ,
+ org.jboss.jbossts.orchestration.rule.grammar.ParseNode.NE,
+ org.jboss.jbossts.orchestration.rule.grammar.ParseNode.GT,
+ org.jboss.jbossts.orchestration.rule.grammar.ParseNode.LT,
+ org.jboss.jbossts.orchestration.rule.grammar.ParseNode.GE,
+ org.jboss.jbossts.orchestration.rule.grammar.ParseNode.LE,
+ org.jboss.jbossts.orchestration.rule.grammar.ParseNode.BOR,
+ org.jboss.jbossts.orchestration.rule.grammar.ParseNode.BAND,
+ org.jboss.jbossts.orchestration.rule.grammar.ParseNode.BXOR,
+ org.jboss.jbossts.orchestration.rule.grammar.ParseNode.UMINUS,
+ org.jboss.jbossts.orchestration.rule.grammar.ParseNode.MUL,
+ org.jboss.jbossts.orchestration.rule.grammar.ParseNode.DIV,
+ org.jboss.jbossts.orchestration.rule.grammar.ParseNode.PLUS,
+ org.jboss.jbossts.orchestration.rule.grammar.ParseNode.MINUS,
+ org.jboss.jbossts.orchestration.rule.grammar.ParseNode.MOD,
+ org.jboss.jbossts.orchestration.rule.grammar.ParseNode.COND
};
final private static String[] operandNames = {
@@ -193,6 +194,7 @@
"|",
"&",
"^",
+ "-",
"*",
"/",
"+",
Modified: labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/PlusExpression.java
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/PlusExpression.java 2008-10-16 05:58:54 UTC (rev 23470)
+++ labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/PlusExpression.java 2008-10-16 07:28:17 UTC (rev 23471)
@@ -24,12 +24,10 @@
package org.jboss.jbossts.orchestration.rule.expression;
import org.jboss.jbossts.orchestration.rule.type.Type;
-import org.jboss.jbossts.orchestration.rule.type.TypeGroup;
-import org.jboss.jbossts.orchestration.rule.binding.Bindings;
import org.jboss.jbossts.orchestration.rule.exception.TypeException;
import org.jboss.jbossts.orchestration.rule.exception.ExecuteException;
import org.jboss.jbossts.orchestration.rule.Rule;
-import org.antlr.runtime.Token;
+import org.jboss.jbossts.orchestration.rule.grammar.ParseNode;
/**
* A plus operator expression which handles the case where we do not know the type of the first
@@ -38,7 +36,7 @@
*/
public class PlusExpression extends BinaryOperExpression
{
- public PlusExpression(Rule rule, Token token, Expression left, Expression right)
+ public PlusExpression(Rule rule, ParseNode token, Expression left, Expression right)
{
super(rule, PLUS, Type.UNDEFINED, token, left, right);
}
Modified: labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/ReturnExpression.java
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/ReturnExpression.java 2008-10-16 05:58:54 UTC (rev 23470)
+++ labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/ReturnExpression.java 2008-10-16 07:28:17 UTC (rev 23471)
@@ -23,15 +23,13 @@
*/
package org.jboss.jbossts.orchestration.rule.expression;
-import org.jboss.jbossts.orchestration.rule.binding.Bindings;
import org.jboss.jbossts.orchestration.rule.binding.Binding;
import org.jboss.jbossts.orchestration.rule.type.Type;
-import org.jboss.jbossts.orchestration.rule.type.TypeGroup;
import org.jboss.jbossts.orchestration.rule.exception.TypeException;
import org.jboss.jbossts.orchestration.rule.exception.ExecuteException;
import org.jboss.jbossts.orchestration.rule.exception.EarlyReturnException;
import org.jboss.jbossts.orchestration.rule.Rule;
-import org.antlr.runtime.Token;
+import org.jboss.jbossts.orchestration.rule.grammar.ParseNode;
import java.io.StringWriter;
@@ -44,7 +42,7 @@
{
private Expression returnValue;
- public ReturnExpression(Rule rule, Token token, Expression returnValue)
+ public ReturnExpression(Rule rule, ParseNode token, Expression returnValue)
{
// the trigger method may return any old tyep but the return expression can only occur
// at the top level in a rule action seuqence so it is actually a VOID expression
Modified: labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/StaticExpression.java
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/StaticExpression.java 2008-10-16 05:58:54 UTC (rev 23470)
+++ labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/StaticExpression.java 2008-10-16 07:28:17 UTC (rev 23471)
@@ -23,28 +23,27 @@
*/
package org.jboss.jbossts.orchestration.rule.expression;
-import org.jboss.jbossts.orchestration.rule.binding.Bindings;
import org.jboss.jbossts.orchestration.rule.type.Type;
import org.jboss.jbossts.orchestration.rule.type.TypeGroup;
import org.jboss.jbossts.orchestration.rule.exception.TypeException;
import org.jboss.jbossts.orchestration.rule.exception.ExecuteException;
import org.jboss.jbossts.orchestration.rule.Rule;
-import org.antlr.runtime.Token;
+import org.jboss.jbossts.orchestration.rule.grammar.ParseNode;
import java.io.StringWriter;
import java.lang.reflect.Field;
/**
- * an expression which identifies aa static field reference
+ * an expression which identifies a static field reference
*/
public class StaticExpression extends Expression
{
- public StaticExpression(Rule rule, Type type, Token token, String[] path) {
+ public StaticExpression(Rule rule, Type type, ParseNode token, String fieldName, String ownerTypeName) {
// type is the type of static field
super(rule, type, token);
- this.path = path;
- this.fieldNames = null;
- this.ownerTypes = null;
+ this.ownerTypeName = ownerTypeName;
+ this.fieldName = fieldName;
+ this.ownerType = null;
}
/**
@@ -62,54 +61,24 @@
}
public Type typeCheck(Type expected) throws TypeException {
- // look for a class whose name matches some initial segment of path
+ // look for a class whose name matches some initial segment of pathList
TypeGroup typeGroup = getTypeGroup();
- Type rootType = typeGroup.match(path);
- if (rootType == null) {
- throw new TypeException("StaticExpression.typeCheck : invalid path to static field " + getPath(path.length) + getPos());
+ ownerType = Type.dereference(typeGroup.create(ownerTypeName));
+ if (ownerType.isUndefined()) {
+ throw new TypeException("StaticExpression.typeCheck : invalid path " + ownerTypeName + " to static field " + fieldName + getPos());
}
- // find out which path elements constitute the type name
- int length = rootType.getName().length();
- int pathLength = path.length;
- int idx = 0;
- int count;
- for (count = 0; count < length;) {
- if (idx != 0) {
- count += 1;
- }
- count += path[idx++].length();
+ Class clazz = ownerType.getTargetClass();
+ try {
+ field = clazz.getField(fieldName);
+ } catch (NoSuchFieldException e) {
+ // oops
+ throw new TypeException("StaticExpression.typeCheck : invalid field name " + fieldName + getPos());
}
- // we need at least one left over element for the field name
+ clazz = field.getType();
+ type = typeGroup.ensureType(clazz);
- if (idx < pathLength - 1) {
- throw new TypeException("StaticExpression.typeCheck : invalid static field name " + getPath(path.length) + getPos());
- }
-
- int fieldCount = pathLength - idx;
- fieldNames = new String[fieldCount];
- fields = new Field[fieldCount];
- ownerTypes = new Type[fieldCount];
- int fieldIdx;
- for (fieldIdx = 0; fieldIdx < fieldCount; fieldIdx++) {
- fieldNames[fieldIdx] = path[idx++];
- }
- Type valueType = rootType;
- for (idx = 0; idx < fieldCount; idx++)
- {
- ownerTypes[idx] = valueType;
- Class clazz = valueType.getTargetClass();
- try {
- fields[idx] = clazz.getField(fieldNames[idx]);
- } catch (NoSuchFieldException e) {
- // oops
- throw new TypeException("StaticExpression.typeCheck : invalid field name " + fieldNames[idx] + getPos());
- }
- clazz = fields[idx].getType();
- valueType = typeGroup.ensureType(clazz);
- }
- type = valueType;
if (Type.dereference(expected).isDefined() && !expected.isAssignableFrom(type)) {
throw new TypeException("StaticExpression.typeCheck : invalid expected return type " + expected.getName() + getPos());
}
@@ -118,43 +87,20 @@
public Object interpret(Rule.BasicHelper helper) throws ExecuteException {
try {
- Object value = fields[0].get(null);
-
- for (int i = 1; i < ownerTypes.length; i++) {
- if (value == null) {
- throw new ExecuteException("StaticExpression.interpret : attempted field indirection through null value " + token.getText() + getPos());
- }
- value = fields[i].get(value);
- }
- return value;
+ return field.get(null);
} catch (ExecuteException e) {
throw e;
} catch (IllegalAccessException e) {
- throw new ExecuteException("StaticExpression.interpret : error accessing field " + token.getText() + getPos(), e);
+ throw new ExecuteException("StaticExpression.interpret : error accessing field " + ownerTypeName + "." + fieldName + getPos(), e);
} catch (Exception e) {
- throw new ExecuteException("StaticExpression.interpret : unexpected exception accessing field " + token.getText() + getPos(), e);
+ throw new ExecuteException("StaticExpression.interpret : unexpected exception accessing field " + ownerTypeName + "." + fieldName + getPos(), e);
}
}
- public String getPath(int len)
- {
- StringBuffer buffer = new StringBuffer();
- buffer.append(path[0]);
-
- for (int i = 1; i < len; i++) {
- buffer.append(".");
- buffer.append(path[i]);
- }
- return buffer.toString();
- }
-
public void writeTo(StringWriter stringWriter) {
- String sepr = "";
- for (String element : path) {
- stringWriter.write(sepr);
- stringWriter.write(element);
- sepr = ".";
- }
+ stringWriter.write(ownerTypeName);
+ stringWriter.write(".");
+ stringWriter.write(fieldName);
}
/**
@@ -162,8 +108,8 @@
* field name and subordinate field references
*/
- private String path[];
- private String fieldNames[];
- private Field fields[];
- private Type ownerTypes[];
+ private String ownerTypeName;
+ private String fieldName;
+ private Field field;
+ private Type ownerType;
}
\ No newline at end of file
Modified: labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/StringLiteral.java
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/StringLiteral.java 2008-10-16 05:58:54 UTC (rev 23470)
+++ labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/StringLiteral.java 2008-10-16 07:28:17 UTC (rev 23471)
@@ -24,12 +24,10 @@
package org.jboss.jbossts.orchestration.rule.expression;
import org.jboss.jbossts.orchestration.rule.type.Type;
-import org.jboss.jbossts.orchestration.rule.type.TypeGroup;
-import org.jboss.jbossts.orchestration.rule.binding.Bindings;
import org.jboss.jbossts.orchestration.rule.exception.TypeException;
import org.jboss.jbossts.orchestration.rule.exception.ExecuteException;
import org.jboss.jbossts.orchestration.rule.Rule;
-import org.antlr.runtime.Token;
+import org.jboss.jbossts.orchestration.rule.grammar.ParseNode;
import java.io.StringWriter;
@@ -38,7 +36,7 @@
*/
public class StringLiteral extends Expression
{
- public StringLiteral(Rule rule, Token token)
+ public StringLiteral(Rule rule, ParseNode token)
{
super(rule, Type.STRING, token);
Modified: labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/StringPlusExpression.java
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/StringPlusExpression.java 2008-10-16 05:58:54 UTC (rev 23470)
+++ labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/StringPlusExpression.java 2008-10-16 07:28:17 UTC (rev 23471)
@@ -24,19 +24,17 @@
package org.jboss.jbossts.orchestration.rule.expression;
import org.jboss.jbossts.orchestration.rule.type.Type;
-import org.jboss.jbossts.orchestration.rule.type.TypeGroup;
-import org.jboss.jbossts.orchestration.rule.binding.Bindings;
import org.jboss.jbossts.orchestration.rule.exception.TypeException;
import org.jboss.jbossts.orchestration.rule.exception.ExecuteException;
import org.jboss.jbossts.orchestration.rule.Rule;
-import org.antlr.runtime.Token;
+import org.jboss.jbossts.orchestration.rule.grammar.ParseNode;
/**
* A binary string concatenation operator expression
*/
public class StringPlusExpression extends BinaryOperExpression
{
- public StringPlusExpression(Rule rule, Token token, Expression left, Expression right)
+ public StringPlusExpression(Rule rule, ParseNode token, Expression left, Expression right)
{
super(rule, PLUS, Type.STRING, token, left, right);
}
Modified: labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/TernaryOperExpression.java
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/TernaryOperExpression.java 2008-10-16 05:58:54 UTC (rev 23470)
+++ labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/TernaryOperExpression.java 2008-10-16 07:28:17 UTC (rev 23471)
@@ -24,17 +24,15 @@
package org.jboss.jbossts.orchestration.rule.expression;
import org.jboss.jbossts.orchestration.rule.type.Type;
-import org.jboss.jbossts.orchestration.rule.binding.Bindings;
-import org.jboss.jbossts.orchestration.rule.exception.TypeException;
import org.jboss.jbossts.orchestration.rule.Rule;
-import org.antlr.runtime.Token;
+import org.jboss.jbossts.orchestration.rule.grammar.ParseNode;
/**
* ternary operators includes conditional evaluation operator 'cond ? if_expr : else_expr'
*/
public abstract class TernaryOperExpression extends OperExpression
{
- public TernaryOperExpression(Rule rule, int oper, Type type, Token token, Expression operand1,
+ public TernaryOperExpression(Rule rule, int oper, Type type, ParseNode token, Expression operand1,
Expression operand2, Expression operand3)
{
super(rule, oper, type, token);
Modified: labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/ThrowExpression.java
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/ThrowExpression.java 2008-10-16 05:58:54 UTC (rev 23470)
+++ labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/ThrowExpression.java 2008-10-16 07:28:17 UTC (rev 23471)
@@ -23,30 +23,24 @@
*/
package org.jboss.jbossts.orchestration.rule.expression;
-import org.jboss.jbossts.orchestration.rule.binding.Bindings;
import org.jboss.jbossts.orchestration.rule.type.Type;
import org.jboss.jbossts.orchestration.rule.type.TypeGroup;
import org.jboss.jbossts.orchestration.rule.exception.TypeException;
import org.jboss.jbossts.orchestration.rule.exception.ExecuteException;
import org.jboss.jbossts.orchestration.rule.exception.ThrowException;
import org.jboss.jbossts.orchestration.rule.Rule;
-import org.antlr.runtime.Token;
+import org.jboss.jbossts.orchestration.rule.grammar.ParseNode;
import java.io.StringWriter;
import java.util.List;
import java.util.Iterator;
import java.util.ArrayList;
-import java.util.ListIterator;
-import java.lang.reflect.Method;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
/**
- * Created by IntelliJ IDEA.
- * User: adinn
- * Date: 30-Sep-2008
- * Time: 11:12:41
- * To change this template use File | Settings | File Templates.
+ * Expression which implements a throw from a rule action but only where the thrown exception is
+ * declared by the trigger method or is a runtime exception which does nto need ot be declared
*/
public class ThrowExpression extends Expression
{
@@ -55,9 +49,9 @@
private List<Type> argumentTypes;
private Constructor constructor;
- public ThrowExpression(Rule rule, String typeName, Token token, List<Expression> arguments) {
+ public ThrowExpression(Rule rule, ParseNode token, List<Expression> arguments) {
super(rule, Type.UNDEFINED, token);
- this.typeName = typeName;
+ this.typeName = token.getText();
this.arguments = arguments;
this.argumentTypes = null;
this.constructor = null;
Modified: labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/TwiddleExpression.java
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/TwiddleExpression.java 2008-10-16 05:58:54 UTC (rev 23470)
+++ labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/TwiddleExpression.java 2008-10-16 07:28:17 UTC (rev 23471)
@@ -24,18 +24,16 @@
package org.jboss.jbossts.orchestration.rule.expression;
import org.jboss.jbossts.orchestration.rule.type.Type;
-import org.jboss.jbossts.orchestration.rule.type.TypeGroup;
-import org.jboss.jbossts.orchestration.rule.binding.Bindings;
import org.jboss.jbossts.orchestration.rule.exception.TypeException;
import org.jboss.jbossts.orchestration.rule.exception.ExecuteException;
import org.jboss.jbossts.orchestration.rule.Rule;
-import org.antlr.runtime.Token;
+import org.jboss.jbossts.orchestration.rule.grammar.ParseNode;
/**
*/
public class TwiddleExpression extends UnaryOperExpression
{
- public TwiddleExpression(Rule rule, Token token, Expression operand)
+ public TwiddleExpression(Rule rule, ParseNode token, Expression operand)
{
super(rule, TWIDDLE, operand.getType(), token, operand);
}
Modified: labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/UnaryOperExpression.java
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/UnaryOperExpression.java 2008-10-16 05:58:54 UTC (rev 23470)
+++ labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/UnaryOperExpression.java 2008-10-16 07:28:17 UTC (rev 23471)
@@ -24,13 +24,9 @@
package org.jboss.jbossts.orchestration.rule.expression;
import org.jboss.jbossts.orchestration.rule.type.Type;
-import org.jboss.jbossts.orchestration.rule.binding.Bindings;
-import org.jboss.jbossts.orchestration.rule.exception.TypeException;
import org.jboss.jbossts.orchestration.rule.Rule;
-import org.antlr.runtime.Token;
+import org.jboss.jbossts.orchestration.rule.grammar.ParseNode;
-import java.io.StringWriter;
-
/**
* unary operators includes boolean NOT and arithmetic TWIDDLE
* n.b. unary MINUS is not currently supported except as part of number
@@ -38,7 +34,7 @@
*/
public abstract class UnaryOperExpression extends OperExpression
{
- public UnaryOperExpression(Rule rule, int oper, Type type, Token token, Expression operand)
+ public UnaryOperExpression(Rule rule, int oper, Type type, ParseNode token, Expression operand)
{
super(rule, oper, type, token);
this.operand = operand;
Modified: labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/Variable.java
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/Variable.java 2008-10-16 05:58:54 UTC (rev 23470)
+++ labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/expression/Variable.java 2008-10-16 07:28:17 UTC (rev 23471)
@@ -23,14 +23,12 @@
*/
package org.jboss.jbossts.orchestration.rule.expression;
-import org.jboss.jbossts.orchestration.rule.binding.Bindings;
import org.jboss.jbossts.orchestration.rule.binding.Binding;
import org.jboss.jbossts.orchestration.rule.type.Type;
-import org.jboss.jbossts.orchestration.rule.type.TypeGroup;
import org.jboss.jbossts.orchestration.rule.exception.TypeException;
import org.jboss.jbossts.orchestration.rule.exception.ExecuteException;
import org.jboss.jbossts.orchestration.rule.Rule;
-import org.antlr.runtime.Token;
+import org.jboss.jbossts.orchestration.rule.grammar.ParseNode;
import java.io.StringWriter;
@@ -41,12 +39,12 @@
*/
public class Variable extends Expression
{
- public Variable(Rule rule, Type type, Token token) {
+ public Variable(Rule rule, Type type, ParseNode token) {
super(rule, type, token);
this.name = token.getText();
}
- public Variable(Rule rule, Type type, Token token, String name) {
+ public Variable(Rule rule, Type type, ParseNode token, String name) {
super(rule, type, token);
this.name = name;
}
Modified: labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/grammar/ECAGrammarParser.java
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/grammar/ECAGrammarParser.java 2008-10-16 05:58:54 UTC (rev 23470)
+++ labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/grammar/ECAGrammarParser.java 2008-10-16 07:28:17 UTC (rev 23471)
@@ -1,4197 +1,1862 @@
-// $ANTLR 3.0.1 dd/grammar/ECAGrammar.g 2008-10-01 15:50:08
+//----------------------------------------------------
+// The following code was generated by CUP v0.10k
+// Thu Oct 16 08:21:59 BST 2008
+//----------------------------------------------------
+
package org.jboss.jbossts.orchestration.rule.grammar;
+import java_cup.runtime.*;
+import org.jboss.jbossts.orchestration.rule.grammar.ParseNode;
-import org.antlr.runtime.*;
-import java.util.Stack;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
+/** CUP v0.10k generated parser.
+ * @version Thu Oct 16 08:21:59 BST 2008
+ */
+public class ECAGrammarParser extends java_cup.runtime.lr_parser {
-import org.antlr.runtime.tree.*;
+ /** Default constructor. */
+ public ECAGrammarParser() {super();}
-public class ECAGrammarParser extends Parser {
- public static final String[] tokenNames = new String[] {
- "<invalid>", "<EOR>", "<DOWN>", "<UP>", "DIGIT", "POSDIGIT", "SIGN", "BAREINT", "INTEGER", "POINT", "EXPPART", "FLOAT", "NUMBER", "BIND", "IF", "DO", "RULE", "CLASS", "METHOD", "LINE", "ENDRULE", "NOTHING", "TRUE", "FALSE", "RETURN", "THROW", "LPAREN", "RPAREN", "LSQUARE", "RSQUARE", "LBRACE", "RBRACE", "SEPR", "DOT", "ASSIGN", "OR", "AND", "NOT", "EQ", "NEQ", "GT", "LT", "GEQ", "LEQ", "BOR", "BAND", "BXOR", "TWIDDLE", "MUL", "DIV", "PLUS", "MINUS", "MOD", "TERN_IF", "COLON", "LETTER", "UNDERSCORE", "QUOTE", "DQUOTE", "SPACE", "NEWLINE", "PUNCT", "STRING", "BARESYM", "QUOTSYM", "DOTSYM", "SYMBOL", "DOLLAR", "DOLLARSYM", "WS", "Tokens", "UNOP", "BINOP", "TERNOP", "METH", "ARRAY", "NUM_LIT", "STRING_LIT"
- };
- public static final int MINUS=51;
- public static final int ARRAY=75;
- public static final int NUMBER=12;
- public static final int FALSE=23;
- public static final int METHOD=18;
- public static final int FLOAT=11;
- public static final int POSDIGIT=5;
- public static final int LEQ=43;
- public static final int TWIDDLE=47;
- public static final int RULE=16;
- public static final int MOD=52;
- public static final int GEQ=42;
- public static final int DQUOTE=58;
- public static final int OR=35;
- public static final int BOR=44;
- public static final int STRING_LIT=77;
- public static final int BAREINT=7;
- public static final int LBRACE=30;
- public static final int NEWLINE=60;
- public static final int DOT=33;
- public static final int RBRACE=31;
- public static final int INTEGER=8;
- public static final int AND=36;
- public static final int NUM_LIT=76;
- public static final int ASSIGN=34;
- public static final int SYMBOL=66;
- public static final int RPAREN=27;
- public static final int SIGN=6;
- public static final int LPAREN=26;
- public static final int METH=74;
- public static final int PLUS=50;
- public static final int DIGIT=4;
- public static final int LINE=19;
- public static final int BINOP=72;
- public static final int BAND=45;
- public static final int NEQ=39;
- public static final int TERNOP=73;
- public static final int SPACE=59;
- public static final int LETTER=55;
- public static final int LSQUARE=28;
- public static final int DO=15;
- public static final int POINT=9;
- public static final int BARESYM=63;
- public static final int NOTHING=21;
- public static final int SEPR=32;
- public static final int WS=69;
- public static final int EQ=38;
- public static final int STRING=62;
- public static final int QUOTSYM=64;
- public static final int LT=41;
- public static final int GT=40;
- public static final int DOLLAR=67;
- public static final int RSQUARE=29;
- public static final int TERN_IF=53;
- public static final int QUOTE=57;
- public static final int UNOP=71;
- public static final int CLASS=17;
- public static final int MUL=48;
- public static final int EXPPART=10;
- public static final int PUNCT=61;
- public static final int RETURN=24;
- public static final int IF=14;
- public static final int EOF=-1;
- public static final int Tokens=70;
- public static final int COLON=54;
- public static final int DIV=49;
- public static final int DOTSYM=65;
- public static final int BXOR=46;
- public static final int ENDRULE=20;
- public static final int BIND=13;
- public static final int NOT=37;
- public static final int TRUE=22;
- public static final int THROW=25;
- public static final int UNDERSCORE=56;
- public static final int DOLLARSYM=68;
+ /** Constructor which sets the default scanner. */
+ public ECAGrammarParser(java_cup.runtime.Scanner s) {super(s);}
- public ECAGrammarParser(TokenStream input) {
- super(input);
- ruleMemo = new HashMap[63+1];
- }
-
- protected TreeAdaptor adaptor = new CommonTreeAdaptor();
+ /** Production table. */
+ protected static final short _production_table[][] =
+ unpackFromStrings(new String[] {
+ "\000\123\000\002\003\003\000\002\002\004\000\002\004" +
+ "\010\000\002\005\003\000\002\005\003\000\002\006\005" +
+ "\000\002\006\005\000\002\006\003\000\002\007\005\000" +
+ "\002\010\005\000\002\010\003\000\002\011\003\000\002" +
+ "\012\003\000\002\012\003\000\002\013\005\000\002\013" +
+ "\005\000\002\013\003\000\002\014\003\000\002\014\003" +
+ "\000\002\014\004\000\002\014\006\000\002\014\007\000" +
+ "\002\015\003\000\002\015\005\000\002\016\003\000\002" +
+ "\016\003\000\002\016\003\000\002\016\003\000\002\016" +
+ "\003\000\002\016\003\000\002\016\003\000\002\016\003" +
+ "\000\002\017\007\000\002\020\005\000\002\020\005\000" +
+ "\002\020\005\000\002\020\005\000\002\020\005\000\002" +
+ "\020\005\000\002\020\005\000\002\020\005\000\002\020" +
+ "\005\000\002\020\005\000\002\020\005\000\002\020\005" +
+ "\000\002\020\005\000\002\020\005\000\002\020\005\000" +
+ "\002\020\005\000\002\021\004\000\002\021\004\000\002" +
+ "\021\004\000\002\022\004\000\002\022\004\000\002\022" +
+ "\004\000\002\030\003\000\002\030\004\000\002\031\005" +
+ "\000\002\023\005\000\002\023\003\000\002\024\005\000" +
+ "\002\024\005\000\002\025\005\000\002\025\006\000\002" +
+ "\025\007\000\002\025\010\000\002\025\003\000\002\026" +
+ "\007\000\002\026\010\000\002\026\007\000\002\026\010" +
+ "\000\002\027\003\000\002\027\003\000\002\027\003\000" +
+ "\002\027\003\000\002\027\004\000\002\027\004\000\002" +
+ "\027\005\000\002\032\003\000\002\032\005\000\002\033" +
+ "\003\000\002\034\003\000\002\034\005" });
- public void setTreeAdaptor(TreeAdaptor adaptor) {
- this.adaptor = adaptor;
- }
- public TreeAdaptor getTreeAdaptor() {
- return adaptor;
- }
+ /** Access to production table. */
+ public short[][] production_table() {return _production_table;}
- public String[] getTokenNames() { return tokenNames; }
- public String getGrammarFileName() { return "dd/grammar/ECAGrammar.g"; }
+ /** Parse-action table. */
+ protected static final short[][] _action_table =
+ unpackFromStrings(new String[] {
+ "\000\221\000\004\004\005\001\002\000\004\002\001\001" +
+ "\002\000\006\007\010\054\012\001\002\000\004\002\007" +
+ "\001\002\000\004\002\000\001\002\000\004\005\ufffe\001" +
+ "\002\000\004\005\177\001\002\000\074\002\uffb1\005\uffb1" +
+ "\006\uffb1\012\uffb1\013\uffb1\014\uffb1\015\uffb1\016\uffb1\017" +
+ "\uffb1\020\uffb1\021\uffb1\022\uffb1\023\uffb1\024\uffb1\025\uffb1" +
+ "\026\uffb1\027\uffb1\030\uffb1\031\uffb1\032\uffb1\033\uffb1\034" +
+ "\uffb1\035\uffb1\036\uffb1\037\uffb1\040\uffb1\041\uffb1\042\uffb1" +
+ "\043\uffb1\001\002\000\004\021\032\001\002\000\006\021" +
+ "\ufff7\023\023\001\002\000\010\005\ufffa\016\020\017\017" +
+ "\001\002\000\004\005\ufffd\001\002\000\004\054\012\001" +
+ "\002\000\004\054\012\001\002\000\004\005\ufffb\001\002" +
+ "\000\004\005\ufffc\001\002\000\004\054\025\001\002\000" +
+ "\004\021\ufff8\001\002\000\072\002\uffb1\005\uffb1\006\uffb1" +
+ "\012\uffb1\013\uffb1\015\uffb1\016\uffb1\017\uffb1\020\uffb0\021" +
+ "\uffb1\022\uffb1\023\uffb1\024\uffb1\025\uffb1\026\uffb1\027\uffb1" +
+ "\030\uffb1\031\uffb1\032\uffb1\033\uffb1\034\uffb1\035\uffb1\036" +
+ "\uffb1\037\uffb1\040\uffb1\041\uffb1\042\uffb1\043\uffb1\001\002" +
+ "\000\004\020\030\001\002\000\006\012\uffb3\021\uffb3\001" +
+ "\002\000\004\054\031\001\002\000\010\012\uffb2\020\uffaf" +
+ "\021\uffb2\001\002\000\026\012\042\042\051\044\036\045" +
+ "\041\047\035\050\057\051\053\052\037\053\044\054\025" +
+ "\001\002\000\052\005\ufff9\016\ufff9\017\ufff9\022\113\024" +
+ "\077\025\073\026\074\027\101\030\110\031\075\032\106" +
+ "\033\100\034\105\035\111\036\104\037\112\040\103\041" +
+ "\076\042\107\043\072\001\002\000\066\002\uffe5\005\uffe5" +
+ "\006\uffe5\013\uffe5\014\060\015\uffe5\016\uffe5\017\uffe5\022" +
+ "\uffe5\023\uffe5\024\uffe5\025\uffe5\026\uffe5\027\uffe5\030\uffe5" +
+ "\031\uffe5\032\uffe5\033\uffe5\034\uffe5\035\uffe5\036\uffe5\037" +
+ "\uffe5\040\uffe5\041\uffe5\042\uffe5\043\uffe5\001\002\000\006" +
+ "\051\174\054\012\001\002\000\026\012\042\042\051\044" +
+ "\036\045\041\047\035\050\057\051\053\052\037\053\044" +
+ "\054\025\001\002\000\070\002\uffb8\005\uffb8\006\uffb8\013" +
+ "\uffb8\014\uffb8\015\uffb8\016\uffb8\017\uffb8\020\uffb8\022\uffb8" +
+ "\023\uffb8\024\uffb8\025\uffb8\026\uffb8\027\uffb8\030\uffb8\031" +
+ "\uffb8\032\uffb8\033\uffb8\034\uffb8\035\uffb8\036\uffb8\037\uffb8" +
+ "\040\uffb8\041\uffb8\042\uffb8\043\uffb8\001\002\000\066\002" +
+ "\uffe2\005\uffe2\006\uffe2\012\167\013\uffe2\015\uffe2\016\uffe2" +
+ "\017\uffe2\022\uffe2\023\uffe2\024\uffe2\025\uffe2\026\uffe2\027" +
+ "\uffe2\030\uffe2\031\uffe2\032\uffe2\033\uffe2\034\uffe2\035\uffe2" +
+ "\036\uffe2\037\uffe2\040\uffe2\041\uffe2\042\uffe2\043\uffe2\001" +
+ "\002\000\026\012\042\042\051\044\036\045\041\047\035" +
+ "\050\057\051\053\052\037\053\044\054\025\001\002\000" +
+ "\026\012\042\042\051\044\036\045\041\047\035\050\057" +
+ "\051\053\052\037\053\044\054\025\001\002\000\070\002" +
+ "\uffe3\005\uffe3\006\uffe3\013\uffe3\014\060\015\uffe3\016\uffe3" +
+ "\017\uffe3\020\156\022\uffe3\023\uffe3\024\uffe3\025\uffe3\026" +
+ "\uffe3\027\uffe3\030\uffe3\031\uffe3\032\uffe3\033\uffe3\034\uffe3" +
+ "\035\uffe3\036\uffe3\037\uffe3\040\uffe3\041\uffe3\042\uffe3\043" +
+ "\uffe3\001\002\000\070\002\uffb7\005\uffb7\006\uffb7\013\uffb7" +
+ "\014\uffb7\015\uffb7\016\uffb7\017\uffb7\020\uffb7\022\uffb7\023" +
+ "\uffb7\024\uffb7\025\uffb7\026\uffb7\027\uffb7\030\uffb7\031\uffb7" +
+ "\032\uffb7\033\uffb7\034\uffb7\035\uffb7\036\uffb7\037\uffb7\040" +
+ "\uffb7\041\uffb7\042\uffb7\043\uffb7\001\002\000\064\002\uffe8" +
+ "\005\uffe8\006\uffe8\013\uffe8\015\uffe8\016\uffe8\017\uffe8\022" +
+ "\uffe8\023\uffe8\024\uffe8\025\uffe8\026\uffe8\027\uffe8\030\uffe8" +
+ "\031\uffe8\032\uffe8\033\uffe8\034\uffe8\035\uffe8\036\uffe8\037" +
+ "\uffe8\040\uffe8\041\uffe8\042\uffe8\043\uffe8\001\002\000\070" +
+ "\002\uffc6\005\uffc6\006\uffc6\013\uffc6\014\uffc6\015\uffc6\016" +
+ "\uffc6\017\uffc6\020\153\022\uffc6\023\uffc6\024\uffc6\025\uffc6" +
+ "\026\uffc6\027\uffc6\030\uffc6\031\uffc6\032\uffc6\033\uffc6\034" +
+ "\uffc6\035\uffc6\036\uffc6\037\uffc6\040\uffc6\041\uffc6\042\uffc6" +
+ "\043\uffc6\001\002\000\004\020\144\001\002\000\064\002" +
+ "\uffe9\005\uffe9\006\uffe9\013\uffe9\015\uffe9\016\uffe9\017\uffe9" +
+ "\022\uffe9\023\uffe9\024\uffe9\025\uffe9\026\uffe9\027\uffe9\030" +
+ "\uffe9\031\uffe9\032\uffe9\033\uffe9\034\uffe9\035\uffe9\036\uffe9" +
+ "\037\uffe9\040\uffe9\041\uffe9\042\uffe9\043\uffe9\001\002\000" +
+ "\026\012\042\042\051\044\036\045\041\047\035\050\057" +
+ "\051\053\052\037\053\044\054\025\001\002\000\070\002" +
+ "\uffbf\005\uffbf\006\uffbf\013\uffbf\014\uffbf\015\uffbf\016\uffbf" +
+ "\017\uffbf\020\uffbf\022\uffbf\023\uffbf\024\uffbf\025\uffbf\026" +
+ "\uffbf\027\uffbf\030\uffbf\031\uffbf\032\uffbf\033\uffbf\034\uffbf" +
+ "\035\uffbf\036\uffbf\037\uffbf\040\uffbf\041\uffbf\042\uffbf\043" +
+ "\uffbf\001\002\000\070\002\uffba\005\uffba\006\uffba\013\uffba" +
+ "\014\uffba\015\uffba\016\uffba\017\uffba\020\uffba\022\uffba\023" +
+ "\uffba\024\uffba\025\uffba\026\uffba\027\uffba\030\uffba\031\uffba" +
+ "\032\uffba\033\uffba\034\uffba\035\uffba\036\uffba\037\uffba\040" +
+ "\uffba\041\uffba\042\uffba\043\uffba\001\002\000\064\002\uffe6" +
+ "\005\uffe6\006\uffe6\013\uffe6\015\uffe6\016\uffe6\017\uffe6\022" +
+ "\uffe6\023\uffe6\024\uffe6\025\uffe6\026\uffe6\027\uffe6\030\uffe6" +
+ "\031\uffe6\032\uffe6\033\uffe6\034\uffe6\035\uffe6\036\uffe6\037" +
+ "\uffe6\040\uffe6\041\uffe6\042\uffe6\043\uffe6\001\002\000\064" +
+ "\002\uffe7\005\uffe7\006\uffe7\013\uffe7\015\uffe7\016\uffe7\017" +
+ "\uffe7\022\uffe7\023\uffe7\024\uffe7\025\uffe7\026\uffe7\027\uffe7" +
+ "\030\uffe7\031\uffe7\032\uffe7\033\uffe7\034\uffe7\035\uffe7\036" +
+ "\uffe7\037\uffe7\040\uffe7\041\uffe7\042\uffe7\043\uffe7\001\002" +
+ "\000\070\002\uffe4\005\uffe4\006\uffe4\013\uffe4\014\060\015" +
+ "\uffe4\016\uffe4\017\uffe4\020\063\022\uffe4\023\uffe4\024\uffe4" +
+ "\025\uffe4\026\uffe4\027\uffe4\030\uffe4\031\uffe4\032\uffe4\033" +
+ "\uffe4\034\uffe4\035\uffe4\036\uffe4\037\uffe4\040\uffe4\041\uffe4" +
+ "\042\uffe4\043\uffe4\001\002\000\070\002\uffb9\005\uffb9\006" +
+ "\uffb9\013\uffb9\014\uffb9\015\uffb9\016\uffb9\017\uffb9\020\uffb9" +
+ "\022\uffb9\023\uffb9\024\uffb9\025\uffb9\026\uffb9\027\uffb9\030" +
+ "\uffb9\031\uffb9\032\uffb9\033\uffb9\034\uffb9\035\uffb9\036\uffb9" +
+ "\037\uffb9\040\uffb9\041\uffb9\042\uffb9\043\uffb9\001\002\000" +
+ "\026\012\042\042\051\044\036\045\041\047\035\050\057" +
+ "\051\053\052\037\053\044\054\025\001\002\000\064\002" +
+ "\uffcb\005\uffcb\006\uffcb\013\uffcb\015\uffcb\016\uffcb\017\uffcb" +
+ "\022\uffcb\023\uffcb\024\uffcb\025\uffcb\026\uffcb\027\uffcb\030" +
+ "\uffcb\031\uffcb\032\uffcb\033\uffcb\034\uffcb\035\uffcb\036\uffcb" +
+ "\037\uffcb\040\uffcb\041\uffcb\042\uffcb\043\uffcb\001\002\000" +
+ "\066\002\uffca\005\uffca\006\uffca\013\uffca\014\060\015\uffca" +
+ "\016\uffca\017\uffca\022\uffca\023\uffca\024\uffca\025\uffca\026" +
+ "\uffca\027\uffca\030\uffca\031\uffca\032\uffca\033\uffca\034\uffca" +
+ "\035\uffca\036\uffca\037\uffca\040\uffca\041\uffca\042\uffca\043" +
+ "\uffca\001\002\000\004\054\012\001\002\000\004\012\065" +
+ "\001\002\000\030\012\042\013\067\042\051\044\036\045" +
+ "\041\047\035\050\057\051\053\052\037\053\044\054\025" +
+ "\001\002\000\050\013\uffeb\017\102\022\113\024\077\025" +
+ "\073\026\074\027\101\030\110\031\075\032\106\033\100" +
+ "\034\105\035\111\036\104\037\112\040\103\041\076\042" +
+ "\107\043\072\001\002\000\070\002\uffbc\005\uffbc\006\uffbc" +
+ "\013\uffbc\014\uffbc\015\uffbc\016\uffbc\017\uffbc\020\uffbc\022" +
+ "\uffbc\023\uffbc\024\uffbc\025\uffbc\026\uffbc\027\uffbc\030\uffbc" +
+ "\031\uffbc\032\uffbc\033\uffbc\034\uffbc\035\uffbc\036\uffbc\037" +
+ "\uffbc\040\uffbc\041\uffbc\042\uffbc\043\uffbc\001\002\000\004" +
+ "\013\071\001\002\000\070\002\uffbb\005\uffbb\006\uffbb\013" +
+ "\uffbb\014\uffbb\015\uffbb\016\uffbb\017\uffbb\020\uffbb\022\uffbb" +
+ "\023\uffbb\024\uffbb\025\uffbb\026\uffbb\027\uffbb\030\uffbb\031" +
+ "\uffbb\032\uffbb\033\uffbb\034\uffbb\035\uffbb\036\uffbb\037\uffbb" +
+ "\040\uffbb\041\uffbb\042\uffbb\043\uffbb\001\002\000\026\012" +
+ "\042\042\051\044\036\045\041\047\035\050\057\051\053" +
+ "\052\037\053\044\054\025\001\002\000\026\012\042\042" +
+ "\051\044\036\045\041\047\035\050\057\051\053\052\037" +
+ "\053\044\054\025\001\002\000\026\012\042\042\051\044" +
+ "\036\045\041\047\035\050\057\051\053\052\037\053\044" +
+ "\054\025\001\002\000\026\012\042\042\051\044\036\045" +
+ "\041\047\035\050\057\051\053\052\037\053\044\054\025" +
+ "\001\002\000\026\012\042\042\051\044\036\045\041\047" +
+ "\035\050\057\051\053\052\037\053\044\054\025\001\002" +
+ "\000\026\012\042\042\051\044\036\045\041\047\035\050" +
+ "\057\051\053\052\037\053\044\054\025\001\002\000\026" +
+ "\012\042\042\051\044\036\045\041\047\035\050\057\051" +
+ "\053\052\037\053\044\054\025\001\002\000\026\012\042" +
+ "\042\051\044\036\045\041\047\035\050\057\051\053\052" +
+ "\037\053\044\054\025\001\002\000\026\012\042\042\051" +
+ "\044\036\045\041\047\035\050\057\051\053\052\037\053" +
+ "\044\054\025\001\002\000\026\012\042\042\051\044\036" +
+ "\045\041\047\035\050\057\051\053\052\037\053\044\054" +
+ "\025\001\002\000\026\012\042\042\051\044\036\045\041" +
+ "\047\035\050\057\051\053\052\037\053\044\054\025\001" +
+ "\002\000\026\012\042\042\051\044\036\045\041\047\035" +
+ "\050\057\051\053\052\037\053\044\054\025\001\002\000" +
+ "\026\012\042\042\051\044\036\045\041\047\035\050\057" +
+ "\051\053\052\037\053\044\054\025\001\002\000\026\012" +
+ "\042\042\051\044\036\045\041\047\035\050\057\051\053" +
+ "\052\037\053\044\054\025\001\002\000\026\012\042\042" +
+ "\051\044\036\045\041\047\035\050\057\051\053\052\037" +
+ "\053\044\054\025\001\002\000\026\012\042\042\051\044" +
+ "\036\045\041\047\035\050\057\051\053\052\037\053\044" +
+ "\054\025\001\002\000\026\012\042\042\051\044\036\045" +
+ "\041\047\035\050\057\051\053\052\037\053\044\054\025" +
+ "\001\002\000\026\012\042\042\051\044\036\045\041\047" +
+ "\035\050\057\051\053\052\037\053\044\054\025\001\002" +
+ "\000\046\022\113\023\115\024\077\025\073\026\074\027" +
+ "\101\030\110\031\075\032\106\033\100\034\105\035\111" +
+ "\036\104\037\112\040\103\041\076\042\107\043\072\001" +
+ "\002\000\026\012\042\042\051\044\036\045\041\047\035" +
+ "\050\057\051\053\052\037\053\044\054\025\001\002\000" +
+ "\064\002\uffe1\005\uffe1\006\uffe1\013\uffe1\015\uffe1\016\uffe1" +
+ "\017\uffe1\022\113\023\uffe1\024\077\025\073\026\074\027" +
+ "\101\030\110\031\075\032\106\033\100\034\105\035\111" +
+ "\036\104\037\112\040\103\041\076\042\107\043\072\001" +
+ "\002\000\064\002\uffd3\005\uffd3\006\uffd3\013\uffd3\015\uffd3" +
+ "\016\uffd3\017\uffd3\022\uffd3\023\uffd3\024\uffd3\025\uffd3\026" +
+ "\uffd3\027\uffd3\030\uffd3\031\uffd3\032\uffd3\033\uffd3\034\105" +
+ "\035\111\036\104\037\uffd3\040\uffd3\041\uffd3\042\uffd3\043" +
+ "\uffd3\001\002\000\064\002\uffd7\005\uffd7\006\uffd7\013\uffd7" +
+ "\015\uffd7\016\uffd7\017\uffd7\022\uffd7\023\uffd7\024\uffd7\025" +
+ "\uffd7\026\uffd7\027\uffd7\030\uffd7\031\uffd7\032\uffd7\033\uffd7" +
+ "\034\uffd7\035\uffd7\036\uffd7\037\uffd7\040\uffd7\041\uffd7\042" +
+ "\uffd7\043\uffd7\001\002\000\060\002\uffdc\005\uffdc\006\uffdc" +
+ "\013\uffdc\015\uffdc\016\uffdc\017\uffdc\022\uffdc\023\uffdc\024" +
+ "\uffdc\025\uffdc\026\074\027\101\032\106\033\100\034\105" +
+ "\035\111\036\104\037\112\040\103\041\076\042\107\043" +
+ "\072\001\002\000\064\002\uffd4\005\uffd4\006\uffd4\013\uffd4" +
+ "\015\uffd4\016\uffd4\017\uffd4\022\uffd4\023\uffd4\024\uffd4\025" +
+ "\uffd4\026\uffd4\027\uffd4\030\uffd4\031\uffd4\032\uffd4\033\uffd4" +
+ "\034\105\035\111\036\104\037\112\040\103\041\uffd4\042" +
+ "\uffd4\043\072\001\002\000\064\002\uffda\005\uffda\006\uffda" +
+ "\013\uffda\015\uffda\016\uffda\017\uffda\022\uffda\023\uffda\024" +
+ "\uffda\025\uffda\026\uffda\027\uffda\030\uffda\031\uffda\032\uffda" +
+ "\033\uffda\034\105\035\111\036\104\037\112\040\103\041" +
+ "\076\042\107\043\072\001\002\000\064\002\uffd8\005\uffd8" +
+ "\006\uffd8\013\uffd8\015\uffd8\016\uffd8\017\uffd8\022\uffd8\023" +
+ "\uffd8\024\uffd8\025\uffd8\026\uffd8\027\uffd8\030\uffd8\031\uffd8" +
+ "\032\uffd8\033\uffd8\034\uffd8\035\uffd8\036\uffd8\037\uffd8\040" +
+ "\uffd8\041\uffd8\042\uffd8\043\uffd8\001\002\000\064\002\uffd6" +
+ "\005\uffd6\006\uffd6\013\uffd6\015\uffd6\016\uffd6\017\uffd6\022" +
+ "\uffd6\023\uffd6\024\uffd6\025\uffd6\026\uffd6\027\uffd6\030\uffd6" +
+ "\031\uffd6\032\uffd6\033\uffd6\034\uffd6\035\uffd6\036\uffd6\037" +
+ "\uffd6\040\uffd6\041\uffd6\042\uffd6\043\uffd6\001\002\000\064" +
+ "\002\uffd2\005\uffd2\006\uffd2\013\uffd2\015\uffd2\016\uffd2\017" +
+ "\uffd2\022\uffd2\023\uffd2\024\uffd2\025\uffd2\026\uffd2\027\uffd2" +
+ "\030\uffd2\031\uffd2\032\uffd2\033\uffd2\034\105\035\111\036" +
+ "\104\037\uffd2\040\uffd2\041\uffd2\042\uffd2\043\uffd2\001\002" +
+ "\000\004\013\uffea\001\002\000\064\002\uffdd\005\uffdd\006" +
+ "\uffdd\013\uffdd\015\uffdd\016\uffdd\017\uffdd\022\uffdd\023\uffdd" +
+ "\024\uffdd\025\uffdd\026\uffdd\027\uffdd\030\uffdd\031\uffdd\032" +
+ "\uffdd\033\uffdd\034\105\035\111\036\104\037\112\040\103" +
+ "\041\076\042\107\043\072\001\002\000\064\002\uffd9\005" +
+ "\uffd9\006\uffd9\013\uffd9\015\uffd9\016\uffd9\017\uffd9\022\uffd9" +
+ "\023\uffd9\024\uffd9\025\uffd9\026\uffd9\027\uffd9\030\uffd9\031" +
+ "\uffd9\032\uffd9\033\uffd9\034\105\035\111\036\104\037\112" +
+ "\040\103\041\076\042\107\043\072\001\002\000\064\002" +
+ "\uffe0\005\uffe0\006\uffe0\013\uffe0\015\uffe0\016\uffe0\017\uffe0" +
+ "\022\uffe0\023\uffe0\024\uffe0\025\uffe0\026\074\027\101\030" +
+ "\110\031\075\032\106\033\100\034\105\035\111\036\104" +
+ "\037\112\040\103\041\076\042\107\043\072\001\002\000" +
+ "\064\002\uffd5\005\uffd5\006\uffd5\013\uffd5\015\uffd5\016\uffd5" +
+ "\017\uffd5\022\uffd5\023\uffd5\024\uffd5\025\uffd5\026\uffd5\027" +
+ "\uffd5\030\uffd5\031\uffd5\032\uffd5\033\uffd5\034\105\035\111" +
+ "\036\104\037\112\040\103\041\uffd5\042\uffd5\043\072\001" +
+ "\002\000\060\002\uffdb\005\uffdb\006\uffdb\013\uffdb\015\uffdb" +
+ "\016\uffdb\017\uffdb\022\uffdb\023\uffdb\024\uffdb\025\uffdb\026" +
+ "\074\027\101\032\106\033\100\034\105\035\111\036\104" +
+ "\037\112\040\103\041\076\042\107\043\072\001\002\000" +
+ "\064\002\uffde\005\uffde\006\uffde\013\uffde\015\uffde\016\uffde" +
+ "\017\uffde\022\uffde\023\uffde\024\uffde\025\uffde\026\uffde\027" +
+ "\uffde\030\uffde\031\uffde\032\uffde\033\uffde\034\105\035\111" +
+ "\036\104\037\112\040\103\041\076\042\107\043\072\001" +
+ "\002\000\064\002\uffdf\005\uffdf\006\uffdf\013\uffdf\015\uffdf" +
+ "\016\uffdf\017\uffdf\022\uffdf\023\uffdf\024\uffdf\025\uffdf\026" +
+ "\074\027\101\030\110\031\075\032\106\033\100\034\105" +
+ "\035\111\036\104\037\112\040\103\041\076\042\107\043" +
+ "\072\001\002\000\064\002\uffd1\005\uffd1\006\uffd1\013\uffd1" +
+ "\015\uffd1\016\uffd1\017\uffd1\022\uffd1\023\uffd1\024\uffd1\025" +
+ "\uffd1\026\uffd1\027\uffd1\030\uffd1\031\uffd1\032\uffd1\033\uffd1" +
+ "\034\105\035\111\036\104\037\uffd1\040\uffd1\041\uffd1\042" +
+ "\uffd1\043\uffd1\001\002\000\064\002\uffc9\005\uffc9\006\uffc9" +
+ "\013\uffc9\015\uffc9\016\uffc9\017\uffc9\022\uffc9\023\uffc9\024" +
+ "\uffc9\025\uffc9\026\uffc9\027\uffc9\030\uffc9\031\uffc9\032\uffc9" +
+ "\033\uffc9\034\uffc9\035\uffc9\036\uffc9\037\uffc9\040\uffc9\041" +
+ "\uffc9\042\uffc9\043\uffc9\001\002\000\046\015\142\022\113" +
+ "\024\077\025\073\026\074\027\101\030\110\031\075\032" +
+ "\106\033\100\034\105\035\111\036\104\037\112\040\103" +
+ "\041\076\042\107\043\072\001\002\000\066\002\uffc8\005" +
+ "\uffc8\006\uffc8\013\uffc8\014\uffc8\015\uffc8\016\uffc8\017\uffc8" +
+ "\022\uffc8\023\uffc8\024\uffc8\025\uffc8\026\uffc8\027\uffc8\030" +
+ "\uffc8\031\uffc8\032\uffc8\033\uffc8\034\uffc8\035\uffc8\036\uffc8" +
+ "\037\uffc8\040\uffc8\041\uffc8\042\uffc8\043\uffc8\001\002\000" +
+ "\064\002\uffce\005\uffce\006\uffce\013\uffce\015\uffce\016\uffce" +
+ "\017\uffce\022\uffce\023\uffce\024\uffce\025\uffce\026\uffce\027" +
+ "\uffce\030\uffce\031\uffce\032\uffce\033\uffce\034\uffce\035\uffce" +
+ "\036\uffce\037\uffce\040\uffce\041\uffce\042\uffce\043\uffce\001" +
+ "\002\000\004\054\145\001\002\000\072\002\uffb1\005\uffb1" +
+ "\006\uffb1\012\uffb1\013\uffb1\014\uffb1\015\uffb1\016\uffb1\017" +
+ "\uffb1\020\uffaf\022\uffb1\023\uffb1\024\uffb1\025\uffb1\026\uffb1" +
+ "\027\uffb1\030\uffb1\031\uffb1\032\uffb1\033\uffb1\034\uffb1\035" +
+ "\uffb1\036\uffb1\037\uffb1\040\uffb1\041\uffb1\042\uffb1\043\uffb1" +
+ "\001\002\000\070\002\uffc7\005\uffc7\006\uffc7\012\147\013" +
+ "\uffc7\014\uffc7\015\uffc7\016\uffc7\017\uffc7\022\uffc7\023\uffc7" +
+ "\024\uffc7\025\uffc7\026\uffc7\027\uffc7\030\uffc7\031\uffc7\032" +
+ "\uffc7\033\uffc7\034\uffc7\035\uffc7\036\uffc7\037\uffc7\040\uffc7" +
+ "\041\uffc7\042\uffc7\043\uffc7\001\002\000\030\012\042\013" +
+ "\150\042\051\044\036\045\041\047\035\050\057\051\053" +
+ "\052\037\053\044\054\025\001\002\000\070\002\uffc1\005" +
+ "\uffc1\006\uffc1\013\uffc1\014\uffc1\015\uffc1\016\uffc1\017\uffc1" +
+ "\020\uffc1\022\uffc1\023\uffc1\024\uffc1\025\uffc1\026\uffc1\027" +
+ "\uffc1\030\uffc1\031\uffc1\032\uffc1\033\uffc1\034\uffc1\035\uffc1" +
+ "\036\uffc1\037\uffc1\040\uffc1\041\uffc1\042\uffc1\043\uffc1\001" +
+ "\002\000\004\013\152\001\002\000\070\002\uffc0\005\uffc0" +
+ "\006\uffc0\013\uffc0\014\uffc0\015\uffc0\016\uffc0\017\uffc0\020" +
+ "\uffc0\022\uffc0\023\uffc0\024\uffc0\025\uffc0\026\uffc0\027\uffc0" +
+ "\030\uffc0\031\uffc0\032\uffc0\033\uffc0\034\uffc0\035\uffc0\036" +
+ "\uffc0\037\uffc0\040\uffc0\041\uffc0\042\uffc0\043\uffc0\001\002" +
+ "\000\004\054\012\001\002\000\070\002\uffc4\005\uffc4\006" +
+ "\uffc4\013\uffc4\014\uffc4\015\uffc4\016\uffc4\017\uffc4\020\uffc4" +
+ "\022\uffc4\023\uffc4\024\uffc4\025\uffc4\026\uffc4\027\uffc4\030" +
+ "\uffc4\031\uffc4\032\uffc4\033\uffc4\034\uffc4\035\uffc4\036\uffc4" +
+ "\037\uffc4\040\uffc4\041\uffc4\042\uffc4\043\uffc4\001\002\000" +
+ "\064\002\uffcd\005\uffcd\006\uffcd\013\uffcd\015\uffcd\016\uffcd" +
+ "\017\uffcd\022\uffcd\023\uffcd\024\uffcd\025\uffcd\026\uffcd\027" +
+ "\uffcd\030\uffcd\031\uffcd\032\uffcd\033\uffcd\034\uffcd\035\uffcd" +
+ "\036\uffcd\037\uffcd\040\uffcd\041\uffcd\042\uffcd\043\uffcd\001" +
+ "\002\000\004\054\012\001\002\000\072\002\uffc5\005\uffc5" +
+ "\006\uffc5\012\160\013\uffc5\014\uffc5\015\uffc5\016\uffc5\017" +
+ "\uffc5\020\uffc5\022\uffc5\023\uffc5\024\uffc5\025\uffc5\026\uffc5" +
+ "\027\uffc5\030\uffc5\031\uffc5\032\uffc5\033\uffc5\034\uffc5\035" +
+ "\uffc5\036\uffc5\037\uffc5\040\uffc5\041\uffc5\042\uffc5\043\uffc5" +
+ "\001\002\000\030\012\042\013\161\042\051\044\036\045" +
+ "\041\047\035\050\057\051\053\052\037\053\044\054\025" +
+ "\001\002\000\070\002\uffbe\005\uffbe\006\uffbe\013\uffbe\014" +
+ "\uffbe\015\uffbe\016\uffbe\017\uffbe\020\uffbe\022\uffbe\023\uffbe" +
+ "\024\uffbe\025\uffbe\026\uffbe\027\uffbe\030\uffbe\031\uffbe\032" +
+ "\uffbe\033\uffbe\034\uffbe\035\uffbe\036\uffbe\037\uffbe\040\uffbe" +
+ "\041\uffbe\042\uffbe\043\uffbe\001\002\000\004\013\163\001" +
+ "\002\000\070\002\uffbd\005\uffbd\006\uffbd\013\uffbd\014\uffbd" +
+ "\015\uffbd\016\uffbd\017\uffbd\020\uffbd\022\uffbd\023\uffbd\024" +
+ "\uffbd\025\uffbd\026\uffbd\027\uffbd\030\uffbd\031\uffbd\032\uffbd" +
+ "\033\uffbd\034\uffbd\035\uffbd\036\uffbd\037\uffbd\040\uffbd\041" +
+ "\uffbd\042\uffbd\043\uffbd\001\002\000\046\013\165\022\113" +
+ "\024\077\025\073\026\074\027\101\030\110\031\075\032" +
+ "\106\033\100\034\105\035\111\036\104\037\112\040\103" +
+ "\041\076\042\107\043\072\001\002\000\070\002\uffb4\005" +
+ "\uffb4\006\uffb4\013\uffb4\014\uffb4\015\uffb4\016\uffb4\017\uffb4" +
+ "\020\uffb4\022\uffb4\023\uffb4\024\uffb4\025\uffb4\026\uffb4\027" +
+ "\uffb4\030\uffb4\031\uffb4\032\uffb4\033\uffb4\034\uffb4\035\uffb4" +
+ "\036\uffb4\037\uffb4\040\uffb4\041\uffb4\042\uffb4\043\uffb4\001" +
+ "\002\000\064\002\uffcf\005\uffcf\006\uffcf\013\uffcf\015\uffcf" +
+ "\016\uffcf\017\uffcf\022\uffcf\023\uffcf\024\uffcf\025\uffcf\026" +
+ "\uffcf\027\uffcf\030\uffcf\031\uffcf\032\uffcf\033\uffcf\034\uffcf" +
+ "\035\uffcf\036\uffcf\037\uffcf\040\uffcf\041\uffcf\042\uffcf\043" +
+ "\uffcf\001\002\000\030\012\042\013\170\042\051\044\036" +
+ "\045\041\047\035\050\057\051\053\052\037\053\044\054" +
+ "\025\001\002\000\070\002\uffc3\005\uffc3\006\uffc3\013\uffc3" +
+ "\014\uffc3\015\uffc3\016\uffc3\017\uffc3\020\uffc3\022\uffc3\023" +
+ "\uffc3\024\uffc3\025\uffc3\026\uffc3\027\uffc3\030\uffc3\031\uffc3" +
+ "\032\uffc3\033\uffc3\034\uffc3\035\uffc3\036\uffc3\037\uffc3\040" +
+ "\uffc3\041\uffc3\042\uffc3\043\uffc3\001\002\000\004\013\172" +
+ "\001\002\000\070\002\uffc2\005\uffc2\006\uffc2\013\uffc2\014" +
+ "\uffc2\015\uffc2\016\uffc2\017\uffc2\020\uffc2\022\uffc2\023\uffc2" +
+ "\024\uffc2\025\uffc2\026\uffc2\027\uffc2\030\uffc2\031\uffc2\032" +
+ "\uffc2\033\uffc2\034\uffc2\035\uffc2\036\uffc2\037\uffc2\040\uffc2" +
+ "\041\uffc2\042\uffc2\043\uffc2\001\002\000\064\002\uffd0\005" +
+ "\uffd0\006\uffd0\013\uffd0\015\uffd0\016\uffd0\017\uffd0\022\uffd0" +
+ "\023\uffd0\024\uffd0\025\uffd0\026\074\027\101\030\110\031" +
+ "\075\032\106\033\100\034\105\035\111\036\104\037\112" +
+ "\040\103\041\076\042\107\043\072\001\002\000\070\002" +
+ "\uffb5\005\uffb5\006\uffb5\013\uffb5\014\uffb5\015\uffb5\016\uffb5" +
+ "\017\uffb5\020\uffb5\022\uffb5\023\uffb5\024\uffb5\025\uffb5\026" +
+ "\uffb5\027\uffb5\030\uffb5\031\uffb5\032\uffb5\033\uffb5\034\uffb5" +
+ "\035\uffb5\036\uffb5\037\uffb5\040\uffb5\041\uffb5\042\uffb5\043" +
+ "\uffb5\001\002\000\070\002\uffb6\005\uffb6\006\uffb6\013\uffb6" +
+ "\014\uffb6\015\uffb6\016\uffb6\017\uffb6\020\uffb6\022\uffb6\023" +
+ "\uffb6\024\uffb6\025\uffb6\026\uffb6\027\uffb6\030\uffb6\031\uffb6" +
+ "\032\uffb6\033\uffb6\034\uffb6\035\uffb6\036\uffb6\037\uffb6\040" +
+ "\uffb6\041\uffb6\042\uffb6\043\uffb6\001\002\000\064\002\uffcc" +
+ "\005\uffcc\006\uffcc\013\uffcc\015\uffcc\016\uffcc\017\uffcc\022" +
+ "\uffcc\023\uffcc\024\uffcc\025\uffcc\026\uffcc\027\uffcc\030\uffcc" +
+ "\031\uffcc\032\uffcc\033\uffcc\034\uffcc\035\uffcc\036\uffcc\037" +
+ "\uffcc\040\uffcc\041\uffcc\042\uffcc\043\uffcc\001\002\000\026" +
+ "\012\042\042\051\044\036\045\041\047\035\050\057\051" +
+ "\053\052\037\053\044\054\025\001\002\000\046\006\ufff6" +
+ "\022\113\024\077\025\073\026\074\027\101\030\110\031" +
+ "\075\032\106\033\100\034\105\035\111\036\104\037\112" +
+ "\040\103\041\076\042\107\043\072\001\002\000\004\006" +
+ "\202\001\002\000\034\007\207\010\205\011\211\012\042" +
+ "\042\051\044\036\045\041\047\035\050\057\051\053\052" +
+ "\037\053\044\054\025\001\002\000\004\002\ufff1\001\002" +
+ "\000\052\002\ufff0\016\220\017\221\022\113\024\077\025" +
+ "\073\026\074\027\101\030\110\031\075\032\106\033\100" +
+ "\034\105\035\111\036\104\037\112\040\103\041\076\042" +
+ "\107\043\072\001\002\000\030\002\uffef\012\042\042\051" +
+ "\044\036\045\041\047\035\050\057\051\053\052\037\053" +
+ "\044\054\025\001\002\000\004\002\uffff\001\002\000\004" +
+ "\002\ufff5\001\002\000\004\002\ufff4\001\002\000\004\054" +
+ "\025\001\002\000\004\012\213\001\002\000\030\012\042" +
+ "\013\214\042\051\044\036\045\041\047\035\050\057\051" +
+ "\053\052\037\053\044\054\025\001\002\000\004\002\uffed" +
+ "\001\002\000\004\013\216\001\002\000\004\002\uffec\001" +
+ "\002\000\046\002\uffee\022\113\024\077\025\073\026\074" +
+ "\027\101\030\110\031\075\032\106\033\100\034\105\035" +
+ "\111\036\104\037\112\040\103\041\076\042\107\043\072" +
+ "\001\002\000\032\010\205\011\211\012\042\042\051\044" +
+ "\036\045\041\047\035\050\057\051\053\052\037\053\044" +
+ "\054\025\001\002\000\032\010\205\011\211\012\042\042" +
+ "\051\044\036\045\041\047\035\050\057\051\053\052\037" +
+ "\053\044\054\025\001\002\000\004\002\ufff2\001\002\000" +
+ "\004\002\ufff3\001\002" });
+ /** Access to parse-action table. */
+ public short[][] action_table() {return _action_table;}
- public static class eca_script_rule_return extends ParserRuleReturnScope {
- Object tree;
- public Object getTree() { return tree; }
- };
+ /** <code>reduce_goto</code> table. */
+ protected static final short[][] _reduce_table =
+ unpackFromStrings(new String[] {
+ "\000\221\000\006\003\005\004\003\001\001\000\002\001" +
+ "\001\000\014\005\010\006\015\007\014\010\012\033\013" +
+ "\001\001\000\002\001\001\000\002\001\001\000\002\001" +
+ "\001\000\002\001\001\000\002\001\001\000\002\001\001" +
+ "\000\002\001\001\000\002\001\001\000\002\001\001\000" +
+ "\012\006\021\007\014\010\012\033\013\001\001\000\012" +
+ "\006\020\007\014\010\012\033\013\001\001\000\002\001" +
+ "\001\000\002\001\001\000\010\032\023\033\026\034\025" +
+ "\001\001\000\002\001\001\000\002\001\001\000\002\001" +
+ "\001\000\002\001\001\000\002\001\001\000\002\001\001" +
+ "\000\032\016\032\017\047\020\044\021\054\022\053\023" +
+ "\033\024\045\025\055\026\051\027\042\033\037\034\046" +
+ "\001\001\000\002\001\001\000\006\030\175\031\061\001" +
+ "\001\000\004\033\174\001\001\000\032\016\172\017\047" +
+ "\020\044\021\054\022\053\023\033\024\045\025\055\026" +
+ "\051\027\042\033\037\034\046\001\001\000\002\001\001" +
+ "\000\002\001\001\000\032\016\165\017\047\020\044\021" +
+ "\054\022\053\023\033\024\045\025\055\026\051\027\042" +
+ "\033\037\034\046\001\001\000\032\016\163\017\047\020" +
+ "\044\021\054\022\053\023\033\024\045\025\055\026\051" +
+ "\027\042\033\037\034\046\001\001\000\006\030\154\031" +
+ "\061\001\001\000\002\001\001\000\002\001\001\000\002" +
+ "\001\001\000\002\001\001\000\002\001\001\000\032\016" +
+ "\142\017\047\020\044\021\054\022\053\023\033\024\045" +
+ "\025\055\026\051\027\042\033\037\034\046\001\001\000" +
+ "\002\001\001\000\002\001\001\000\002\001\001\000\002" +
+ "\001\001\000\006\030\060\031\061\001\001\000\002\001" +
+ "\001\000\032\016\140\017\047\020\044\021\054\022\053" +
+ "\023\033\024\045\025\055\026\051\027\042\033\037\034" +
+ "\046\001\001\000\002\001\001\000\006\030\137\031\061" +
+ "\001\001\000\004\033\063\001\001\000\002\001\001\000" +
+ "\034\015\067\016\065\017\047\020\044\021\054\022\053" +
+ "\023\033\024\045\025\055\026\051\027\042\033\037\034" +
+ "\046\001\001\000\002\001\001\000\002\001\001\000\002" +
+ "\001\001\000\002\001\001\000\032\016\136\017\047\020" +
+ "\044\021\054\022\053\023\033\024\045\025\055\026\051" +
+ "\027\042\033\037\034\046\001\001\000\032\016\135\017" +
+ "\047\020\044\021\054\022\053\023\033\024\045\025\055" +
+ "\026\051\027\042\033\037\034\046\001\001\000\032\016" +
+ "\134\017\047\020\044\021\054\022\053\023\033\024\045" +
+ "\025\055\026\051\027\042\033\037\034\046\001\001\000" +
+ "\032\016\133\017\047\020\044\021\054\022\053\023\033" +
+ "\024\045\025\055\026\051\027\042\033\037\034\046\001" +
+ "\001\000\032\016\132\017\047\020\044\021\054\022\053" +
+ "\023\033\024\045\025\055\026\051\027\042\033\037\034" +
+ "\046\001\001\000\032\016\131\017\047\020\044\021\054" +
+ "\022\053\023\033\024\045\025\055\026\051\027\042\033" +
+ "\037\034\046\001\001\000\032\016\130\017\047\020\044" +
+ "\021\054\022\053\023\033\024\045\025\055\026\051\027" +
+ "\042\033\037\034\046\001\001\000\032\016\127\017\047" +
+ "\020\044\021\054\022\053\023\033\024\045\025\055\026" +
+ "\051\027\042\033\037\034\046\001\001\000\034\015\126" +
+ "\016\065\017\047\020\044\021\054\022\053\023\033\024" +
+ "\045\025\055\026\051\027\042\033\037\034\046\001\001" +
+ "\000\032\016\125\017\047\020\044\021\054\022\053\023" +
+ "\033\024\045\025\055\026\051\027\042\033\037\034\046" +
+ "\001\001\000\032\016\124\017\047\020\044\021\054\022" +
+ "\053\023\033\024\045\025\055\026\051\027\042\033\037" +
+ "\034\046\001\001\000\032\016\123\017\047\020\044\021" +
+ "\054\022\053\023\033\024\045\025\055\026\051\027\042" +
+ "\033\037\034\046\001\001\000\032\016\122\017\047\020" +
+ "\044\021\054\022\053\023\033\024\045\025\055\026\051" +
+ "\027\042\033\037\034\046\001\001\000\032\016\121\017" +
+ "\047\020\044\021\054\022\053\023\033\024\045\025\055" +
+ "\026\051\027\042\033\037\034\046\001\001\000\032\016" +
+ "\120\017\047\020\044\021\054\022\053\023\033\024\045" +
+ "\025\055\026\051\027\042\033\037\034\046\001\001\000" +
+ "\032\016\117\017\047\020\044\021\054\022\053\023\033" +
+ "\024\045\025\055\026\051\027\042\033\037\034\046\001" +
+ "\001\000\032\016\116\017\047\020\044\021\054\022\053" +
+ "\023\033\024\045\025\055\026\051\027\042\033\037\034" +
+ "\046\001\001\000\032\016\113\017\047\020\044\021\054" +
+ "\022\053\023\033\024\045\025\055\026\051\027\042\033" +
+ "\037\034\046\001\001\000\002\001\001\000\032\016\115" +
+ "\017\047\020\044\021\054\022\053\023\033\024\045\025" +
+ "\055\026\051\027\042\033\037\034\046\001\001\000\002" +
+ "\001\001\000\002\001\001\000\002\001\001\000\002\001" +
+ "\001\000\002\001\001\000\002\001\001\000\002\001\001" +
+ "\000\002\001\001\000\002\001\001\000\002\001\001\000" +
+ "\002\001\001\000\002\001\001\000\002\001\001\000\002" +
+ "\001\001\000\002\001\001\000\002\001\001\000\002\001" +
+ "\001\000\002\001\001\000\002\001\001\000\002\001\001" +
+ "\000\002\001\001\000\002\001\001\000\004\033\145\001" +
+ "\001\000\002\001\001\000\002\001\001\000\034\015\150" +
+ "\016\065\017\047\020\044\021\054\022\053\023\033\024" +
+ "\045\025\055\026\051\027\042\033\037\034\046\001\001" +
+ "\000\002\001\001\000\002\001\001\000\002\001\001\000" +
+ "\004\033\153\001\001\000\002\001\001\000\002\001\001" +
+ "\000\004\033\156\001\001\000\002\001\001\000\034\015" +
+ "\161\016\065\017\047\020\044\021\054\022\053\023\033" +
+ "\024\045\025\055\026\051\027\042\033\037\034\046\001" +
+ "\001\000\002\001\001\000\002\001\001\000\002\001\001" +
+ "\000\002\001\001\000\002\001\001\000\002\001\001\000" +
+ "\034\015\170\016\065\017\047\020\044\021\054\022\053" +
+ "\023\033\024\045\025\055\026\051\027\042\033\037\034" +
+ "\046\001\001\000\002\001\001\000\002\001\001\000\002" +
+ "\001\001\000\002\001\001\000\002\001\001\000\002\001" +
+ "\001\000\002\001\001\000\034\011\200\016\177\017\047" +
+ "\020\044\021\054\022\053\023\033\024\045\025\055\026" +
+ "\051\027\042\033\037\034\046\001\001\000\002\001\001" +
+ "\000\002\001\001\000\040\012\205\013\207\014\202\016" +
+ "\203\017\047\020\044\021\054\022\053\023\033\024\045" +
+ "\025\055\026\051\027\042\033\037\034\046\001\001\000" +
+ "\002\001\001\000\002\001\001\000\032\016\216\017\047" +
+ "\020\044\021\054\022\053\023\033\024\045\025\055\026" +
+ "\051\027\042\033\037\034\046\001\001\000\002\001\001" +
+ "\000\002\001\001\000\002\001\001\000\010\032\211\033" +
+ "\026\034\025\001\001\000\002\001\001\000\034\015\214" +
+ "\016\065\017\047\020\044\021\054\022\053\023\033\024" +
+ "\045\025\055\026\051\027\042\033\037\034\046\001\001" +
+ "\000\002\001\001\000\002\001\001\000\002\001\001\000" +
+ "\002\001\001\000\036\013\222\014\202\016\203\017\047" +
+ "\020\044\021\054\022\053\023\033\024\045\025\055\026" +
+ "\051\027\042\033\037\034\046\001\001\000\036\013\221" +
+ "\014\202\016\203\017\047\020\044\021\054\022\053\023" +
+ "\033\024\045\025\055\026\051\027\042\033\037\034\046" +
+ "\001\001\000\002\001\001\000\002\001\001" });
- // $ANTLR start eca_script_rule
- // dd/grammar/ECAGrammar.g:49:1: eca_script_rule : rule= eca_script_rule_one EOF -> ^( $rule) ;
- public final eca_script_rule_return eca_script_rule() throws RecognitionException {
- eca_script_rule_return retval = new eca_script_rule_return();
- retval.start = input.LT(1);
+ /** Access to <code>reduce_goto</code> table. */
+ public short[][] reduce_table() {return _reduce_table;}
- Object root_0 = null;
+ /** Instance of action encapsulation class. */
+ protected CUP$ECAGrammarParser$actions action_obj;
- Token EOF1=null;
- eca_script_rule_one_return rule = null;
+ /** Action encapsulation object initializer. */
+ protected void init_actions()
+ {
+ action_obj = new CUP$ECAGrammarParser$actions(this);
+ }
+ /** Invoke a user supplied parse action. */
+ public java_cup.runtime.Symbol do_action(
+ int act_num,
+ java_cup.runtime.lr_parser parser,
+ java.util.Stack stack,
+ int top)
+ throws java.lang.Exception
+ {
+ /* call code in generated class */
+ return action_obj.CUP$ECAGrammarParser$do_action(act_num, parser, stack, top);
+ }
- Object EOF1_tree=null;
- RewriteRuleTokenStream stream_EOF=new RewriteRuleTokenStream(adaptor,"token EOF");
- RewriteRuleSubtreeStream stream_eca_script_rule_one=new RewriteRuleSubtreeStream(adaptor,"rule eca_script_rule_one");
- try {
- // dd/grammar/ECAGrammar.g:49:17: (rule= eca_script_rule_one EOF -> ^( $rule) )
- // dd/grammar/ECAGrammar.g:49:19: rule= eca_script_rule_one EOF
- {
- pushFollow(FOLLOW_eca_script_rule_one_in_eca_script_rule90);
- rule=eca_script_rule_one();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) stream_eca_script_rule_one.add(rule.getTree());
- EOF1=(Token)input.LT(1);
- match(input,EOF,FOLLOW_EOF_in_eca_script_rule92); if (failed) return retval;
- if ( backtracking==0 ) stream_EOF.add(EOF1);
+ /** Indicates start state. */
+ public int start_state() {return 0;}
+ /** Indicates start production. */
+ public int start_production() {return 1;}
+ /** <code>EOF</code> Symbol index. */
+ public int EOF_sym() {return 0;}
- // AST REWRITE
- // elements: rule
- // token labels:
- // rule labels: rule, retval
- // token list labels:
- // rule list labels:
- if ( backtracking==0 ) {
- retval.tree = root_0;
- RewriteRuleSubtreeStream stream_rule=new RewriteRuleSubtreeStream(adaptor,"token rule",rule!=null?rule.tree:null);
- RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
+ /** <code>error</code> Symbol index. */
+ public int error_sym() {return 1;}
- root_0 = (Object)adaptor.nil();
- // 49:48: -> ^( $rule)
- {
- // dd/grammar/ECAGrammar.g:49:51: ^( $rule)
- {
- Object root_1 = (Object)adaptor.nil();
- root_1 = (Object)adaptor.becomeRoot(stream_rule.nextNode(), root_1);
- adaptor.addChild(root_0, root_1);
- }
+ /** Scan to get the next Symbol. */
+ public java_cup.runtime.Symbol scan()
+ throws java.lang.Exception
+ {
+ Symbol token = getScanner().next_token();
+ return token;
+
+ }
+}
- }
+/** Cup generated class to encapsulate user supplied action code.*/
+class CUP$ECAGrammarParser$actions {
- }
- }
+ /*
+ private ParseNode node(int tag)
+ {
+ return ParseNode.node(tag);
+ }
+ */
- retval.stop = input.LT(-1);
+ private ParseNode node(int tag, int line, int column)
+ {
+ return ParseNode.node(tag, line, column);
+ }
- if ( backtracking==0 ) {
- retval.tree = (Object)adaptor.rulePostProcessing(root_0);
- adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
- }
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return retval;
+ private ParseNode node(int tag, int line, int column, Object child0)
+ {
+ return ParseNode.node(tag, line, column, child0);
}
- // $ANTLR end eca_script_rule
- public static class eca_script_rule_one_return extends ParserRuleReturnScope {
- Object tree;
- public Object getTree() { return tree; }
- };
+ private ParseNode node(int tag, int line, int column, Object child0, Object child1)
+ {
+ return ParseNode.node(tag, line, column, child0, child1);
+ }
- // $ANTLR start eca_script_rule_one
- // dd/grammar/ECAGrammar.g:51:1: eca_script_rule_one : RULE n= SYMBOL CLASS cl= SYMBOL METHOD m= SYMBOL LINE l= NUMBER BIND e= event IF c= condition DO a= action ENDRULE -> ^( RULE $n $cl $m $l $e $c $a) ;
- public final eca_script_rule_one_return eca_script_rule_one() throws RecognitionException {
- eca_script_rule_one_return retval = new eca_script_rule_one_return();
- retval.start = input.LT(1);
+ private ParseNode node(int tag, int line, int column, Object child0, Object child1, Object child2)
+ {
+ return ParseNode.node(tag, line, column, child0, child1, child2);
+ }
- Object root_0 = null;
+ /*
+ private ParseNode node(int tag, int line, int column, Object child0, Object child1, Object child2, Object child3)
+ {
+ return ParseNode.node(tag, line, column, child0, child1, child2, child3);
+ }
+ */
- Token n=null;
- Token cl=null;
- Token m=null;
- Token l=null;
- Token RULE2=null;
- Token CLASS3=null;
- Token METHOD4=null;
- Token LINE5=null;
- Token BIND6=null;
- Token IF7=null;
- Token DO8=null;
- Token ENDRULE9=null;
- event_return e = null;
+ private final ECAGrammarParser parser;
- condition_return c = null;
+ /** Constructor */
+ CUP$ECAGrammarParser$actions(ECAGrammarParser parser) {
+ this.parser = parser;
+ }
- action_return a = null;
+ /** Method with the actual generated action code. */
+ public final java_cup.runtime.Symbol CUP$ECAGrammarParser$do_action(
+ int CUP$ECAGrammarParser$act_num,
+ java_cup.runtime.lr_parser CUP$ECAGrammarParser$parser,
+ java.util.Stack CUP$ECAGrammarParser$stack,
+ int CUP$ECAGrammarParser$top)
+ throws java.lang.Exception
+ {
+ /* Symbol object for return from actions */
+ java_cup.runtime.Symbol CUP$ECAGrammarParser$result;
-
- Object n_tree=null;
- Object cl_tree=null;
- Object m_tree=null;
- Object l_tree=null;
- Object RULE2_tree=null;
- Object CLASS3_tree=null;
- Object METHOD4_tree=null;
- Object LINE5_tree=null;
- Object BIND6_tree=null;
- Object IF7_tree=null;
- Object DO8_tree=null;
- Object ENDRULE9_tree=null;
- RewriteRuleTokenStream stream_CLASS=new RewriteRuleTokenStream(adaptor,"token CLASS");
- RewriteRuleTokenStream stream_RULE=new RewriteRuleTokenStream(adaptor,"token RULE");
- RewriteRuleTokenStream stream_DO=new RewriteRuleTokenStream(adaptor,"token DO");
- RewriteRuleTokenStream stream_LINE=new RewriteRuleTokenStream(adaptor,"token LINE");
- RewriteRuleTokenStream stream_ENDRULE=new RewriteRuleTokenStream(adaptor,"token ENDRULE");
- RewriteRuleTokenStream stream_BIND=new RewriteRuleTokenStream(adaptor,"token BIND");
- RewriteRuleTokenStream stream_IF=new RewriteRuleTokenStream(adaptor,"token IF");
- RewriteRuleTokenStream stream_NUMBER=new RewriteRuleTokenStream(adaptor,"token NUMBER");
- RewriteRuleTokenStream stream_SYMBOL=new RewriteRuleTokenStream(adaptor,"token SYMBOL");
- RewriteRuleTokenStream stream_METHOD=new RewriteRuleTokenStream(adaptor,"token METHOD");
- RewriteRuleSubtreeStream stream_action=new RewriteRuleSubtreeStream(adaptor,"rule action");
- RewriteRuleSubtreeStream stream_event=new RewriteRuleSubtreeStream(adaptor,"rule event");
- RewriteRuleSubtreeStream stream_condition=new RewriteRuleSubtreeStream(adaptor,"rule condition");
- try {
- // dd/grammar/ECAGrammar.g:52:2: ( RULE n= SYMBOL CLASS cl= SYMBOL METHOD m= SYMBOL LINE l= NUMBER BIND e= event IF c= condition DO a= action ENDRULE -> ^( RULE $n $cl $m $l $e $c $a) )
- // dd/grammar/ECAGrammar.g:52:4: RULE n= SYMBOL CLASS cl= SYMBOL METHOD m= SYMBOL LINE l= NUMBER BIND e= event IF c= condition DO a= action ENDRULE
+ /* select the action based on the action number */
+ switch (CUP$ECAGrammarParser$act_num)
+ {
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 82: // path ::= path DOT IDENTIFIER
{
- RULE2=(Token)input.LT(1);
- match(input,RULE,FOLLOW_RULE_in_eca_script_rule_one109); if (failed) return retval;
- if ( backtracking==0 ) stream_RULE.add(RULE2);
+ ParseNode RESULT = null;
+ int pleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left;
+ int pright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).right;
+ ParseNode p = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).value;
+ int ileft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int iright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ String i = (String)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.PATH, ileft, iright, i, p);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(26/*path*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
+ }
+ return CUP$ECAGrammarParser$result;
- n=(Token)input.LT(1);
- match(input,SYMBOL,FOLLOW_SYMBOL_in_eca_script_rule_one113); if (failed) return retval;
- if ( backtracking==0 ) stream_SYMBOL.add(n);
-
- CLASS3=(Token)input.LT(1);
- match(input,CLASS,FOLLOW_CLASS_in_eca_script_rule_one117); if (failed) return retval;
- if ( backtracking==0 ) stream_CLASS.add(CLASS3);
-
- cl=(Token)input.LT(1);
- match(input,SYMBOL,FOLLOW_SYMBOL_in_eca_script_rule_one121); if (failed) return retval;
- if ( backtracking==0 ) stream_SYMBOL.add(cl);
-
- METHOD4=(Token)input.LT(1);
- match(input,METHOD,FOLLOW_METHOD_in_eca_script_rule_one125); if (failed) return retval;
- if ( backtracking==0 ) stream_METHOD.add(METHOD4);
-
- m=(Token)input.LT(1);
- match(input,SYMBOL,FOLLOW_SYMBOL_in_eca_script_rule_one129); if (failed) return retval;
- if ( backtracking==0 ) stream_SYMBOL.add(m);
-
- LINE5=(Token)input.LT(1);
- match(input,LINE,FOLLOW_LINE_in_eca_script_rule_one133); if (failed) return retval;
- if ( backtracking==0 ) stream_LINE.add(LINE5);
-
- l=(Token)input.LT(1);
- match(input,NUMBER,FOLLOW_NUMBER_in_eca_script_rule_one137); if (failed) return retval;
- if ( backtracking==0 ) stream_NUMBER.add(l);
-
- BIND6=(Token)input.LT(1);
- match(input,BIND,FOLLOW_BIND_in_eca_script_rule_one141); if (failed) return retval;
- if ( backtracking==0 ) stream_BIND.add(BIND6);
-
- pushFollow(FOLLOW_event_in_eca_script_rule_one145);
- e=event();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) stream_event.add(e.getTree());
- IF7=(Token)input.LT(1);
- match(input,IF,FOLLOW_IF_in_eca_script_rule_one149); if (failed) return retval;
- if ( backtracking==0 ) stream_IF.add(IF7);
-
- pushFollow(FOLLOW_condition_in_eca_script_rule_one153);
- c=condition();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) stream_condition.add(c.getTree());
- DO8=(Token)input.LT(1);
- match(input,DO,FOLLOW_DO_in_eca_script_rule_one157); if (failed) return retval;
- if ( backtracking==0 ) stream_DO.add(DO8);
-
- pushFollow(FOLLOW_action_in_eca_script_rule_one161);
- a=action();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) stream_action.add(a.getTree());
- ENDRULE9=(Token)input.LT(1);
- match(input,ENDRULE,FOLLOW_ENDRULE_in_eca_script_rule_one165); if (failed) return retval;
- if ( backtracking==0 ) stream_ENDRULE.add(ENDRULE9);
-
-
- // AST REWRITE
- // elements: n, a, l, RULE, c, e, m, cl
- // token labels: cl, m, n, l
- // rule labels: a, c, retval, e
- // token list labels:
- // rule list labels:
- if ( backtracking==0 ) {
- retval.tree = root_0;
- RewriteRuleTokenStream stream_cl=new RewriteRuleTokenStream(adaptor,"token cl",cl);
- RewriteRuleTokenStream stream_m=new RewriteRuleTokenStream(adaptor,"token m",m);
- RewriteRuleTokenStream stream_n=new RewriteRuleTokenStream(adaptor,"token n",n);
- RewriteRuleTokenStream stream_l=new RewriteRuleTokenStream(adaptor,"token l",l);
- RewriteRuleSubtreeStream stream_a=new RewriteRuleSubtreeStream(adaptor,"token a",a!=null?a.tree:null);
- RewriteRuleSubtreeStream stream_c=new RewriteRuleSubtreeStream(adaptor,"token c",c!=null?c.tree:null);
- RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
- RewriteRuleSubtreeStream stream_e=new RewriteRuleSubtreeStream(adaptor,"token e",e!=null?e.tree:null);
-
- root_0 = (Object)adaptor.nil();
- // 59:12: -> ^( RULE $n $cl $m $l $e $c $a)
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 81: // path ::= IDENTIFIER
{
- // dd/grammar/ECAGrammar.g:59:15: ^( RULE $n $cl $m $l $e $c $a)
- {
- Object root_1 = (Object)adaptor.nil();
- root_1 = (Object)adaptor.becomeRoot(stream_RULE.next(), root_1);
-
- adaptor.addChild(root_1, stream_n.next());
- adaptor.addChild(root_1, stream_cl.next());
- adaptor.addChild(root_1, stream_m.next());
- adaptor.addChild(root_1, stream_l.next());
- adaptor.addChild(root_1, stream_e.next());
- adaptor.addChild(root_1, stream_c.next());
- adaptor.addChild(root_1, stream_a.next());
-
- adaptor.addChild(root_0, root_1);
- }
-
+ ParseNode RESULT = null;
+ int ileft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int iright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ String i = (String)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.PATH, ileft, iright, i, null);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(26/*path*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
+ return CUP$ECAGrammarParser$result;
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 80: // simple_name ::= IDENTIFIER
+ {
+ ParseNode RESULT = null;
+ int ileft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int iright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ String i = (String)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.IDENTIFIER, ileft, iright, i, null);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(25/*simple_name*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
+ return CUP$ECAGrammarParser$result;
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 79: // name ::= path DOT IDENTIFIER
+ {
+ ParseNode RESULT = null;
+ int pleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left;
+ int pright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).right;
+ ParseNode p = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).value;
+ int ileft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int iright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ String i = (String)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.IDENTIFIER, ileft, iright, i, p);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(24/*name*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
+ return CUP$ECAGrammarParser$result;
- retval.stop = input.LT(-1);
-
- if ( backtracking==0 ) {
- retval.tree = (Object)adaptor.rulePostProcessing(root_0);
- adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 78: // name ::= simple_name
+ {
+ ParseNode RESULT = null;
+ int nleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int nright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode n = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = n;
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(24/*name*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return retval;
- }
- // $ANTLR end eca_script_rule_one
+ return CUP$ECAGrammarParser$result;
- public static class eca_rule_return extends ParserRuleReturnScope {
- Object tree;
- public Object getTree() { return tree; }
- };
-
- // $ANTLR start eca_rule
- // dd/grammar/ECAGrammar.g:61:1: eca_rule : eca EOF -> ^( eca ) ;
- public final eca_rule_return eca_rule() throws RecognitionException {
- eca_rule_return retval = new eca_rule_return();
- retval.start = input.LT(1);
-
- Object root_0 = null;
-
- Token EOF11=null;
- eca_return eca10 = null;
-
-
- Object EOF11_tree=null;
- RewriteRuleTokenStream stream_EOF=new RewriteRuleTokenStream(adaptor,"token EOF");
- RewriteRuleSubtreeStream stream_eca=new RewriteRuleSubtreeStream(adaptor,"rule eca");
- try {
- // dd/grammar/ECAGrammar.g:61:10: ( eca EOF -> ^( eca ) )
- // dd/grammar/ECAGrammar.g:61:12: eca EOF
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 77: // simple_expr ::= LPAREN expr RPAREN
{
- pushFollow(FOLLOW_eca_in_eca_rule202);
- eca10=eca();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) stream_eca.add(eca10.getTree());
- EOF11=(Token)input.LT(1);
- match(input,EOF,FOLLOW_EOF_in_eca_rule204); if (failed) return retval;
- if ( backtracking==0 ) stream_EOF.add(EOF11);
+ ParseNode RESULT = null;
+ int eleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).left;
+ int eright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).right;
+ ParseNode e = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).value;
+ RESULT = e;
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(21/*simple_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
+ }
+ return CUP$ECAGrammarParser$result;
-
- // AST REWRITE
- // elements: eca
- // token labels:
- // rule labels: retval
- // token list labels:
- // rule list labels:
- if ( backtracking==0 ) {
- retval.tree = root_0;
- RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
-
- root_0 = (Object)adaptor.nil();
- // 61:20: -> ^( eca )
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 76: // simple_expr ::= DOLLAR INTEGER_LITERAL
{
- // dd/grammar/ECAGrammar.g:61:23: ^( eca )
- {
- Object root_1 = (Object)adaptor.nil();
- root_1 = (Object)adaptor.becomeRoot(stream_eca.nextNode(), root_1);
-
- adaptor.addChild(root_0, root_1);
- }
-
+ ParseNode RESULT = null;
+ int oleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).left;
+ int oright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).right;
+ Object o = (Object)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).value;
+ int ileft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int iright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ Integer i = (Integer)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.UNOP, ileft, iright, node(ParseNode.DOLLAR, oleft, oright), node(ParseNode.INTEGER_LITERAL, ileft, iright, i));
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(21/*simple_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
+ return CUP$ECAGrammarParser$result;
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 75: // simple_expr ::= DOLLAR simple_name
+ {
+ ParseNode RESULT = null;
+ int oleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).left;
+ int oright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).right;
+ Object o = (Object)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).value;
+ int snleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int snright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode sn = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.UNOP, snleft, snright, node(ParseNode.DOLLAR, oleft, oright), sn);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(21/*simple_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
+ return CUP$ECAGrammarParser$result;
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 74: // simple_expr ::= STRING_LITERAL
+ {
+ ParseNode RESULT = null;
+ int sleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int sright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ String s = (String)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.STRING_LITERAL, sleft, sright, s);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(21/*simple_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
+ return CUP$ECAGrammarParser$result;
- retval.stop = input.LT(-1);
-
- if ( backtracking==0 ) {
- retval.tree = (Object)adaptor.rulePostProcessing(root_0);
- adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 73: // simple_expr ::= BOOLEAN_LITERAL
+ {
+ ParseNode RESULT = null;
+ int bleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int bright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ Boolean b = (Boolean)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.BOOLEAN_LITERAL, bleft, bright, b);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(21/*simple_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return retval;
- }
- // $ANTLR end eca_rule
+ return CUP$ECAGrammarParser$result;
- public static class eca_event_return extends ParserRuleReturnScope {
- Object tree;
- public Object getTree() { return tree; }
- };
-
- // $ANTLR start eca_event
- // dd/grammar/ECAGrammar.g:64:1: eca_event : event EOF -> ^( event ) ;
- public final eca_event_return eca_event() throws RecognitionException {
- eca_event_return retval = new eca_event_return();
- retval.start = input.LT(1);
-
- Object root_0 = null;
-
- Token EOF13=null;
- event_return event12 = null;
-
-
- Object EOF13_tree=null;
- RewriteRuleTokenStream stream_EOF=new RewriteRuleTokenStream(adaptor,"token EOF");
- RewriteRuleSubtreeStream stream_event=new RewriteRuleSubtreeStream(adaptor,"rule event");
- try {
- // dd/grammar/ECAGrammar.g:64:11: ( event EOF -> ^( event ) )
- // dd/grammar/ECAGrammar.g:64:13: event EOF
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 72: // simple_expr ::= FLOAT_LITERAL
{
- pushFollow(FOLLOW_event_in_eca_event221);
- event12=event();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) stream_event.add(event12.getTree());
- EOF13=(Token)input.LT(1);
- match(input,EOF,FOLLOW_EOF_in_eca_event223); if (failed) return retval;
- if ( backtracking==0 ) stream_EOF.add(EOF13);
+ ParseNode RESULT = null;
+ int fleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int fright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ Float f = (Float)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.FLOAT_LITERAL, fleft, fright, f);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(21/*simple_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
+ }
+ return CUP$ECAGrammarParser$result;
-
- // AST REWRITE
- // elements: event
- // token labels:
- // rule labels: retval
- // token list labels:
- // rule list labels:
- if ( backtracking==0 ) {
- retval.tree = root_0;
- RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
-
- root_0 = (Object)adaptor.nil();
- // 64:23: -> ^( event )
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 71: // simple_expr ::= INTEGER_LITERAL
{
- // dd/grammar/ECAGrammar.g:64:26: ^( event )
- {
- Object root_1 = (Object)adaptor.nil();
- root_1 = (Object)adaptor.becomeRoot(stream_event.nextNode(), root_1);
-
- adaptor.addChild(root_0, root_1);
- }
-
+ ParseNode RESULT = null;
+ int ileft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int iright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ Integer i = (Integer)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.INTEGER_LITERAL, ileft, iright, i);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(21/*simple_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
+ return CUP$ECAGrammarParser$result;
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 70: // expr_meth_expr ::= meth_expr DOT simple_name LPAREN expr_list RPAREN
+ {
+ ParseNode RESULT = null;
+ int emeleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-5)).left;
+ int emeright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-5)).right;
+ ParseNode eme = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-5)).value;
+ int mleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-3)).left;
+ int mright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-3)).right;
+ ParseNode m = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-3)).value;
+ int argsleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).left;
+ int argsright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).right;
+ ParseNode args = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).value;
+ RESULT = node(ParseNode.METH, mleft, mright, m, eme, args);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(20/*expr_meth_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-5)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
+ return CUP$ECAGrammarParser$result;
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 69: // expr_meth_expr ::= meth_expr DOT simple_name LPAREN RPAREN
+ {
+ ParseNode RESULT = null;
+ int emeleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-4)).left;
+ int emeright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-4)).right;
+ ParseNode eme = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-4)).value;
+ int mleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left;
+ int mright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).right;
+ ParseNode m = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).value;
+ RESULT = node(ParseNode.METH, mleft, mright, m, eme, null);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(20/*expr_meth_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-4)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
+ return CUP$ECAGrammarParser$result;
- retval.stop = input.LT(-1);
-
- if ( backtracking==0 ) {
- retval.tree = (Object)adaptor.rulePostProcessing(root_0);
- adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 68: // expr_meth_expr ::= simple_expr DOT simple_name LPAREN expr_list RPAREN
+ {
+ ParseNode RESULT = null;
+ int seleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-5)).left;
+ int seright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-5)).right;
+ ParseNode se = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-5)).value;
+ int mleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-3)).left;
+ int mright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-3)).right;
+ ParseNode m = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-3)).value;
+ int argsleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).left;
+ int argsright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).right;
+ ParseNode args = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).value;
+ RESULT = node(ParseNode.METH, mleft, mright, m, se, args);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(20/*expr_meth_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-5)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return retval;
- }
- // $ANTLR end eca_event
+ return CUP$ECAGrammarParser$result;
- public static class eca_condition_return extends ParserRuleReturnScope {
- Object tree;
- public Object getTree() { return tree; }
- };
-
- // $ANTLR start eca_condition
- // dd/grammar/ECAGrammar.g:67:1: eca_condition : condition EOF -> ^( condition ) ;
- public final eca_condition_return eca_condition() throws RecognitionException {
- eca_condition_return retval = new eca_condition_return();
- retval.start = input.LT(1);
-
- Object root_0 = null;
-
- Token EOF15=null;
- condition_return condition14 = null;
-
-
- Object EOF15_tree=null;
- RewriteRuleTokenStream stream_EOF=new RewriteRuleTokenStream(adaptor,"token EOF");
- RewriteRuleSubtreeStream stream_condition=new RewriteRuleSubtreeStream(adaptor,"rule condition");
- try {
- // dd/grammar/ECAGrammar.g:67:15: ( condition EOF -> ^( condition ) )
- // dd/grammar/ECAGrammar.g:67:17: condition EOF
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 67: // expr_meth_expr ::= simple_expr DOT simple_name LPAREN RPAREN
{
- pushFollow(FOLLOW_condition_in_eca_condition239);
- condition14=condition();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) stream_condition.add(condition14.getTree());
- EOF15=(Token)input.LT(1);
- match(input,EOF,FOLLOW_EOF_in_eca_condition241); if (failed) return retval;
- if ( backtracking==0 ) stream_EOF.add(EOF15);
+ ParseNode RESULT = null;
+ int seleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-4)).left;
+ int seright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-4)).right;
+ ParseNode se = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-4)).value;
+ int mleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left;
+ int mright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).right;
+ ParseNode m = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).value;
+ RESULT = node(ParseNode.METH, mleft, mright, m, se, null);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(20/*expr_meth_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-4)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
+ }
+ return CUP$ECAGrammarParser$result;
-
- // AST REWRITE
- // elements: condition
- // token labels:
- // rule labels: retval
- // token list labels:
- // rule list labels:
- if ( backtracking==0 ) {
- retval.tree = root_0;
- RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
-
- root_0 = (Object)adaptor.nil();
- // 67:31: -> ^( condition )
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 66: // meth_expr ::= expr_meth_expr
{
- // dd/grammar/ECAGrammar.g:67:34: ^( condition )
- {
- Object root_1 = (Object)adaptor.nil();
- root_1 = (Object)adaptor.becomeRoot(stream_condition.nextNode(), root_1);
-
- adaptor.addChild(root_0, root_1);
- }
-
+ ParseNode RESULT = null;
+ int emeleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int emeright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode eme = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = eme;
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(19/*meth_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
+ return CUP$ECAGrammarParser$result;
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 65: // meth_expr ::= path DOT simple_name LPAREN expr_list RPAREN
+ {
+ ParseNode RESULT = null;
+ int pleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-5)).left;
+ int pright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-5)).right;
+ ParseNode p = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-5)).value;
+ int mleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-3)).left;
+ int mright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-3)).right;
+ ParseNode m = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-3)).value;
+ int argsleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).left;
+ int argsright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).right;
+ ParseNode args = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).value;
+ RESULT = node(ParseNode.METH, mleft, mright, m, p, args);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(19/*meth_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-5)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
+ return CUP$ECAGrammarParser$result;
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 64: // meth_expr ::= path DOT simple_name LPAREN RPAREN
+ {
+ ParseNode RESULT = null;
+ int pleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-4)).left;
+ int pright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-4)).right;
+ ParseNode p = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-4)).value;
+ int mleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left;
+ int mright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).right;
+ ParseNode m = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).value;
+ RESULT = node(ParseNode.METH, mleft, mright, m, p, null);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(19/*meth_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-4)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
+ return CUP$ECAGrammarParser$result;
- retval.stop = input.LT(-1);
-
- if ( backtracking==0 ) {
- retval.tree = (Object)adaptor.rulePostProcessing(root_0);
- adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 63: // meth_expr ::= simple_name LPAREN expr_list RPAREN
+ {
+ ParseNode RESULT = null;
+ int mleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-3)).left;
+ int mright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-3)).right;
+ ParseNode m = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-3)).value;
+ int argsleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).left;
+ int argsright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).right;
+ ParseNode args = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).value;
+ RESULT = node(ParseNode.METH, mleft, mright, m, null, args);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(19/*meth_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-3)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return retval;
- }
- // $ANTLR end eca_condition
+ return CUP$ECAGrammarParser$result;
- public static class eca_action_return extends ParserRuleReturnScope {
- Object tree;
- public Object getTree() { return tree; }
- };
-
- // $ANTLR start eca_action
- // dd/grammar/ECAGrammar.g:70:1: eca_action : action EOF -> ^( action ) ;
- public final eca_action_return eca_action() throws RecognitionException {
- eca_action_return retval = new eca_action_return();
- retval.start = input.LT(1);
-
- Object root_0 = null;
-
- Token EOF17=null;
- action_return action16 = null;
-
-
- Object EOF17_tree=null;
- RewriteRuleTokenStream stream_EOF=new RewriteRuleTokenStream(adaptor,"token EOF");
- RewriteRuleSubtreeStream stream_action=new RewriteRuleSubtreeStream(adaptor,"rule action");
- try {
- // dd/grammar/ECAGrammar.g:70:12: ( action EOF -> ^( action ) )
- // dd/grammar/ECAGrammar.g:70:14: action EOF
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 62: // meth_expr ::= simple_name LPAREN RPAREN
{
- pushFollow(FOLLOW_action_in_eca_action257);
- action16=action();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) stream_action.add(action16.getTree());
- EOF17=(Token)input.LT(1);
- match(input,EOF,FOLLOW_EOF_in_eca_action259); if (failed) return retval;
- if ( backtracking==0 ) stream_EOF.add(EOF17);
+ ParseNode RESULT = null;
+ int mleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left;
+ int mright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).right;
+ ParseNode m = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).value;
+ RESULT = node(ParseNode.METH, mleft, mright, m, null, null);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(19/*meth_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
+ }
+ return CUP$ECAGrammarParser$result;
-
- // AST REWRITE
- // elements: action
- // token labels:
- // rule labels: retval
- // token list labels:
- // rule list labels:
- if ( backtracking==0 ) {
- retval.tree = root_0;
- RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
-
- root_0 = (Object)adaptor.nil();
- // 70:25: -> ^( action )
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 61: // expr_field_expr ::= expr_field_expr DOT simple_name
{
- // dd/grammar/ECAGrammar.g:70:28: ^( action )
- {
- Object root_1 = (Object)adaptor.nil();
- root_1 = (Object)adaptor.becomeRoot(stream_action.nextNode(), root_1);
-
- adaptor.addChild(root_0, root_1);
- }
-
+ ParseNode RESULT = null;
+ int efeleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left;
+ int eferight = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).right;
+ ParseNode efe = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).value;
+ int fleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int fright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode f = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.FIELD, fleft, fright, f, efe);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(18/*expr_field_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
+ return CUP$ECAGrammarParser$result;
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 60: // expr_field_expr ::= simple_expr DOT simple_name
+ {
+ ParseNode RESULT = null;
+ int seleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left;
+ int seright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).right;
+ ParseNode se = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).value;
+ int fleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int fright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode f = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.FIELD, fleft, fright, f, se);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(18/*expr_field_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
+ return CUP$ECAGrammarParser$result;
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 59: // field_expr ::= expr_field_expr
+ {
+ ParseNode RESULT = null;
+ int efeleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int eferight = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode efe = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = efe;
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(17/*field_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
+ return CUP$ECAGrammarParser$result;
- retval.stop = input.LT(-1);
-
- if ( backtracking==0 ) {
- retval.tree = (Object)adaptor.rulePostProcessing(root_0);
- adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 58: // field_expr ::= path DOT simple_name
+ {
+ ParseNode RESULT = null;
+ int pleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left;
+ int pright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).right;
+ ParseNode p = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).value;
+ int fleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int fright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode f = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.FIELD, fleft, fright, f, p);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(17/*field_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return retval;
- }
- // $ANTLR end eca_action
+ return CUP$ECAGrammarParser$result;
- public static class eca_return extends ParserRuleReturnScope {
- Object tree;
- public Object getTree() { return tree; }
- };
-
- // $ANTLR start eca
- // dd/grammar/ECAGrammar.g:73:1: eca : BIND e= event IF c= condition DO a= action -> ^( BIND $e $c $a) ;
- public final eca_return eca() throws RecognitionException {
- eca_return retval = new eca_return();
- retval.start = input.LT(1);
-
- Object root_0 = null;
-
- Token BIND18=null;
- Token IF19=null;
- Token DO20=null;
- event_return e = null;
-
- condition_return c = null;
-
- action_return a = null;
-
-
- Object BIND18_tree=null;
- Object IF19_tree=null;
- Object DO20_tree=null;
- RewriteRuleTokenStream stream_DO=new RewriteRuleTokenStream(adaptor,"token DO");
- RewriteRuleTokenStream stream_BIND=new RewriteRuleTokenStream(adaptor,"token BIND");
- RewriteRuleTokenStream stream_IF=new RewriteRuleTokenStream(adaptor,"token IF");
- RewriteRuleSubtreeStream stream_action=new RewriteRuleSubtreeStream(adaptor,"rule action");
- RewriteRuleSubtreeStream stream_event=new RewriteRuleSubtreeStream(adaptor,"rule event");
- RewriteRuleSubtreeStream stream_condition=new RewriteRuleSubtreeStream(adaptor,"rule condition");
- try {
- // dd/grammar/ECAGrammar.g:73:5: ( BIND e= event IF c= condition DO a= action -> ^( BIND $e $c $a) )
- // dd/grammar/ECAGrammar.g:73:7: BIND e= event IF c= condition DO a= action
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 57: // array_idx ::= LSQUARE expr RSQUARE
{
- BIND18=(Token)input.LT(1);
- match(input,BIND,FOLLOW_BIND_in_eca275); if (failed) return retval;
- if ( backtracking==0 ) stream_BIND.add(BIND18);
+ ParseNode RESULT = null;
+ int eleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).left;
+ int eright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).right;
+ ParseNode e = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).value;
+ RESULT = e;
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(23/*array_idx*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
+ }
+ return CUP$ECAGrammarParser$result;
- pushFollow(FOLLOW_event_in_eca279);
- e=event();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) stream_event.add(e.getTree());
- IF19=(Token)input.LT(1);
- match(input,IF,FOLLOW_IF_in_eca283); if (failed) return retval;
- if ( backtracking==0 ) stream_IF.add(IF19);
-
- pushFollow(FOLLOW_condition_in_eca287);
- c=condition();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) stream_condition.add(c.getTree());
- DO20=(Token)input.LT(1);
- match(input,DO,FOLLOW_DO_in_eca291); if (failed) return retval;
- if ( backtracking==0 ) stream_DO.add(DO20);
-
- pushFollow(FOLLOW_action_in_eca295);
- a=action();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) stream_action.add(a.getTree());
-
- // AST REWRITE
- // elements: e, a, c, BIND
- // token labels:
- // rule labels: a, c, retval, e
- // token list labels:
- // rule list labels:
- if ( backtracking==0 ) {
- retval.tree = root_0;
- RewriteRuleSubtreeStream stream_a=new RewriteRuleSubtreeStream(adaptor,"token a",a!=null?a.tree:null);
- RewriteRuleSubtreeStream stream_c=new RewriteRuleSubtreeStream(adaptor,"token c",c!=null?c.tree:null);
- RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
- RewriteRuleSubtreeStream stream_e=new RewriteRuleSubtreeStream(adaptor,"token e",e!=null?e.tree:null);
-
- root_0 = (Object)adaptor.nil();
- // 75:15: -> ^( BIND $e $c $a)
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 56: // array_idx_list ::= array_idx array_idx_list
{
- // dd/grammar/ECAGrammar.g:75:18: ^( BIND $e $c $a)
- {
- Object root_1 = (Object)adaptor.nil();
- root_1 = (Object)adaptor.becomeRoot(stream_BIND.next(), root_1);
-
- adaptor.addChild(root_1, stream_e.next());
- adaptor.addChild(root_1, stream_c.next());
- adaptor.addChild(root_1, stream_a.next());
-
- adaptor.addChild(root_0, root_1);
- }
-
+ ParseNode RESULT = null;
+ int aileft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).left;
+ int airight = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).right;
+ ParseNode ai = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).value;
+ int ailleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int ailright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode ail = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.SEMI, aileft, airight, ai, ail);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(22/*array_idx_list*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
+ return CUP$ECAGrammarParser$result;
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 55: // array_idx_list ::= array_idx
+ {
+ ParseNode RESULT = null;
+ int aileft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int airight = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode ai = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = ai;
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(22/*array_idx_list*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
+ return CUP$ECAGrammarParser$result;
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 54: // array_expr ::= meth_expr array_idx_list
+ {
+ ParseNode RESULT = null;
+ int meleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).left;
+ int meright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).right;
+ ParseNode me = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).value;
+ int ailleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int ailright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode ail = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.ARRAY, meleft, meright, me, ail);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(16/*array_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
+ return CUP$ECAGrammarParser$result;
- retval.stop = input.LT(-1);
-
- if ( backtracking==0 ) {
- retval.tree = (Object)adaptor.rulePostProcessing(root_0);
- adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 53: // array_expr ::= field_expr array_idx_list
+ {
+ ParseNode RESULT = null;
+ int feleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).left;
+ int feright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).right;
+ ParseNode fe = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).value;
+ int ailleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int ailright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode ail = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.ARRAY, feleft, feright, fe, ail);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(16/*array_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return retval;
- }
- // $ANTLR end eca
+ return CUP$ECAGrammarParser$result;
- public static class event_return extends ParserRuleReturnScope {
- Object tree;
- public Object getTree() { return tree; }
- };
-
- // $ANTLR start event
- // dd/grammar/ECAGrammar.g:80:1: event : bindings ;
- public final event_return event() throws RecognitionException {
- event_return retval = new event_return();
- retval.start = input.LT(1);
-
- Object root_0 = null;
-
- bindings_return bindings21 = null;
-
-
-
- try {
- // dd/grammar/ECAGrammar.g:80:7: ( bindings )
- // dd/grammar/ECAGrammar.g:80:9: bindings
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 52: // array_expr ::= simple_expr array_idx_list
{
- root_0 = (Object)adaptor.nil();
-
- pushFollow(FOLLOW_bindings_in_event322);
- bindings21=bindings();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) adaptor.addChild(root_0, bindings21.getTree());
-
+ ParseNode RESULT = null;
+ int seleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).left;
+ int seright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).right;
+ ParseNode se = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).value;
+ int ailleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int ailright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode ail = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.ARRAY, seleft, seright, se, ail);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(16/*array_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
+ return CUP$ECAGrammarParser$result;
- retval.stop = input.LT(-1);
-
- if ( backtracking==0 ) {
- retval.tree = (Object)adaptor.rulePostProcessing(root_0);
- adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 51: // unary_oper_expr ::= MINUS expr
+ {
+ ParseNode RESULT = null;
+ int oleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).left;
+ int oright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).right;
+ Object o = (Object)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).value;
+ int eleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int eright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode e = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.UNOP, eleft, eright, node(ParseNode.UMINUS, oleft, oright), e);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(15/*unary_oper_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return retval;
- }
- // $ANTLR end event
+ return CUP$ECAGrammarParser$result;
- public static class bindings_return extends ParserRuleReturnScope {
- Object tree;
- public Object getTree() { return tree; }
- };
-
- // $ANTLR start bindings
- // dd/grammar/ECAGrammar.g:85:1: bindings : ( binding SEPR bindings -> ^( SEPR binding bindings ) | binding );
- public final bindings_return bindings() throws RecognitionException {
- bindings_return retval = new bindings_return();
- retval.start = input.LT(1);
-
- Object root_0 = null;
-
- Token SEPR23=null;
- binding_return binding22 = null;
-
- bindings_return bindings24 = null;
-
- binding_return binding25 = null;
-
-
- Object SEPR23_tree=null;
- RewriteRuleTokenStream stream_SEPR=new RewriteRuleTokenStream(adaptor,"token SEPR");
- RewriteRuleSubtreeStream stream_bindings=new RewriteRuleSubtreeStream(adaptor,"rule bindings");
- RewriteRuleSubtreeStream stream_binding=new RewriteRuleSubtreeStream(adaptor,"rule binding");
- try {
- // dd/grammar/ECAGrammar.g:85:10: ( binding SEPR bindings -> ^( SEPR binding bindings ) | binding )
- int alt1=2;
- int LA1_0 = input.LA(1);
-
- if ( (LA1_0==SYMBOL) ) {
- int LA1_1 = input.LA(2);
-
- if ( (synpred1()) ) {
- alt1=1;
- }
- else if ( (true) ) {
- alt1=2;
- }
- else {
- if (backtracking>0) {failed=true; return retval;}
- NoViableAltException nvae =
- new NoViableAltException("85:1: bindings : ( binding SEPR bindings -> ^( SEPR binding bindings ) | binding );", 1, 1, input);
-
- throw nvae;
- }
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 50: // unary_oper_expr ::= TWIDDLE expr
+ {
+ ParseNode RESULT = null;
+ int oleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).left;
+ int oright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).right;
+ Object o = (Object)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).value;
+ int eleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int eright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode e = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.UNOP, eleft, eright, node(ParseNode.TWIDDLE, oleft, oright), e);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(15/*unary_oper_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
- else {
- if (backtracking>0) {failed=true; return retval;}
- NoViableAltException nvae =
- new NoViableAltException("85:1: bindings : ( binding SEPR bindings -> ^( SEPR binding bindings ) | binding );", 1, 0, input);
+ return CUP$ECAGrammarParser$result;
- throw nvae;
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 49: // unary_oper_expr ::= NOT expr
+ {
+ ParseNode RESULT = null;
+ int oleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).left;
+ int oright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).right;
+ Object o = (Object)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).value;
+ int eleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int eright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode e = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.UNOP, eleft, eright, node(ParseNode.NOT, oleft, oright), e);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(15/*unary_oper_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
- switch (alt1) {
- case 1 :
- // dd/grammar/ECAGrammar.g:85:12: binding SEPR bindings
- {
- pushFollow(FOLLOW_binding_in_bindings334);
- binding22=binding();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) stream_binding.add(binding22.getTree());
- SEPR23=(Token)input.LT(1);
- match(input,SEPR,FOLLOW_SEPR_in_bindings336); if (failed) return retval;
- if ( backtracking==0 ) stream_SEPR.add(SEPR23);
+ return CUP$ECAGrammarParser$result;
- pushFollow(FOLLOW_bindings_in_bindings338);
- bindings24=bindings();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) stream_bindings.add(bindings24.getTree());
-
- // AST REWRITE
- // elements: bindings, SEPR, binding
- // token labels:
- // rule labels: retval
- // token list labels:
- // rule list labels:
- if ( backtracking==0 ) {
- retval.tree = root_0;
- RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
-
- root_0 = (Object)adaptor.nil();
- // 85:34: -> ^( SEPR binding bindings )
- {
- // dd/grammar/ECAGrammar.g:85:37: ^( SEPR binding bindings )
- {
- Object root_1 = (Object)adaptor.nil();
- root_1 = (Object)adaptor.becomeRoot(stream_SEPR.next(), root_1);
-
- adaptor.addChild(root_1, stream_binding.next());
- adaptor.addChild(root_1, stream_bindings.next());
-
- adaptor.addChild(root_0, root_1);
- }
-
- }
-
- }
-
- }
- break;
- case 2 :
- // dd/grammar/ECAGrammar.g:86:4: binding
- {
- root_0 = (Object)adaptor.nil();
-
- pushFollow(FOLLOW_binding_in_bindings353);
- binding25=binding();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) adaptor.addChild(root_0, binding25.getTree());
-
- }
- break;
-
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 48: // binary_oper_expr ::= expr MOD expr
+ {
+ ParseNode RESULT = null;
+ int e1left = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left;
+ int e1right = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).right;
+ ParseNode e1 = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).value;
+ int oleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).left;
+ int oright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).right;
+ Object o = (Object)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).value;
+ int e2left = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int e2right = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode e2 = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.BINOP, e1left, e1right, node(ParseNode.MOD, oleft, oright), e1, e2);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(14/*binary_oper_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
- retval.stop = input.LT(-1);
+ return CUP$ECAGrammarParser$result;
- if ( backtracking==0 ) {
- retval.tree = (Object)adaptor.rulePostProcessing(root_0);
- adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 47: // binary_oper_expr ::= expr DIV expr
+ {
+ ParseNode RESULT = null;
+ int e1left = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left;
+ int e1right = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).right;
+ ParseNode e1 = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).value;
+ int oleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).left;
+ int oright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).right;
+ Object o = (Object)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).value;
+ int e2left = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int e2right = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode e2 = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.BINOP, e1left, e1right, node(ParseNode.DIV, oleft, oright), e1, e2);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(14/*binary_oper_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return retval;
- }
- // $ANTLR end bindings
+ return CUP$ECAGrammarParser$result;
- public static class binding_return extends ParserRuleReturnScope {
- Object tree;
- public Object getTree() { return tree; }
- };
-
- // $ANTLR start binding
- // dd/grammar/ECAGrammar.g:89:1: binding : bind_sym ASSIGN expr -> ^( ASSIGN bind_sym expr ) ;
- public final binding_return binding() throws RecognitionException {
- binding_return retval = new binding_return();
- retval.start = input.LT(1);
-
- Object root_0 = null;
-
- Token ASSIGN27=null;
- bind_sym_return bind_sym26 = null;
-
- expr_return expr28 = null;
-
-
- Object ASSIGN27_tree=null;
- RewriteRuleTokenStream stream_ASSIGN=new RewriteRuleTokenStream(adaptor,"token ASSIGN");
- RewriteRuleSubtreeStream stream_expr=new RewriteRuleSubtreeStream(adaptor,"rule expr");
- RewriteRuleSubtreeStream stream_bind_sym=new RewriteRuleSubtreeStream(adaptor,"rule bind_sym");
- try {
- // dd/grammar/ECAGrammar.g:89:9: ( bind_sym ASSIGN expr -> ^( ASSIGN bind_sym expr ) )
- // dd/grammar/ECAGrammar.g:89:11: bind_sym ASSIGN expr
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 46: // binary_oper_expr ::= expr MUL expr
{
- pushFollow(FOLLOW_bind_sym_in_binding363);
- bind_sym26=bind_sym();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) stream_bind_sym.add(bind_sym26.getTree());
- ASSIGN27=(Token)input.LT(1);
- match(input,ASSIGN,FOLLOW_ASSIGN_in_binding365); if (failed) return retval;
- if ( backtracking==0 ) stream_ASSIGN.add(ASSIGN27);
+ ParseNode RESULT = null;
+ int e1left = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left;
+ int e1right = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).right;
+ ParseNode e1 = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).value;
+ int oleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).left;
+ int oright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).right;
+ Object o = (Object)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).value;
+ int e2left = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int e2right = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode e2 = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.BINOP, e1left, e1right, node(ParseNode.MUL, oleft, oright), e1, e2);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(14/*binary_oper_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
+ }
+ return CUP$ECAGrammarParser$result;
- pushFollow(FOLLOW_expr_in_binding367);
- expr28=expr();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) stream_expr.add(expr28.getTree());
-
- // AST REWRITE
- // elements: bind_sym, ASSIGN, expr
- // token labels:
- // rule labels: retval
- // token list labels:
- // rule list labels:
- if ( backtracking==0 ) {
- retval.tree = root_0;
- RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
-
- root_0 = (Object)adaptor.nil();
- // 89:32: -> ^( ASSIGN bind_sym expr )
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 45: // binary_oper_expr ::= expr MINUS expr
{
- // dd/grammar/ECAGrammar.g:89:35: ^( ASSIGN bind_sym expr )
- {
- Object root_1 = (Object)adaptor.nil();
- root_1 = (Object)adaptor.becomeRoot(stream_ASSIGN.next(), root_1);
-
- adaptor.addChild(root_1, stream_bind_sym.next());
- adaptor.addChild(root_1, stream_expr.next());
-
- adaptor.addChild(root_0, root_1);
- }
-
+ ParseNode RESULT = null;
+ int e1left = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left;
+ int e1right = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).right;
+ ParseNode e1 = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).value;
+ int oleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).left;
+ int oright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).right;
+ Object o = (Object)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).value;
+ int e2left = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int e2right = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode e2 = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.BINOP, e1left, e1right, node(ParseNode.MINUS, oleft, oright), e1, e2);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(14/*binary_oper_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
+ return CUP$ECAGrammarParser$result;
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 44: // binary_oper_expr ::= expr PLUS expr
+ {
+ ParseNode RESULT = null;
+ int e1left = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left;
+ int e1right = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).right;
+ ParseNode e1 = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).value;
+ int oleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).left;
+ int oright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).right;
+ Object o = (Object)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).value;
+ int e2left = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int e2right = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode e2 = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.BINOP, e1left, e1right, node(ParseNode.PLUS, oleft, oright), e1, e2);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(14/*binary_oper_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
+ return CUP$ECAGrammarParser$result;
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 43: // binary_oper_expr ::= expr BXOR expr
+ {
+ ParseNode RESULT = null;
+ int e1left = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left;
+ int e1right = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).right;
+ ParseNode e1 = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).value;
+ int oleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).left;
+ int oright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).right;
+ Object o = (Object)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).value;
+ int e2left = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int e2right = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode e2 = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.BINOP, e1left, e1right, node(ParseNode.BXOR, oleft, oright), e1, e2);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(14/*binary_oper_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
+ return CUP$ECAGrammarParser$result;
- retval.stop = input.LT(-1);
-
- if ( backtracking==0 ) {
- retval.tree = (Object)adaptor.rulePostProcessing(root_0);
- adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 42: // binary_oper_expr ::= expr BAND expr
+ {
+ ParseNode RESULT = null;
+ int e1left = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left;
+ int e1right = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).right;
+ ParseNode e1 = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).value;
+ int oleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).left;
+ int oright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).right;
+ Object o = (Object)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).value;
+ int e2left = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int e2right = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode e2 = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.BINOP, e1left, e1right, node(ParseNode.BAND, oleft, oright), e1, e2);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(14/*binary_oper_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return retval;
- }
- // $ANTLR end binding
+ return CUP$ECAGrammarParser$result;
- public static class bind_sym_return extends ParserRuleReturnScope {
- Object tree;
- public Object getTree() { return tree; }
- };
-
- // $ANTLR start bind_sym
- // dd/grammar/ECAGrammar.g:93:1: bind_sym : (v= SYMBOL COLON t= SYMBOL -> ^( COLON $v $t) | SYMBOL );
- public final bind_sym_return bind_sym() throws RecognitionException {
- bind_sym_return retval = new bind_sym_return();
- retval.start = input.LT(1);
-
- Object root_0 = null;
-
- Token v=null;
- Token t=null;
- Token COLON29=null;
- Token SYMBOL30=null;
-
- Object v_tree=null;
- Object t_tree=null;
- Object COLON29_tree=null;
- Object SYMBOL30_tree=null;
- RewriteRuleTokenStream stream_COLON=new RewriteRuleTokenStream(adaptor,"token COLON");
- RewriteRuleTokenStream stream_SYMBOL=new RewriteRuleTokenStream(adaptor,"token SYMBOL");
-
- try {
- // dd/grammar/ECAGrammar.g:93:10: (v= SYMBOL COLON t= SYMBOL -> ^( COLON $v $t) | SYMBOL )
- int alt2=2;
- int LA2_0 = input.LA(1);
-
- if ( (LA2_0==SYMBOL) ) {
- int LA2_1 = input.LA(2);
-
- if ( (LA2_1==COLON) ) {
- alt2=1;
- }
- else if ( (LA2_1==ASSIGN) ) {
- alt2=2;
- }
- else {
- if (backtracking>0) {failed=true; return retval;}
- NoViableAltException nvae =
- new NoViableAltException("93:1: bind_sym : (v= SYMBOL COLON t= SYMBOL -> ^( COLON $v $t) | SYMBOL );", 2, 1, input);
-
- throw nvae;
- }
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 41: // binary_oper_expr ::= expr BOR expr
+ {
+ ParseNode RESULT = null;
+ int e1left = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left;
+ int e1right = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).right;
+ ParseNode e1 = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).value;
+ int oleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).left;
+ int oright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).right;
+ Object o = (Object)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).value;
+ int e2left = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int e2right = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode e2 = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.BINOP, e1left, e1right, node(ParseNode.BOR, oleft, oright), e1, e2);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(14/*binary_oper_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
- else {
- if (backtracking>0) {failed=true; return retval;}
- NoViableAltException nvae =
- new NoViableAltException("93:1: bind_sym : (v= SYMBOL COLON t= SYMBOL -> ^( COLON $v $t) | SYMBOL );", 2, 0, input);
+ return CUP$ECAGrammarParser$result;
- throw nvae;
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 40: // binary_oper_expr ::= expr GT expr
+ {
+ ParseNode RESULT = null;
+ int e1left = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left;
+ int e1right = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).right;
+ ParseNode e1 = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).value;
+ int oleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).left;
+ int oright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).right;
+ Object o = (Object)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).value;
+ int e2left = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int e2right = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode e2 = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.BINOP, e1left, e1right, node(ParseNode.GT, oleft, oright), e1, e2);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(14/*binary_oper_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
- switch (alt2) {
- case 1 :
- // dd/grammar/ECAGrammar.g:93:12: v= SYMBOL COLON t= SYMBOL
- {
- v=(Token)input.LT(1);
- match(input,SYMBOL,FOLLOW_SYMBOL_in_bind_sym390); if (failed) return retval;
- if ( backtracking==0 ) stream_SYMBOL.add(v);
+ return CUP$ECAGrammarParser$result;
- COLON29=(Token)input.LT(1);
- match(input,COLON,FOLLOW_COLON_in_bind_sym392); if (failed) return retval;
- if ( backtracking==0 ) stream_COLON.add(COLON29);
-
- t=(Token)input.LT(1);
- match(input,SYMBOL,FOLLOW_SYMBOL_in_bind_sym396); if (failed) return retval;
- if ( backtracking==0 ) stream_SYMBOL.add(t);
-
-
- // AST REWRITE
- // elements: t, COLON, v
- // token labels: t, v
- // rule labels: retval
- // token list labels:
- // rule list labels:
- if ( backtracking==0 ) {
- retval.tree = root_0;
- RewriteRuleTokenStream stream_t=new RewriteRuleTokenStream(adaptor,"token t",t);
- RewriteRuleTokenStream stream_v=new RewriteRuleTokenStream(adaptor,"token v",v);
- RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
-
- root_0 = (Object)adaptor.nil();
- // 93:36: -> ^( COLON $v $t)
- {
- // dd/grammar/ECAGrammar.g:93:39: ^( COLON $v $t)
- {
- Object root_1 = (Object)adaptor.nil();
- root_1 = (Object)adaptor.becomeRoot(stream_COLON.next(), root_1);
-
- adaptor.addChild(root_1, stream_v.next());
- adaptor.addChild(root_1, stream_t.next());
-
- adaptor.addChild(root_0, root_1);
- }
-
- }
-
- }
-
- }
- break;
- case 2 :
- // dd/grammar/ECAGrammar.g:94:4: SYMBOL
- {
- root_0 = (Object)adaptor.nil();
-
- SYMBOL30=(Token)input.LT(1);
- match(input,SYMBOL,FOLLOW_SYMBOL_in_bind_sym414); if (failed) return retval;
- if ( backtracking==0 ) {
- SYMBOL30_tree = (Object)adaptor.create(SYMBOL30);
- adaptor.addChild(root_0, SYMBOL30_tree);
- }
-
- }
- break;
-
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 39: // binary_oper_expr ::= expr GE expr
+ {
+ ParseNode RESULT = null;
+ int e1left = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left;
+ int e1right = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).right;
+ ParseNode e1 = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).value;
+ int oleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).left;
+ int oright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).right;
+ Object o = (Object)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).value;
+ int e2left = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int e2right = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode e2 = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.BINOP, e1left, e1right, node(ParseNode.GE, oleft, oright), e1, e2);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(14/*binary_oper_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
- retval.stop = input.LT(-1);
+ return CUP$ECAGrammarParser$result;
- if ( backtracking==0 ) {
- retval.tree = (Object)adaptor.rulePostProcessing(root_0);
- adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 38: // binary_oper_expr ::= expr NE expr
+ {
+ ParseNode RESULT = null;
+ int e1left = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left;
+ int e1right = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).right;
+ ParseNode e1 = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).value;
+ int oleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).left;
+ int oright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).right;
+ Object o = (Object)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).value;
+ int e2left = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int e2right = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode e2 = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.BINOP, e1left, e1right, node(ParseNode.NE, oleft, oright), e1, e2);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(14/*binary_oper_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return retval;
- }
- // $ANTLR end bind_sym
+ return CUP$ECAGrammarParser$result;
- public static class condition_return extends ParserRuleReturnScope {
- Object tree;
- public Object getTree() { return tree; }
- };
-
- // $ANTLR start condition
- // dd/grammar/ECAGrammar.g:101:1: condition : ( TRUE -> ^( TRUE ) | FALSE -> ^( FALSE ) | expr );
- public final condition_return condition() throws RecognitionException {
- condition_return retval = new condition_return();
- retval.start = input.LT(1);
-
- Object root_0 = null;
-
- Token TRUE31=null;
- Token FALSE32=null;
- expr_return expr33 = null;
-
-
- Object TRUE31_tree=null;
- Object FALSE32_tree=null;
- RewriteRuleTokenStream stream_TRUE=new RewriteRuleTokenStream(adaptor,"token TRUE");
- RewriteRuleTokenStream stream_FALSE=new RewriteRuleTokenStream(adaptor,"token FALSE");
-
- try {
- // dd/grammar/ECAGrammar.g:101:11: ( TRUE -> ^( TRUE ) | FALSE -> ^( FALSE ) | expr )
- int alt3=3;
- switch ( input.LA(1) ) {
- case TRUE:
- {
- alt3=1;
- }
- break;
- case FALSE:
- {
- alt3=2;
- }
- break;
- case NUMBER:
- case LPAREN:
- case NOT:
- case TWIDDLE:
- case STRING:
- case SYMBOL:
- case DOLLARSYM:
- {
- alt3=3;
- }
- break;
- default:
- if (backtracking>0) {failed=true; return retval;}
- NoViableAltException nvae =
- new NoViableAltException("101:1: condition : ( TRUE -> ^( TRUE ) | FALSE -> ^( FALSE ) | expr );", 3, 0, input);
-
- throw nvae;
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 37: // binary_oper_expr ::= expr EQ expr
+ {
+ ParseNode RESULT = null;
+ int e1left = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left;
+ int e1right = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).right;
+ ParseNode e1 = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).value;
+ int oleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).left;
+ int oright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).right;
+ Object o = (Object)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).value;
+ int e2left = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int e2right = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode e2 = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.BINOP, e1left, e1right, node(ParseNode.EQ, oleft, oright), e1, e2);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(14/*binary_oper_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
+ return CUP$ECAGrammarParser$result;
- switch (alt3) {
- case 1 :
- // dd/grammar/ECAGrammar.g:101:13: TRUE
- {
- TRUE31=(Token)input.LT(1);
- match(input,TRUE,FOLLOW_TRUE_in_condition428); if (failed) return retval;
- if ( backtracking==0 ) stream_TRUE.add(TRUE31);
-
-
- // AST REWRITE
- // elements: TRUE
- // token labels:
- // rule labels: retval
- // token list labels:
- // rule list labels:
- if ( backtracking==0 ) {
- retval.tree = root_0;
- RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
-
- root_0 = (Object)adaptor.nil();
- // 101:19: -> ^( TRUE )
- {
- // dd/grammar/ECAGrammar.g:101:22: ^( TRUE )
- {
- Object root_1 = (Object)adaptor.nil();
- root_1 = (Object)adaptor.becomeRoot(stream_TRUE.next(), root_1);
-
- adaptor.addChild(root_0, root_1);
- }
-
- }
-
- }
-
- }
- break;
- case 2 :
- // dd/grammar/ECAGrammar.g:102:4: FALSE
- {
- FALSE32=(Token)input.LT(1);
- match(input,FALSE,FOLLOW_FALSE_in_condition440); if (failed) return retval;
- if ( backtracking==0 ) stream_FALSE.add(FALSE32);
-
-
- // AST REWRITE
- // elements: FALSE
- // token labels:
- // rule labels: retval
- // token list labels:
- // rule list labels:
- if ( backtracking==0 ) {
- retval.tree = root_0;
- RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
-
- root_0 = (Object)adaptor.nil();
- // 102:11: -> ^( FALSE )
- {
- // dd/grammar/ECAGrammar.g:102:14: ^( FALSE )
- {
- Object root_1 = (Object)adaptor.nil();
- root_1 = (Object)adaptor.becomeRoot(stream_FALSE.next(), root_1);
-
- adaptor.addChild(root_0, root_1);
- }
-
- }
-
- }
-
- }
- break;
- case 3 :
- // dd/grammar/ECAGrammar.g:103:4: expr
- {
- root_0 = (Object)adaptor.nil();
-
- pushFollow(FOLLOW_expr_in_condition452);
- expr33=expr();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) adaptor.addChild(root_0, expr33.getTree());
-
- }
- break;
-
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 36: // binary_oper_expr ::= expr LE expr
+ {
+ ParseNode RESULT = null;
+ int e1left = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left;
+ int e1right = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).right;
+ ParseNode e1 = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).value;
+ int oleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).left;
+ int oright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).right;
+ Object o = (Object)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).value;
+ int e2left = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int e2right = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode e2 = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.BINOP, e1left, e1right, node(ParseNode.LE, oleft, oright), e1, e2);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(14/*binary_oper_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
- retval.stop = input.LT(-1);
+ return CUP$ECAGrammarParser$result;
- if ( backtracking==0 ) {
- retval.tree = (Object)adaptor.rulePostProcessing(root_0);
- adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 35: // binary_oper_expr ::= expr LT expr
+ {
+ ParseNode RESULT = null;
+ int e1left = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left;
+ int e1right = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).right;
+ ParseNode e1 = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).value;
+ int oleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).left;
+ int oright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).right;
+ Object o = (Object)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).value;
+ int e2left = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int e2right = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode e2 = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.BINOP, e1left, e1right, node(ParseNode.LT, oleft, oright), e1, e2);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(14/*binary_oper_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return retval;
- }
- // $ANTLR end condition
+ return CUP$ECAGrammarParser$result;
- public static class action_return extends ParserRuleReturnScope {
- Object tree;
- public Object getTree() { return tree; }
- };
-
- // $ANTLR start action
- // dd/grammar/ECAGrammar.g:110:1: action : ( NOTHING -> ^( NOTHING ) | action_expr_list );
- public final action_return action() throws RecognitionException {
- action_return retval = new action_return();
- retval.start = input.LT(1);
-
- Object root_0 = null;
-
- Token NOTHING34=null;
- action_expr_list_return action_expr_list35 = null;
-
-
- Object NOTHING34_tree=null;
- RewriteRuleTokenStream stream_NOTHING=new RewriteRuleTokenStream(adaptor,"token NOTHING");
-
- try {
- // dd/grammar/ECAGrammar.g:110:8: ( NOTHING -> ^( NOTHING ) | action_expr_list )
- int alt4=2;
- int LA4_0 = input.LA(1);
-
- if ( (LA4_0==NOTHING) ) {
- alt4=1;
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 34: // binary_oper_expr ::= expr AND expr
+ {
+ ParseNode RESULT = null;
+ int e1left = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left;
+ int e1right = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).right;
+ ParseNode e1 = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).value;
+ int oleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).left;
+ int oright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).right;
+ Object o = (Object)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).value;
+ int e2left = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int e2right = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode e2 = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.BINOP, e1left, e1right, node(ParseNode.AND, oleft, oright), e1, e2);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(14/*binary_oper_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
- else if ( (LA4_0==NUMBER||(LA4_0>=RETURN && LA4_0<=LPAREN)||LA4_0==NOT||LA4_0==TWIDDLE||LA4_0==STRING||LA4_0==SYMBOL||LA4_0==DOLLARSYM) ) {
- alt4=2;
- }
- else {
- if (backtracking>0) {failed=true; return retval;}
- NoViableAltException nvae =
- new NoViableAltException("110:1: action : ( NOTHING -> ^( NOTHING ) | action_expr_list );", 4, 0, input);
+ return CUP$ECAGrammarParser$result;
- throw nvae;
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 33: // binary_oper_expr ::= expr OR expr
+ {
+ ParseNode RESULT = null;
+ int e1left = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left;
+ int e1right = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).right;
+ ParseNode e1 = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).value;
+ int oleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).left;
+ int oright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).right;
+ Object o = (Object)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).value;
+ int e2left = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int e2right = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode e2 = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.BINOP, e1left, e1right, node(ParseNode.OR, oleft, oright), e1, e2);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(14/*binary_oper_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
- switch (alt4) {
- case 1 :
- // dd/grammar/ECAGrammar.g:110:10: NOTHING
- {
- NOTHING34=(Token)input.LT(1);
- match(input,NOTHING,FOLLOW_NOTHING_in_action466); if (failed) return retval;
- if ( backtracking==0 ) stream_NOTHING.add(NOTHING34);
+ return CUP$ECAGrammarParser$result;
-
- // AST REWRITE
- // elements: NOTHING
- // token labels:
- // rule labels: retval
- // token list labels:
- // rule list labels:
- if ( backtracking==0 ) {
- retval.tree = root_0;
- RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
-
- root_0 = (Object)adaptor.nil();
- // 110:19: -> ^( NOTHING )
- {
- // dd/grammar/ECAGrammar.g:110:22: ^( NOTHING )
- {
- Object root_1 = (Object)adaptor.nil();
- root_1 = (Object)adaptor.becomeRoot(stream_NOTHING.next(), root_1);
-
- adaptor.addChild(root_0, root_1);
- }
-
- }
-
- }
-
- }
- break;
- case 2 :
- // dd/grammar/ECAGrammar.g:111:4: action_expr_list
- {
- root_0 = (Object)adaptor.nil();
-
- pushFollow(FOLLOW_action_expr_list_in_action478);
- action_expr_list35=action_expr_list();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) adaptor.addChild(root_0, action_expr_list35.getTree());
-
- }
- break;
-
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 32: // ternary_oper_expr ::= expr TERN_IF expr COLON expr
+ {
+ ParseNode RESULT = null;
+ int condleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-4)).left;
+ int condright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-4)).right;
+ ParseNode cond = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-4)).value;
+ int iftrueleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left;
+ int iftrueright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).right;
+ ParseNode iftrue = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).value;
+ int iffalseleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int iffalseright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode iffalse = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.TERNOP, condleft, condright, cond, iftrue, iffalse);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(13/*ternary_oper_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-4)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
- retval.stop = input.LT(-1);
+ return CUP$ECAGrammarParser$result;
- if ( backtracking==0 ) {
- retval.tree = (Object)adaptor.rulePostProcessing(root_0);
- adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 31: // expr ::= simple_name
+ {
+ ParseNode RESULT = null;
+ int nleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int nright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode n = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = n;
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(12/*expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return retval;
- }
- // $ANTLR end action
+ return CUP$ECAGrammarParser$result;
- public static class action_expr_list_return extends ParserRuleReturnScope {
- Object tree;
- public Object getTree() { return tree; }
- };
-
- // $ANTLR start action_expr_list
- // dd/grammar/ECAGrammar.g:114:1: action_expr_list : ( action_expr SEPR action_expr_list -> ^( SEPR action_expr action_expr_list ) | action_expr );
- public final action_expr_list_return action_expr_list() throws RecognitionException {
- action_expr_list_return retval = new action_expr_list_return();
- retval.start = input.LT(1);
-
- Object root_0 = null;
-
- Token SEPR37=null;
- action_expr_return action_expr36 = null;
-
- action_expr_list_return action_expr_list38 = null;
-
- action_expr_return action_expr39 = null;
-
-
- Object SEPR37_tree=null;
- RewriteRuleTokenStream stream_SEPR=new RewriteRuleTokenStream(adaptor,"token SEPR");
- RewriteRuleSubtreeStream stream_action_expr_list=new RewriteRuleSubtreeStream(adaptor,"rule action_expr_list");
- RewriteRuleSubtreeStream stream_action_expr=new RewriteRuleSubtreeStream(adaptor,"rule action_expr");
- try {
- // dd/grammar/ECAGrammar.g:115:2: ( action_expr SEPR action_expr_list -> ^( SEPR action_expr action_expr_list ) | action_expr )
- int alt5=2;
- switch ( input.LA(1) ) {
- case RETURN:
- {
- int LA5_1 = input.LA(2);
-
- if ( (synpred6()) ) {
- alt5=1;
- }
- else if ( (true) ) {
- alt5=2;
- }
- else {
- if (backtracking>0) {failed=true; return retval;}
- NoViableAltException nvae =
- new NoViableAltException("114:1: action_expr_list : ( action_expr SEPR action_expr_list -> ^( SEPR action_expr action_expr_list ) | action_expr );", 5, 1, input);
-
- throw nvae;
- }
- }
- break;
- case THROW:
- {
- int LA5_2 = input.LA(2);
-
- if ( (synpred6()) ) {
- alt5=1;
- }
- else if ( (true) ) {
- alt5=2;
- }
- else {
- if (backtracking>0) {failed=true; return retval;}
- NoViableAltException nvae =
- new NoViableAltException("114:1: action_expr_list : ( action_expr SEPR action_expr_list -> ^( SEPR action_expr action_expr_list ) | action_expr );", 5, 2, input);
-
- throw nvae;
- }
- }
- break;
- case DOLLARSYM:
- {
- int LA5_3 = input.LA(2);
-
- if ( (synpred6()) ) {
- alt5=1;
- }
- else if ( (true) ) {
- alt5=2;
- }
- else {
- if (backtracking>0) {failed=true; return retval;}
- NoViableAltException nvae =
- new NoViableAltException("114:1: action_expr_list : ( action_expr SEPR action_expr_list -> ^( SEPR action_expr action_expr_list ) | action_expr );", 5, 3, input);
-
- throw nvae;
- }
- }
- break;
- case SYMBOL:
- {
- int LA5_4 = input.LA(2);
-
- if ( (synpred6()) ) {
- alt5=1;
- }
- else if ( (true) ) {
- alt5=2;
- }
- else {
- if (backtracking>0) {failed=true; return retval;}
- NoViableAltException nvae =
- new NoViableAltException("114:1: action_expr_list : ( action_expr SEPR action_expr_list -> ^( SEPR action_expr action_expr_list ) | action_expr );", 5, 4, input);
-
- throw nvae;
- }
- }
- break;
- case NUMBER:
- {
- int LA5_5 = input.LA(2);
-
- if ( (synpred6()) ) {
- alt5=1;
- }
- else if ( (true) ) {
- alt5=2;
- }
- else {
- if (backtracking>0) {failed=true; return retval;}
- NoViableAltException nvae =
- new NoViableAltException("114:1: action_expr_list : ( action_expr SEPR action_expr_list -> ^( SEPR action_expr action_expr_list ) | action_expr );", 5, 5, input);
-
- throw nvae;
- }
- }
- break;
- case STRING:
- {
- int LA5_6 = input.LA(2);
-
- if ( (synpred6()) ) {
- alt5=1;
- }
- else if ( (true) ) {
- alt5=2;
- }
- else {
- if (backtracking>0) {failed=true; return retval;}
- NoViableAltException nvae =
- new NoViableAltException("114:1: action_expr_list : ( action_expr SEPR action_expr_list -> ^( SEPR action_expr action_expr_list ) | action_expr );", 5, 6, input);
-
- throw nvae;
- }
- }
- break;
- case LPAREN:
- {
- int LA5_7 = input.LA(2);
-
- if ( (synpred6()) ) {
- alt5=1;
- }
- else if ( (true) ) {
- alt5=2;
- }
- else {
- if (backtracking>0) {failed=true; return retval;}
- NoViableAltException nvae =
- new NoViableAltException("114:1: action_expr_list : ( action_expr SEPR action_expr_list -> ^( SEPR action_expr action_expr_list ) | action_expr );", 5, 7, input);
-
- throw nvae;
- }
- }
- break;
- case NOT:
- case TWIDDLE:
- {
- int LA5_8 = input.LA(2);
-
- if ( (synpred6()) ) {
- alt5=1;
- }
- else if ( (true) ) {
- alt5=2;
- }
- else {
- if (backtracking>0) {failed=true; return retval;}
- NoViableAltException nvae =
- new NoViableAltException("114:1: action_expr_list : ( action_expr SEPR action_expr_list -> ^( SEPR action_expr action_expr_list ) | action_expr );", 5, 8, input);
-
- throw nvae;
- }
- }
- break;
- default:
- if (backtracking>0) {failed=true; return retval;}
- NoViableAltException nvae =
- new NoViableAltException("114:1: action_expr_list : ( action_expr SEPR action_expr_list -> ^( SEPR action_expr action_expr_list ) | action_expr );", 5, 0, input);
-
- throw nvae;
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 30: // expr ::= simple_expr
+ {
+ ParseNode RESULT = null;
+ int eleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int eright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode e = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = e;
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(12/*expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
+ return CUP$ECAGrammarParser$result;
- switch (alt5) {
- case 1 :
- // dd/grammar/ECAGrammar.g:115:4: action_expr SEPR action_expr_list
- {
- pushFollow(FOLLOW_action_expr_in_action_expr_list489);
- action_expr36=action_expr();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) stream_action_expr.add(action_expr36.getTree());
- SEPR37=(Token)input.LT(1);
- match(input,SEPR,FOLLOW_SEPR_in_action_expr_list491); if (failed) return retval;
- if ( backtracking==0 ) stream_SEPR.add(SEPR37);
-
- pushFollow(FOLLOW_action_expr_list_in_action_expr_list493);
- action_expr_list38=action_expr_list();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) stream_action_expr_list.add(action_expr_list38.getTree());
-
- // AST REWRITE
- // elements: SEPR, action_expr, action_expr_list
- // token labels:
- // rule labels: retval
- // token list labels:
- // rule list labels:
- if ( backtracking==0 ) {
- retval.tree = root_0;
- RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
-
- root_0 = (Object)adaptor.nil();
- // 115:38: -> ^( SEPR action_expr action_expr_list )
- {
- // dd/grammar/ECAGrammar.g:115:41: ^( SEPR action_expr action_expr_list )
- {
- Object root_1 = (Object)adaptor.nil();
- root_1 = (Object)adaptor.becomeRoot(stream_SEPR.next(), root_1);
-
- adaptor.addChild(root_1, stream_action_expr.next());
- adaptor.addChild(root_1, stream_action_expr_list.next());
-
- adaptor.addChild(root_0, root_1);
- }
-
- }
-
- }
-
- }
- break;
- case 2 :
- // dd/grammar/ECAGrammar.g:116:4: action_expr
- {
- root_0 = (Object)adaptor.nil();
-
- pushFollow(FOLLOW_action_expr_in_action_expr_list508);
- action_expr39=action_expr();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) adaptor.addChild(root_0, action_expr39.getTree());
-
- }
- break;
-
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 29: // expr ::= meth_expr
+ {
+ ParseNode RESULT = null;
+ int eleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int eright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode e = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = e;
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(12/*expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
- retval.stop = input.LT(-1);
+ return CUP$ECAGrammarParser$result;
- if ( backtracking==0 ) {
- retval.tree = (Object)adaptor.rulePostProcessing(root_0);
- adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 28: // expr ::= field_expr
+ {
+ ParseNode RESULT = null;
+ int eleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int eright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode e = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = e;
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(12/*expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return retval;
- }
- // $ANTLR end action_expr_list
+ return CUP$ECAGrammarParser$result;
- public static class action_expr_return extends ParserRuleReturnScope {
- Object tree;
- public Object getTree() { return tree; }
- };
-
- // $ANTLR start action_expr
- // dd/grammar/ECAGrammar.g:119:1: action_expr : ( RETURN -> ^( RETURN ) | RETURN expr -> ^( RETURN expr ) | THROW e= SYMBOL LPAREN RPAREN -> ^( THROW $e) | THROW e= SYMBOL LPAREN args= expr_list RPAREN -> ^( THROW $e $args) | expr );
- public final action_expr_return action_expr() throws RecognitionException {
- action_expr_return retval = new action_expr_return();
- retval.start = input.LT(1);
-
- Object root_0 = null;
-
- Token e=null;
- Token RETURN40=null;
- Token RETURN41=null;
- Token THROW43=null;
- Token LPAREN44=null;
- Token RPAREN45=null;
- Token THROW46=null;
- Token LPAREN47=null;
- Token RPAREN48=null;
- expr_list_return args = null;
-
- expr_return expr42 = null;
-
- expr_return expr49 = null;
-
-
- Object e_tree=null;
- Object RETURN40_tree=null;
- Object RETURN41_tree=null;
- Object THROW43_tree=null;
- Object LPAREN44_tree=null;
- Object RPAREN45_tree=null;
- Object THROW46_tree=null;
- Object LPAREN47_tree=null;
- Object RPAREN48_tree=null;
- RewriteRuleTokenStream stream_RPAREN=new RewriteRuleTokenStream(adaptor,"token RPAREN");
- RewriteRuleTokenStream stream_LPAREN=new RewriteRuleTokenStream(adaptor,"token LPAREN");
- RewriteRuleTokenStream stream_RETURN=new RewriteRuleTokenStream(adaptor,"token RETURN");
- RewriteRuleTokenStream stream_THROW=new RewriteRuleTokenStream(adaptor,"token THROW");
- RewriteRuleTokenStream stream_SYMBOL=new RewriteRuleTokenStream(adaptor,"token SYMBOL");
- RewriteRuleSubtreeStream stream_expr_list=new RewriteRuleSubtreeStream(adaptor,"rule expr_list");
- RewriteRuleSubtreeStream stream_expr=new RewriteRuleSubtreeStream(adaptor,"rule expr");
- try {
- // dd/grammar/ECAGrammar.g:119:13: ( RETURN -> ^( RETURN ) | RETURN expr -> ^( RETURN expr ) | THROW e= SYMBOL LPAREN RPAREN -> ^( THROW $e) | THROW e= SYMBOL LPAREN args= expr_list RPAREN -> ^( THROW $e $args) | expr )
- int alt6=5;
- switch ( input.LA(1) ) {
- case RETURN:
- {
- int LA6_1 = input.LA(2);
-
- if ( (LA6_1==NUMBER||LA6_1==LPAREN||LA6_1==NOT||LA6_1==TWIDDLE||LA6_1==STRING||LA6_1==SYMBOL||LA6_1==DOLLARSYM) ) {
- alt6=2;
- }
- else if ( (LA6_1==EOF||LA6_1==ENDRULE||LA6_1==SEPR) ) {
- alt6=1;
- }
- else {
- if (backtracking>0) {failed=true; return retval;}
- NoViableAltException nvae =
- new NoViableAltException("119:1: action_expr : ( RETURN -> ^( RETURN ) | RETURN expr -> ^( RETURN expr ) | THROW e= SYMBOL LPAREN RPAREN -> ^( THROW $e) | THROW e= SYMBOL LPAREN args= expr_list RPAREN -> ^( THROW $e $args) | expr );", 6, 1, input);
-
- throw nvae;
- }
- }
- break;
- case THROW:
- {
- int LA6_2 = input.LA(2);
-
- if ( (LA6_2==SYMBOL) ) {
- int LA6_6 = input.LA(3);
-
- if ( (LA6_6==LPAREN) ) {
- int LA6_7 = input.LA(4);
-
- if ( (LA6_7==RPAREN) ) {
- alt6=3;
- }
- else if ( (LA6_7==NUMBER||LA6_7==LPAREN||LA6_7==NOT||LA6_7==TWIDDLE||LA6_7==STRING||LA6_7==SYMBOL||LA6_7==DOLLARSYM) ) {
- alt6=4;
- }
- else {
- if (backtracking>0) {failed=true; return retval;}
- NoViableAltException nvae =
- new NoViableAltException("119:1: action_expr : ( RETURN -> ^( RETURN ) | RETURN expr -> ^( RETURN expr ) | THROW e= SYMBOL LPAREN RPAREN -> ^( THROW $e) | THROW e= SYMBOL LPAREN args= expr_list RPAREN -> ^( THROW $e $args) | expr );", 6, 7, input);
-
- throw nvae;
- }
- }
- else {
- if (backtracking>0) {failed=true; return retval;}
- NoViableAltException nvae =
- new NoViableAltException("119:1: action_expr : ( RETURN -> ^( RETURN ) | RETURN expr -> ^( RETURN expr ) | THROW e= SYMBOL LPAREN RPAREN -> ^( THROW $e) | THROW e= SYMBOL LPAREN args= expr_list RPAREN -> ^( THROW $e $args) | expr );", 6, 6, input);
-
- throw nvae;
- }
- }
- else {
- if (backtracking>0) {failed=true; return retval;}
- NoViableAltException nvae =
- new NoViableAltException("119:1: action_expr : ( RETURN -> ^( RETURN ) | RETURN expr -> ^( RETURN expr ) | THROW e= SYMBOL LPAREN RPAREN -> ^( THROW $e) | THROW e= SYMBOL LPAREN args= expr_list RPAREN -> ^( THROW $e $args) | expr );", 6, 2, input);
-
- throw nvae;
- }
- }
- break;
- case NUMBER:
- case LPAREN:
- case NOT:
- case TWIDDLE:
- case STRING:
- case SYMBOL:
- case DOLLARSYM:
- {
- alt6=5;
- }
- break;
- default:
- if (backtracking>0) {failed=true; return retval;}
- NoViableAltException nvae =
- new NoViableAltException("119:1: action_expr : ( RETURN -> ^( RETURN ) | RETURN expr -> ^( RETURN expr ) | THROW e= SYMBOL LPAREN RPAREN -> ^( THROW $e) | THROW e= SYMBOL LPAREN args= expr_list RPAREN -> ^( THROW $e $args) | expr );", 6, 0, input);
-
- throw nvae;
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 27: // expr ::= array_expr
+ {
+ ParseNode RESULT = null;
+ int eleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int eright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode e = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = e;
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(12/*expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
+ return CUP$ECAGrammarParser$result;
- switch (alt6) {
- case 1 :
- // dd/grammar/ECAGrammar.g:119:15: RETURN
- {
- RETURN40=(Token)input.LT(1);
- match(input,RETURN,FOLLOW_RETURN_in_action_expr518); if (failed) return retval;
- if ( backtracking==0 ) stream_RETURN.add(RETURN40);
-
-
- // AST REWRITE
- // elements: RETURN
- // token labels:
- // rule labels: retval
- // token list labels:
- // rule list labels:
- if ( backtracking==0 ) {
- retval.tree = root_0;
- RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
-
- root_0 = (Object)adaptor.nil();
- // 119:25: -> ^( RETURN )
- {
- // dd/grammar/ECAGrammar.g:119:28: ^( RETURN )
- {
- Object root_1 = (Object)adaptor.nil();
- root_1 = (Object)adaptor.becomeRoot(stream_RETURN.next(), root_1);
-
- adaptor.addChild(root_0, root_1);
- }
-
- }
-
- }
-
- }
- break;
- case 2 :
- // dd/grammar/ECAGrammar.g:120:4: RETURN expr
- {
- RETURN41=(Token)input.LT(1);
- match(input,RETURN,FOLLOW_RETURN_in_action_expr532); if (failed) return retval;
- if ( backtracking==0 ) stream_RETURN.add(RETURN41);
-
- pushFollow(FOLLOW_expr_in_action_expr534);
- expr42=expr();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) stream_expr.add(expr42.getTree());
-
- // AST REWRITE
- // elements: expr, RETURN
- // token labels:
- // rule labels: retval
- // token list labels:
- // rule list labels:
- if ( backtracking==0 ) {
- retval.tree = root_0;
- RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
-
- root_0 = (Object)adaptor.nil();
- // 120:19: -> ^( RETURN expr )
- {
- // dd/grammar/ECAGrammar.g:120:22: ^( RETURN expr )
- {
- Object root_1 = (Object)adaptor.nil();
- root_1 = (Object)adaptor.becomeRoot(stream_RETURN.next(), root_1);
-
- adaptor.addChild(root_1, stream_expr.next());
-
- adaptor.addChild(root_0, root_1);
- }
-
- }
-
- }
-
- }
- break;
- case 3 :
- // dd/grammar/ECAGrammar.g:121:4: THROW e= SYMBOL LPAREN RPAREN
- {
- THROW43=(Token)input.LT(1);
- match(input,THROW,FOLLOW_THROW_in_action_expr550); if (failed) return retval;
- if ( backtracking==0 ) stream_THROW.add(THROW43);
-
- e=(Token)input.LT(1);
- match(input,SYMBOL,FOLLOW_SYMBOL_in_action_expr554); if (failed) return retval;
- if ( backtracking==0 ) stream_SYMBOL.add(e);
-
- LPAREN44=(Token)input.LT(1);
- match(input,LPAREN,FOLLOW_LPAREN_in_action_expr556); if (failed) return retval;
- if ( backtracking==0 ) stream_LPAREN.add(LPAREN44);
-
- RPAREN45=(Token)input.LT(1);
- match(input,RPAREN,FOLLOW_RPAREN_in_action_expr558); if (failed) return retval;
- if ( backtracking==0 ) stream_RPAREN.add(RPAREN45);
-
-
- // AST REWRITE
- // elements: THROW, e
- // token labels: e
- // rule labels: retval
- // token list labels:
- // rule list labels:
- if ( backtracking==0 ) {
- retval.tree = root_0;
- RewriteRuleTokenStream stream_e=new RewriteRuleTokenStream(adaptor,"token e",e);
- RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
-
- root_0 = (Object)adaptor.nil();
- // 121:34: -> ^( THROW $e)
- {
- // dd/grammar/ECAGrammar.g:121:37: ^( THROW $e)
- {
- Object root_1 = (Object)adaptor.nil();
- root_1 = (Object)adaptor.becomeRoot(stream_THROW.next(), root_1);
-
- adaptor.addChild(root_1, stream_e.next());
-
- adaptor.addChild(root_0, root_1);
- }
-
- }
-
- }
-
- }
- break;
- case 4 :
- // dd/grammar/ECAGrammar.g:122:4: THROW e= SYMBOL LPAREN args= expr_list RPAREN
- {
- THROW46=(Token)input.LT(1);
- match(input,THROW,FOLLOW_THROW_in_action_expr573); if (failed) return retval;
- if ( backtracking==0 ) stream_THROW.add(THROW46);
-
- e=(Token)input.LT(1);
- match(input,SYMBOL,FOLLOW_SYMBOL_in_action_expr577); if (failed) return retval;
- if ( backtracking==0 ) stream_SYMBOL.add(e);
-
- LPAREN47=(Token)input.LT(1);
- match(input,LPAREN,FOLLOW_LPAREN_in_action_expr579); if (failed) return retval;
- if ( backtracking==0 ) stream_LPAREN.add(LPAREN47);
-
- pushFollow(FOLLOW_expr_list_in_action_expr583);
- args=expr_list();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) stream_expr_list.add(args.getTree());
- RPAREN48=(Token)input.LT(1);
- match(input,RPAREN,FOLLOW_RPAREN_in_action_expr585); if (failed) return retval;
- if ( backtracking==0 ) stream_RPAREN.add(RPAREN48);
-
-
- // AST REWRITE
- // elements: args, e, THROW
- // token labels: e
- // rule labels: args, retval
- // token list labels:
- // rule list labels:
- if ( backtracking==0 ) {
- retval.tree = root_0;
- RewriteRuleTokenStream stream_e=new RewriteRuleTokenStream(adaptor,"token e",e);
- RewriteRuleSubtreeStream stream_args=new RewriteRuleSubtreeStream(adaptor,"token args",args!=null?args.tree:null);
- RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
-
- root_0 = (Object)adaptor.nil();
- // 122:48: -> ^( THROW $e $args)
- {
- // dd/grammar/ECAGrammar.g:122:51: ^( THROW $e $args)
- {
- Object root_1 = (Object)adaptor.nil();
- root_1 = (Object)adaptor.becomeRoot(stream_THROW.next(), root_1);
-
- adaptor.addChild(root_1, stream_e.next());
- adaptor.addChild(root_1, stream_args.next());
-
- adaptor.addChild(root_0, root_1);
- }
-
- }
-
- }
-
- }
- break;
- case 5 :
- // dd/grammar/ECAGrammar.g:123:4: expr
- {
- root_0 = (Object)adaptor.nil();
-
- pushFollow(FOLLOW_expr_in_action_expr602);
- expr49=expr();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) adaptor.addChild(root_0, expr49.getTree());
-
- }
- break;
-
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 26: // expr ::= unary_oper_expr
+ {
+ ParseNode RESULT = null;
+ int eleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int eright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode e = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = e;
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(12/*expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
- retval.stop = input.LT(-1);
+ return CUP$ECAGrammarParser$result;
- if ( backtracking==0 ) {
- retval.tree = (Object)adaptor.rulePostProcessing(root_0);
- adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 25: // expr ::= binary_oper_expr
+ {
+ ParseNode RESULT = null;
+ int eleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int eright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode e = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = e;
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(12/*expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return retval;
- }
- // $ANTLR end action_expr
+ return CUP$ECAGrammarParser$result;
- public static class expr_return extends ParserRuleReturnScope {
- Object tree;
- public Object getTree() { return tree; }
- };
-
- // $ANTLR start expr
- // dd/grammar/ECAGrammar.g:126:1: expr : ( simple_expr infix_oper expr -> ^( BINOP infix_oper simple_expr expr ) | simple_expr | unary_oper expr -> ^( UNOP unary_oper expr ) | cond= simple_expr TERN_IF iftrue= expr COLON iffalse= expr -> ^( TERNOP $cond $iftrue $iffalse) );
- public final expr_return expr() throws RecognitionException {
- expr_return retval = new expr_return();
- retval.start = input.LT(1);
-
- Object root_0 = null;
-
- Token TERN_IF56=null;
- Token COLON57=null;
- simple_expr_return cond = null;
-
- expr_return iftrue = null;
-
- expr_return iffalse = null;
-
- simple_expr_return simple_expr50 = null;
-
- infix_oper_return infix_oper51 = null;
-
- expr_return expr52 = null;
-
- simple_expr_return simple_expr53 = null;
-
- unary_oper_return unary_oper54 = null;
-
- expr_return expr55 = null;
-
-
- Object TERN_IF56_tree=null;
- Object COLON57_tree=null;
- RewriteRuleTokenStream stream_COLON=new RewriteRuleTokenStream(adaptor,"token COLON");
- RewriteRuleTokenStream stream_TERN_IF=new RewriteRuleTokenStream(adaptor,"token TERN_IF");
- RewriteRuleSubtreeStream stream_unary_oper=new RewriteRuleSubtreeStream(adaptor,"rule unary_oper");
- RewriteRuleSubtreeStream stream_infix_oper=new RewriteRuleSubtreeStream(adaptor,"rule infix_oper");
- RewriteRuleSubtreeStream stream_expr=new RewriteRuleSubtreeStream(adaptor,"rule expr");
- RewriteRuleSubtreeStream stream_simple_expr=new RewriteRuleSubtreeStream(adaptor,"rule simple_expr");
- try {
- // dd/grammar/ECAGrammar.g:126:6: ( simple_expr infix_oper expr -> ^( BINOP infix_oper simple_expr expr ) | simple_expr | unary_oper expr -> ^( UNOP unary_oper expr ) | cond= simple_expr TERN_IF iftrue= expr COLON iffalse= expr -> ^( TERNOP $cond $iftrue $iffalse) )
- int alt7=4;
- switch ( input.LA(1) ) {
- case DOLLARSYM:
- {
- switch ( input.LA(2) ) {
- case OR:
- case AND:
- case EQ:
- case NEQ:
- case GT:
- case LT:
- case GEQ:
- case LEQ:
- case BOR:
- case BAND:
- case BXOR:
- case MUL:
- case DIV:
- case PLUS:
- case MINUS:
- {
- alt7=1;
- }
- break;
- case TERN_IF:
- {
- alt7=4;
- }
- break;
- case EOF:
- case IF:
- case DO:
- case ENDRULE:
- case RPAREN:
- case RSQUARE:
- case SEPR:
- case COLON:
- {
- alt7=2;
- }
- break;
- default:
- if (backtracking>0) {failed=true; return retval;}
- NoViableAltException nvae =
- new NoViableAltException("126:1: expr : ( simple_expr infix_oper expr -> ^( BINOP infix_oper simple_expr expr ) | simple_expr | unary_oper expr -> ^( UNOP unary_oper expr ) | cond= simple_expr TERN_IF iftrue= expr COLON iffalse= expr -> ^( TERNOP $cond $iftrue $iffalse) );", 7, 1, input);
-
- throw nvae;
- }
-
- }
- break;
- case SYMBOL:
- {
- switch ( input.LA(2) ) {
- case LPAREN:
- {
- int LA7_10 = input.LA(3);
-
- if ( (synpred11()) ) {
- alt7=1;
- }
- else if ( (synpred12()) ) {
- alt7=2;
- }
- else if ( (true) ) {
- alt7=4;
- }
- else {
- if (backtracking>0) {failed=true; return retval;}
- NoViableAltException nvae =
- new NoViableAltException("126:1: expr : ( simple_expr infix_oper expr -> ^( BINOP infix_oper simple_expr expr ) | simple_expr | unary_oper expr -> ^( UNOP unary_oper expr ) | cond= simple_expr TERN_IF iftrue= expr COLON iffalse= expr -> ^( TERNOP $cond $iftrue $iffalse) );", 7, 10, input);
-
- throw nvae;
- }
- }
- break;
- case TERN_IF:
- {
- alt7=4;
- }
- break;
- case LSQUARE:
- {
- int LA7_11 = input.LA(3);
-
- if ( (synpred11()) ) {
- alt7=1;
- }
- else if ( (synpred12()) ) {
- alt7=2;
- }
- else if ( (true) ) {
- alt7=4;
- }
- else {
- if (backtracking>0) {failed=true; return retval;}
- NoViableAltException nvae =
- new NoViableAltException("126:1: expr : ( simple_expr infix_oper expr -> ^( BINOP infix_oper simple_expr expr ) | simple_expr | unary_oper expr -> ^( UNOP unary_oper expr ) | cond= simple_expr TERN_IF iftrue= expr COLON iffalse= expr -> ^( TERNOP $cond $iftrue $iffalse) );", 7, 11, input);
-
- throw nvae;
- }
- }
- break;
- case EOF:
- case IF:
- case DO:
- case ENDRULE:
- case RPAREN:
- case RSQUARE:
- case SEPR:
- case COLON:
- {
- alt7=2;
- }
- break;
- case OR:
- case AND:
- case EQ:
- case NEQ:
- case GT:
- case LT:
- case GEQ:
- case LEQ:
- case BOR:
- case BAND:
- case BXOR:
- case MUL:
- case DIV:
- case PLUS:
- case MINUS:
- {
- alt7=1;
- }
- break;
- default:
- if (backtracking>0) {failed=true; return retval;}
- NoViableAltException nvae =
- new NoViableAltException("126:1: expr : ( simple_expr infix_oper expr -> ^( BINOP infix_oper simple_expr expr ) | simple_expr | unary_oper expr -> ^( UNOP unary_oper expr ) | cond= simple_expr TERN_IF iftrue= expr COLON iffalse= expr -> ^( TERNOP $cond $iftrue $iffalse) );", 7, 2, input);
-
- throw nvae;
- }
-
- }
- break;
- case NUMBER:
- {
- switch ( input.LA(2) ) {
- case TERN_IF:
- {
- alt7=4;
- }
- break;
- case EOF:
- case IF:
- case DO:
- case ENDRULE:
- case RPAREN:
- case RSQUARE:
- case SEPR:
- case COLON:
- {
- alt7=2;
- }
- break;
- case OR:
- case AND:
- case EQ:
- case NEQ:
- case GT:
- case LT:
- case GEQ:
- case LEQ:
- case BOR:
- case BAND:
- case BXOR:
- case MUL:
- case DIV:
- case PLUS:
- case MINUS:
- {
- alt7=1;
- }
- break;
- default:
- if (backtracking>0) {failed=true; return retval;}
- NoViableAltException nvae =
- new NoViableAltException("126:1: expr : ( simple_expr infix_oper expr -> ^( BINOP infix_oper simple_expr expr ) | simple_expr | unary_oper expr -> ^( UNOP unary_oper expr ) | cond= simple_expr TERN_IF iftrue= expr COLON iffalse= expr -> ^( TERNOP $cond $iftrue $iffalse) );", 7, 3, input);
-
- throw nvae;
- }
-
- }
- break;
- case STRING:
- {
- switch ( input.LA(2) ) {
- case OR:
- case AND:
- case EQ:
- case NEQ:
- case GT:
- case LT:
- case GEQ:
- case LEQ:
- case BOR:
- case BAND:
- case BXOR:
- case MUL:
- case DIV:
- case PLUS:
- case MINUS:
- {
- alt7=1;
- }
- break;
- case EOF:
- case IF:
- case DO:
- case ENDRULE:
- case RPAREN:
- case RSQUARE:
- case SEPR:
- case COLON:
- {
- alt7=2;
- }
- break;
- case TERN_IF:
- {
- alt7=4;
- }
- break;
- default:
- if (backtracking>0) {failed=true; return retval;}
- NoViableAltException nvae =
- new NoViableAltException("126:1: expr : ( simple_expr infix_oper expr -> ^( BINOP infix_oper simple_expr expr ) | simple_expr | unary_oper expr -> ^( UNOP unary_oper expr ) | cond= simple_expr TERN_IF iftrue= expr COLON iffalse= expr -> ^( TERNOP $cond $iftrue $iffalse) );", 7, 4, input);
-
- throw nvae;
- }
-
- }
- break;
- case LPAREN:
- {
- int LA7_5 = input.LA(2);
-
- if ( (synpred11()) ) {
- alt7=1;
- }
- else if ( (synpred12()) ) {
- alt7=2;
- }
- else if ( (true) ) {
- alt7=4;
- }
- else {
- if (backtracking>0) {failed=true; return retval;}
- NoViableAltException nvae =
- new NoViableAltException("126:1: expr : ( simple_expr infix_oper expr -> ^( BINOP infix_oper simple_expr expr ) | simple_expr | unary_oper expr -> ^( UNOP unary_oper expr ) | cond= simple_expr TERN_IF iftrue= expr COLON iffalse= expr -> ^( TERNOP $cond $iftrue $iffalse) );", 7, 5, input);
-
- throw nvae;
- }
- }
- break;
- case NOT:
- case TWIDDLE:
- {
- alt7=3;
- }
- break;
- default:
- if (backtracking>0) {failed=true; return retval;}
- NoViableAltException nvae =
- new NoViableAltException("126:1: expr : ( simple_expr infix_oper expr -> ^( BINOP infix_oper simple_expr expr ) | simple_expr | unary_oper expr -> ^( UNOP unary_oper expr ) | cond= simple_expr TERN_IF iftrue= expr COLON iffalse= expr -> ^( TERNOP $cond $iftrue $iffalse) );", 7, 0, input);
-
- throw nvae;
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 24: // expr ::= ternary_oper_expr
+ {
+ ParseNode RESULT = null;
+ int eleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int eright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode e = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = e;
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(12/*expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
+ return CUP$ECAGrammarParser$result;
- switch (alt7) {
- case 1 :
- // dd/grammar/ECAGrammar.g:126:8: simple_expr infix_oper expr
- {
- pushFollow(FOLLOW_simple_expr_in_expr612);
- simple_expr50=simple_expr();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) stream_simple_expr.add(simple_expr50.getTree());
- pushFollow(FOLLOW_infix_oper_in_expr614);
- infix_oper51=infix_oper();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) stream_infix_oper.add(infix_oper51.getTree());
- pushFollow(FOLLOW_expr_in_expr616);
- expr52=expr();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) stream_expr.add(expr52.getTree());
-
- // AST REWRITE
- // elements: infix_oper, expr, simple_expr
- // token labels:
- // rule labels: retval
- // token list labels:
- // rule list labels:
- if ( backtracking==0 ) {
- retval.tree = root_0;
- RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
-
- root_0 = (Object)adaptor.nil();
- // 126:37: -> ^( BINOP infix_oper simple_expr expr )
- {
- // dd/grammar/ECAGrammar.g:126:40: ^( BINOP infix_oper simple_expr expr )
- {
- Object root_1 = (Object)adaptor.nil();
- root_1 = (Object)adaptor.becomeRoot(adaptor.create(BINOP, "BINOP"), root_1);
-
- adaptor.addChild(root_1, stream_infix_oper.next());
- adaptor.addChild(root_1, stream_simple_expr.next());
- adaptor.addChild(root_1, stream_expr.next());
-
- adaptor.addChild(root_0, root_1);
- }
-
- }
-
- }
-
- }
- break;
- case 2 :
- // dd/grammar/ECAGrammar.g:127:4: simple_expr
- {
- root_0 = (Object)adaptor.nil();
-
- pushFollow(FOLLOW_simple_expr_in_expr634);
- simple_expr53=simple_expr();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) adaptor.addChild(root_0, simple_expr53.getTree());
-
- }
- break;
- case 3 :
- // dd/grammar/ECAGrammar.g:128:4: unary_oper expr
- {
- pushFollow(FOLLOW_unary_oper_in_expr639);
- unary_oper54=unary_oper();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) stream_unary_oper.add(unary_oper54.getTree());
- pushFollow(FOLLOW_expr_in_expr641);
- expr55=expr();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) stream_expr.add(expr55.getTree());
-
- // AST REWRITE
- // elements: expr, unary_oper
- // token labels:
- // rule labels: retval
- // token list labels:
- // rule list labels:
- if ( backtracking==0 ) {
- retval.tree = root_0;
- RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
-
- root_0 = (Object)adaptor.nil();
- // 128:22: -> ^( UNOP unary_oper expr )
- {
- // dd/grammar/ECAGrammar.g:128:25: ^( UNOP unary_oper expr )
- {
- Object root_1 = (Object)adaptor.nil();
- root_1 = (Object)adaptor.becomeRoot(adaptor.create(UNOP, "UNOP"), root_1);
-
- adaptor.addChild(root_1, stream_unary_oper.next());
- adaptor.addChild(root_1, stream_expr.next());
-
- adaptor.addChild(root_0, root_1);
- }
-
- }
-
- }
-
- }
- break;
- case 4 :
- // dd/grammar/ECAGrammar.g:129:4: cond= simple_expr TERN_IF iftrue= expr COLON iffalse= expr
- {
- pushFollow(FOLLOW_simple_expr_in_expr660);
- cond=simple_expr();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) stream_simple_expr.add(cond.getTree());
- TERN_IF56=(Token)input.LT(1);
- match(input,TERN_IF,FOLLOW_TERN_IF_in_expr662); if (failed) return retval;
- if ( backtracking==0 ) stream_TERN_IF.add(TERN_IF56);
-
- pushFollow(FOLLOW_expr_in_expr666);
- iftrue=expr();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) stream_expr.add(iftrue.getTree());
- COLON57=(Token)input.LT(1);
- match(input,COLON,FOLLOW_COLON_in_expr668); if (failed) return retval;
- if ( backtracking==0 ) stream_COLON.add(COLON57);
-
- pushFollow(FOLLOW_expr_in_expr672);
- iffalse=expr();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) stream_expr.add(iffalse.getTree());
-
- // AST REWRITE
- // elements: cond, iftrue, iffalse
- // token labels:
- // rule labels: iftrue, iffalse, cond, retval
- // token list labels:
- // rule list labels:
- if ( backtracking==0 ) {
- retval.tree = root_0;
- RewriteRuleSubtreeStream stream_iftrue=new RewriteRuleSubtreeStream(adaptor,"token iftrue",iftrue!=null?iftrue.tree:null);
- RewriteRuleSubtreeStream stream_iffalse=new RewriteRuleSubtreeStream(adaptor,"token iffalse",iffalse!=null?iffalse.tree:null);
- RewriteRuleSubtreeStream stream_cond=new RewriteRuleSubtreeStream(adaptor,"token cond",cond!=null?cond.tree:null);
- RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
-
- root_0 = (Object)adaptor.nil();
- // 129:60: -> ^( TERNOP $cond $iftrue $iffalse)
- {
- // dd/grammar/ECAGrammar.g:129:63: ^( TERNOP $cond $iftrue $iffalse)
- {
- Object root_1 = (Object)adaptor.nil();
- root_1 = (Object)adaptor.becomeRoot(adaptor.create(TERNOP, "TERNOP"), root_1);
-
- adaptor.addChild(root_1, stream_cond.next());
- adaptor.addChild(root_1, stream_iftrue.next());
- adaptor.addChild(root_1, stream_iffalse.next());
-
- adaptor.addChild(root_0, root_1);
- }
-
- }
-
- }
-
- }
- break;
-
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 23: // expr_list ::= expr COMMA expr_list
+ {
+ ParseNode RESULT = null;
+ int eleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left;
+ int eright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).right;
+ ParseNode e = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).value;
+ int elleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int elright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode el = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.COMMA, eleft, eright, e, el);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(11/*expr_list*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
- retval.stop = input.LT(-1);
+ return CUP$ECAGrammarParser$result;
- if ( backtracking==0 ) {
- retval.tree = (Object)adaptor.rulePostProcessing(root_0);
- adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 22: // expr_list ::= expr
+ {
+ ParseNode RESULT = null;
+ int eleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int eright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode e = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = e;
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(11/*expr_list*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return retval;
- }
- // $ANTLR end expr
+ return CUP$ECAGrammarParser$result;
- public static class simple_expr_return extends ParserRuleReturnScope {
- Object tree;
- public Object getTree() { return tree; }
- };
-
- // $ANTLR start simple_expr
- // dd/grammar/ECAGrammar.g:132:1: simple_expr : (v= DOLLARSYM | v= SYMBOL idx= array_idx -> ^( ARRAY $v $idx) | v= SYMBOL LPAREN RPAREN -> ^( METH $v) | v= SYMBOL | v= SYMBOL LPAREN args= expr_list RPAREN -> ^( METH $v $args) | NUMBER | STRING | LPAREN expr RPAREN -> ^( expr ) );
- public final simple_expr_return simple_expr() throws RecognitionException {
- simple_expr_return retval = new simple_expr_return();
- retval.start = input.LT(1);
-
- Object root_0 = null;
-
- Token v=null;
- Token LPAREN58=null;
- Token RPAREN59=null;
- Token LPAREN60=null;
- Token RPAREN61=null;
- Token NUMBER62=null;
- Token STRING63=null;
- Token LPAREN64=null;
- Token RPAREN66=null;
- array_idx_return idx = null;
-
- expr_list_return args = null;
-
- expr_return expr65 = null;
-
-
- Object v_tree=null;
- Object LPAREN58_tree=null;
- Object RPAREN59_tree=null;
- Object LPAREN60_tree=null;
- Object RPAREN61_tree=null;
- Object NUMBER62_tree=null;
- Object STRING63_tree=null;
- Object LPAREN64_tree=null;
- Object RPAREN66_tree=null;
- RewriteRuleTokenStream stream_RPAREN=new RewriteRuleTokenStream(adaptor,"token RPAREN");
- RewriteRuleTokenStream stream_LPAREN=new RewriteRuleTokenStream(adaptor,"token LPAREN");
- RewriteRuleTokenStream stream_SYMBOL=new RewriteRuleTokenStream(adaptor,"token SYMBOL");
- RewriteRuleSubtreeStream stream_expr_list=new RewriteRuleSubtreeStream(adaptor,"rule expr_list");
- RewriteRuleSubtreeStream stream_expr=new RewriteRuleSubtreeStream(adaptor,"rule expr");
- RewriteRuleSubtreeStream stream_array_idx=new RewriteRuleSubtreeStream(adaptor,"rule array_idx");
- try {
- // dd/grammar/ECAGrammar.g:132:13: (v= DOLLARSYM | v= SYMBOL idx= array_idx -> ^( ARRAY $v $idx) | v= SYMBOL LPAREN RPAREN -> ^( METH $v) | v= SYMBOL | v= SYMBOL LPAREN args= expr_list RPAREN -> ^( METH $v $args) | NUMBER | STRING | LPAREN expr RPAREN -> ^( expr ) )
- int alt8=8;
- switch ( input.LA(1) ) {
- case DOLLARSYM:
- {
- alt8=1;
- }
- break;
- case SYMBOL:
- {
- switch ( input.LA(2) ) {
- case LPAREN:
- {
- int LA8_6 = input.LA(3);
-
- if ( (LA8_6==RPAREN) ) {
- alt8=3;
- }
- else if ( (LA8_6==NUMBER||LA8_6==LPAREN||LA8_6==NOT||LA8_6==TWIDDLE||LA8_6==STRING||LA8_6==SYMBOL||LA8_6==DOLLARSYM) ) {
- alt8=5;
- }
- else {
- if (backtracking>0) {failed=true; return retval;}
- NoViableAltException nvae =
- new NoViableAltException("132:1: simple_expr : (v= DOLLARSYM | v= SYMBOL idx= array_idx -> ^( ARRAY $v $idx) | v= SYMBOL LPAREN RPAREN -> ^( METH $v) | v= SYMBOL | v= SYMBOL LPAREN args= expr_list RPAREN -> ^( METH $v $args) | NUMBER | STRING | LPAREN expr RPAREN -> ^( expr ) );", 8, 6, input);
-
- throw nvae;
- }
- }
- break;
- case LSQUARE:
- {
- alt8=2;
- }
- break;
- case EOF:
- case IF:
- case DO:
- case ENDRULE:
- case RPAREN:
- case RSQUARE:
- case SEPR:
- case OR:
- case AND:
- case EQ:
- case NEQ:
- case GT:
- case LT:
- case GEQ:
- case LEQ:
- case BOR:
- case BAND:
- case BXOR:
- case MUL:
- case DIV:
- case PLUS:
- case MINUS:
- case TERN_IF:
- case COLON:
- {
- alt8=4;
- }
- break;
- default:
- if (backtracking>0) {failed=true; return retval;}
- NoViableAltException nvae =
- new NoViableAltException("132:1: simple_expr : (v= DOLLARSYM | v= SYMBOL idx= array_idx -> ^( ARRAY $v $idx) | v= SYMBOL LPAREN RPAREN -> ^( METH $v) | v= SYMBOL | v= SYMBOL LPAREN args= expr_list RPAREN -> ^( METH $v $args) | NUMBER | STRING | LPAREN expr RPAREN -> ^( expr ) );", 8, 2, input);
-
- throw nvae;
- }
-
- }
- break;
- case NUMBER:
- {
- alt8=6;
- }
- break;
- case STRING:
- {
- alt8=7;
- }
- break;
- case LPAREN:
- {
- alt8=8;
- }
- break;
- default:
- if (backtracking>0) {failed=true; return retval;}
- NoViableAltException nvae =
- new NoViableAltException("132:1: simple_expr : (v= DOLLARSYM | v= SYMBOL idx= array_idx -> ^( ARRAY $v $idx) | v= SYMBOL LPAREN RPAREN -> ^( METH $v) | v= SYMBOL | v= SYMBOL LPAREN args= expr_list RPAREN -> ^( METH $v $args) | NUMBER | STRING | LPAREN expr RPAREN -> ^( expr ) );", 8, 0, input);
-
- throw nvae;
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 21: // action_expr ::= THROW name LPAREN expr_list RPAREN
+ {
+ ParseNode RESULT = null;
+ int ileft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-3)).left;
+ int iright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-3)).right;
+ ParseNode i = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-3)).value;
+ int argsleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).left;
+ int argsright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).right;
+ ParseNode args = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).value;
+ RESULT = node(ParseNode.THROW, ileft, iright, i, args);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(10/*action_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-4)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
+ return CUP$ECAGrammarParser$result;
- switch (alt8) {
- case 1 :
- // dd/grammar/ECAGrammar.g:132:15: v= DOLLARSYM
- {
- root_0 = (Object)adaptor.nil();
-
- v=(Token)input.LT(1);
- match(input,DOLLARSYM,FOLLOW_DOLLARSYM_in_simple_expr699); if (failed) return retval;
- if ( backtracking==0 ) {
- v_tree = (Object)adaptor.create(v);
- adaptor.addChild(root_0, v_tree);
- }
-
- }
- break;
- case 2 :
- // dd/grammar/ECAGrammar.g:133:4: v= SYMBOL idx= array_idx
- {
- v=(Token)input.LT(1);
- match(input,SYMBOL,FOLLOW_SYMBOL_in_simple_expr706); if (failed) return retval;
- if ( backtracking==0 ) stream_SYMBOL.add(v);
-
- pushFollow(FOLLOW_array_idx_in_simple_expr710);
- idx=array_idx();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) stream_array_idx.add(idx.getTree());
-
- // AST REWRITE
- // elements: idx, v
- // token labels: v
- // rule labels: idx, retval
- // token list labels:
- // rule list labels:
- if ( backtracking==0 ) {
- retval.tree = root_0;
- RewriteRuleTokenStream stream_v=new RewriteRuleTokenStream(adaptor,"token v",v);
- RewriteRuleSubtreeStream stream_idx=new RewriteRuleSubtreeStream(adaptor,"token idx",idx!=null?idx.tree:null);
- RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
-
- root_0 = (Object)adaptor.nil();
- // 133:29: -> ^( ARRAY $v $idx)
- {
- // dd/grammar/ECAGrammar.g:133:32: ^( ARRAY $v $idx)
- {
- Object root_1 = (Object)adaptor.nil();
- root_1 = (Object)adaptor.becomeRoot(adaptor.create(ARRAY, "ARRAY"), root_1);
-
- adaptor.addChild(root_1, stream_v.next());
- adaptor.addChild(root_1, stream_idx.next());
-
- adaptor.addChild(root_0, root_1);
- }
-
- }
-
- }
-
- }
- break;
- case 3 :
- // dd/grammar/ECAGrammar.g:134:4: v= SYMBOL LPAREN RPAREN
- {
- v=(Token)input.LT(1);
- match(input,SYMBOL,FOLLOW_SYMBOL_in_simple_expr731); if (failed) return retval;
- if ( backtracking==0 ) stream_SYMBOL.add(v);
-
- LPAREN58=(Token)input.LT(1);
- match(input,LPAREN,FOLLOW_LPAREN_in_simple_expr733); if (failed) return retval;
- if ( backtracking==0 ) stream_LPAREN.add(LPAREN58);
-
- RPAREN59=(Token)input.LT(1);
- match(input,RPAREN,FOLLOW_RPAREN_in_simple_expr735); if (failed) return retval;
- if ( backtracking==0 ) stream_RPAREN.add(RPAREN59);
-
-
- // AST REWRITE
- // elements: v
- // token labels: v
- // rule labels: retval
- // token list labels:
- // rule list labels:
- if ( backtracking==0 ) {
- retval.tree = root_0;
- RewriteRuleTokenStream stream_v=new RewriteRuleTokenStream(adaptor,"token v",v);
- RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
-
- root_0 = (Object)adaptor.nil();
- // 134:29: -> ^( METH $v)
- {
- // dd/grammar/ECAGrammar.g:134:32: ^( METH $v)
- {
- Object root_1 = (Object)adaptor.nil();
- root_1 = (Object)adaptor.becomeRoot(adaptor.create(METH, "METH"), root_1);
-
- adaptor.addChild(root_1, stream_v.next());
-
- adaptor.addChild(root_0, root_1);
- }
-
- }
-
- }
-
- }
- break;
- case 4 :
- // dd/grammar/ECAGrammar.g:135:4: v= SYMBOL
- {
- root_0 = (Object)adaptor.nil();
-
- v=(Token)input.LT(1);
- match(input,SYMBOL,FOLLOW_SYMBOL_in_simple_expr753); if (failed) return retval;
- if ( backtracking==0 ) {
- v_tree = (Object)adaptor.create(v);
- adaptor.addChild(root_0, v_tree);
- }
-
- }
- break;
- case 5 :
- // dd/grammar/ECAGrammar.g:136:4: v= SYMBOL LPAREN args= expr_list RPAREN
- {
- v=(Token)input.LT(1);
- match(input,SYMBOL,FOLLOW_SYMBOL_in_simple_expr760); if (failed) return retval;
- if ( backtracking==0 ) stream_SYMBOL.add(v);
-
- LPAREN60=(Token)input.LT(1);
- match(input,LPAREN,FOLLOW_LPAREN_in_simple_expr762); if (failed) return retval;
- if ( backtracking==0 ) stream_LPAREN.add(LPAREN60);
-
- pushFollow(FOLLOW_expr_list_in_simple_expr766);
- args=expr_list();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) stream_expr_list.add(args.getTree());
- RPAREN61=(Token)input.LT(1);
- match(input,RPAREN,FOLLOW_RPAREN_in_simple_expr768); if (failed) return retval;
- if ( backtracking==0 ) stream_RPAREN.add(RPAREN61);
-
-
- // AST REWRITE
- // elements: args, v
- // token labels: v
- // rule labels: args, retval
- // token list labels:
- // rule list labels:
- if ( backtracking==0 ) {
- retval.tree = root_0;
- RewriteRuleTokenStream stream_v=new RewriteRuleTokenStream(adaptor,"token v",v);
- RewriteRuleSubtreeStream stream_args=new RewriteRuleSubtreeStream(adaptor,"token args",args!=null?args.tree:null);
- RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
-
- root_0 = (Object)adaptor.nil();
- // 136:43: -> ^( METH $v $args)
- {
- // dd/grammar/ECAGrammar.g:136:46: ^( METH $v $args)
- {
- Object root_1 = (Object)adaptor.nil();
- root_1 = (Object)adaptor.becomeRoot(adaptor.create(METH, "METH"), root_1);
-
- adaptor.addChild(root_1, stream_v.next());
- adaptor.addChild(root_1, stream_args.next());
-
- adaptor.addChild(root_0, root_1);
- }
-
- }
-
- }
-
- }
- break;
- case 6 :
- // dd/grammar/ECAGrammar.g:137:4: NUMBER
- {
- root_0 = (Object)adaptor.nil();
-
- NUMBER62=(Token)input.LT(1);
- match(input,NUMBER,FOLLOW_NUMBER_in_simple_expr787); if (failed) return retval;
- if ( backtracking==0 ) {
- NUMBER62_tree = (Object)adaptor.create(NUMBER62);
- adaptor.addChild(root_0, NUMBER62_tree);
- }
-
- }
- break;
- case 7 :
- // dd/grammar/ECAGrammar.g:138:4: STRING
- {
- root_0 = (Object)adaptor.nil();
-
- STRING63=(Token)input.LT(1);
- match(input,STRING,FOLLOW_STRING_in_simple_expr792); if (failed) return retval;
- if ( backtracking==0 ) {
- STRING63_tree = (Object)adaptor.create(STRING63);
- adaptor.addChild(root_0, STRING63_tree);
- }
-
- }
- break;
- case 8 :
- // dd/grammar/ECAGrammar.g:139:4: LPAREN expr RPAREN
- {
- LPAREN64=(Token)input.LT(1);
- match(input,LPAREN,FOLLOW_LPAREN_in_simple_expr797); if (failed) return retval;
- if ( backtracking==0 ) stream_LPAREN.add(LPAREN64);
-
- pushFollow(FOLLOW_expr_in_simple_expr799);
- expr65=expr();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) stream_expr.add(expr65.getTree());
- RPAREN66=(Token)input.LT(1);
- match(input,RPAREN,FOLLOW_RPAREN_in_simple_expr801); if (failed) return retval;
- if ( backtracking==0 ) stream_RPAREN.add(RPAREN66);
-
-
- // AST REWRITE
- // elements: expr
- // token labels:
- // rule labels: retval
- // token list labels:
- // rule list labels:
- if ( backtracking==0 ) {
- retval.tree = root_0;
- RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
-
- root_0 = (Object)adaptor.nil();
- // 139:25: -> ^( expr )
- {
- // dd/grammar/ECAGrammar.g:139:28: ^( expr )
- {
- Object root_1 = (Object)adaptor.nil();
- root_1 = (Object)adaptor.becomeRoot(stream_expr.nextNode(), root_1);
-
- adaptor.addChild(root_0, root_1);
- }
-
- }
-
- }
-
- }
- break;
-
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 20: // action_expr ::= THROW name LPAREN RPAREN
+ {
+ ParseNode RESULT = null;
+ int ileft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left;
+ int iright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).right;
+ ParseNode i = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).value;
+ RESULT = node(ParseNode.THROW, ileft, iright, i, null);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(10/*action_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-3)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
- retval.stop = input.LT(-1);
+ return CUP$ECAGrammarParser$result;
- if ( backtracking==0 ) {
- retval.tree = (Object)adaptor.rulePostProcessing(root_0);
- adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 19: // action_expr ::= RETURN expr
+ {
+ ParseNode RESULT = null;
+ int rleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).left;
+ int rright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).right;
+ Object r = (Object)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).value;
+ int eleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int eright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode e = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.RETURN, rleft, rright, e);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(10/*action_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return retval;
- }
- // $ANTLR end simple_expr
+ return CUP$ECAGrammarParser$result;
- public static class expr_list_return extends ParserRuleReturnScope {
- Object tree;
- public Object getTree() { return tree; }
- };
-
- // $ANTLR start expr_list
- // dd/grammar/ECAGrammar.g:142:1: expr_list : ( expr SEPR expr_list -> ^( SEPR expr expr_list ) | expr );
- public final expr_list_return expr_list() throws RecognitionException {
- expr_list_return retval = new expr_list_return();
- retval.start = input.LT(1);
-
- Object root_0 = null;
-
- Token SEPR68=null;
- expr_return expr67 = null;
-
- expr_list_return expr_list69 = null;
-
- expr_return expr70 = null;
-
-
- Object SEPR68_tree=null;
- RewriteRuleTokenStream stream_SEPR=new RewriteRuleTokenStream(adaptor,"token SEPR");
- RewriteRuleSubtreeStream stream_expr_list=new RewriteRuleSubtreeStream(adaptor,"rule expr_list");
- RewriteRuleSubtreeStream stream_expr=new RewriteRuleSubtreeStream(adaptor,"rule expr");
- try {
- // dd/grammar/ECAGrammar.g:143:2: ( expr SEPR expr_list -> ^( SEPR expr expr_list ) | expr )
- int alt9=2;
- switch ( input.LA(1) ) {
- case DOLLARSYM:
- {
- int LA9_1 = input.LA(2);
-
- if ( (synpred21()) ) {
- alt9=1;
- }
- else if ( (true) ) {
- alt9=2;
- }
- else {
- if (backtracking>0) {failed=true; return retval;}
- NoViableAltException nvae =
- new NoViableAltException("142:1: expr_list : ( expr SEPR expr_list -> ^( SEPR expr expr_list ) | expr );", 9, 1, input);
-
- throw nvae;
- }
- }
- break;
- case SYMBOL:
- {
- int LA9_2 = input.LA(2);
-
- if ( (synpred21()) ) {
- alt9=1;
- }
- else if ( (true) ) {
- alt9=2;
- }
- else {
- if (backtracking>0) {failed=true; return retval;}
- NoViableAltException nvae =
- new NoViableAltException("142:1: expr_list : ( expr SEPR expr_list -> ^( SEPR expr expr_list ) | expr );", 9, 2, input);
-
- throw nvae;
- }
- }
- break;
- case NUMBER:
- {
- int LA9_3 = input.LA(2);
-
- if ( (synpred21()) ) {
- alt9=1;
- }
- else if ( (true) ) {
- alt9=2;
- }
- else {
- if (backtracking>0) {failed=true; return retval;}
- NoViableAltException nvae =
- new NoViableAltException("142:1: expr_list : ( expr SEPR expr_list -> ^( SEPR expr expr_list ) | expr );", 9, 3, input);
-
- throw nvae;
- }
- }
- break;
- case STRING:
- {
- int LA9_4 = input.LA(2);
-
- if ( (synpred21()) ) {
- alt9=1;
- }
- else if ( (true) ) {
- alt9=2;
- }
- else {
- if (backtracking>0) {failed=true; return retval;}
- NoViableAltException nvae =
- new NoViableAltException("142:1: expr_list : ( expr SEPR expr_list -> ^( SEPR expr expr_list ) | expr );", 9, 4, input);
-
- throw nvae;
- }
- }
- break;
- case LPAREN:
- {
- int LA9_5 = input.LA(2);
-
- if ( (synpred21()) ) {
- alt9=1;
- }
- else if ( (true) ) {
- alt9=2;
- }
- else {
- if (backtracking>0) {failed=true; return retval;}
- NoViableAltException nvae =
- new NoViableAltException("142:1: expr_list : ( expr SEPR expr_list -> ^( SEPR expr expr_list ) | expr );", 9, 5, input);
-
- throw nvae;
- }
- }
- break;
- case NOT:
- case TWIDDLE:
- {
- int LA9_6 = input.LA(2);
-
- if ( (synpred21()) ) {
- alt9=1;
- }
- else if ( (true) ) {
- alt9=2;
- }
- else {
- if (backtracking>0) {failed=true; return retval;}
- NoViableAltException nvae =
- new NoViableAltException("142:1: expr_list : ( expr SEPR expr_list -> ^( SEPR expr expr_list ) | expr );", 9, 6, input);
-
- throw nvae;
- }
- }
- break;
- default:
- if (backtracking>0) {failed=true; return retval;}
- NoViableAltException nvae =
- new NoViableAltException("142:1: expr_list : ( expr SEPR expr_list -> ^( SEPR expr expr_list ) | expr );", 9, 0, input);
-
- throw nvae;
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 18: // action_expr ::= RETURN
+ {
+ ParseNode RESULT = null;
+ int rleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int rright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ Object r = (Object)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.RETURN, rleft, rright, null);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(10/*action_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
+ return CUP$ECAGrammarParser$result;
- switch (alt9) {
- case 1 :
- // dd/grammar/ECAGrammar.g:143:4: expr SEPR expr_list
- {
- pushFollow(FOLLOW_expr_in_expr_list820);
- expr67=expr();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) stream_expr.add(expr67.getTree());
- SEPR68=(Token)input.LT(1);
- match(input,SEPR,FOLLOW_SEPR_in_expr_list822); if (failed) return retval;
- if ( backtracking==0 ) stream_SEPR.add(SEPR68);
-
- pushFollow(FOLLOW_expr_list_in_expr_list824);
- expr_list69=expr_list();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) stream_expr_list.add(expr_list69.getTree());
-
- // AST REWRITE
- // elements: SEPR, expr, expr_list
- // token labels:
- // rule labels: retval
- // token list labels:
- // rule list labels:
- if ( backtracking==0 ) {
- retval.tree = root_0;
- RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
-
- root_0 = (Object)adaptor.nil();
- // 143:26: -> ^( SEPR expr expr_list )
- {
- // dd/grammar/ECAGrammar.g:143:29: ^( SEPR expr expr_list )
- {
- Object root_1 = (Object)adaptor.nil();
- root_1 = (Object)adaptor.becomeRoot(stream_SEPR.next(), root_1);
-
- adaptor.addChild(root_1, stream_expr.next());
- adaptor.addChild(root_1, stream_expr_list.next());
-
- adaptor.addChild(root_0, root_1);
- }
-
- }
-
- }
-
- }
- break;
- case 2 :
- // dd/grammar/ECAGrammar.g:144:4: expr
- {
- root_0 = (Object)adaptor.nil();
-
- pushFollow(FOLLOW_expr_in_expr_list841);
- expr70=expr();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) adaptor.addChild(root_0, expr70.getTree());
-
- }
- break;
-
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 17: // action_expr ::= expr
+ {
+ ParseNode RESULT = null;
+ int eleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int eright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode e = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = e;
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(10/*action_expr*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
- retval.stop = input.LT(-1);
+ return CUP$ECAGrammarParser$result;
- if ( backtracking==0 ) {
- retval.tree = (Object)adaptor.rulePostProcessing(root_0);
- adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 16: // action_expr_list ::= action_expr
+ {
+ ParseNode RESULT = null;
+ int aeleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int aeright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode ae = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = ae;
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(9/*action_expr_list*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return retval;
- }
- // $ANTLR end expr_list
+ return CUP$ECAGrammarParser$result;
- public static class array_idx_list_return extends ParserRuleReturnScope {
- Object tree;
- public Object getTree() { return tree; }
- };
-
- // $ANTLR start array_idx_list
- // dd/grammar/ECAGrammar.g:147:1: array_idx_list : ( array_idx array_idx_list -> ^( SEPR array_idx array_idx_list ) | array_idx );
- public final array_idx_list_return array_idx_list() throws RecognitionException {
- array_idx_list_return retval = new array_idx_list_return();
- retval.start = input.LT(1);
-
- Object root_0 = null;
-
- array_idx_return array_idx71 = null;
-
- array_idx_list_return array_idx_list72 = null;
-
- array_idx_return array_idx73 = null;
-
-
- RewriteRuleSubtreeStream stream_array_idx=new RewriteRuleSubtreeStream(adaptor,"rule array_idx");
- RewriteRuleSubtreeStream stream_array_idx_list=new RewriteRuleSubtreeStream(adaptor,"rule array_idx_list");
- try {
- // dd/grammar/ECAGrammar.g:148:2: ( array_idx array_idx_list -> ^( SEPR array_idx array_idx_list ) | array_idx )
- int alt10=2;
- int LA10_0 = input.LA(1);
-
- if ( (LA10_0==LSQUARE) ) {
- int LA10_1 = input.LA(2);
-
- if ( (synpred22()) ) {
- alt10=1;
- }
- else if ( (true) ) {
- alt10=2;
- }
- else {
- if (backtracking>0) {failed=true; return retval;}
- NoViableAltException nvae =
- new NoViableAltException("147:1: array_idx_list : ( array_idx array_idx_list -> ^( SEPR array_idx array_idx_list ) | array_idx );", 10, 1, input);
-
- throw nvae;
- }
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 15: // action_expr_list ::= expr COMMA action_expr_list
+ {
+ ParseNode RESULT = null;
+ int eleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left;
+ int eright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).right;
+ ParseNode e = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).value;
+ int aelleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int aelright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode ael = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.SEMI, eleft, eright, e, ael);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(9/*action_expr_list*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
- else {
- if (backtracking>0) {failed=true; return retval;}
- NoViableAltException nvae =
- new NoViableAltException("147:1: array_idx_list : ( array_idx array_idx_list -> ^( SEPR array_idx array_idx_list ) | array_idx );", 10, 0, input);
+ return CUP$ECAGrammarParser$result;
- throw nvae;
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 14: // action_expr_list ::= expr SEMI action_expr_list
+ {
+ ParseNode RESULT = null;
+ int eleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left;
+ int eright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).right;
+ ParseNode e = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).value;
+ int aelleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int aelright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode ael = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.SEMI, eleft, eright, e, ael);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(9/*action_expr_list*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
- switch (alt10) {
- case 1 :
- // dd/grammar/ECAGrammar.g:148:4: array_idx array_idx_list
- {
- pushFollow(FOLLOW_array_idx_in_array_idx_list852);
- array_idx71=array_idx();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) stream_array_idx.add(array_idx71.getTree());
- pushFollow(FOLLOW_array_idx_list_in_array_idx_list854);
- array_idx_list72=array_idx_list();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) stream_array_idx_list.add(array_idx_list72.getTree());
+ return CUP$ECAGrammarParser$result;
- // AST REWRITE
- // elements: array_idx, array_idx_list
- // token labels:
- // rule labels: retval
- // token list labels:
- // rule list labels:
- if ( backtracking==0 ) {
- retval.tree = root_0;
- RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
-
- root_0 = (Object)adaptor.nil();
- // 148:31: -> ^( SEPR array_idx array_idx_list )
- {
- // dd/grammar/ECAGrammar.g:148:34: ^( SEPR array_idx array_idx_list )
- {
- Object root_1 = (Object)adaptor.nil();
- root_1 = (Object)adaptor.becomeRoot(adaptor.create(SEPR, "SEPR"), root_1);
-
- adaptor.addChild(root_1, stream_array_idx.next());
- adaptor.addChild(root_1, stream_array_idx_list.next());
-
- adaptor.addChild(root_0, root_1);
- }
-
- }
-
- }
-
- }
- break;
- case 2 :
- // dd/grammar/ECAGrammar.g:149:4: array_idx
- {
- root_0 = (Object)adaptor.nil();
-
- pushFollow(FOLLOW_array_idx_in_array_idx_list871);
- array_idx73=array_idx();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) adaptor.addChild(root_0, array_idx73.getTree());
-
- }
- break;
-
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 13: // actions ::= action_expr_list
+ {
+ ParseNode RESULT = null;
+ int aelleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int aelright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode ael = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = ael;
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(8/*actions*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
- retval.stop = input.LT(-1);
+ return CUP$ECAGrammarParser$result;
- if ( backtracking==0 ) {
- retval.tree = (Object)adaptor.rulePostProcessing(root_0);
- adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 12: // actions ::= NOTHING
+ {
+ ParseNode RESULT = null;
+ int nleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int nright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ Object n = (Object)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.NOTHING, nleft, nright);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(8/*actions*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return retval;
- }
- // $ANTLR end array_idx_list
+ return CUP$ECAGrammarParser$result;
- public static class array_idx_return extends ParserRuleReturnScope {
- Object tree;
- public Object getTree() { return tree; }
- };
-
- // $ANTLR start array_idx
- // dd/grammar/ECAGrammar.g:152:1: array_idx : LSQUARE expr RSQUARE -> ^( expr ) ;
- public final array_idx_return array_idx() throws RecognitionException {
- array_idx_return retval = new array_idx_return();
- retval.start = input.LT(1);
-
- Object root_0 = null;
-
- Token LSQUARE74=null;
- Token RSQUARE76=null;
- expr_return expr75 = null;
-
-
- Object LSQUARE74_tree=null;
- Object RSQUARE76_tree=null;
- RewriteRuleTokenStream stream_LSQUARE=new RewriteRuleTokenStream(adaptor,"token LSQUARE");
- RewriteRuleTokenStream stream_RSQUARE=new RewriteRuleTokenStream(adaptor,"token RSQUARE");
- RewriteRuleSubtreeStream stream_expr=new RewriteRuleSubtreeStream(adaptor,"rule expr");
- try {
- // dd/grammar/ECAGrammar.g:153:2: ( LSQUARE expr RSQUARE -> ^( expr ) )
- // dd/grammar/ECAGrammar.g:153:4: LSQUARE expr RSQUARE
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 11: // condition ::= expr
{
- LSQUARE74=(Token)input.LT(1);
- match(input,LSQUARE,FOLLOW_LSQUARE_in_array_idx882); if (failed) return retval;
- if ( backtracking==0 ) stream_LSQUARE.add(LSQUARE74);
+ ParseNode RESULT = null;
+ int eleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int eright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode e = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = e;
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(7/*condition*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
+ }
+ return CUP$ECAGrammarParser$result;
- pushFollow(FOLLOW_expr_in_array_idx884);
- expr75=expr();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) stream_expr.add(expr75.getTree());
- RSQUARE76=(Token)input.LT(1);
- match(input,RSQUARE,FOLLOW_RSQUARE_in_array_idx886); if (failed) return retval;
- if ( backtracking==0 ) stream_RSQUARE.add(RSQUARE76);
-
-
- // AST REWRITE
- // elements: expr
- // token labels:
- // rule labels: retval
- // token list labels:
- // rule list labels:
- if ( backtracking==0 ) {
- retval.tree = root_0;
- RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);
-
- root_0 = (Object)adaptor.nil();
- // 153:27: -> ^( expr )
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 10: // bind_sym ::= simple_name
{
- // dd/grammar/ECAGrammar.g:153:30: ^( expr )
- {
- Object root_1 = (Object)adaptor.nil();
- root_1 = (Object)adaptor.becomeRoot(stream_expr.nextNode(), root_1);
-
- adaptor.addChild(root_0, root_1);
- }
-
+ ParseNode RESULT = null;
+ int varleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int varright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode var = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = var;
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(6/*bind_sym*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
+ return CUP$ECAGrammarParser$result;
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 9: // bind_sym ::= simple_name COLON name
+ {
+ ParseNode RESULT = null;
+ int varleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left;
+ int varright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).right;
+ ParseNode var = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).value;
+ int typeleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int typeright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode type = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.COLON, varleft, varright, var, type);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(6/*bind_sym*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
+ return CUP$ECAGrammarParser$result;
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 8: // binding ::= bind_sym ASSIGN expr
+ {
+ ParseNode RESULT = null;
+ int sleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left;
+ int sright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).right;
+ ParseNode s = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).value;
+ int eleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int eright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode e = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.ASSIGN, sleft, sright, s, e);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(5/*binding*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
+ return CUP$ECAGrammarParser$result;
- retval.stop = input.LT(-1);
-
- if ( backtracking==0 ) {
- retval.tree = (Object)adaptor.rulePostProcessing(root_0);
- adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 7: // bindings ::= binding
+ {
+ ParseNode RESULT = null;
+ int bleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int bright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode b = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = b;
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(4/*bindings*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return retval;
- }
- // $ANTLR end array_idx
+ return CUP$ECAGrammarParser$result;
- public static class infix_oper_return extends ParserRuleReturnScope {
- Object tree;
- public Object getTree() { return tree; }
- };
-
- // $ANTLR start infix_oper
- // dd/grammar/ECAGrammar.g:156:1: infix_oper : ( infix_bit_oper | infix_arith_oper | infix_bool_oper | infix_cmp_oper );
- public final infix_oper_return infix_oper() throws RecognitionException {
- infix_oper_return retval = new infix_oper_return();
- retval.start = input.LT(1);
-
- Object root_0 = null;
-
- infix_bit_oper_return infix_bit_oper77 = null;
-
- infix_arith_oper_return infix_arith_oper78 = null;
-
- infix_bool_oper_return infix_bool_oper79 = null;
-
- infix_cmp_oper_return infix_cmp_oper80 = null;
-
-
-
- try {
- // dd/grammar/ECAGrammar.g:156:12: ( infix_bit_oper | infix_arith_oper | infix_bool_oper | infix_cmp_oper )
- int alt11=4;
- switch ( input.LA(1) ) {
- case BOR:
- case BAND:
- case BXOR:
- {
- alt11=1;
- }
- break;
- case MUL:
- case DIV:
- case PLUS:
- case MINUS:
- {
- alt11=2;
- }
- break;
- case OR:
- case AND:
- {
- alt11=3;
- }
- break;
- case EQ:
- case NEQ:
- case GT:
- case LT:
- case GEQ:
- case LEQ:
- {
- alt11=4;
- }
- break;
- default:
- if (backtracking>0) {failed=true; return retval;}
- NoViableAltException nvae =
- new NoViableAltException("156:1: infix_oper : ( infix_bit_oper | infix_arith_oper | infix_bool_oper | infix_cmp_oper );", 11, 0, input);
-
- throw nvae;
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 6: // bindings ::= binding SEMI bindings
+ {
+ ParseNode RESULT = null;
+ int bleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left;
+ int bright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).right;
+ ParseNode b = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).value;
+ int bsleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int bsright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode bs = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.COMMA, bleft, bright, b, bs);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(4/*bindings*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
+ return CUP$ECAGrammarParser$result;
- switch (alt11) {
- case 1 :
- // dd/grammar/ECAGrammar.g:156:14: infix_bit_oper
- {
- root_0 = (Object)adaptor.nil();
-
- pushFollow(FOLLOW_infix_bit_oper_in_infix_oper904);
- infix_bit_oper77=infix_bit_oper();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) adaptor.addChild(root_0, infix_bit_oper77.getTree());
-
- }
- break;
- case 2 :
- // dd/grammar/ECAGrammar.g:157:4: infix_arith_oper
- {
- root_0 = (Object)adaptor.nil();
-
- pushFollow(FOLLOW_infix_arith_oper_in_infix_oper909);
- infix_arith_oper78=infix_arith_oper();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) adaptor.addChild(root_0, infix_arith_oper78.getTree());
-
- }
- break;
- case 3 :
- // dd/grammar/ECAGrammar.g:158:4: infix_bool_oper
- {
- root_0 = (Object)adaptor.nil();
-
- pushFollow(FOLLOW_infix_bool_oper_in_infix_oper914);
- infix_bool_oper79=infix_bool_oper();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) adaptor.addChild(root_0, infix_bool_oper79.getTree());
-
- }
- break;
- case 4 :
- // dd/grammar/ECAGrammar.g:159:4: infix_cmp_oper
- {
- root_0 = (Object)adaptor.nil();
-
- pushFollow(FOLLOW_infix_cmp_oper_in_infix_oper919);
- infix_cmp_oper80=infix_cmp_oper();
- _fsp--;
- if (failed) return retval;
- if ( backtracking==0 ) adaptor.addChild(root_0, infix_cmp_oper80.getTree());
-
- }
- break;
-
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 5: // bindings ::= binding COMMA bindings
+ {
+ ParseNode RESULT = null;
+ int bleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left;
+ int bright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).right;
+ ParseNode b = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).value;
+ int bsleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int bsright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode bs = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.COMMA, bleft, bright, b, bs);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(4/*bindings*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
- retval.stop = input.LT(-1);
+ return CUP$ECAGrammarParser$result;
- if ( backtracking==0 ) {
- retval.tree = (Object)adaptor.rulePostProcessing(root_0);
- adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
- }
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return retval;
- }
- // $ANTLR end infix_oper
-
- public static class infix_bit_oper_return extends ParserRuleReturnScope {
- Object tree;
- public Object getTree() { return tree; }
- };
-
- // $ANTLR start infix_bit_oper
- // dd/grammar/ECAGrammar.g:162:1: infix_bit_oper : ( BAND | BOR | BXOR );
- public final infix_bit_oper_return infix_bit_oper() throws RecognitionException {
- infix_bit_oper_return retval = new infix_bit_oper_return();
- retval.start = input.LT(1);
-
- Object root_0 = null;
-
- Token set81=null;
-
- Object set81_tree=null;
-
- try {
- // dd/grammar/ECAGrammar.g:163:2: ( BAND | BOR | BXOR )
- // dd/grammar/ECAGrammar.g:
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 4: // event ::= bindings
{
- root_0 = (Object)adaptor.nil();
-
- set81=(Token)input.LT(1);
- if ( (input.LA(1)>=BOR && input.LA(1)<=BXOR) ) {
- input.consume();
- if ( backtracking==0 ) adaptor.addChild(root_0, adaptor.create(set81));
- errorRecovery=false;failed=false;
+ ParseNode RESULT = null;
+ int bleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int bright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode b = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = b;
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(3/*event*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
- else {
- if (backtracking>0) {failed=true; return retval;}
- MismatchedSetException mse =
- new MismatchedSetException(null,input);
- recoverFromMismatchedSet(input,mse,FOLLOW_set_in_infix_bit_oper0); throw mse;
- }
+ return CUP$ECAGrammarParser$result;
-
- }
-
- retval.stop = input.LT(-1);
-
- if ( backtracking==0 ) {
- retval.tree = (Object)adaptor.rulePostProcessing(root_0);
- adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
- }
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return retval;
- }
- // $ANTLR end infix_bit_oper
-
- public static class infix_arith_oper_return extends ParserRuleReturnScope {
- Object tree;
- public Object getTree() { return tree; }
- };
-
- // $ANTLR start infix_arith_oper
- // dd/grammar/ECAGrammar.g:168:1: infix_arith_oper : ( MUL | DIV | PLUS | MINUS );
- public final infix_arith_oper_return infix_arith_oper() throws RecognitionException {
- infix_arith_oper_return retval = new infix_arith_oper_return();
- retval.start = input.LT(1);
-
- Object root_0 = null;
-
- Token set82=null;
-
- Object set82_tree=null;
-
- try {
- // dd/grammar/ECAGrammar.g:169:2: ( MUL | DIV | PLUS | MINUS )
- // dd/grammar/ECAGrammar.g:
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 3: // event ::= NOTHING
{
- root_0 = (Object)adaptor.nil();
-
- set82=(Token)input.LT(1);
- if ( (input.LA(1)>=MUL && input.LA(1)<=MINUS) ) {
- input.consume();
- if ( backtracking==0 ) adaptor.addChild(root_0, adaptor.create(set82));
- errorRecovery=false;failed=false;
+ ParseNode RESULT = null;
+ int nleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int nright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ Object n = (Object)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.NOTHING, nleft, nright);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(3/*event*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
- else {
- if (backtracking>0) {failed=true; return retval;}
- MismatchedSetException mse =
- new MismatchedSetException(null,input);
- recoverFromMismatchedSet(input,mse,FOLLOW_set_in_infix_arith_oper0); throw mse;
- }
+ return CUP$ECAGrammarParser$result;
-
- }
-
- retval.stop = input.LT(-1);
-
- if ( backtracking==0 ) {
- retval.tree = (Object)adaptor.rulePostProcessing(root_0);
- adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
- }
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return retval;
- }
- // $ANTLR end infix_arith_oper
-
- public static class infix_bool_oper_return extends ParserRuleReturnScope {
- Object tree;
- public Object getTree() { return tree; }
- };
-
- // $ANTLR start infix_bool_oper
- // dd/grammar/ECAGrammar.g:175:1: infix_bool_oper : ( AND | OR );
- public final infix_bool_oper_return infix_bool_oper() throws RecognitionException {
- infix_bool_oper_return retval = new infix_bool_oper_return();
- retval.start = input.LT(1);
-
- Object root_0 = null;
-
- Token set83=null;
-
- Object set83_tree=null;
-
- try {
- // dd/grammar/ECAGrammar.g:176:2: ( AND | OR )
- // dd/grammar/ECAGrammar.g:
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 2: // eca ::= BIND event IF condition DO actions
{
- root_0 = (Object)adaptor.nil();
-
- set83=(Token)input.LT(1);
- if ( (input.LA(1)>=OR && input.LA(1)<=AND) ) {
- input.consume();
- if ( backtracking==0 ) adaptor.addChild(root_0, adaptor.create(set83));
- errorRecovery=false;failed=false;
+ ParseNode RESULT = null;
+ int eleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-4)).left;
+ int eright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-4)).right;
+ ParseNode e = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-4)).value;
+ int cleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).left;
+ int cright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).right;
+ ParseNode c = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-2)).value;
+ int aleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int aright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode a = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = node(ParseNode.BIND, eleft, eright, e, c, a);
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(2/*eca*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-5)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
- else {
- if (backtracking>0) {failed=true; return retval;}
- MismatchedSetException mse =
- new MismatchedSetException(null,input);
- recoverFromMismatchedSet(input,mse,FOLLOW_set_in_infix_bool_oper0); throw mse;
- }
+ return CUP$ECAGrammarParser$result;
-
- }
-
- retval.stop = input.LT(-1);
-
- if ( backtracking==0 ) {
- retval.tree = (Object)adaptor.rulePostProcessing(root_0);
- adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
- }
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return retval;
- }
- // $ANTLR end infix_bool_oper
-
- public static class infix_cmp_oper_return extends ParserRuleReturnScope {
- Object tree;
- public Object getTree() { return tree; }
- };
-
- // $ANTLR start infix_cmp_oper
- // dd/grammar/ECAGrammar.g:180:1: infix_cmp_oper : ( EQ | NEQ | GT | LT | GEQ | LEQ );
- public final infix_cmp_oper_return infix_cmp_oper() throws RecognitionException {
- infix_cmp_oper_return retval = new infix_cmp_oper_return();
- retval.start = input.LT(1);
-
- Object root_0 = null;
-
- Token set84=null;
-
- Object set84_tree=null;
-
- try {
- // dd/grammar/ECAGrammar.g:181:2: ( EQ | NEQ | GT | LT | GEQ | LEQ )
- // dd/grammar/ECAGrammar.g:
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 1: // $START ::= eca_rule EOF
{
- root_0 = (Object)adaptor.nil();
-
- set84=(Token)input.LT(1);
- if ( (input.LA(1)>=EQ && input.LA(1)<=LEQ) ) {
- input.consume();
- if ( backtracking==0 ) adaptor.addChild(root_0, adaptor.create(set84));
- errorRecovery=false;failed=false;
+ Object RESULT = null;
+ int start_valleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).left;
+ int start_valright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).right;
+ ParseNode start_val = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).value;
+ RESULT = start_val;
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(0/*$START*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-1)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
- else {
- if (backtracking>0) {failed=true; return retval;}
- MismatchedSetException mse =
- new MismatchedSetException(null,input);
- recoverFromMismatchedSet(input,mse,FOLLOW_set_in_infix_cmp_oper0); throw mse;
- }
+ /* ACCEPT */
+ CUP$ECAGrammarParser$parser.done_parsing();
+ return CUP$ECAGrammarParser$result;
-
- }
-
- retval.stop = input.LT(-1);
-
- if ( backtracking==0 ) {
- retval.tree = (Object)adaptor.rulePostProcessing(root_0);
- adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
- }
- }
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return retval;
- }
- // $ANTLR end infix_cmp_oper
-
- public static class unary_oper_return extends ParserRuleReturnScope {
- Object tree;
- public Object getTree() { return tree; }
- };
-
- // $ANTLR start unary_oper
- // dd/grammar/ECAGrammar.g:189:1: unary_oper : ( NOT | TWIDDLE );
- public final unary_oper_return unary_oper() throws RecognitionException {
- unary_oper_return retval = new unary_oper_return();
- retval.start = input.LT(1);
-
- Object root_0 = null;
-
- Token set85=null;
-
- Object set85_tree=null;
-
- try {
- // dd/grammar/ECAGrammar.g:189:12: ( NOT | TWIDDLE )
- // dd/grammar/ECAGrammar.g:
+ /*. . . . . . . . . . . . . . . . . . . .*/
+ case 0: // eca_rule ::= eca
{
- root_0 = (Object)adaptor.nil();
-
- set85=(Token)input.LT(1);
- if ( input.LA(1)==NOT||input.LA(1)==TWIDDLE ) {
- input.consume();
- if ( backtracking==0 ) adaptor.addChild(root_0, adaptor.create(set85));
- errorRecovery=false;failed=false;
+ ParseNode RESULT = null;
+ int ruleleft = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left;
+ int ruleright = ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right;
+ ParseNode rule = (ParseNode)((java_cup.runtime.Symbol) CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).value;
+ RESULT = rule;
+ CUP$ECAGrammarParser$result = new java_cup.runtime.Symbol(1/*eca_rule*/, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).left, ((java_cup.runtime.Symbol)CUP$ECAGrammarParser$stack.elementAt(CUP$ECAGrammarParser$top-0)).right, RESULT);
}
- else {
- if (backtracking>0) {failed=true; return retval;}
- MismatchedSetException mse =
- new MismatchedSetException(null,input);
- recoverFromMismatchedSet(input,mse,FOLLOW_set_in_unary_oper0); throw mse;
- }
+ return CUP$ECAGrammarParser$result;
+ /* . . . . . .*/
+ default:
+ throw new Exception(
+ "Invalid action number found in internal parse table");
- }
-
- retval.stop = input.LT(-1);
-
- if ( backtracking==0 ) {
- retval.tree = (Object)adaptor.rulePostProcessing(root_0);
- adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
- }
}
- catch (RecognitionException re) {
- reportError(re);
- recover(input,re);
- }
- finally {
- }
- return retval;
}
- // $ANTLR end unary_oper
+}
- // $ANTLR start synpred1
- public final void synpred1_fragment() throws RecognitionException {
- // dd/grammar/ECAGrammar.g:85:12: ( binding SEPR bindings )
- // dd/grammar/ECAGrammar.g:85:12: binding SEPR bindings
- {
- pushFollow(FOLLOW_binding_in_synpred1334);
- binding();
- _fsp--;
- if (failed) return ;
- match(input,SEPR,FOLLOW_SEPR_in_synpred1336); if (failed) return ;
- pushFollow(FOLLOW_bindings_in_synpred1338);
- bindings();
- _fsp--;
- if (failed) return ;
-
- }
- }
- // $ANTLR end synpred1
-
- // $ANTLR start synpred6
- public final void synpred6_fragment() throws RecognitionException {
- // dd/grammar/ECAGrammar.g:115:4: ( action_expr SEPR action_expr_list )
- // dd/grammar/ECAGrammar.g:115:4: action_expr SEPR action_expr_list
- {
- pushFollow(FOLLOW_action_expr_in_synpred6489);
- action_expr();
- _fsp--;
- if (failed) return ;
- match(input,SEPR,FOLLOW_SEPR_in_synpred6491); if (failed) return ;
- pushFollow(FOLLOW_action_expr_list_in_synpred6493);
- action_expr_list();
- _fsp--;
- if (failed) return ;
-
- }
- }
- // $ANTLR end synpred6
-
- // $ANTLR start synpred11
- public final void synpred11_fragment() throws RecognitionException {
- // dd/grammar/ECAGrammar.g:126:8: ( simple_expr infix_oper expr )
- // dd/grammar/ECAGrammar.g:126:8: simple_expr infix_oper expr
- {
- pushFollow(FOLLOW_simple_expr_in_synpred11612);
- simple_expr();
- _fsp--;
- if (failed) return ;
- pushFollow(FOLLOW_infix_oper_in_synpred11614);
- infix_oper();
- _fsp--;
- if (failed) return ;
- pushFollow(FOLLOW_expr_in_synpred11616);
- expr();
- _fsp--;
- if (failed) return ;
-
- }
- }
- // $ANTLR end synpred11
-
- // $ANTLR start synpred12
- public final void synpred12_fragment() throws RecognitionException {
- // dd/grammar/ECAGrammar.g:127:4: ( simple_expr )
- // dd/grammar/ECAGrammar.g:127:4: simple_expr
- {
- pushFollow(FOLLOW_simple_expr_in_synpred12634);
- simple_expr();
- _fsp--;
- if (failed) return ;
-
- }
- }
- // $ANTLR end synpred12
-
- // $ANTLR start synpred21
- public final void synpred21_fragment() throws RecognitionException {
- // dd/grammar/ECAGrammar.g:143:4: ( expr SEPR expr_list )
- // dd/grammar/ECAGrammar.g:143:4: expr SEPR expr_list
- {
- pushFollow(FOLLOW_expr_in_synpred21820);
- expr();
- _fsp--;
- if (failed) return ;
- match(input,SEPR,FOLLOW_SEPR_in_synpred21822); if (failed) return ;
- pushFollow(FOLLOW_expr_list_in_synpred21824);
- expr_list();
- _fsp--;
- if (failed) return ;
-
- }
- }
- // $ANTLR end synpred21
-
- // $ANTLR start synpred22
- public final void synpred22_fragment() throws RecognitionException {
- // dd/grammar/ECAGrammar.g:148:4: ( array_idx array_idx_list )
- // dd/grammar/ECAGrammar.g:148:4: array_idx array_idx_list
- {
- pushFollow(FOLLOW_array_idx_in_synpred22852);
- array_idx();
- _fsp--;
- if (failed) return ;
- pushFollow(FOLLOW_array_idx_list_in_synpred22854);
- array_idx_list();
- _fsp--;
- if (failed) return ;
-
- }
- }
- // $ANTLR end synpred22
-
- public final boolean synpred12() {
- backtracking++;
- int start = input.mark();
- try {
- synpred12_fragment(); // can never throw exception
- } catch (RecognitionException re) {
- System.err.println("impossible: "+re);
- }
- boolean success = !failed;
- input.rewind(start);
- backtracking--;
- failed=false;
- return success;
- }
- public final boolean synpred1() {
- backtracking++;
- int start = input.mark();
- try {
- synpred1_fragment(); // can never throw exception
- } catch (RecognitionException re) {
- System.err.println("impossible: "+re);
- }
- boolean success = !failed;
- input.rewind(start);
- backtracking--;
- failed=false;
- return success;
- }
- public final boolean synpred11() {
- backtracking++;
- int start = input.mark();
- try {
- synpred11_fragment(); // can never throw exception
- } catch (RecognitionException re) {
- System.err.println("impossible: "+re);
- }
- boolean success = !failed;
- input.rewind(start);
- backtracking--;
- failed=false;
- return success;
- }
- public final boolean synpred6() {
- backtracking++;
- int start = input.mark();
- try {
- synpred6_fragment(); // can never throw exception
- } catch (RecognitionException re) {
- System.err.println("impossible: "+re);
- }
- boolean success = !failed;
- input.rewind(start);
- backtracking--;
- failed=false;
- return success;
- }
- public final boolean synpred22() {
- backtracking++;
- int start = input.mark();
- try {
- synpred22_fragment(); // can never throw exception
- } catch (RecognitionException re) {
- System.err.println("impossible: "+re);
- }
- boolean success = !failed;
- input.rewind(start);
- backtracking--;
- failed=false;
- return success;
- }
- public final boolean synpred21() {
- backtracking++;
- int start = input.mark();
- try {
- synpred21_fragment(); // can never throw exception
- } catch (RecognitionException re) {
- System.err.println("impossible: "+re);
- }
- boolean success = !failed;
- input.rewind(start);
- backtracking--;
- failed=false;
- return success;
- }
-
-
-
-
- public static final BitSet FOLLOW_eca_script_rule_one_in_eca_script_rule90 = new BitSet(new long[]{0x0000000000000000L});
- public static final BitSet FOLLOW_EOF_in_eca_script_rule92 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_RULE_in_eca_script_rule_one109 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000004L});
- public static final BitSet FOLLOW_SYMBOL_in_eca_script_rule_one113 = new BitSet(new long[]{0x0000000000020000L});
- public static final BitSet FOLLOW_CLASS_in_eca_script_rule_one117 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000004L});
- public static final BitSet FOLLOW_SYMBOL_in_eca_script_rule_one121 = new BitSet(new long[]{0x0000000000040000L});
- public static final BitSet FOLLOW_METHOD_in_eca_script_rule_one125 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000004L});
- public static final BitSet FOLLOW_SYMBOL_in_eca_script_rule_one129 = new BitSet(new long[]{0x0000000000080000L});
- public static final BitSet FOLLOW_LINE_in_eca_script_rule_one133 = new BitSet(new long[]{0x0000000000001000L});
- public static final BitSet FOLLOW_NUMBER_in_eca_script_rule_one137 = new BitSet(new long[]{0x0000000000002000L});
- public static final BitSet FOLLOW_BIND_in_eca_script_rule_one141 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000004L});
- public static final BitSet FOLLOW_event_in_eca_script_rule_one145 = new BitSet(new long[]{0x0000000000004000L});
- public static final BitSet FOLLOW_IF_in_eca_script_rule_one149 = new BitSet(new long[]{0x4000802004C01000L,0x0000000000000014L});
- public static final BitSet FOLLOW_condition_in_eca_script_rule_one153 = new BitSet(new long[]{0x0000000000008000L});
- public static final BitSet FOLLOW_DO_in_eca_script_rule_one157 = new BitSet(new long[]{0x4000802007201000L,0x0000000000000014L});
- public static final BitSet FOLLOW_action_in_eca_script_rule_one161 = new BitSet(new long[]{0x0000000000100000L});
- public static final BitSet FOLLOW_ENDRULE_in_eca_script_rule_one165 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_eca_in_eca_rule202 = new BitSet(new long[]{0x0000000000000000L});
- public static final BitSet FOLLOW_EOF_in_eca_rule204 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_event_in_eca_event221 = new BitSet(new long[]{0x0000000000000000L});
- public static final BitSet FOLLOW_EOF_in_eca_event223 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_condition_in_eca_condition239 = new BitSet(new long[]{0x0000000000000000L});
- public static final BitSet FOLLOW_EOF_in_eca_condition241 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_action_in_eca_action257 = new BitSet(new long[]{0x0000000000000000L});
- public static final BitSet FOLLOW_EOF_in_eca_action259 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_BIND_in_eca275 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000004L});
- public static final BitSet FOLLOW_event_in_eca279 = new BitSet(new long[]{0x0000000000004000L});
- public static final BitSet FOLLOW_IF_in_eca283 = new BitSet(new long[]{0x4000802004C01000L,0x0000000000000014L});
- public static final BitSet FOLLOW_condition_in_eca287 = new BitSet(new long[]{0x0000000000008000L});
- public static final BitSet FOLLOW_DO_in_eca291 = new BitSet(new long[]{0x4000802007201000L,0x0000000000000014L});
- public static final BitSet FOLLOW_action_in_eca295 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_bindings_in_event322 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_binding_in_bindings334 = new BitSet(new long[]{0x0000000100000000L});
- public static final BitSet FOLLOW_SEPR_in_bindings336 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000004L});
- public static final BitSet FOLLOW_bindings_in_bindings338 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_binding_in_bindings353 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_bind_sym_in_binding363 = new BitSet(new long[]{0x0000000400000000L});
- public static final BitSet FOLLOW_ASSIGN_in_binding365 = new BitSet(new long[]{0x4000802004001000L,0x0000000000000014L});
- public static final BitSet FOLLOW_expr_in_binding367 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_SYMBOL_in_bind_sym390 = new BitSet(new long[]{0x0040000000000000L});
- public static final BitSet FOLLOW_COLON_in_bind_sym392 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000004L});
- public static final BitSet FOLLOW_SYMBOL_in_bind_sym396 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_SYMBOL_in_bind_sym414 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_TRUE_in_condition428 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_FALSE_in_condition440 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_expr_in_condition452 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_NOTHING_in_action466 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_action_expr_list_in_action478 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_action_expr_in_action_expr_list489 = new BitSet(new long[]{0x0000000100000000L});
- public static final BitSet FOLLOW_SEPR_in_action_expr_list491 = new BitSet(new long[]{0x4000802007001000L,0x0000000000000014L});
- public static final BitSet FOLLOW_action_expr_list_in_action_expr_list493 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_action_expr_in_action_expr_list508 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_RETURN_in_action_expr518 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_RETURN_in_action_expr532 = new BitSet(new long[]{0x4000802004001000L,0x0000000000000014L});
- public static final BitSet FOLLOW_expr_in_action_expr534 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_THROW_in_action_expr550 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000004L});
- public static final BitSet FOLLOW_SYMBOL_in_action_expr554 = new BitSet(new long[]{0x0000000004000000L});
- public static final BitSet FOLLOW_LPAREN_in_action_expr556 = new BitSet(new long[]{0x0000000008000000L});
- public static final BitSet FOLLOW_RPAREN_in_action_expr558 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_THROW_in_action_expr573 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000004L});
- public static final BitSet FOLLOW_SYMBOL_in_action_expr577 = new BitSet(new long[]{0x0000000004000000L});
- public static final BitSet FOLLOW_LPAREN_in_action_expr579 = new BitSet(new long[]{0x4000802004001000L,0x0000000000000014L});
- public static final BitSet FOLLOW_expr_list_in_action_expr583 = new BitSet(new long[]{0x0000000008000000L});
- public static final BitSet FOLLOW_RPAREN_in_action_expr585 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_expr_in_action_expr602 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_simple_expr_in_expr612 = new BitSet(new long[]{0x000F7FD800000000L});
- public static final BitSet FOLLOW_infix_oper_in_expr614 = new BitSet(new long[]{0x4000802004001000L,0x0000000000000014L});
- public static final BitSet FOLLOW_expr_in_expr616 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_simple_expr_in_expr634 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_unary_oper_in_expr639 = new BitSet(new long[]{0x4000802004001000L,0x0000000000000014L});
- public static final BitSet FOLLOW_expr_in_expr641 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_simple_expr_in_expr660 = new BitSet(new long[]{0x0020000000000000L});
- public static final BitSet FOLLOW_TERN_IF_in_expr662 = new BitSet(new long[]{0x4000802004001000L,0x0000000000000014L});
- public static final BitSet FOLLOW_expr_in_expr666 = new BitSet(new long[]{0x0040000000000000L});
- public static final BitSet FOLLOW_COLON_in_expr668 = new BitSet(new long[]{0x4000802004001000L,0x0000000000000014L});
- public static final BitSet FOLLOW_expr_in_expr672 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_DOLLARSYM_in_simple_expr699 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_SYMBOL_in_simple_expr706 = new BitSet(new long[]{0x0000000010000000L});
- public static final BitSet FOLLOW_array_idx_in_simple_expr710 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_SYMBOL_in_simple_expr731 = new BitSet(new long[]{0x0000000004000000L});
- public static final BitSet FOLLOW_LPAREN_in_simple_expr733 = new BitSet(new long[]{0x0000000008000000L});
- public static final BitSet FOLLOW_RPAREN_in_simple_expr735 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_SYMBOL_in_simple_expr753 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_SYMBOL_in_simple_expr760 = new BitSet(new long[]{0x0000000004000000L});
- public static final BitSet FOLLOW_LPAREN_in_simple_expr762 = new BitSet(new long[]{0x4000802004001000L,0x0000000000000014L});
- public static final BitSet FOLLOW_expr_list_in_simple_expr766 = new BitSet(new long[]{0x0000000008000000L});
- public static final BitSet FOLLOW_RPAREN_in_simple_expr768 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_NUMBER_in_simple_expr787 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_STRING_in_simple_expr792 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_LPAREN_in_simple_expr797 = new BitSet(new long[]{0x4000802004001000L,0x0000000000000014L});
- public static final BitSet FOLLOW_expr_in_simple_expr799 = new BitSet(new long[]{0x0000000008000000L});
- public static final BitSet FOLLOW_RPAREN_in_simple_expr801 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_expr_in_expr_list820 = new BitSet(new long[]{0x0000000100000000L});
- public static final BitSet FOLLOW_SEPR_in_expr_list822 = new BitSet(new long[]{0x4000802004001000L,0x0000000000000014L});
- public static final BitSet FOLLOW_expr_list_in_expr_list824 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_expr_in_expr_list841 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_array_idx_in_array_idx_list852 = new BitSet(new long[]{0x0000000010000000L});
- public static final BitSet FOLLOW_array_idx_list_in_array_idx_list854 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_array_idx_in_array_idx_list871 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_LSQUARE_in_array_idx882 = new BitSet(new long[]{0x4000802004001000L,0x0000000000000014L});
- public static final BitSet FOLLOW_expr_in_array_idx884 = new BitSet(new long[]{0x0000000020000000L});
- public static final BitSet FOLLOW_RSQUARE_in_array_idx886 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_infix_bit_oper_in_infix_oper904 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_infix_arith_oper_in_infix_oper909 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_infix_bool_oper_in_infix_oper914 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_infix_cmp_oper_in_infix_oper919 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_set_in_infix_bit_oper0 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_set_in_infix_arith_oper0 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_set_in_infix_bool_oper0 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_set_in_infix_cmp_oper0 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_set_in_unary_oper0 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_binding_in_synpred1334 = new BitSet(new long[]{0x0000000100000000L});
- public static final BitSet FOLLOW_SEPR_in_synpred1336 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000004L});
- public static final BitSet FOLLOW_bindings_in_synpred1338 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_action_expr_in_synpred6489 = new BitSet(new long[]{0x0000000100000000L});
- public static final BitSet FOLLOW_SEPR_in_synpred6491 = new BitSet(new long[]{0x4000802007001000L,0x0000000000000014L});
- public static final BitSet FOLLOW_action_expr_list_in_synpred6493 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_simple_expr_in_synpred11612 = new BitSet(new long[]{0x000F7FD800000000L});
- public static final BitSet FOLLOW_infix_oper_in_synpred11614 = new BitSet(new long[]{0x4000802004001000L,0x0000000000000014L});
- public static final BitSet FOLLOW_expr_in_synpred11616 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_simple_expr_in_synpred12634 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_expr_in_synpred21820 = new BitSet(new long[]{0x0000000100000000L});
- public static final BitSet FOLLOW_SEPR_in_synpred21822 = new BitSet(new long[]{0x4000802004001000L,0x0000000000000014L});
- public static final BitSet FOLLOW_expr_list_in_synpred21824 = new BitSet(new long[]{0x0000000000000002L});
- public static final BitSet FOLLOW_array_idx_in_synpred22852 = new BitSet(new long[]{0x0000000010000000L});
- public static final BitSet FOLLOW_array_idx_list_in_synpred22854 = new BitSet(new long[]{0x0000000000000002L});
-
-}
\ No newline at end of file
Modified: labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/grammar/ECATokenLexer.java
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/grammar/ECATokenLexer.java 2008-10-16 05:58:54 UTC (rev 23470)
+++ labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/grammar/ECATokenLexer.java 2008-10-16 07:28:17 UTC (rev 23471)
@@ -1,4325 +1,1098 @@
-// $ANTLR 3.0.1 dd/grammar/ECAToken.g 2008-10-01 15:50:04
+/* The following code was generated by JFlex 1.4.2 on 16/10/08 08:21 */
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2008, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*
+* @authors Andrew Dinn
+*/
+
package org.jboss.jbossts.orchestration.rule.grammar;
+import java_cup.runtime.*;
-import org.antlr.runtime.*;
-import java.util.Stack;
-import java.util.List;
-import java.util.ArrayList;
-public class ECATokenLexer extends Lexer {
- public static final int MINUS=51;
- public static final int NUMBER=12;
- public static final int METHOD=18;
- public static final int FLOAT=11;
- public static final int FALSE=23;
- public static final int POSDIGIT=5;
- public static final int TWIDDLE=47;
- public static final int LEQ=43;
- public static final int RULE=16;
- public static final int MOD=52;
- public static final int GEQ=42;
- public static final int DQUOTE=58;
- public static final int BOR=44;
- public static final int OR=35;
- public static final int BAREINT=7;
- public static final int LBRACE=30;
- public static final int NEWLINE=60;
- public static final int DOT=33;
- public static final int RBRACE=31;
- public static final int INTEGER=8;
- public static final int AND=36;
- public static final int ASSIGN=34;
- public static final int SYMBOL=66;
- public static final int RPAREN=27;
- public static final int SIGN=6;
- public static final int LPAREN=26;
- public static final int PLUS=50;
- public static final int DIGIT=4;
- public static final int LINE=19;
- public static final int BAND=45;
- public static final int NEQ=39;
- public static final int SPACE=59;
- public static final int LETTER=55;
- public static final int LSQUARE=28;
- public static final int DO=15;
- public static final int POINT=9;
- public static final int BARESYM=63;
- public static final int NOTHING=21;
- public static final int SEPR=32;
- public static final int WS=69;
- public static final int STRING=62;
- public static final int EQ=38;
- public static final int QUOTSYM=64;
- public static final int LT=41;
- public static final int GT=40;
- public static final int DOLLAR=67;
- public static final int RSQUARE=29;
- public static final int QUOTE=57;
- public static final int TERN_IF=53;
- public static final int MUL=48;
- public static final int CLASS=17;
- public static final int EXPPART=10;
- public static final int PUNCT=61;
- public static final int RETURN=24;
- public static final int IF=14;
- public static final int EOF=-1;
- public static final int Tokens=70;
- public static final int COLON=54;
- public static final int DIV=49;
- public static final int DOTSYM=65;
- public static final int BXOR=46;
- public static final int ENDRULE=20;
- public static final int BIND=13;
- public static final int NOT=37;
- public static final int TRUE=22;
- public static final int UNDERSCORE=56;
- public static final int THROW=25;
- public static final int DOLLARSYM=68;
- public ECATokenLexer() {;}
- public ECATokenLexer(CharStream input) {
- super(input);
- }
- public String getGrammarFileName() { return "dd/grammar/ECAToken.g"; }
+/**
+ * This class is a scanner generated by
+ * <a href="http://www.jflex.de/">JFlex</a> 1.4.2
+ * on 16/10/08 08:21 from the specification file
+ * <tt>dd/grammar/flex/ECAToken.flex</tt>
+ */
+public class ECATokenLexer implements java_cup.runtime.Scanner {
- // $ANTLR start DIGIT
- public final void mDIGIT() throws RecognitionException {
- try {
- // dd/grammar/ECAToken.g:33:7: ( '0' .. '9' )
- // dd/grammar/ECAToken.g:33:9: '0' .. '9'
- {
- matchRange('0','9');
+ /** This character denotes the end of file */
+ public static final int YYEOF = -1;
- }
+ /** initial size of the lookahead buffer */
+ private static final int ZZ_BUFFERSIZE = 16384;
- }
- finally {
- }
- }
- // $ANTLR end DIGIT
+ /** lexical states */
+ public static final int STRING = 2;
+ public static final int QUOTEDIDENT = 4;
+ public static final int YYINITIAL = 0;
+ public static final int COMMENT = 6;
- // $ANTLR start POSDIGIT
- public final void mPOSDIGIT() throws RecognitionException {
- try {
- // dd/grammar/ECAToken.g:37:10: ( '1' .. '9' )
- // dd/grammar/ECAToken.g:37:12: '1' .. '9'
- {
- matchRange('1','9');
+ /**
+ * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l
+ * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l
+ * at the beginning of a line
+ * l is of the form l = 2*k, k a non negative integer
+ */
+ private static final int ZZ_LEXSTATE[] = {
+ 0, 0, 1, 1, 2, 2, 3, 3
+ };
- }
+ /**
+ * Translates characters to character classes
+ */
+ private static final String ZZ_CMAP_PACKED =
+ "\11\0\1\3\1\2\1\0\1\3\1\1\22\0\1\3\1\65\1\106"+
+ "\1\110\1\5\1\103\1\64\1\107\1\52\1\53\1\73\1\10\1\57"+
+ "\1\62\1\12\1\76\1\6\11\7\1\105\1\56\1\61\1\60\1\70"+
+ "\1\104\1\0\1\42\1\13\1\4\1\16\1\37\1\23\1\31\1\30"+
+ "\1\14\2\4\1\43\1\74\1\15\1\25\1\101\1\66\1\35\1\44"+
+ "\1\27\1\36\1\77\1\50\3\4\1\54\1\111\1\55\1\71\1\4"+
+ "\1\0\1\45\1\17\1\4\1\22\1\11\1\24\1\34\1\33\1\20"+
+ "\2\4\1\46\1\75\1\21\1\26\1\102\1\67\1\40\1\47\1\32"+
+ "\1\41\1\100\1\51\3\4\1\0\1\63\1\0\1\72\uff81\0";
- }
- finally {
- }
- }
- // $ANTLR end POSDIGIT
+ /**
+ * Translates characters to character classes
+ */
+ private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED);
- // $ANTLR start SIGN
- public final void mSIGN() throws RecognitionException {
- try {
- // dd/grammar/ECAToken.g:41:6: ( '+' | '-' )
- // dd/grammar/ECAToken.g:
- {
- if ( input.LA(1)=='+'||input.LA(1)=='-' ) {
- input.consume();
+ /**
+ * Translates DFA states to action switch labels.
+ */
+ private static final int [] ZZ_ACTION = zzUnpackAction();
- }
- else {
- MismatchedSetException mse =
- new MismatchedSetException(null,input);
- recover(mse); throw mse;
- }
+ private static final String ZZ_ACTION_PACKED_0 =
+ "\4\0\1\1\2\2\1\3\1\4\2\5\1\6\1\3"+
+ "\1\7\27\3\1\10\1\11\1\12\1\13\1\14\1\15"+
+ "\1\16\1\17\1\20\1\21\1\22\1\23\1\24\1\25"+
+ "\1\26\1\27\2\3\1\30\2\3\1\31\1\32\1\33"+
+ "\1\34\1\35\1\36\1\37\1\40\1\41\1\42\1\43"+
+ "\1\37\2\44\1\45\1\46\2\47\1\0\1\50\1\51"+
+ "\1\3\1\52\1\3\1\53\1\3\1\54\5\3\1\55"+
+ "\3\3\1\24\1\56\6\3\1\17\1\57\1\3\1\51"+
+ "\1\57\1\0\1\55\1\60\1\53\1\56\6\3\1\61"+
+ "\1\62\1\63\1\64\2\50\1\0\2\50\1\3\1\23"+
+ "\2\3\1\23\13\3\1\60\1\16\1\3\1\31\3\3"+
+ "\1\65\10\3\1\66\6\3\1\6\4\3\1\67\1\27"+
+ "\1\70\2\3\1\20\1\3\1\30\1\3\1\71\1\72";
+ private static int [] zzUnpackAction() {
+ int [] result = new int[182];
+ int offset = 0;
+ offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result);
+ return result;
+ }
- }
-
- }
- finally {
- }
+ private static int zzUnpackAction(String packed, int offset, int [] result) {
+ int i = 0; /* index in packed string */
+ int j = offset; /* index in unpacked array */
+ int l = packed.length();
+ while (i < l) {
+ int count = packed.charAt(i++);
+ int value = packed.charAt(i++);
+ do result[j++] = value; while (--count > 0);
}
- // $ANTLR end SIGN
+ return j;
+ }
- // $ANTLR start BAREINT
- public final void mBAREINT() throws RecognitionException {
- try {
- // dd/grammar/ECAToken.g:45:9: ( '0' | ( POSDIGIT ( DIGIT )* ) )
- int alt2=2;
- int LA2_0 = input.LA(1);
- if ( (LA2_0=='0') ) {
- alt2=1;
- }
- else if ( ((LA2_0>='1' && LA2_0<='9')) ) {
- alt2=2;
- }
- else {
- NoViableAltException nvae =
- new NoViableAltException("44:1: fragment BAREINT : ( '0' | ( POSDIGIT ( DIGIT )* ) );", 2, 0, input);
+ /**
+ * Translates a state to a row index in the transition table
+ */
+ private static final int [] ZZ_ROWMAP = zzUnpackRowMap();
- throw nvae;
- }
- switch (alt2) {
- case 1 :
- // dd/grammar/ECAToken.g:45:11: '0'
- {
- match('0');
+ private static final String ZZ_ROWMAP_PACKED_0 =
+ "\0\0\0\112\0\224\0\336\0\u0128\0\u0172\0\u0128\0\u01bc"+
+ "\0\u0128\0\u0206\0\u0250\0\u029a\0\u02e4\0\u0128\0\u032e\0\u0378"+
+ "\0\u03c2\0\u040c\0\u0456\0\u04a0\0\u04ea\0\u0534\0\u057e\0\u05c8"+
+ "\0\u0612\0\u065c\0\u06a6\0\u06f0\0\u073a\0\u0784\0\u07ce\0\u0818"+
+ "\0\u0862\0\u08ac\0\u08f6\0\u0940\0\u098a\0\u0128\0\u0128\0\u0128"+
+ "\0\u0128\0\u0128\0\u0128\0\u09d4\0\u0a1e\0\u029a\0\u0a68\0\u0ab2"+
+ "\0\u0afc\0\u0b46\0\u0128\0\u0128\0\u0128\0\u0b90\0\u0bda\0\u0128"+
+ "\0\u0c24\0\u0c6e\0\u0128\0\u0128\0\u0128\0\u0128\0\u0128\0\u0128"+
+ "\0\u0cb8\0\u0128\0\u0128\0\u0128\0\u0d02\0\u0d4c\0\u0d96\0\u0128"+
+ "\0\u0128\0\u0128\0\u0de0\0\u0128\0\u0e2a\0\u0e74\0\u01bc\0\u0ebe"+
+ "\0\u01bc\0\u0f08\0\u01bc\0\u0f52\0\u01bc\0\u0f9c\0\u0fe6\0\u1030"+
+ "\0\u107a\0\u10c4\0\u01bc\0\u110e\0\u1158\0\u11a2\0\u01bc\0\u01bc"+
+ "\0\u11ec\0\u1236\0\u1280\0\u12ca\0\u1314\0\u135e\0\u01bc\0\u01bc"+
+ "\0\u13a8\0\u0128\0\u0128\0\u13f2\0\u0128\0\u0128\0\u0128\0\u0128"+
+ "\0\u143c\0\u1486\0\u14d0\0\u151a\0\u1564\0\u15ae\0\u0128\0\u0128"+
+ "\0\u0128\0\u0128\0\u0128\0\u15f8\0\u1642\0\u168c\0\u16d6\0\u1720"+
+ "\0\u176a\0\u17b4\0\u17fe\0\u1848\0\u1892\0\u18dc\0\u1926\0\u1970"+
+ "\0\u19ba\0\u1a04\0\u1a4e\0\u1a98\0\u1ae2\0\u1b2c\0\u1b76\0\u01bc"+
+ "\0\u0128\0\u1bc0\0\u01bc\0\u1c0a\0\u1c54\0\u1c9e\0\u01bc\0\u1ce8"+
+ "\0\u1d32\0\u1d7c\0\u1dc6\0\u1e10\0\u1e5a\0\u1ea4\0\u1eee\0\u01bc"+
+ "\0\u1f38\0\u1f82\0\u1fcc\0\u2016\0\u2060\0\u20aa\0\u01bc\0\u20f4"+
+ "\0\u213e\0\u2188\0\u21d2\0\u01bc\0\u01bc\0\u01bc\0\u221c\0\u2266"+
+ "\0\u01bc\0\u22b0\0\u01bc\0\u22fa\0\u01bc\0\u01bc";
- }
- break;
- case 2 :
- // dd/grammar/ECAToken.g:45:17: ( POSDIGIT ( DIGIT )* )
- {
- // dd/grammar/ECAToken.g:45:17: ( POSDIGIT ( DIGIT )* )
- // dd/grammar/ECAToken.g:45:18: POSDIGIT ( DIGIT )*
- {
- mPOSDIGIT();
- // dd/grammar/ECAToken.g:45:27: ( DIGIT )*
- loop1:
- do {
- int alt1=2;
- int LA1_0 = input.LA(1);
+ private static int [] zzUnpackRowMap() {
+ int [] result = new int[182];
+ int offset = 0;
+ offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result);
+ return result;
+ }
- if ( ((LA1_0>='0' && LA1_0<='9')) ) {
- alt1=1;
- }
-
-
- switch (alt1) {
- case 1 :
- // dd/grammar/ECAToken.g:45:28: DIGIT
- {
- mDIGIT();
-
- }
- break;
-
- default :
- break loop1;
- }
- } while (true);
-
-
- }
-
-
- }
- break;
-
- }
- }
- finally {
- }
+ private static int zzUnpackRowMap(String packed, int offset, int [] result) {
+ int i = 0; /* index in packed string */
+ int j = offset; /* index in unpacked array */
+ int l = packed.length();
+ while (i < l) {
+ int high = packed.charAt(i++) << 16;
+ result[j++] = high | packed.charAt(i++);
}
- // $ANTLR end BAREINT
+ return j;
+ }
- // $ANTLR start INTEGER
- public final void mINTEGER() throws RecognitionException {
- try {
- // dd/grammar/ECAToken.g:48:9: ( ( SIGN )? BAREINT )
- // dd/grammar/ECAToken.g:48:11: ( SIGN )? BAREINT
- {
- // dd/grammar/ECAToken.g:48:11: ( SIGN )?
- int alt3=2;
- int LA3_0 = input.LA(1);
+ /**
+ * The transition table of the DFA
+ */
+ private static final int [] ZZ_TRANS = zzUnpackTrans();
- if ( (LA3_0=='+'||LA3_0=='-') ) {
- alt3=1;
- }
- switch (alt3) {
- case 1 :
- // dd/grammar/ECAToken.g:48:11: SIGN
- {
- mSIGN();
+ private static final String ZZ_TRANS_PACKED_0 =
+ "\1\5\1\6\2\7\1\10\1\11\1\12\1\13\1\14"+
+ "\1\15\1\16\1\17\1\20\1\21\1\22\1\23\1\24"+
+ "\1\25\1\26\1\27\1\30\1\31\1\32\1\33\1\10"+
+ "\1\34\1\35\1\10\1\36\1\37\1\10\1\40\1\41"+
+ "\1\10\1\42\1\43\1\10\1\44\1\45\3\10\1\46"+
+ "\1\47\1\50\1\51\1\52\1\53\1\54\1\55\1\56"+
+ "\1\57\1\60\1\61\2\10\1\62\1\63\1\64\1\65"+
+ "\1\66\1\67\1\70\2\10\1\71\1\72\1\73\1\74"+
+ "\1\75\1\76\1\77\1\100\1\5\1\101\1\102\1\103"+
+ "\103\101\1\104\2\101\1\105\1\106\1\107\1\110\104\106"+
+ "\1\111\2\106\1\112\1\113\1\114\107\112\114\0\1\7"+
+ "\113\0\4\10\1\0\1\10\1\0\37\10\14\0\2\10"+
+ "\4\0\2\10\1\0\4\10\20\0\1\115\1\116\24\0"+
+ "\1\115\60\0\2\13\1\0\1\115\1\116\24\0\1\115"+
+ "\60\0\1\12\1\13\106\0\4\10\1\0\1\10\1\0"+
+ "\37\10\14\0\1\10\1\117\4\0\2\10\1\0\4\10"+
+ "\13\0\4\10\1\0\1\10\1\0\1\10\1\120\35\10"+
+ "\14\0\2\10\4\0\2\10\1\0\4\10\13\0\4\10"+
+ "\1\0\1\10\1\0\10\10\1\121\26\10\14\0\2\10"+
+ "\4\0\2\10\1\0\4\10\13\0\4\10\1\0\1\10"+
+ "\1\0\12\10\1\122\11\10\1\123\12\10\14\0\2\10"+
+ "\4\0\2\10\1\0\4\10\13\0\4\10\1\0\1\10"+
+ "\1\0\1\10\1\124\10\10\1\125\24\10\14\0\2\10"+
+ "\4\0\2\10\1\0\4\10\13\0\4\10\1\0\1\10"+
+ "\1\0\5\10\1\126\31\10\14\0\2\10\4\0\2\10"+
+ "\1\0\4\10\13\0\4\10\1\0\1\10\1\0\11\10"+
+ "\1\121\25\10\14\0\2\10\4\0\2\10\1\0\4\10"+
+ "\13\0\4\10\1\0\1\123\1\0\13\10\1\127\23\10"+
+ "\14\0\2\10\4\0\2\10\1\0\4\10\13\0\4\10"+
+ "\1\0\1\10\1\0\5\10\1\130\5\10\1\125\23\10"+
+ "\14\0\2\10\4\0\2\10\1\0\4\10\13\0\4\10"+
+ "\1\0\1\10\1\0\27\10\1\131\7\10\14\0\2\10"+
+ "\4\0\2\10\1\0\4\10\13\0\4\10\1\0\1\10"+
+ "\1\0\32\10\1\132\4\10\14\0\2\10\4\0\2\10"+
+ "\1\0\4\10\13\0\4\10\1\0\1\10\1\0\22\10"+
+ "\1\133\14\10\14\0\2\10\4\0\2\10\1\0\4\10"+
+ "\13\0\4\10\1\0\1\10\1\0\25\10\1\133\11\10"+
+ "\14\0\2\10\4\0\2\10\1\0\4\10\13\0\4\10"+
+ "\1\0\1\10\1\0\1\10\1\134\13\10\1\135\4\10"+
+ "\1\136\14\10\14\0\2\10\4\0\2\10\1\0\4\10"+
+ "\13\0\4\10\1\0\1\10\1\0\14\10\1\137\7\10"+
+ "\1\140\12\10\14\0\2\10\4\0\2\10\1\0\4\10"+
+ "\13\0\4\10\1\0\1\10\1\0\5\10\1\141\12\10"+
+ "\1\142\4\10\1\143\11\10\14\0\2\10\4\0\2\10"+
+ "\1\0\4\10\13\0\4\10\1\0\1\140\1\0\17\10"+
+ "\1\137\17\10\14\0\2\10\4\0\2\10\1\0\4\10"+
+ "\13\0\4\10\1\0\1\10\1\0\24\10\1\144\12\10"+
+ "\14\0\2\10\4\0\2\10\1\0\4\10\13\0\4\10"+
+ "\1\0\1\10\1\0\37\10\14\0\1\117\1\10\4\0"+
+ "\2\10\1\0\4\10\13\0\4\10\1\0\1\145\1\0"+
+ "\37\10\14\0\2\10\4\0\2\10\1\0\4\10\13\0"+
+ "\4\10\1\0\1\10\1\0\2\10\1\146\34\10\14\0"+
+ "\2\10\4\0\2\10\1\0\4\10\13\0\4\10\1\0"+
+ "\1\10\1\0\14\10\1\147\7\10\1\150\12\10\14\0"+
+ "\2\10\4\0\2\10\1\0\4\10\13\0\4\10\1\0"+
+ "\1\10\1\0\6\10\1\151\30\10\14\0\2\10\4\0"+
+ "\2\10\1\0\4\10\13\0\4\10\1\0\1\150\1\0"+
+ "\17\10\1\147\17\10\14\0\2\10\4\0\2\10\1\0"+
+ "\4\10\67\0\1\152\111\0\1\153\1\0\1\154\112\0"+
+ "\1\155\112\0\1\156\105\0\1\157\111\0\1\160\35\0"+
+ "\4\10\1\0\1\10\1\0\1\10\1\161\10\10\1\162"+
+ "\24\10\14\0\2\10\4\0\2\10\1\0\4\10\13\0"+
+ "\4\10\1\0\1\10\1\0\5\10\1\163\5\10\1\164"+
+ "\23\10\14\0\2\10\4\0\2\10\1\0\4\10\13\0"+
+ "\4\10\1\0\1\10\1\0\30\10\1\165\6\10\14\0"+
+ "\2\10\4\0\2\10\1\0\4\10\13\0\4\10\1\0"+
+ "\1\10\1\0\33\10\1\166\3\10\14\0\2\10\4\0"+
+ "\2\10\1\0\4\10\7\0\1\101\2\0\103\101\1\0"+
+ "\2\101\22\0\1\167\10\0\1\170\5\0\1\171\45\0"+
+ "\1\172\3\0\1\106\2\0\104\106\1\0\2\106\2\0"+
+ "\1\110\111\0\1\114\115\0\1\173\1\174\1\175\51\0"+
+ "\1\175\35\0\1\176\1\177\1\0\1\115\25\0\1\115"+
+ "\56\0\4\10\1\0\1\10\1\0\2\10\1\200\34\10"+
+ "\14\0\2\10\4\0\2\10\1\0\4\10\13\0\4\10"+
+ "\1\0\1\10\1\0\14\10\1\201\22\10\14\0\2\10"+
+ "\4\0\2\10\1\0\4\10\13\0\4\10\1\0\1\10"+
+ "\1\0\37\10\14\0\2\10\4\0\2\10\1\0\1\202"+
+ "\3\10\13\0\4\10\1\0\1\10\1\0\6\10\1\203"+
+ "\30\10\14\0\2\10\4\0\2\10\1\0\4\10\13\0"+
+ "\4\10\1\0\1\10\1\0\17\10\1\204\17\10\14\0"+
+ "\2\10\4\0\2\10\1\0\4\10\13\0\4\10\1\0"+
+ "\1\10\1\0\37\10\14\0\2\10\4\0\2\10\1\0"+
+ "\1\10\1\205\2\10\13\0\4\10\1\0\1\10\1\0"+
+ "\30\10\1\206\6\10\14\0\2\10\4\0\2\10\1\0"+
+ "\4\10\13\0\4\10\1\0\1\10\1\0\33\10\1\207"+
+ "\3\10\14\0\2\10\4\0\2\10\1\0\4\10\13\0"+
+ "\4\10\1\0\1\10\1\0\37\10\14\0\2\10\4\0"+
+ "\1\210\1\10\1\0\4\10\13\0\4\10\1\0\1\10"+
+ "\1\0\22\10\1\211\14\10\14\0\2\10\4\0\2\10"+
+ "\1\0\4\10\13\0\4\10\1\0\1\10\1\0\23\10"+
+ "\1\212\13\10\14\0\2\10\4\0\2\10\1\0\4\10"+
+ "\13\0\4\10\1\0\1\10\1\0\37\10\14\0\2\10"+
+ "\4\0\1\10\1\213\1\0\4\10\13\0\4\10\1\0"+
+ "\1\10\1\0\25\10\1\214\11\10\14\0\2\10\4\0"+
+ "\2\10\1\0\4\10\13\0\4\10\1\0\1\10\1\0"+
+ "\26\10\1\215\10\10\14\0\2\10\4\0\2\10\1\0"+
+ "\4\10\13\0\4\10\1\0\1\10\1\0\14\10\1\216"+
+ "\22\10\14\0\2\10\4\0\2\10\1\0\4\10\13\0"+
+ "\4\10\1\0\1\10\1\0\17\10\1\217\17\10\14\0"+
+ "\2\10\4\0\2\10\1\0\4\10\13\0\4\10\1\0"+
+ "\1\10\1\0\3\10\1\220\33\10\14\0\2\10\4\0"+
+ "\2\10\1\0\4\10\13\0\4\10\1\0\1\10\1\0"+
+ "\7\10\1\220\27\10\14\0\2\10\4\0\2\10\1\0"+
+ "\4\10\71\0\1\221\33\0\4\10\1\0\1\10\1\0"+
+ "\2\10\1\222\34\10\14\0\2\10\4\0\2\10\1\0"+
+ "\4\10\13\0\4\10\1\0\1\10\1\0\3\10\1\223"+
+ "\33\10\14\0\2\10\4\0\2\10\1\0\4\10\13\0"+
+ "\4\10\1\0\1\10\1\0\6\10\1\224\30\10\14\0"+
+ "\2\10\4\0\2\10\1\0\4\10\13\0\4\10\1\0"+
+ "\1\10\1\0\7\10\1\223\27\10\14\0\2\10\4\0"+
+ "\2\10\1\0\4\10\13\0\4\10\1\0\1\10\1\0"+
+ "\23\10\1\225\13\10\14\0\2\10\4\0\2\10\1\0"+
+ "\4\10\13\0\4\10\1\0\1\10\1\0\26\10\1\226"+
+ "\10\10\14\0\2\10\4\0\2\10\1\0\4\10\15\0"+
+ "\2\174\110\0\1\173\1\174\113\0\1\115\25\0\1\115"+
+ "\60\0\2\177\1\0\1\115\25\0\1\115\56\0\4\10"+
+ "\1\0\1\10\1\0\3\10\1\227\33\10\14\0\2\10"+
+ "\4\0\2\10\1\0\4\10\13\0\4\10\1\0\1\10"+
+ "\1\0\15\10\1\230\21\10\14\0\2\10\4\0\2\10"+
+ "\1\0\4\10\13\0\4\10\1\0\1\10\1\0\1\10"+
+ "\1\231\35\10\14\0\2\10\4\0\2\10\1\0\4\10"+
+ "\13\0\4\10\1\0\1\10\1\0\7\10\1\227\27\10"+
+ "\14\0\2\10\4\0\2\10\1\0\4\10\13\0\4\10"+
+ "\1\0\1\10\1\0\20\10\1\232\16\10\14\0\2\10"+
+ "\4\0\2\10\1\0\4\10\13\0\4\10\1\0\1\10"+
+ "\1\0\5\10\1\233\31\10\14\0\2\10\4\0\2\10"+
+ "\1\0\4\10\13\0\4\10\1\0\1\10\1\0\31\10"+
+ "\1\234\5\10\14\0\2\10\4\0\2\10\1\0\4\10"+
+ "\13\0\4\10\1\0\1\10\1\0\34\10\1\235\2\10"+
+ "\14\0\2\10\4\0\2\10\1\0\4\10\13\0\4\10"+
+ "\1\0\1\10\1\0\24\10\1\236\12\10\14\0\2\10"+
+ "\4\0\2\10\1\0\4\10\13\0\4\10\1\0\1\10"+
+ "\1\0\12\10\1\237\24\10\14\0\2\10\4\0\2\10"+
+ "\1\0\4\10\13\0\4\10\1\0\1\10\1\0\24\10"+
+ "\1\240\12\10\14\0\2\10\4\0\2\10\1\0\4\10"+
+ "\13\0\4\10\1\0\1\241\1\0\37\10\14\0\2\10"+
+ "\4\0\2\10\1\0\4\10\13\0\4\10\1\0\1\10"+
+ "\1\0\13\10\1\242\23\10\14\0\2\10\4\0\2\10"+
+ "\1\0\4\10\13\0\4\10\1\0\1\240\1\0\37\10"+
+ "\14\0\2\10\4\0\2\10\1\0\4\10\13\0\4\10"+
+ "\1\0\1\10\1\0\23\10\1\243\13\10\14\0\2\10"+
+ "\4\0\2\10\1\0\4\10\13\0\4\10\1\0\1\10"+
+ "\1\0\26\10\1\244\10\10\14\0\2\10\4\0\2\10"+
+ "\1\0\4\10\13\0\4\10\1\0\1\10\1\0\23\10"+
+ "\1\245\13\10\14\0\2\10\4\0\2\10\1\0\4\10"+
+ "\13\0\4\10\1\0\1\10\1\0\26\10\1\246\10\10"+
+ "\14\0\2\10\4\0\2\10\1\0\4\10\13\0\4\10"+
+ "\1\0\1\10\1\0\31\10\1\247\5\10\14\0\2\10"+
+ "\4\0\2\10\1\0\4\10\13\0\4\10\1\0\1\10"+
+ "\1\0\34\10\1\247\2\10\14\0\2\10\4\0\2\10"+
+ "\1\0\4\10\13\0\4\10\1\0\1\10\1\0\1\10"+
+ "\1\250\35\10\14\0\2\10\4\0\2\10\1\0\4\10"+
+ "\13\0\4\10\1\0\1\10\1\0\3\10\1\251\33\10"+
+ "\14\0\2\10\4\0\2\10\1\0\4\10\13\0\4\10"+
+ "\1\0\1\10\1\0\5\10\1\252\31\10\14\0\2\10"+
+ "\4\0\2\10\1\0\4\10\13\0\4\10\1\0\1\10"+
+ "\1\0\7\10\1\253\27\10\14\0\2\10\4\0\2\10"+
+ "\1\0\4\10\13\0\4\10\1\0\1\10\1\0\24\10"+
+ "\1\254\12\10\14\0\2\10\4\0\2\10\1\0\4\10"+
+ "\13\0\4\10\1\0\1\254\1\0\37\10\14\0\2\10"+
+ "\4\0\2\10\1\0\4\10\13\0\4\10\1\0\1\10"+
+ "\1\0\31\10\1\255\5\10\14\0\2\10\4\0\2\10"+
+ "\1\0\4\10\13\0\4\10\1\0\1\10\1\0\35\10"+
+ "\1\256\1\10\14\0\2\10\4\0\2\10\1\0\4\10"+
+ "\13\0\4\10\1\0\1\10\1\0\34\10\1\255\2\10"+
+ "\14\0\2\10\4\0\2\10\1\0\4\10\13\0\4\10"+
+ "\1\0\1\10\1\0\36\10\1\256\14\0\2\10\4\0"+
+ "\2\10\1\0\4\10\13\0\4\10\1\0\1\10\1\0"+
+ "\22\10\1\257\14\10\14\0\2\10\4\0\2\10\1\0"+
+ "\4\10\13\0\4\10\1\0\1\10\1\0\25\10\1\260"+
+ "\11\10\14\0\2\10\4\0\2\10\1\0\4\10\13\0"+
+ "\4\10\1\0\1\10\1\0\31\10\1\261\5\10\14\0"+
+ "\2\10\4\0\2\10\1\0\4\10\13\0\4\10\1\0"+
+ "\1\10\1\0\34\10\1\261\2\10\14\0\2\10\4\0"+
+ "\2\10\1\0\4\10\13\0\4\10\1\0\1\10\1\0"+
+ "\2\10\1\262\34\10\14\0\2\10\4\0\2\10\1\0"+
+ "\4\10\13\0\4\10\1\0\1\10\1\0\24\10\1\263"+
+ "\12\10\14\0\2\10\4\0\2\10\1\0\4\10\13\0"+
+ "\4\10\1\0\1\10\1\0\6\10\1\264\30\10\14\0"+
+ "\2\10\4\0\2\10\1\0\4\10\13\0\4\10\1\0"+
+ "\1\263\1\0\37\10\14\0\2\10\4\0\2\10\1\0"+
+ "\4\10\13\0\4\10\1\0\1\10\1\0\2\10\1\265"+
+ "\34\10\14\0\2\10\4\0\2\10\1\0\4\10\13\0"+
+ "\4\10\1\0\1\10\1\0\6\10\1\265\30\10\14\0"+
+ "\2\10\4\0\2\10\1\0\4\10\13\0\4\10\1\0"+
+ "\1\10\1\0\16\10\1\266\20\10\14\0\2\10\4\0"+
+ "\2\10\1\0\4\10\13\0\4\10\1\0\1\10\1\0"+
+ "\21\10\1\266\15\10\14\0\2\10\4\0\2\10\1\0"+
+ "\4\10\7\0";
- }
- break;
+ private static int [] zzUnpackTrans() {
+ int [] result = new int[9028];
+ int offset = 0;
+ offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result);
+ return result;
+ }
- }
-
- mBAREINT();
-
- }
-
- }
- finally {
- }
+ private static int zzUnpackTrans(String packed, int offset, int [] result) {
+ int i = 0; /* index in packed string */
+ int j = offset; /* index in unpacked array */
+ int l = packed.length();
+ while (i < l) {
+ int count = packed.charAt(i++);
+ int value = packed.charAt(i++);
+ value--;
+ do result[j++] = value; while (--count > 0);
}
- // $ANTLR end INTEGER
+ return j;
+ }
- // $ANTLR start POINT
- public final void mPOINT() throws RecognitionException {
- try {
- // dd/grammar/ECAToken.g:52:7: ( '.' )
- // dd/grammar/ECAToken.g:52:9: '.'
- {
- match('.');
- }
+ /* error codes */
+ private static final int ZZ_UNKNOWN_ERROR = 0;
+ private static final int ZZ_NO_MATCH = 1;
+ private static final int ZZ_PUSHBACK_2BIG = 2;
- }
- finally {
- }
- }
- // $ANTLR end POINT
+ /* error messages for the codes above */
+ private static final String ZZ_ERROR_MSG[] = {
+ "Unkown internal scanner error",
+ "Error: could not match input",
+ "Error: pushback value was too large"
+ };
- // $ANTLR start EXPPART
- public final void mEXPPART() throws RecognitionException {
- try {
- // dd/grammar/ECAToken.g:56:9: ( ( 'e' | 'E' ) INTEGER )
- // dd/grammar/ECAToken.g:56:12: ( 'e' | 'E' ) INTEGER
- {
- if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
- input.consume();
+ /**
+ * ZZ_ATTRIBUTE[aState] contains the attributes of state <code>aState</code>
+ */
+ private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute();
- }
- else {
- MismatchedSetException mse =
- new MismatchedSetException(null,input);
- recover(mse); throw mse;
- }
+ private static final String ZZ_ATTRIBUTE_PACKED_0 =
+ "\4\0\1\11\1\1\1\11\1\1\1\11\4\1\1\11"+
+ "\27\1\6\11\7\1\3\11\2\1\1\11\2\1\6\11"+
+ "\1\1\3\11\3\1\3\11\1\1\1\11\1\0\34\1"+
+ "\2\11\1\0\4\11\6\1\5\11\1\1\1\0\23\1"+
+ "\1\11\45\1";
- mINTEGER();
+ private static int [] zzUnpackAttribute() {
+ int [] result = new int[182];
+ int offset = 0;
+ offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result);
+ return result;
+ }
- }
-
- }
- finally {
- }
+ private static int zzUnpackAttribute(String packed, int offset, int [] result) {
+ int i = 0; /* index in packed string */
+ int j = offset; /* index in unpacked array */
+ int l = packed.length();
+ while (i < l) {
+ int count = packed.charAt(i++);
+ int value = packed.charAt(i++);
+ do result[j++] = value; while (--count > 0);
}
- // $ANTLR end EXPPART
+ return j;
+ }
- // $ANTLR start FLOAT
- public final void mFLOAT() throws RecognitionException {
- try {
- // dd/grammar/ECAToken.g:61:7: ( INTEGER POINT ( BAREINT )? ( EXPPART )? )
- // dd/grammar/ECAToken.g:61:9: INTEGER POINT ( BAREINT )? ( EXPPART )?
- {
- mINTEGER();
- mPOINT();
- // dd/grammar/ECAToken.g:61:23: ( BAREINT )?
- int alt4=2;
- int LA4_0 = input.LA(1);
+ /** the input device */
+ private java.io.Reader zzReader;
- if ( ((LA4_0>='0' && LA4_0<='9')) ) {
- alt4=1;
- }
- switch (alt4) {
- case 1 :
- // dd/grammar/ECAToken.g:61:23: BAREINT
- {
- mBAREINT();
+ /** the current state of the DFA */
+ private int zzState;
- }
- break;
+ /** the current lexical state */
+ private int zzLexicalState = YYINITIAL;
- }
+ /** this buffer contains the current text to be matched and is
+ the source of the yytext() string */
+ private char zzBuffer[] = new char[ZZ_BUFFERSIZE];
- // dd/grammar/ECAToken.g:61:32: ( EXPPART )?
- int alt5=2;
- int LA5_0 = input.LA(1);
+ /** the textposition at the last accepting state */
+ private int zzMarkedPos;
- if ( (LA5_0=='E'||LA5_0=='e') ) {
- alt5=1;
- }
- switch (alt5) {
- case 1 :
- // dd/grammar/ECAToken.g:61:32: EXPPART
- {
- mEXPPART();
+ /** the current text position in the buffer */
+ private int zzCurrentPos;
- }
- break;
+ /** startRead marks the beginning of the yytext() string in the buffer */
+ private int zzStartRead;
- }
+ /** endRead marks the last character in the buffer, that has been read
+ from input */
+ private int zzEndRead;
+ /** number of newlines encountered up to the start of the matched text */
+ private int yyline;
- }
+ /** the number of characters up to the start of the matched text */
+ private int yychar;
- }
- finally {
- }
- }
- // $ANTLR end FLOAT
+ /**
+ * the number of characters from the last newline up to the start of the
+ * matched text
+ */
+ private int yycolumn;
- // $ANTLR start NUMBER
- public final void mNUMBER() throws RecognitionException {
- try {
- int _type = NUMBER;
- // dd/grammar/ECAToken.g:64:8: ( INTEGER | FLOAT )
- int alt6=2;
- alt6 = dfa6.predict(input);
- switch (alt6) {
- case 1 :
- // dd/grammar/ECAToken.g:64:10: INTEGER
- {
- mINTEGER();
+ /**
+ * zzAtBOL == true <=> the scanner is currently at the beginning of a line
+ */
+ private boolean zzAtBOL = true;
- }
- break;
- case 2 :
- // dd/grammar/ECAToken.g:64:20: FLOAT
- {
- mFLOAT();
+ /** zzAtEOF == true <=> the scanner is at the EOF */
+ private boolean zzAtEOF;
- }
- break;
+ /** denotes if the user-EOF-code has already been executed */
+ private boolean zzEOFDone;
- }
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end NUMBER
+ /* user code: */
+ StringBuffer string = new StringBuffer();
- // $ANTLR start BIND
- public final void mBIND() throws RecognitionException {
- try {
- int _type = BIND;
- // dd/grammar/ECAToken.g:69:6: ( 'BIND' )
- // dd/grammar/ECAToken.g:69:8: 'BIND'
- {
- match("BIND");
+ private Symbol symbol(int type) {
+ return new Symbol(type, yyline, yycolumn);
+ }
+ private Symbol symbol(int type, Object value) {
+ return new Symbol(type, yyline, yycolumn, value);
+ }
- }
+ /**
+ * Creates a new scanner
+ * There is also a java.io.InputStream version of this constructor.
+ *
+ * @param in the java.io.Reader to read input from.
+ */
+ public ECATokenLexer(java.io.Reader in) {
+ this.zzReader = in;
+ }
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end BIND
+ /**
+ * Creates a new scanner.
+ * There is also java.io.Reader version of this constructor.
+ *
+ * @param in the java.io.Inputstream to read input from.
+ */
+ public ECATokenLexer(java.io.InputStream in) {
+ this(new java.io.InputStreamReader(in));
+ }
- // $ANTLR start IF
- public final void mIF() throws RecognitionException {
- try {
- int _type = IF;
- // dd/grammar/ECAToken.g:72:4: ( 'IF' )
- // dd/grammar/ECAToken.g:72:6: 'IF'
- {
- match("IF");
-
-
- }
-
- this.type = _type;
- }
- finally {
- }
+ /**
+ * Unpacks the compressed character translation table.
+ *
+ * @param packed the packed character translation table
+ * @return the unpacked character translation table
+ */
+ private static char [] zzUnpackCMap(String packed) {
+ char [] map = new char[0x10000];
+ int i = 0; /* index in packed string */
+ int j = 0; /* index in unpacked array */
+ while (i < 178) {
+ int count = packed.charAt(i++);
+ char value = packed.charAt(i++);
+ do map[j++] = value; while (--count > 0);
}
- // $ANTLR end IF
+ return map;
+ }
- // $ANTLR start DO
- public final void mDO() throws RecognitionException {
- try {
- int _type = DO;
- // dd/grammar/ECAToken.g:75:4: ( 'DO' )
- // dd/grammar/ECAToken.g:75:6: 'DO'
- {
- match("DO");
+ /**
+ * Refills the input buffer.
+ *
+ * @return <code>false</code>, iff there was new input.
+ *
+ * @exception java.io.IOException if any I/O-Error occurs
+ */
+ private boolean zzRefill() throws java.io.IOException {
- }
+ /* first: make room (if you can) */
+ if (zzStartRead > 0) {
+ System.arraycopy(zzBuffer, zzStartRead,
+ zzBuffer, 0,
+ zzEndRead-zzStartRead);
- this.type = _type;
- }
- finally {
- }
+ /* translate stored positions */
+ zzEndRead-= zzStartRead;
+ zzCurrentPos-= zzStartRead;
+ zzMarkedPos-= zzStartRead;
+ zzStartRead = 0;
}
- // $ANTLR end DO
- // $ANTLR start RULE
- public final void mRULE() throws RecognitionException {
- try {
- int _type = RULE;
- // dd/grammar/ECAToken.g:78:6: ( 'RULE' )
- // dd/grammar/ECAToken.g:78:8: 'RULE'
- {
- match("RULE");
-
-
- }
-
- this.type = _type;
- }
- finally {
- }
+ /* is the buffer big enough? */
+ if (zzCurrentPos >= zzBuffer.length) {
+ /* if not: blow it up */
+ char newBuffer[] = new char[zzCurrentPos*2];
+ System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length);
+ zzBuffer = newBuffer;
}
- // $ANTLR end RULE
- // $ANTLR start CLASS
- public final void mCLASS() throws RecognitionException {
- try {
- int _type = CLASS;
- // dd/grammar/ECAToken.g:81:7: ( 'CLASS' )
- // dd/grammar/ECAToken.g:81:9: 'CLASS'
- {
- match("CLASS");
+ /* finally: fill the buffer with new input */
+ int numRead = zzReader.read(zzBuffer, zzEndRead,
+ zzBuffer.length-zzEndRead);
-
- }
-
- this.type = _type;
- }
- finally {
- }
+ if (numRead > 0) {
+ zzEndRead+= numRead;
+ return false;
}
- // $ANTLR end CLASS
-
- // $ANTLR start METHOD
- public final void mMETHOD() throws RecognitionException {
- try {
- int _type = METHOD;
- // dd/grammar/ECAToken.g:84:8: ( 'METHOD' )
- // dd/grammar/ECAToken.g:84:10: 'METHOD'
- {
- match("METHOD");
-
-
- }
-
- this.type = _type;
- }
- finally {
- }
+ // unlikely but not impossible: read 0 characters, but not at end of stream
+ if (numRead == 0) {
+ int c = zzReader.read();
+ if (c == -1) {
+ return true;
+ } else {
+ zzBuffer[zzEndRead++] = (char) c;
+ return false;
+ }
}
- // $ANTLR end METHOD
- // $ANTLR start LINE
- public final void mLINE() throws RecognitionException {
- try {
- int _type = LINE;
- // dd/grammar/ECAToken.g:87:6: ( 'LINE' )
- // dd/grammar/ECAToken.g:87:8: 'LINE'
- {
- match("LINE");
+ // numRead < 0
+ return true;
+ }
+
+ /**
+ * Closes the input stream.
+ */
+ public final void yyclose() throws java.io.IOException {
+ zzAtEOF = true; /* indicate end of file */
+ zzEndRead = zzStartRead; /* invalidate buffer */
- }
+ if (zzReader != null)
+ zzReader.close();
+ }
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end LINE
- // $ANTLR start ENDRULE
- public final void mENDRULE() throws RecognitionException {
- try {
- int _type = ENDRULE;
- // dd/grammar/ECAToken.g:90:9: ( 'ENDRULE' )
- // dd/grammar/ECAToken.g:90:11: 'ENDRULE'
- {
- match("ENDRULE");
+ /**
+ * Resets the scanner to read from a new input stream.
+ * Does not close the old reader.
+ *
+ * All internal variables are reset, the old input stream
+ * <b>cannot</b> be reused (internal buffer is discarded and lost).
+ * Lexical state is set to <tt>ZZ_INITIAL</tt>.
+ *
+ * @param reader the new input stream
+ */
+ public final void yyreset(java.io.Reader reader) {
+ zzReader = reader;
+ zzAtBOL = true;
+ zzAtEOF = false;
+ zzEndRead = zzStartRead = 0;
+ zzCurrentPos = zzMarkedPos = 0;
+ yyline = yychar = yycolumn = 0;
+ zzLexicalState = YYINITIAL;
+ }
- }
+ /**
+ * Returns the current lexical state.
+ */
+ public final int yystate() {
+ return zzLexicalState;
+ }
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end ENDRULE
- // $ANTLR start NOTHING
- public final void mNOTHING() throws RecognitionException {
- try {
- int _type = NOTHING;
- // dd/grammar/ECAToken.g:93:9: ( 'NOTHING' )
- // dd/grammar/ECAToken.g:93:11: 'NOTHING'
- {
- match("NOTHING");
+ /**
+ * Enters a new lexical state
+ *
+ * @param newState the new lexical state
+ */
+ public final void yybegin(int newState) {
+ zzLexicalState = newState;
+ }
- }
+ /**
+ * Returns the text matched by the current regular expression.
+ */
+ public final String yytext() {
+ return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead );
+ }
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end NOTHING
- // $ANTLR start TRUE
- public final void mTRUE() throws RecognitionException {
- try {
- int _type = TRUE;
- // dd/grammar/ECAToken.g:96:6: ( 'TRUE' | 'true' )
- int alt7=2;
- int LA7_0 = input.LA(1);
+ /**
+ * Returns the character at position <tt>pos</tt> from the
+ * matched text.
+ *
+ * It is equivalent to yytext().charAt(pos), but faster
+ *
+ * @param pos the position of the character to fetch.
+ * A value from 0 to yylength()-1.
+ *
+ * @return the character at position pos
+ */
+ public final char yycharat(int pos) {
+ return zzBuffer[zzStartRead+pos];
+ }
- if ( (LA7_0=='T') ) {
- alt7=1;
- }
- else if ( (LA7_0=='t') ) {
- alt7=2;
- }
- else {
- NoViableAltException nvae =
- new NoViableAltException("96:1: TRUE : ( 'TRUE' | 'true' );", 7, 0, input);
- throw nvae;
- }
- switch (alt7) {
- case 1 :
- // dd/grammar/ECAToken.g:96:9: 'TRUE'
- {
- match("TRUE");
+ /**
+ * Returns the length of the matched text region.
+ */
+ public final int yylength() {
+ return zzMarkedPos-zzStartRead;
+ }
- }
- break;
- case 2 :
- // dd/grammar/ECAToken.g:96:18: 'true'
- {
- match("true");
-
-
- }
- break;
-
- }
- this.type = _type;
- }
- finally {
- }
+ /**
+ * Reports an error that occured while scanning.
+ *
+ * In a wellformed scanner (no or only correct usage of
+ * yypushback(int) and a match-all fallback rule) this method
+ * will only be called with things that "Can't Possibly Happen".
+ * If this method is called, something is seriously wrong
+ * (e.g. a JFlex bug producing a faulty scanner etc.).
+ *
+ * Usual syntax/scanner level error handling should be done
+ * in error fallback rules.
+ *
+ * @param errorCode the code of the errormessage to display
+ */
+ private void zzScanError(int errorCode) {
+ String message;
+ try {
+ message = ZZ_ERROR_MSG[errorCode];
}
- // $ANTLR end TRUE
-
- // $ANTLR start FALSE
- public final void mFALSE() throws RecognitionException {
- try {
- int _type = FALSE;
- // dd/grammar/ECAToken.g:99:7: ( 'FALSE' | 'false' )
- int alt8=2;
- int LA8_0 = input.LA(1);
-
- if ( (LA8_0=='F') ) {
- alt8=1;
- }
- else if ( (LA8_0=='f') ) {
- alt8=2;
- }
- else {
- NoViableAltException nvae =
- new NoViableAltException("99:1: FALSE : ( 'FALSE' | 'false' );", 8, 0, input);
-
- throw nvae;
- }
- switch (alt8) {
- case 1 :
- // dd/grammar/ECAToken.g:99:9: 'FALSE'
- {
- match("FALSE");
-
-
- }
- break;
- case 2 :
- // dd/grammar/ECAToken.g:99:17: 'false'
- {
- match("false");
-
-
- }
- break;
-
- }
- this.type = _type;
- }
- finally {
- }
+ catch (ArrayIndexOutOfBoundsException e) {
+ message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR];
}
- // $ANTLR end FALSE
- // $ANTLR start RETURN
- public final void mRETURN() throws RecognitionException {
- try {
- int _type = RETURN;
- // dd/grammar/ECAToken.g:102:8: ( 'RETURN' | 'return' )
- int alt9=2;
- int LA9_0 = input.LA(1);
+ throw new Error(message);
+ }
- if ( (LA9_0=='R') ) {
- alt9=1;
- }
- else if ( (LA9_0=='r') ) {
- alt9=2;
- }
- else {
- NoViableAltException nvae =
- new NoViableAltException("102:1: RETURN : ( 'RETURN' | 'return' );", 9, 0, input);
- throw nvae;
- }
- switch (alt9) {
- case 1 :
- // dd/grammar/ECAToken.g:102:10: 'RETURN'
- {
- match("RETURN");
+ /**
+ * Pushes the specified amount of characters back into the input stream.
+ *
+ * They will be read again by then next call of the scanning method
+ *
+ * @param number the number of characters to be read again.
+ * This number must not be greater than yylength()!
+ */
+ public void yypushback(int number) {
+ if ( number > yylength() )
+ zzScanError(ZZ_PUSHBACK_2BIG);
+ zzMarkedPos -= number;
+ }
- }
- break;
- case 2 :
- // dd/grammar/ECAToken.g:102:19: 'return'
- {
- match("return");
-
- }
- break;
-
- }
- this.type = _type;
- }
- finally {
- }
+ /**
+ * Contains user EOF-code, which will be executed exactly once,
+ * when the end of file is reached
+ */
+ private void zzDoEOF() throws java.io.IOException {
+ if (!zzEOFDone) {
+ zzEOFDone = true;
+ yyclose();
}
- // $ANTLR end RETURN
+ }
- // $ANTLR start THROW
- public final void mTHROW() throws RecognitionException {
- try {
- int _type = THROW;
- // dd/grammar/ECAToken.g:105:7: ( 'THROW' | 'throw' )
- int alt10=2;
- int LA10_0 = input.LA(1);
- if ( (LA10_0=='T') ) {
- alt10=1;
- }
- else if ( (LA10_0=='t') ) {
- alt10=2;
- }
- else {
- NoViableAltException nvae =
- new NoViableAltException("105:1: THROW : ( 'THROW' | 'throw' );", 10, 0, input);
+ /**
+ * Resumes scanning until the next regular expression is matched,
+ * the end of input is encountered or an I/O-Error occurs.
+ *
+ * @return the next token
+ * @exception java.io.IOException if any I/O-Error occurs
+ */
+ public java_cup.runtime.Symbol next_token() throws java.io.IOException {
+ int zzInput;
+ int zzAction;
- throw nvae;
- }
- switch (alt10) {
- case 1 :
- // dd/grammar/ECAToken.g:105:9: 'THROW'
- {
- match("THROW");
+ // cached fields:
+ int zzCurrentPosL;
+ int zzMarkedPosL;
+ int zzEndReadL = zzEndRead;
+ char [] zzBufferL = zzBuffer;
+ char [] zzCMapL = ZZ_CMAP;
+ int [] zzTransL = ZZ_TRANS;
+ int [] zzRowMapL = ZZ_ROWMAP;
+ int [] zzAttrL = ZZ_ATTRIBUTE;
- }
- break;
- case 2 :
- // dd/grammar/ECAToken.g:105:17: 'throw'
- {
- match("throw");
+ while (true) {
+ zzMarkedPosL = zzMarkedPos;
-
- }
- break;
-
- }
- this.type = _type;
+ boolean zzR = false;
+ for (zzCurrentPosL = zzStartRead; zzCurrentPosL < zzMarkedPosL;
+ zzCurrentPosL++) {
+ switch (zzBufferL[zzCurrentPosL]) {
+ case '\u000B':
+ case '\u000C':
+ case '\u0085':
+ case '\u2028':
+ case '\u2029':
+ yyline++;
+ yycolumn = 0;
+ zzR = false;
+ break;
+ case '\r':
+ yyline++;
+ yycolumn = 0;
+ zzR = true;
+ break;
+ case '\n':
+ if (zzR)
+ zzR = false;
+ else {
+ yyline++;
+ yycolumn = 0;
+ }
+ break;
+ default:
+ zzR = false;
+ yycolumn++;
}
- finally {
- }
- }
- // $ANTLR end THROW
+ }
- // $ANTLR start LPAREN
- public final void mLPAREN() throws RecognitionException {
- try {
- int _type = LPAREN;
- // dd/grammar/ECAToken.g:110:8: ( '(' )
- // dd/grammar/ECAToken.g:110:10: '('
- {
- match('(');
-
- }
-
- this.type = _type;
+ if (zzR) {
+ // peek one character ahead if it is \n (if we have counted one line too much)
+ boolean zzPeek;
+ if (zzMarkedPosL < zzEndReadL)
+ zzPeek = zzBufferL[zzMarkedPosL] == '\n';
+ else if (zzAtEOF)
+ zzPeek = false;
+ else {
+ boolean eof = zzRefill();
+ zzEndReadL = zzEndRead;
+ zzMarkedPosL = zzMarkedPos;
+ zzBufferL = zzBuffer;
+ if (eof)
+ zzPeek = false;
+ else
+ zzPeek = zzBufferL[zzMarkedPosL] == '\n';
}
- finally {
- }
- }
- // $ANTLR end LPAREN
+ if (zzPeek) yyline--;
+ }
+ zzAction = -1;
- // $ANTLR start RPAREN
- public final void mRPAREN() throws RecognitionException {
- try {
- int _type = RPAREN;
- // dd/grammar/ECAToken.g:113:8: ( ')' )
- // dd/grammar/ECAToken.g:113:10: ')'
- {
- match(')');
+ zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL;
+
+ zzState = ZZ_LEXSTATE[zzLexicalState];
- }
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end RPAREN
-
- // $ANTLR start LSQUARE
- public final void mLSQUARE() throws RecognitionException {
- try {
- int _type = LSQUARE;
- // dd/grammar/ECAToken.g:116:9: ( '\\[' )
- // dd/grammar/ECAToken.g:116:11: '\\['
- {
- match('[');
-
+ zzForAction: {
+ while (true) {
+
+ if (zzCurrentPosL < zzEndReadL)
+ zzInput = zzBufferL[zzCurrentPosL++];
+ else if (zzAtEOF) {
+ zzInput = YYEOF;
+ break zzForAction;
+ }
+ else {
+ // store back cached positions
+ zzCurrentPos = zzCurrentPosL;
+ zzMarkedPos = zzMarkedPosL;
+ boolean eof = zzRefill();
+ // get translated positions and possibly new buffer
+ zzCurrentPosL = zzCurrentPos;
+ zzMarkedPosL = zzMarkedPos;
+ zzBufferL = zzBuffer;
+ zzEndReadL = zzEndRead;
+ if (eof) {
+ zzInput = YYEOF;
+ break zzForAction;
}
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end LSQUARE
-
- // $ANTLR start RSQUARE
- public final void mRSQUARE() throws RecognitionException {
- try {
- int _type = RSQUARE;
- // dd/grammar/ECAToken.g:119:9: ( '\\]' )
- // dd/grammar/ECAToken.g:119:11: '\\]'
- {
- match(']');
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end RSQUARE
-
- // $ANTLR start LBRACE
- public final void mLBRACE() throws RecognitionException {
- try {
- int _type = LBRACE;
- // dd/grammar/ECAToken.g:122:8: ( '{' )
- // dd/grammar/ECAToken.g:122:10: '{'
- {
- match('{');
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end LBRACE
-
- // $ANTLR start RBRACE
- public final void mRBRACE() throws RecognitionException {
- try {
- int _type = RBRACE;
- // dd/grammar/ECAToken.g:125:8: ( '}' )
- // dd/grammar/ECAToken.g:125:10: '}'
- {
- match('}');
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end RBRACE
-
- // $ANTLR start SEPR
- public final void mSEPR() throws RecognitionException {
- try {
- int _type = SEPR;
- // dd/grammar/ECAToken.g:130:6: ( ';' | ',' )
- // dd/grammar/ECAToken.g:
- {
- if ( input.LA(1)==','||input.LA(1)==';' ) {
- input.consume();
-
- }
else {
- MismatchedSetException mse =
- new MismatchedSetException(null,input);
- recover(mse); throw mse;
+ zzInput = zzBufferL[zzCurrentPosL++];
}
+ }
+ int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ];
+ if (zzNext == -1) break zzForAction;
+ zzState = zzNext;
+ int zzAttributes = zzAttrL[zzState];
+ if ( (zzAttributes & 1) == 1 ) {
+ zzAction = zzState;
+ zzMarkedPosL = zzCurrentPosL;
+ if ( (zzAttributes & 8) == 8 ) break zzForAction;
+ }
- }
-
- this.type = _type;
}
- finally {
- }
- }
- // $ANTLR end SEPR
+ }
- // $ANTLR start DOT
- public final void mDOT() throws RecognitionException {
- try {
- int _type = DOT;
- // dd/grammar/ECAToken.g:136:5: ( '.' )
- // dd/grammar/ECAToken.g:136:7: '.'
- {
- match('.');
+ // store back cached position
+ zzMarkedPos = zzMarkedPosL;
- }
-
- this.type = _type;
- }
- finally {
- }
+ switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) {
+ case 2:
+ { /* ignore */
+ }
+ case 59: break;
+ case 1:
+ { throw new Error("Illegal character <"+ yytext()+">");
+ }
+ case 60: break;
+ case 18:
+ { return symbol(sym.BAND);
+ }
+ case 61: break;
+ case 9:
+ { return symbol(sym.RPAREN);
+ }
+ case 62: break;
+ case 34:
+ { yybegin(YYINITIAL);
+ return symbol(sym.STRING_LITERAL,
+ string.toString());
+ }
+ case 63: break;
+ case 54:
+ { return symbol(sym.BOOLEAN_LITERAL, Boolean.TRUE);
+ }
+ case 64: break;
+ case 33:
+ { throw new Error("Newline in string <"+ yytext()+">");
+ }
+ case 65: break;
+ case 20:
+ { return symbol(sym.GT);
+ }
+ case 66: break;
+ case 50:
+ { string.append('\t');
+ }
+ case 67: break;
+ case 10:
+ { return symbol(sym.LSQUARE);
+ }
+ case 68: break;
+ case 4:
+ { return symbol(sym.DOLLAR);
+ }
+ case 69: break;
+ case 15:
+ { return symbol(sym.LT);
+ }
+ case 70: break;
+ case 28:
+ { string.setLength(0); yybegin(STRING);
+ }
+ case 71: break;
+ case 40:
+ { return symbol(sym.FLOAT_LITERAL, Float.valueOf(yytext()));
+ }
+ case 72: break;
+ case 56:
+ { return symbol(sym.THROW);
+ }
+ case 73: break;
+ case 48:
+ { return symbol(sym.AND);
+ }
+ case 74: break;
+ case 19:
+ { return symbol(sym.NOT);
+ }
+ case 75: break;
+ case 14:
+ { return symbol(sym.ASSIGN);
+ }
+ case 76: break;
+ case 24:
+ { return symbol(sym.DIV);
+ }
+ case 77: break;
+ case 35:
+ { string.append('\\');
+ }
+ case 78: break;
+ case 57:
+ { return symbol(sym.RETURN);
+ }
+ case 79: break;
+ case 51:
+ { string.append('\r');
+ }
+ case 80: break;
+ case 39:
+ { yybegin(YYINITIAL);
+ }
+ case 81: break;
+ case 6:
+ { return symbol(sym.PLUS);
+ }
+ case 82: break;
+ case 25:
+ { return symbol(sym.MOD);
+ }
+ case 83: break;
+ case 32:
+ { throw new Error("Illegal character in string <"+ yytext()+">");
+ }
+ case 84: break;
+ case 36:
+ { throw new Error("Newline in quoted identifier <"+ yytext()+">");
+ }
+ case 85: break;
+ case 30:
+ { yybegin(COMMENT);
+ }
+ case 86: break;
+ case 3:
+ { return symbol(sym.IDENTIFIER, yytext());
+ }
+ case 87: break;
+ case 44:
+ { return symbol(sym.DO);
+ }
+ case 88: break;
+ case 52:
+ { string.append('\"');
+ }
+ case 89: break;
+ case 27:
+ { return symbol(sym.COLON);
+ }
+ case 90: break;
+ case 21:
+ { return symbol(sym.BXOR);
+ }
+ case 91: break;
+ case 42:
+ { return symbol(sym.IF);
+ }
+ case 92: break;
+ case 55:
+ { return symbol(sym.BOOLEAN_LITERAL, Boolean.FALSE);
+ }
+ case 93: break;
+ case 8:
+ { return symbol(sym.LPAREN);
+ }
+ case 94: break;
+ case 45:
+ { return symbol(sym.OR);
+ }
+ case 95: break;
+ case 41:
+ { return symbol(sym.EQ);
+ }
+ case 96: break;
+ case 49:
+ { string.append('\n');
+ }
+ case 97: break;
+ case 12:
+ { return symbol(sym.SEMI);
+ }
+ case 98: break;
+ case 11:
+ { return symbol(sym.RSQUARE);
+ }
+ case 99: break;
+ case 43:
+ { return symbol(sym.NE);
+ }
+ case 100: break;
+ case 16:
+ { return symbol(sym.MINUS);
+ }
+ case 101: break;
+ case 17:
+ { return symbol(sym.BOR);
+ }
+ case 102: break;
+ case 29:
+ { string.setLength(0); yybegin(QUOTEDIDENT);
+ }
+ case 103: break;
+ case 22:
+ { return symbol(sym.TWIDDLE);
+ }
+ case 104: break;
+ case 53:
+ { return symbol(sym.BIND);
+ }
+ case 105: break;
+ case 26:
+ { return symbol(sym.TERN_IF);
+ }
+ case 106: break;
+ case 46:
+ { return symbol(sym.GE);
+ }
+ case 107: break;
+ case 37:
+ { yybegin(YYINITIAL);
+ return symbol(sym.IDENTIFIER,
+ string.toString());
+ }
+ case 108: break;
+ case 13:
+ { return symbol(sym.COMMA);
+ }
+ case 109: break;
+ case 47:
+ { return symbol(sym.LE);
+ }
+ case 110: break;
+ case 23:
+ { return symbol(sym.MUL);
+ }
+ case 111: break;
+ case 58:
+ { return symbol(sym.NOTHING);
+ }
+ case 112: break;
+ case 5:
+ { return symbol(sym.INTEGER_LITERAL, Integer.valueOf(yytext()));
+ }
+ case 113: break;
+ case 31:
+ { string.append( yytext() );
+ }
+ case 114: break;
+ case 38:
+ { /*ignore */
+ }
+ case 115: break;
+ case 7:
+ { return symbol(sym.DOT);
+ }
+ case 116: break;
+ default:
+ if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {
+ zzAtEOF = true;
+ zzDoEOF();
+ { return new java_cup.runtime.Symbol(sym.EOF); }
+ }
+ else {
+ zzScanError(ZZ_NO_MATCH);
+ }
+ }
}
- // $ANTLR end DOT
+ }
- // $ANTLR start ASSIGN
- public final void mASSIGN() throws RecognitionException {
- try {
- int _type = ASSIGN;
- // dd/grammar/ECAToken.g:141:8: ( '=' | '<--' )
- int alt11=2;
- int LA11_0 = input.LA(1);
- if ( (LA11_0=='=') ) {
- alt11=1;
- }
- else if ( (LA11_0=='<') ) {
- alt11=2;
- }
- else {
- NoViableAltException nvae =
- new NoViableAltException("141:1: ASSIGN : ( '=' | '<--' );", 11, 0, input);
-
- throw nvae;
- }
- switch (alt11) {
- case 1 :
- // dd/grammar/ECAToken.g:141:10: '='
- {
- match('=');
-
- }
- break;
- case 2 :
- // dd/grammar/ECAToken.g:142:4: '<--'
- {
- match("<--");
-
-
- }
- break;
-
- }
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end ASSIGN
-
- // $ANTLR start OR
- public final void mOR() throws RecognitionException {
- try {
- int _type = OR;
- // dd/grammar/ECAToken.g:147:4: ( '||' | 'OR' | 'or' )
- int alt12=3;
- switch ( input.LA(1) ) {
- case '|':
- {
- alt12=1;
- }
- break;
- case 'O':
- {
- alt12=2;
- }
- break;
- case 'o':
- {
- alt12=3;
- }
- break;
- default:
- NoViableAltException nvae =
- new NoViableAltException("147:1: OR : ( '||' | 'OR' | 'or' );", 12, 0, input);
-
- throw nvae;
- }
-
- switch (alt12) {
- case 1 :
- // dd/grammar/ECAToken.g:147:6: '||'
- {
- match("||");
-
-
- }
- break;
- case 2 :
- // dd/grammar/ECAToken.g:148:4: 'OR'
- {
- match("OR");
-
-
- }
- break;
- case 3 :
- // dd/grammar/ECAToken.g:149:4: 'or'
- {
- match("or");
-
-
- }
- break;
-
- }
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end OR
-
- // $ANTLR start AND
- public final void mAND() throws RecognitionException {
- try {
- int _type = AND;
- // dd/grammar/ECAToken.g:152:5: ( '&&' | 'AND' | 'and' )
- int alt13=3;
- switch ( input.LA(1) ) {
- case '&':
- {
- alt13=1;
- }
- break;
- case 'A':
- {
- alt13=2;
- }
- break;
- case 'a':
- {
- alt13=3;
- }
- break;
- default:
- NoViableAltException nvae =
- new NoViableAltException("152:1: AND : ( '&&' | 'AND' | 'and' );", 13, 0, input);
-
- throw nvae;
- }
-
- switch (alt13) {
- case 1 :
- // dd/grammar/ECAToken.g:152:7: '&&'
- {
- match("&&");
-
-
- }
- break;
- case 2 :
- // dd/grammar/ECAToken.g:153:4: 'AND'
- {
- match("AND");
-
-
- }
- break;
- case 3 :
- // dd/grammar/ECAToken.g:154:4: 'and'
- {
- match("and");
-
-
- }
- break;
-
- }
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end AND
-
- // $ANTLR start NOT
- public final void mNOT() throws RecognitionException {
- try {
- int _type = NOT;
- // dd/grammar/ECAToken.g:157:5: ( '!' | 'NOT' | 'not' )
- int alt14=3;
- switch ( input.LA(1) ) {
- case '!':
- {
- alt14=1;
- }
- break;
- case 'N':
- {
- alt14=2;
- }
- break;
- case 'n':
- {
- alt14=3;
- }
- break;
- default:
- NoViableAltException nvae =
- new NoViableAltException("157:1: NOT : ( '!' | 'NOT' | 'not' );", 14, 0, input);
-
- throw nvae;
- }
-
- switch (alt14) {
- case 1 :
- // dd/grammar/ECAToken.g:157:7: '!'
- {
- match('!');
-
- }
- break;
- case 2 :
- // dd/grammar/ECAToken.g:158:4: 'NOT'
- {
- match("NOT");
-
-
- }
- break;
- case 3 :
- // dd/grammar/ECAToken.g:159:4: 'not'
- {
- match("not");
-
-
- }
- break;
-
- }
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end NOT
-
- // $ANTLR start EQ
- public final void mEQ() throws RecognitionException {
- try {
- int _type = EQ;
- // dd/grammar/ECAToken.g:164:4: ( '==' | 'EQ' | 'eq' )
- int alt15=3;
- switch ( input.LA(1) ) {
- case '=':
- {
- alt15=1;
- }
- break;
- case 'E':
- {
- alt15=2;
- }
- break;
- case 'e':
- {
- alt15=3;
- }
- break;
- default:
- NoViableAltException nvae =
- new NoViableAltException("164:1: EQ : ( '==' | 'EQ' | 'eq' );", 15, 0, input);
-
- throw nvae;
- }
-
- switch (alt15) {
- case 1 :
- // dd/grammar/ECAToken.g:164:6: '=='
- {
- match("==");
-
-
- }
- break;
- case 2 :
- // dd/grammar/ECAToken.g:165:4: 'EQ'
- {
- match("EQ");
-
-
- }
- break;
- case 3 :
- // dd/grammar/ECAToken.g:166:4: 'eq'
- {
- match("eq");
-
-
- }
- break;
-
- }
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end EQ
-
- // $ANTLR start NEQ
- public final void mNEQ() throws RecognitionException {
- try {
- int _type = NEQ;
- // dd/grammar/ECAToken.g:169:5: ( '!=' | 'NEQ' | 'neq' )
- int alt16=3;
- switch ( input.LA(1) ) {
- case '!':
- {
- alt16=1;
- }
- break;
- case 'N':
- {
- alt16=2;
- }
- break;
- case 'n':
- {
- alt16=3;
- }
- break;
- default:
- NoViableAltException nvae =
- new NoViableAltException("169:1: NEQ : ( '!=' | 'NEQ' | 'neq' );", 16, 0, input);
-
- throw nvae;
- }
-
- switch (alt16) {
- case 1 :
- // dd/grammar/ECAToken.g:169:7: '!='
- {
- match("!=");
-
-
- }
- break;
- case 2 :
- // dd/grammar/ECAToken.g:170:4: 'NEQ'
- {
- match("NEQ");
-
-
- }
- break;
- case 3 :
- // dd/grammar/ECAToken.g:171:4: 'neq'
- {
- match("neq");
-
-
- }
- break;
-
- }
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end NEQ
-
- // $ANTLR start GT
- public final void mGT() throws RecognitionException {
- try {
- int _type = GT;
- // dd/grammar/ECAToken.g:174:4: ( '>' | 'GT' | 'gt' )
- int alt17=3;
- switch ( input.LA(1) ) {
- case '>':
- {
- alt17=1;
- }
- break;
- case 'G':
- {
- alt17=2;
- }
- break;
- case 'g':
- {
- alt17=3;
- }
- break;
- default:
- NoViableAltException nvae =
- new NoViableAltException("174:1: GT : ( '>' | 'GT' | 'gt' );", 17, 0, input);
-
- throw nvae;
- }
-
- switch (alt17) {
- case 1 :
- // dd/grammar/ECAToken.g:174:6: '>'
- {
- match('>');
-
- }
- break;
- case 2 :
- // dd/grammar/ECAToken.g:175:4: 'GT'
- {
- match("GT");
-
-
- }
- break;
- case 3 :
- // dd/grammar/ECAToken.g:176:4: 'gt'
- {
- match("gt");
-
-
- }
- break;
-
- }
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end GT
-
- // $ANTLR start LT
- public final void mLT() throws RecognitionException {
- try {
- int _type = LT;
- // dd/grammar/ECAToken.g:179:4: ( '<' | 'LT' | 'lt' )
- int alt18=3;
- switch ( input.LA(1) ) {
- case '<':
- {
- alt18=1;
- }
- break;
- case 'L':
- {
- alt18=2;
- }
- break;
- case 'l':
- {
- alt18=3;
- }
- break;
- default:
- NoViableAltException nvae =
- new NoViableAltException("179:1: LT : ( '<' | 'LT' | 'lt' );", 18, 0, input);
-
- throw nvae;
- }
-
- switch (alt18) {
- case 1 :
- // dd/grammar/ECAToken.g:179:6: '<'
- {
- match('<');
-
- }
- break;
- case 2 :
- // dd/grammar/ECAToken.g:180:4: 'LT'
- {
- match("LT");
-
-
- }
- break;
- case 3 :
- // dd/grammar/ECAToken.g:181:4: 'lt'
- {
- match("lt");
-
-
- }
- break;
-
- }
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end LT
-
- // $ANTLR start GEQ
- public final void mGEQ() throws RecognitionException {
- try {
- int _type = GEQ;
- // dd/grammar/ECAToken.g:184:5: ( '>=' | 'EQ' | 'geq' )
- int alt19=3;
- switch ( input.LA(1) ) {
- case '>':
- {
- alt19=1;
- }
- break;
- case 'E':
- {
- alt19=2;
- }
- break;
- case 'g':
- {
- alt19=3;
- }
- break;
- default:
- NoViableAltException nvae =
- new NoViableAltException("184:1: GEQ : ( '>=' | 'EQ' | 'geq' );", 19, 0, input);
-
- throw nvae;
- }
-
- switch (alt19) {
- case 1 :
- // dd/grammar/ECAToken.g:184:7: '>='
- {
- match(">=");
-
-
- }
- break;
- case 2 :
- // dd/grammar/ECAToken.g:185:4: 'EQ'
- {
- match("EQ");
-
-
- }
- break;
- case 3 :
- // dd/grammar/ECAToken.g:186:4: 'geq'
- {
- match("geq");
-
-
- }
- break;
-
- }
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end GEQ
-
- // $ANTLR start LEQ
- public final void mLEQ() throws RecognitionException {
- try {
- int _type = LEQ;
- // dd/grammar/ECAToken.g:189:5: ( '<=' | 'LEQ' | 'leq' )
- int alt20=3;
- switch ( input.LA(1) ) {
- case '<':
- {
- alt20=1;
- }
- break;
- case 'L':
- {
- alt20=2;
- }
- break;
- case 'l':
- {
- alt20=3;
- }
- break;
- default:
- NoViableAltException nvae =
- new NoViableAltException("189:1: LEQ : ( '<=' | 'LEQ' | 'leq' );", 20, 0, input);
-
- throw nvae;
- }
-
- switch (alt20) {
- case 1 :
- // dd/grammar/ECAToken.g:189:7: '<='
- {
- match("<=");
-
-
- }
- break;
- case 2 :
- // dd/grammar/ECAToken.g:190:4: 'LEQ'
- {
- match("LEQ");
-
-
- }
- break;
- case 3 :
- // dd/grammar/ECAToken.g:191:4: 'leq'
- {
- match("leq");
-
-
- }
- break;
-
- }
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end LEQ
-
- // $ANTLR start BOR
- public final void mBOR() throws RecognitionException {
- try {
- int _type = BOR;
- // dd/grammar/ECAToken.g:196:5: ( '|' )
- // dd/grammar/ECAToken.g:196:7: '|'
- {
- match('|');
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end BOR
-
- // $ANTLR start BAND
- public final void mBAND() throws RecognitionException {
- try {
- int _type = BAND;
- // dd/grammar/ECAToken.g:199:6: ( '&' )
- // dd/grammar/ECAToken.g:199:8: '&'
- {
- match('&');
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end BAND
-
- // $ANTLR start BXOR
- public final void mBXOR() throws RecognitionException {
- try {
- int _type = BXOR;
- // dd/grammar/ECAToken.g:202:6: ( '^' )
- // dd/grammar/ECAToken.g:202:8: '^'
- {
- match('^');
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end BXOR
-
- // $ANTLR start TWIDDLE
- public final void mTWIDDLE() throws RecognitionException {
- try {
- int _type = TWIDDLE;
- // dd/grammar/ECAToken.g:205:9: ( '~' )
- // dd/grammar/ECAToken.g:205:11: '~'
- {
- match('~');
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end TWIDDLE
-
- // $ANTLR start MUL
- public final void mMUL() throws RecognitionException {
- try {
- int _type = MUL;
- // dd/grammar/ECAToken.g:210:5: ( '*' | 'TIMES' | 'times' )
- int alt21=3;
- switch ( input.LA(1) ) {
- case '*':
- {
- alt21=1;
- }
- break;
- case 'T':
- {
- alt21=2;
- }
- break;
- case 't':
- {
- alt21=3;
- }
- break;
- default:
- NoViableAltException nvae =
- new NoViableAltException("210:1: MUL : ( '*' | 'TIMES' | 'times' );", 21, 0, input);
-
- throw nvae;
- }
-
- switch (alt21) {
- case 1 :
- // dd/grammar/ECAToken.g:210:7: '*'
- {
- match('*');
-
- }
- break;
- case 2 :
- // dd/grammar/ECAToken.g:211:4: 'TIMES'
- {
- match("TIMES");
-
-
- }
- break;
- case 3 :
- // dd/grammar/ECAToken.g:212:4: 'times'
- {
- match("times");
-
-
- }
- break;
-
- }
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end MUL
-
- // $ANTLR start DIV
- public final void mDIV() throws RecognitionException {
- try {
- int _type = DIV;
- // dd/grammar/ECAToken.g:215:5: ( '/' | 'DIVIDE' | 'divide' )
- int alt22=3;
- switch ( input.LA(1) ) {
- case '/':
- {
- alt22=1;
- }
- break;
- case 'D':
- {
- alt22=2;
- }
- break;
- case 'd':
- {
- alt22=3;
- }
- break;
- default:
- NoViableAltException nvae =
- new NoViableAltException("215:1: DIV : ( '/' | 'DIVIDE' | 'divide' );", 22, 0, input);
-
- throw nvae;
- }
-
- switch (alt22) {
- case 1 :
- // dd/grammar/ECAToken.g:215:7: '/'
- {
- match('/');
-
- }
- break;
- case 2 :
- // dd/grammar/ECAToken.g:216:4: 'DIVIDE'
- {
- match("DIVIDE");
-
-
- }
- break;
- case 3 :
- // dd/grammar/ECAToken.g:217:4: 'divide'
- {
- match("divide");
-
-
- }
- break;
-
- }
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end DIV
-
- // $ANTLR start PLUS
- public final void mPLUS() throws RecognitionException {
- try {
- int _type = PLUS;
- // dd/grammar/ECAToken.g:220:6: ( '+' | 'PLUS' | 'plus' )
- int alt23=3;
- switch ( input.LA(1) ) {
- case '+':
- {
- alt23=1;
- }
- break;
- case 'P':
- {
- alt23=2;
- }
- break;
- case 'p':
- {
- alt23=3;
- }
- break;
- default:
- NoViableAltException nvae =
- new NoViableAltException("220:1: PLUS : ( '+' | 'PLUS' | 'plus' );", 23, 0, input);
-
- throw nvae;
- }
-
- switch (alt23) {
- case 1 :
- // dd/grammar/ECAToken.g:220:8: '+'
- {
- match('+');
-
- }
- break;
- case 2 :
- // dd/grammar/ECAToken.g:221:4: 'PLUS'
- {
- match("PLUS");
-
-
- }
- break;
- case 3 :
- // dd/grammar/ECAToken.g:222:4: 'plus'
- {
- match("plus");
-
-
- }
- break;
-
- }
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end PLUS
-
- // $ANTLR start MINUS
- public final void mMINUS() throws RecognitionException {
- try {
- int _type = MINUS;
- // dd/grammar/ECAToken.g:225:7: ( '-' | 'MINUS' | 'minus' )
- int alt24=3;
- switch ( input.LA(1) ) {
- case '-':
- {
- alt24=1;
- }
- break;
- case 'M':
- {
- alt24=2;
- }
- break;
- case 'm':
- {
- alt24=3;
- }
- break;
- default:
- NoViableAltException nvae =
- new NoViableAltException("225:1: MINUS : ( '-' | 'MINUS' | 'minus' );", 24, 0, input);
-
- throw nvae;
- }
-
- switch (alt24) {
- case 1 :
- // dd/grammar/ECAToken.g:225:9: '-'
- {
- match('-');
-
- }
- break;
- case 2 :
- // dd/grammar/ECAToken.g:226:4: 'MINUS'
- {
- match("MINUS");
-
-
- }
- break;
- case 3 :
- // dd/grammar/ECAToken.g:227:4: 'minus'
- {
- match("minus");
-
-
- }
- break;
-
- }
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end MINUS
-
- // $ANTLR start MOD
- public final void mMOD() throws RecognitionException {
- try {
- int _type = MOD;
- // dd/grammar/ECAToken.g:230:5: ( '%' | 'MOD' | 'mod' )
- int alt25=3;
- switch ( input.LA(1) ) {
- case '%':
- {
- alt25=1;
- }
- break;
- case 'M':
- {
- alt25=2;
- }
- break;
- case 'm':
- {
- alt25=3;
- }
- break;
- default:
- NoViableAltException nvae =
- new NoViableAltException("230:1: MOD : ( '%' | 'MOD' | 'mod' );", 25, 0, input);
-
- throw nvae;
- }
-
- switch (alt25) {
- case 1 :
- // dd/grammar/ECAToken.g:230:7: '%'
- {
- match('%');
-
- }
- break;
- case 2 :
- // dd/grammar/ECAToken.g:231:4: 'MOD'
- {
- match("MOD");
-
-
- }
- break;
- case 3 :
- // dd/grammar/ECAToken.g:232:4: 'mod'
- {
- match("mod");
-
-
- }
- break;
-
- }
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end MOD
-
- // $ANTLR start TERN_IF
- public final void mTERN_IF() throws RecognitionException {
- try {
- int _type = TERN_IF;
- // dd/grammar/ECAToken.g:237:9: ( '?' )
- // dd/grammar/ECAToken.g:237:11: '?'
- {
- match('?');
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end TERN_IF
-
- // $ANTLR start COLON
- public final void mCOLON() throws RecognitionException {
- try {
- int _type = COLON;
- // dd/grammar/ECAToken.g:240:7: ( ':' )
- // dd/grammar/ECAToken.g:240:9: ':'
- {
- match(':');
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end COLON
-
- // $ANTLR start LETTER
- public final void mLETTER() throws RecognitionException {
- try {
- // dd/grammar/ECAToken.g:246:8: ( 'a' .. 'z' | 'A' .. 'Z' )
- // dd/grammar/ECAToken.g:
- {
- if ( (input.LA(1)>='A' && input.LA(1)<='Z')||(input.LA(1)>='a' && input.LA(1)<='z') ) {
- input.consume();
-
- }
- else {
- MismatchedSetException mse =
- new MismatchedSetException(null,input);
- recover(mse); throw mse;
- }
-
-
- }
-
- }
- finally {
- }
- }
- // $ANTLR end LETTER
-
- // $ANTLR start UNDERSCORE
- public final void mUNDERSCORE() throws RecognitionException {
- try {
- // dd/grammar/ECAToken.g:250:12: ( '_' )
- // dd/grammar/ECAToken.g:250:14: '_'
- {
- match('_');
-
- }
-
- }
- finally {
- }
- }
- // $ANTLR end UNDERSCORE
-
- // $ANTLR start QUOTE
- public final void mQUOTE() throws RecognitionException {
- try {
- int _type = QUOTE;
- // dd/grammar/ECAToken.g:253:7: ( '\\'' )
- // dd/grammar/ECAToken.g:253:9: '\\''
- {
- match('\'');
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end QUOTE
-
- // $ANTLR start DQUOTE
- public final void mDQUOTE() throws RecognitionException {
- try {
- int _type = DQUOTE;
- // dd/grammar/ECAToken.g:256:8: ( '\"' )
- // dd/grammar/ECAToken.g:256:10: '\"'
- {
- match('\"');
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end DQUOTE
-
- // $ANTLR start SPACE
- public final void mSPACE() throws RecognitionException {
- try {
- // dd/grammar/ECAToken.g:260:7: ( ' ' | '\\t' | '\\r' )
- // dd/grammar/ECAToken.g:
- {
- if ( input.LA(1)=='\t'||input.LA(1)=='\r'||input.LA(1)==' ' ) {
- input.consume();
-
- }
- else {
- MismatchedSetException mse =
- new MismatchedSetException(null,input);
- recover(mse); throw mse;
- }
-
-
- }
-
- }
- finally {
- }
- }
- // $ANTLR end SPACE
-
- // $ANTLR start NEWLINE
- public final void mNEWLINE() throws RecognitionException {
- try {
- // dd/grammar/ECAToken.g:264:9: ( '\\n' )
- // dd/grammar/ECAToken.g:264:11: '\\n'
- {
- match('\n');
-
- }
-
- }
- finally {
- }
- }
- // $ANTLR end NEWLINE
-
- // $ANTLR start PUNCT
- public final void mPUNCT() throws RecognitionException {
- try {
- // dd/grammar/ECAToken.g:268:7: ( '!' | '$' | '%' | '^' | '&' | '*' | '(' | ')' | '-' | '+' | '=' | '{' | '}' | '[' | ']' | ':' | ';' | '@' | '~' | '#' | '|' | '\\\\' | '`' | ',' | '<' | '.' | '>' | '/' | '?' )
- // dd/grammar/ECAToken.g:
- {
- if ( input.LA(1)=='!'||(input.LA(1)>='#' && input.LA(1)<='&')||(input.LA(1)>='(' && input.LA(1)<='/')||(input.LA(1)>=':' && input.LA(1)<='@')||(input.LA(1)>='[' && input.LA(1)<='^')||input.LA(1)=='`'||(input.LA(1)>='{' && input.LA(1)<='~') ) {
- input.consume();
-
- }
- else {
- MismatchedSetException mse =
- new MismatchedSetException(null,input);
- recover(mse); throw mse;
- }
-
-
- }
-
- }
- finally {
- }
- }
- // $ANTLR end PUNCT
-
- // $ANTLR start STRING
- public final void mSTRING() throws RecognitionException {
- try {
- int _type = STRING;
- // dd/grammar/ECAToken.g:271:8: ( DQUOTE ( SPACE | PUNCT | LETTER | UNDERSCORE | DIGIT | QUOTE )* DQUOTE )
- // dd/grammar/ECAToken.g:271:10: DQUOTE ( SPACE | PUNCT | LETTER | UNDERSCORE | DIGIT | QUOTE )* DQUOTE
- {
- mDQUOTE();
- // dd/grammar/ECAToken.g:271:17: ( SPACE | PUNCT | LETTER | UNDERSCORE | DIGIT | QUOTE )*
- loop26:
- do {
- int alt26=2;
- int LA26_0 = input.LA(1);
-
- if ( (LA26_0=='\t'||LA26_0=='\r'||(LA26_0>=' ' && LA26_0<='!')||(LA26_0>='#' && LA26_0<='~')) ) {
- alt26=1;
- }
-
-
- switch (alt26) {
- case 1 :
- // dd/grammar/ECAToken.g:
- {
- if ( input.LA(1)=='\t'||input.LA(1)=='\r'||(input.LA(1)>=' ' && input.LA(1)<='!')||(input.LA(1)>='#' && input.LA(1)<='~') ) {
- input.consume();
-
- }
- else {
- MismatchedSetException mse =
- new MismatchedSetException(null,input);
- recover(mse); throw mse;
- }
-
-
- }
- break;
-
- default :
- break loop26;
- }
- } while (true);
-
- mDQUOTE();
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end STRING
-
- // $ANTLR start BARESYM
- public final void mBARESYM() throws RecognitionException {
- try {
- // dd/grammar/ECAToken.g:275:9: ( ( LETTER | UNDERSCORE ) ( LETTER | DIGIT | UNDERSCORE )* )
- // dd/grammar/ECAToken.g:275:11: ( LETTER | UNDERSCORE ) ( LETTER | DIGIT | UNDERSCORE )*
- {
- if ( (input.LA(1)>='A' && input.LA(1)<='Z')||input.LA(1)=='_'||(input.LA(1)>='a' && input.LA(1)<='z') ) {
- input.consume();
-
- }
- else {
- MismatchedSetException mse =
- new MismatchedSetException(null,input);
- recover(mse); throw mse;
- }
-
- // dd/grammar/ECAToken.g:275:33: ( LETTER | DIGIT | UNDERSCORE )*
- loop27:
- do {
- int alt27=2;
- int LA27_0 = input.LA(1);
-
- if ( ((LA27_0>='0' && LA27_0<='9')||(LA27_0>='A' && LA27_0<='Z')||LA27_0=='_'||(LA27_0>='a' && LA27_0<='z')) ) {
- alt27=1;
- }
-
-
- switch (alt27) {
- case 1 :
- // dd/grammar/ECAToken.g:
- {
- if ( (input.LA(1)>='0' && input.LA(1)<='9')||(input.LA(1)>='A' && input.LA(1)<='Z')||input.LA(1)=='_'||(input.LA(1)>='a' && input.LA(1)<='z') ) {
- input.consume();
-
- }
- else {
- MismatchedSetException mse =
- new MismatchedSetException(null,input);
- recover(mse); throw mse;
- }
-
-
- }
- break;
-
- default :
- break loop27;
- }
- } while (true);
-
-
- }
-
- }
- finally {
- }
- }
- // $ANTLR end BARESYM
-
- // $ANTLR start QUOTSYM
- public final void mQUOTSYM() throws RecognitionException {
- try {
- // dd/grammar/ECAToken.g:278:9: ( QUOTE ( PUNCT | LETTER | UNDERSCORE | DIGIT | DQUOTE | SPACE )* QUOTE )
- // dd/grammar/ECAToken.g:278:11: QUOTE ( PUNCT | LETTER | UNDERSCORE | DIGIT | DQUOTE | SPACE )* QUOTE
- {
- mQUOTE();
- // dd/grammar/ECAToken.g:278:17: ( PUNCT | LETTER | UNDERSCORE | DIGIT | DQUOTE | SPACE )*
- loop28:
- do {
- int alt28=2;
- int LA28_0 = input.LA(1);
-
- if ( (LA28_0=='\t'||LA28_0=='\r'||(LA28_0>=' ' && LA28_0<='&')||(LA28_0>='(' && LA28_0<='~')) ) {
- alt28=1;
- }
-
-
- switch (alt28) {
- case 1 :
- // dd/grammar/ECAToken.g:
- {
- if ( input.LA(1)=='\t'||input.LA(1)=='\r'||(input.LA(1)>=' ' && input.LA(1)<='&')||(input.LA(1)>='(' && input.LA(1)<='~') ) {
- input.consume();
-
- }
- else {
- MismatchedSetException mse =
- new MismatchedSetException(null,input);
- recover(mse); throw mse;
- }
-
-
- }
- break;
-
- default :
- break loop28;
- }
- } while (true);
-
- mQUOTE();
-
- }
-
- }
- finally {
- }
- }
- // $ANTLR end QUOTSYM
-
- // $ANTLR start DOTSYM
- public final void mDOTSYM() throws RecognitionException {
- try {
- // dd/grammar/ECAToken.g:283:8: ( BARESYM DOT DOTSYM | BARESYM )
- int alt29=2;
- alt29 = dfa29.predict(input);
- switch (alt29) {
- case 1 :
- // dd/grammar/ECAToken.g:283:10: BARESYM DOT DOTSYM
- {
- mBARESYM();
- mDOT();
- mDOTSYM();
-
- }
- break;
- case 2 :
- // dd/grammar/ECAToken.g:284:4: BARESYM
- {
- mBARESYM();
-
- }
- break;
-
- }
- }
- finally {
- }
- }
- // $ANTLR end DOTSYM
-
- // $ANTLR start SYMBOL
- public final void mSYMBOL() throws RecognitionException {
- try {
- int _type = SYMBOL;
- // dd/grammar/ECAToken.g:287:8: ( DOTSYM | QUOTSYM )
- int alt30=2;
- int LA30_0 = input.LA(1);
-
- if ( ((LA30_0>='A' && LA30_0<='Z')||LA30_0=='_'||(LA30_0>='a' && LA30_0<='z')) ) {
- alt30=1;
- }
- else if ( (LA30_0=='\'') ) {
- alt30=2;
- }
- else {
- NoViableAltException nvae =
- new NoViableAltException("287:1: SYMBOL : ( DOTSYM | QUOTSYM );", 30, 0, input);
-
- throw nvae;
- }
- switch (alt30) {
- case 1 :
- // dd/grammar/ECAToken.g:287:10: DOTSYM
- {
- mDOTSYM();
-
- }
- break;
- case 2 :
- // dd/grammar/ECAToken.g:288:4: QUOTSYM
- {
- mQUOTSYM();
-
- }
- break;
-
- }
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end SYMBOL
-
- // $ANTLR start DOLLAR
- public final void mDOLLAR() throws RecognitionException {
- try {
- // dd/grammar/ECAToken.g:293:8: ( '$' )
- // dd/grammar/ECAToken.g:293:10: '$'
- {
- match('$');
-
- }
-
- }
- finally {
- }
- }
- // $ANTLR end DOLLAR
-
- // $ANTLR start DOLLARSYM
- public final void mDOLLARSYM() throws RecognitionException {
- try {
- int _type = DOLLARSYM;
- // dd/grammar/ECAToken.g:298:11: ( DOLLAR ( BAREINT | BARESYM ) )
- // dd/grammar/ECAToken.g:298:13: DOLLAR ( BAREINT | BARESYM )
- {
- mDOLLAR();
- // dd/grammar/ECAToken.g:298:20: ( BAREINT | BARESYM )
- int alt31=2;
- int LA31_0 = input.LA(1);
-
- if ( ((LA31_0>='0' && LA31_0<='9')) ) {
- alt31=1;
- }
- else if ( ((LA31_0>='A' && LA31_0<='Z')||LA31_0=='_'||(LA31_0>='a' && LA31_0<='z')) ) {
- alt31=2;
- }
- else {
- NoViableAltException nvae =
- new NoViableAltException("298:20: ( BAREINT | BARESYM )", 31, 0, input);
-
- throw nvae;
- }
- switch (alt31) {
- case 1 :
- // dd/grammar/ECAToken.g:298:21: BAREINT
- {
- mBAREINT();
-
- }
- break;
- case 2 :
- // dd/grammar/ECAToken.g:298:31: BARESYM
- {
- mBARESYM();
-
- }
- break;
-
- }
-
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end DOLLARSYM
-
- // $ANTLR start WS
- public final void mWS() throws RecognitionException {
- try {
- int _type = WS;
- // dd/grammar/ECAToken.g:304:4: ( ( SPACE | NEWLINE ) )
- // dd/grammar/ECAToken.g:304:6: ( SPACE | NEWLINE )
- {
- if ( (input.LA(1)>='\t' && input.LA(1)<='\n')||input.LA(1)=='\r'||input.LA(1)==' ' ) {
- input.consume();
-
- }
- else {
- MismatchedSetException mse =
- new MismatchedSetException(null,input);
- recover(mse); throw mse;
- }
-
- skip();
-
- }
-
- this.type = _type;
- }
- finally {
- }
- }
- // $ANTLR end WS
-
- public void mTokens() throws RecognitionException {
- // dd/grammar/ECAToken.g:1:8: ( NUMBER | BIND | IF | DO | RULE | CLASS | METHOD | LINE | ENDRULE | NOTHING | TRUE | FALSE | RETURN | THROW | LPAREN | RPAREN | LSQUARE | RSQUARE | LBRACE | RBRACE | SEPR | DOT | ASSIGN | OR | AND | NOT | EQ | NEQ | GT | LT | GEQ | LEQ | BOR | BAND | BXOR | TWIDDLE | MUL | DIV | PLUS | MINUS | MOD | TERN_IF | COLON | QUOTE | DQUOTE | STRING | SYMBOL | DOLLARSYM | WS )
- int alt32=49;
- switch ( input.LA(1) ) {
- case '+':
- {
- int LA32_1 = input.LA(2);
-
- if ( ((LA32_1>='0' && LA32_1<='9')) ) {
- alt32=1;
- }
- else {
- alt32=39;}
- }
- break;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- {
- alt32=1;
- }
- break;
- case 'B':
- {
- int LA32_3 = input.LA(2);
-
- if ( (LA32_3=='I') ) {
- int LA32_58 = input.LA(3);
-
- if ( (LA32_58=='N') ) {
- int LA32_117 = input.LA(4);
-
- if ( (LA32_117=='D') ) {
- int LA32_152 = input.LA(5);
-
- if ( (LA32_152=='.'||(LA32_152>='0' && LA32_152<='9')||(LA32_152>='A' && LA32_152<='Z')||LA32_152=='_'||(LA32_152>='a' && LA32_152<='z')) ) {
- alt32=47;
- }
- else {
- alt32=2;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- break;
- case 'I':
- {
- int LA32_4 = input.LA(2);
-
- if ( (LA32_4=='F') ) {
- int LA32_59 = input.LA(3);
-
- if ( (LA32_59=='.'||(LA32_59>='0' && LA32_59<='9')||(LA32_59>='A' && LA32_59<='Z')||LA32_59=='_'||(LA32_59>='a' && LA32_59<='z')) ) {
- alt32=47;
- }
- else {
- alt32=3;}
- }
- else {
- alt32=47;}
- }
- break;
- case 'D':
- {
- switch ( input.LA(2) ) {
- case 'O':
- {
- int LA32_60 = input.LA(3);
-
- if ( (LA32_60=='.'||(LA32_60>='0' && LA32_60<='9')||(LA32_60>='A' && LA32_60<='Z')||LA32_60=='_'||(LA32_60>='a' && LA32_60<='z')) ) {
- alt32=47;
- }
- else {
- alt32=4;}
- }
- break;
- case 'I':
- {
- int LA32_61 = input.LA(3);
-
- if ( (LA32_61=='V') ) {
- int LA32_120 = input.LA(4);
-
- if ( (LA32_120=='I') ) {
- int LA32_153 = input.LA(5);
-
- if ( (LA32_153=='D') ) {
- int LA32_176 = input.LA(6);
-
- if ( (LA32_176=='E') ) {
- int LA32_195 = input.LA(7);
-
- if ( (LA32_195=='.'||(LA32_195>='0' && LA32_195<='9')||(LA32_195>='A' && LA32_195<='Z')||LA32_195=='_'||(LA32_195>='a' && LA32_195<='z')) ) {
- alt32=47;
- }
- else {
- alt32=38;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- break;
- default:
- alt32=47;}
-
- }
- break;
- case 'R':
- {
- switch ( input.LA(2) ) {
- case 'U':
- {
- int LA32_62 = input.LA(3);
-
- if ( (LA32_62=='L') ) {
- int LA32_121 = input.LA(4);
-
- if ( (LA32_121=='E') ) {
- int LA32_154 = input.LA(5);
-
- if ( (LA32_154=='.'||(LA32_154>='0' && LA32_154<='9')||(LA32_154>='A' && LA32_154<='Z')||LA32_154=='_'||(LA32_154>='a' && LA32_154<='z')) ) {
- alt32=47;
- }
- else {
- alt32=5;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- break;
- case 'E':
- {
- int LA32_63 = input.LA(3);
-
- if ( (LA32_63=='T') ) {
- int LA32_122 = input.LA(4);
-
- if ( (LA32_122=='U') ) {
- int LA32_155 = input.LA(5);
-
- if ( (LA32_155=='R') ) {
- int LA32_178 = input.LA(6);
-
- if ( (LA32_178=='N') ) {
- int LA32_196 = input.LA(7);
-
- if ( (LA32_196=='.'||(LA32_196>='0' && LA32_196<='9')||(LA32_196>='A' && LA32_196<='Z')||LA32_196=='_'||(LA32_196>='a' && LA32_196<='z')) ) {
- alt32=47;
- }
- else {
- alt32=13;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- break;
- default:
- alt32=47;}
-
- }
- break;
- case 'C':
- {
- int LA32_7 = input.LA(2);
-
- if ( (LA32_7=='L') ) {
- int LA32_64 = input.LA(3);
-
- if ( (LA32_64=='A') ) {
- int LA32_123 = input.LA(4);
-
- if ( (LA32_123=='S') ) {
- int LA32_156 = input.LA(5);
-
- if ( (LA32_156=='S') ) {
- int LA32_179 = input.LA(6);
-
- if ( (LA32_179=='.'||(LA32_179>='0' && LA32_179<='9')||(LA32_179>='A' && LA32_179<='Z')||LA32_179=='_'||(LA32_179>='a' && LA32_179<='z')) ) {
- alt32=47;
- }
- else {
- alt32=6;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- break;
- case 'M':
- {
- switch ( input.LA(2) ) {
- case 'I':
- {
- int LA32_65 = input.LA(3);
-
- if ( (LA32_65=='N') ) {
- int LA32_124 = input.LA(4);
-
- if ( (LA32_124=='U') ) {
- int LA32_157 = input.LA(5);
-
- if ( (LA32_157=='S') ) {
- int LA32_180 = input.LA(6);
-
- if ( (LA32_180=='.'||(LA32_180>='0' && LA32_180<='9')||(LA32_180>='A' && LA32_180<='Z')||LA32_180=='_'||(LA32_180>='a' && LA32_180<='z')) ) {
- alt32=47;
- }
- else {
- alt32=40;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- break;
- case 'O':
- {
- int LA32_66 = input.LA(3);
-
- if ( (LA32_66=='D') ) {
- int LA32_125 = input.LA(4);
-
- if ( (LA32_125=='.'||(LA32_125>='0' && LA32_125<='9')||(LA32_125>='A' && LA32_125<='Z')||LA32_125=='_'||(LA32_125>='a' && LA32_125<='z')) ) {
- alt32=47;
- }
- else {
- alt32=41;}
- }
- else {
- alt32=47;}
- }
- break;
- case 'E':
- {
- int LA32_67 = input.LA(3);
-
- if ( (LA32_67=='T') ) {
- int LA32_126 = input.LA(4);
-
- if ( (LA32_126=='H') ) {
- int LA32_158 = input.LA(5);
-
- if ( (LA32_158=='O') ) {
- int LA32_181 = input.LA(6);
-
- if ( (LA32_181=='D') ) {
- int LA32_198 = input.LA(7);
-
- if ( (LA32_198=='.'||(LA32_198>='0' && LA32_198<='9')||(LA32_198>='A' && LA32_198<='Z')||LA32_198=='_'||(LA32_198>='a' && LA32_198<='z')) ) {
- alt32=47;
- }
- else {
- alt32=7;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- break;
- default:
- alt32=47;}
-
- }
- break;
- case 'L':
- {
- switch ( input.LA(2) ) {
- case 'T':
- {
- int LA32_68 = input.LA(3);
-
- if ( (LA32_68=='.'||(LA32_68>='0' && LA32_68<='9')||(LA32_68>='A' && LA32_68<='Z')||LA32_68=='_'||(LA32_68>='a' && LA32_68<='z')) ) {
- alt32=47;
- }
- else {
- alt32=30;}
- }
- break;
- case 'E':
- {
- int LA32_69 = input.LA(3);
-
- if ( (LA32_69=='Q') ) {
- int LA32_127 = input.LA(4);
-
- if ( (LA32_127=='.'||(LA32_127>='0' && LA32_127<='9')||(LA32_127>='A' && LA32_127<='Z')||LA32_127=='_'||(LA32_127>='a' && LA32_127<='z')) ) {
- alt32=47;
- }
- else {
- alt32=32;}
- }
- else {
- alt32=47;}
- }
- break;
- case 'I':
- {
- int LA32_70 = input.LA(3);
-
- if ( (LA32_70=='N') ) {
- int LA32_128 = input.LA(4);
-
- if ( (LA32_128=='E') ) {
- int LA32_159 = input.LA(5);
-
- if ( (LA32_159=='.'||(LA32_159>='0' && LA32_159<='9')||(LA32_159>='A' && LA32_159<='Z')||LA32_159=='_'||(LA32_159>='a' && LA32_159<='z')) ) {
- alt32=47;
- }
- else {
- alt32=8;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- break;
- default:
- alt32=47;}
-
- }
- break;
- case 'E':
- {
- switch ( input.LA(2) ) {
- case 'N':
- {
- int LA32_71 = input.LA(3);
-
- if ( (LA32_71=='D') ) {
- int LA32_129 = input.LA(4);
-
- if ( (LA32_129=='R') ) {
- int LA32_160 = input.LA(5);
-
- if ( (LA32_160=='U') ) {
- int LA32_183 = input.LA(6);
-
- if ( (LA32_183=='L') ) {
- int LA32_199 = input.LA(7);
-
- if ( (LA32_199=='E') ) {
- int LA32_207 = input.LA(8);
-
- if ( (LA32_207=='.'||(LA32_207>='0' && LA32_207<='9')||(LA32_207>='A' && LA32_207<='Z')||LA32_207=='_'||(LA32_207>='a' && LA32_207<='z')) ) {
- alt32=47;
- }
- else {
- alt32=9;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- break;
- case 'Q':
- {
- int LA32_72 = input.LA(3);
-
- if ( (LA32_72=='.'||(LA32_72>='0' && LA32_72<='9')||(LA32_72>='A' && LA32_72<='Z')||LA32_72=='_'||(LA32_72>='a' && LA32_72<='z')) ) {
- alt32=47;
- }
- else {
- alt32=27;}
- }
- break;
- default:
- alt32=47;}
-
- }
- break;
- case 'N':
- {
- switch ( input.LA(2) ) {
- case 'O':
- {
- int LA32_73 = input.LA(3);
-
- if ( (LA32_73=='T') ) {
- switch ( input.LA(4) ) {
- case 'H':
- {
- int LA32_161 = input.LA(5);
-
- if ( (LA32_161=='I') ) {
- int LA32_184 = input.LA(6);
-
- if ( (LA32_184=='N') ) {
- int LA32_200 = input.LA(7);
-
- if ( (LA32_200=='G') ) {
- int LA32_208 = input.LA(8);
-
- if ( (LA32_208=='.'||(LA32_208>='0' && LA32_208<='9')||(LA32_208>='A' && LA32_208<='Z')||LA32_208=='_'||(LA32_208>='a' && LA32_208<='z')) ) {
- alt32=47;
- }
- else {
- alt32=10;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- break;
- case '.':
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case 'A':
- case 'B':
- case 'C':
- case 'D':
- case 'E':
- case 'F':
- case 'G':
- case 'I':
- case 'J':
- case 'K':
- case 'L':
- case 'M':
- case 'N':
- case 'O':
- case 'P':
- case 'Q':
- case 'R':
- case 'S':
- case 'T':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '_':
- case 'a':
- case 'b':
- case 'c':
- case 'd':
- case 'e':
- case 'f':
- case 'g':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'l':
- case 'm':
- case 'n':
- case 'o':
- case 'p':
- case 'q':
- case 'r':
- case 's':
- case 't':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z':
- {
- alt32=47;
- }
- break;
- default:
- alt32=26;}
-
- }
- else {
- alt32=47;}
- }
- break;
- case 'E':
- {
- int LA32_74 = input.LA(3);
-
- if ( (LA32_74=='Q') ) {
- int LA32_131 = input.LA(4);
-
- if ( (LA32_131=='.'||(LA32_131>='0' && LA32_131<='9')||(LA32_131>='A' && LA32_131<='Z')||LA32_131=='_'||(LA32_131>='a' && LA32_131<='z')) ) {
- alt32=47;
- }
- else {
- alt32=28;}
- }
- else {
- alt32=47;}
- }
- break;
- default:
- alt32=47;}
-
- }
- break;
- case 'T':
- {
- switch ( input.LA(2) ) {
- case 'R':
- {
- int LA32_75 = input.LA(3);
-
- if ( (LA32_75=='U') ) {
- int LA32_132 = input.LA(4);
-
- if ( (LA32_132=='E') ) {
- int LA32_162 = input.LA(5);
-
- if ( (LA32_162=='.'||(LA32_162>='0' && LA32_162<='9')||(LA32_162>='A' && LA32_162<='Z')||LA32_162=='_'||(LA32_162>='a' && LA32_162<='z')) ) {
- alt32=47;
- }
- else {
- alt32=11;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- break;
- case 'H':
- {
- int LA32_76 = input.LA(3);
-
- if ( (LA32_76=='R') ) {
- int LA32_133 = input.LA(4);
-
- if ( (LA32_133=='O') ) {
- int LA32_163 = input.LA(5);
-
- if ( (LA32_163=='W') ) {
- int LA32_186 = input.LA(6);
-
- if ( (LA32_186=='.'||(LA32_186>='0' && LA32_186<='9')||(LA32_186>='A' && LA32_186<='Z')||LA32_186=='_'||(LA32_186>='a' && LA32_186<='z')) ) {
- alt32=47;
- }
- else {
- alt32=14;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- break;
- case 'I':
- {
- int LA32_77 = input.LA(3);
-
- if ( (LA32_77=='M') ) {
- int LA32_134 = input.LA(4);
-
- if ( (LA32_134=='E') ) {
- int LA32_164 = input.LA(5);
-
- if ( (LA32_164=='S') ) {
- int LA32_187 = input.LA(6);
-
- if ( (LA32_187=='.'||(LA32_187>='0' && LA32_187<='9')||(LA32_187>='A' && LA32_187<='Z')||LA32_187=='_'||(LA32_187>='a' && LA32_187<='z')) ) {
- alt32=47;
- }
- else {
- alt32=37;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- break;
- default:
- alt32=47;}
-
- }
- break;
- case 't':
- {
- switch ( input.LA(2) ) {
- case 'r':
- {
- int LA32_78 = input.LA(3);
-
- if ( (LA32_78=='u') ) {
- int LA32_135 = input.LA(4);
-
- if ( (LA32_135=='e') ) {
- int LA32_165 = input.LA(5);
-
- if ( (LA32_165=='.'||(LA32_165>='0' && LA32_165<='9')||(LA32_165>='A' && LA32_165<='Z')||LA32_165=='_'||(LA32_165>='a' && LA32_165<='z')) ) {
- alt32=47;
- }
- else {
- alt32=11;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- break;
- case 'i':
- {
- int LA32_79 = input.LA(3);
-
- if ( (LA32_79=='m') ) {
- int LA32_136 = input.LA(4);
-
- if ( (LA32_136=='e') ) {
- int LA32_166 = input.LA(5);
-
- if ( (LA32_166=='s') ) {
- int LA32_188 = input.LA(6);
-
- if ( (LA32_188=='.'||(LA32_188>='0' && LA32_188<='9')||(LA32_188>='A' && LA32_188<='Z')||LA32_188=='_'||(LA32_188>='a' && LA32_188<='z')) ) {
- alt32=47;
- }
- else {
- alt32=37;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- break;
- case 'h':
- {
- int LA32_80 = input.LA(3);
-
- if ( (LA32_80=='r') ) {
- int LA32_137 = input.LA(4);
-
- if ( (LA32_137=='o') ) {
- int LA32_167 = input.LA(5);
-
- if ( (LA32_167=='w') ) {
- int LA32_189 = input.LA(6);
-
- if ( (LA32_189=='.'||(LA32_189>='0' && LA32_189<='9')||(LA32_189>='A' && LA32_189<='Z')||LA32_189=='_'||(LA32_189>='a' && LA32_189<='z')) ) {
- alt32=47;
- }
- else {
- alt32=14;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- break;
- default:
- alt32=47;}
-
- }
- break;
- case 'F':
- {
- int LA32_14 = input.LA(2);
-
- if ( (LA32_14=='A') ) {
- int LA32_81 = input.LA(3);
-
- if ( (LA32_81=='L') ) {
- int LA32_138 = input.LA(4);
-
- if ( (LA32_138=='S') ) {
- int LA32_168 = input.LA(5);
-
- if ( (LA32_168=='E') ) {
- int LA32_190 = input.LA(6);
-
- if ( (LA32_190=='.'||(LA32_190>='0' && LA32_190<='9')||(LA32_190>='A' && LA32_190<='Z')||LA32_190=='_'||(LA32_190>='a' && LA32_190<='z')) ) {
- alt32=47;
- }
- else {
- alt32=12;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- break;
- case 'f':
- {
- int LA32_15 = input.LA(2);
-
- if ( (LA32_15=='a') ) {
- int LA32_82 = input.LA(3);
-
- if ( (LA32_82=='l') ) {
- int LA32_139 = input.LA(4);
-
- if ( (LA32_139=='s') ) {
- int LA32_169 = input.LA(5);
-
- if ( (LA32_169=='e') ) {
- int LA32_191 = input.LA(6);
-
- if ( (LA32_191=='.'||(LA32_191>='0' && LA32_191<='9')||(LA32_191>='A' && LA32_191<='Z')||LA32_191=='_'||(LA32_191>='a' && LA32_191<='z')) ) {
- alt32=47;
- }
- else {
- alt32=12;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- break;
- case 'r':
- {
- int LA32_16 = input.LA(2);
-
- if ( (LA32_16=='e') ) {
- int LA32_83 = input.LA(3);
-
- if ( (LA32_83=='t') ) {
- int LA32_140 = input.LA(4);
-
- if ( (LA32_140=='u') ) {
- int LA32_170 = input.LA(5);
-
- if ( (LA32_170=='r') ) {
- int LA32_192 = input.LA(6);
-
- if ( (LA32_192=='n') ) {
- int LA32_203 = input.LA(7);
-
- if ( (LA32_203=='.'||(LA32_203>='0' && LA32_203<='9')||(LA32_203>='A' && LA32_203<='Z')||LA32_203=='_'||(LA32_203>='a' && LA32_203<='z')) ) {
- alt32=47;
- }
- else {
- alt32=13;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- break;
- case '(':
- {
- alt32=15;
- }
- break;
- case ')':
- {
- alt32=16;
- }
- break;
- case '[':
- {
- alt32=17;
- }
- break;
- case ']':
- {
- alt32=18;
- }
- break;
- case '{':
- {
- alt32=19;
- }
- break;
- case '}':
- {
- alt32=20;
- }
- break;
- case ',':
- case ';':
- {
- alt32=21;
- }
- break;
- case '.':
- {
- alt32=22;
- }
- break;
- case '=':
- {
- int LA32_25 = input.LA(2);
-
- if ( (LA32_25=='=') ) {
- alt32=27;
- }
- else {
- alt32=23;}
- }
- break;
- case '<':
- {
- switch ( input.LA(2) ) {
- case '-':
- {
- alt32=23;
- }
- break;
- case '=':
- {
- alt32=32;
- }
- break;
- default:
- alt32=30;}
-
- }
- break;
- case '|':
- {
- int LA32_27 = input.LA(2);
-
- if ( (LA32_27=='|') ) {
- alt32=24;
- }
- else {
- alt32=33;}
- }
- break;
- case 'O':
- {
- int LA32_28 = input.LA(2);
-
- if ( (LA32_28=='R') ) {
- int LA32_90 = input.LA(3);
-
- if ( (LA32_90=='.'||(LA32_90>='0' && LA32_90<='9')||(LA32_90>='A' && LA32_90<='Z')||LA32_90=='_'||(LA32_90>='a' && LA32_90<='z')) ) {
- alt32=47;
- }
- else {
- alt32=24;}
- }
- else {
- alt32=47;}
- }
- break;
- case 'o':
- {
- int LA32_29 = input.LA(2);
-
- if ( (LA32_29=='r') ) {
- int LA32_91 = input.LA(3);
-
- if ( (LA32_91=='.'||(LA32_91>='0' && LA32_91<='9')||(LA32_91>='A' && LA32_91<='Z')||LA32_91=='_'||(LA32_91>='a' && LA32_91<='z')) ) {
- alt32=47;
- }
- else {
- alt32=24;}
- }
- else {
- alt32=47;}
- }
- break;
- case '&':
- {
- int LA32_30 = input.LA(2);
-
- if ( (LA32_30=='&') ) {
- alt32=25;
- }
- else {
- alt32=34;}
- }
- break;
- case 'A':
- {
- int LA32_31 = input.LA(2);
-
- if ( (LA32_31=='N') ) {
- int LA32_94 = input.LA(3);
-
- if ( (LA32_94=='D') ) {
- int LA32_141 = input.LA(4);
-
- if ( (LA32_141=='.'||(LA32_141>='0' && LA32_141<='9')||(LA32_141>='A' && LA32_141<='Z')||LA32_141=='_'||(LA32_141>='a' && LA32_141<='z')) ) {
- alt32=47;
- }
- else {
- alt32=25;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- break;
- case 'a':
- {
- int LA32_32 = input.LA(2);
-
- if ( (LA32_32=='n') ) {
- int LA32_95 = input.LA(3);
-
- if ( (LA32_95=='d') ) {
- int LA32_142 = input.LA(4);
-
- if ( (LA32_142=='.'||(LA32_142>='0' && LA32_142<='9')||(LA32_142>='A' && LA32_142<='Z')||LA32_142=='_'||(LA32_142>='a' && LA32_142<='z')) ) {
- alt32=47;
- }
- else {
- alt32=25;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- break;
- case '!':
- {
- int LA32_33 = input.LA(2);
-
- if ( (LA32_33=='=') ) {
- alt32=28;
- }
- else {
- alt32=26;}
- }
- break;
- case 'n':
- {
- switch ( input.LA(2) ) {
- case 'o':
- {
- int LA32_98 = input.LA(3);
-
- if ( (LA32_98=='t') ) {
- int LA32_143 = input.LA(4);
-
- if ( (LA32_143=='.'||(LA32_143>='0' && LA32_143<='9')||(LA32_143>='A' && LA32_143<='Z')||LA32_143=='_'||(LA32_143>='a' && LA32_143<='z')) ) {
- alt32=47;
- }
- else {
- alt32=26;}
- }
- else {
- alt32=47;}
- }
- break;
- case 'e':
- {
- int LA32_99 = input.LA(3);
-
- if ( (LA32_99=='q') ) {
- int LA32_144 = input.LA(4);
-
- if ( (LA32_144=='.'||(LA32_144>='0' && LA32_144<='9')||(LA32_144>='A' && LA32_144<='Z')||LA32_144=='_'||(LA32_144>='a' && LA32_144<='z')) ) {
- alt32=47;
- }
- else {
- alt32=28;}
- }
- else {
- alt32=47;}
- }
- break;
- default:
- alt32=47;}
-
- }
- break;
- case 'e':
- {
- int LA32_35 = input.LA(2);
-
- if ( (LA32_35=='q') ) {
- int LA32_100 = input.LA(3);
-
- if ( (LA32_100=='.'||(LA32_100>='0' && LA32_100<='9')||(LA32_100>='A' && LA32_100<='Z')||LA32_100=='_'||(LA32_100>='a' && LA32_100<='z')) ) {
- alt32=47;
- }
- else {
- alt32=27;}
- }
- else {
- alt32=47;}
- }
- break;
- case '>':
- {
- int LA32_36 = input.LA(2);
-
- if ( (LA32_36=='=') ) {
- alt32=31;
- }
- else {
- alt32=29;}
- }
- break;
- case 'G':
- {
- int LA32_37 = input.LA(2);
-
- if ( (LA32_37=='T') ) {
- int LA32_103 = input.LA(3);
-
- if ( (LA32_103=='.'||(LA32_103>='0' && LA32_103<='9')||(LA32_103>='A' && LA32_103<='Z')||LA32_103=='_'||(LA32_103>='a' && LA32_103<='z')) ) {
- alt32=47;
- }
- else {
- alt32=29;}
- }
- else {
- alt32=47;}
- }
- break;
- case 'g':
- {
- switch ( input.LA(2) ) {
- case 't':
- {
- int LA32_104 = input.LA(3);
-
- if ( (LA32_104=='.'||(LA32_104>='0' && LA32_104<='9')||(LA32_104>='A' && LA32_104<='Z')||LA32_104=='_'||(LA32_104>='a' && LA32_104<='z')) ) {
- alt32=47;
- }
- else {
- alt32=29;}
- }
- break;
- case 'e':
- {
- int LA32_105 = input.LA(3);
-
- if ( (LA32_105=='q') ) {
- int LA32_145 = input.LA(4);
-
- if ( (LA32_145=='.'||(LA32_145>='0' && LA32_145<='9')||(LA32_145>='A' && LA32_145<='Z')||LA32_145=='_'||(LA32_145>='a' && LA32_145<='z')) ) {
- alt32=47;
- }
- else {
- alt32=31;}
- }
- else {
- alt32=47;}
- }
- break;
- default:
- alt32=47;}
-
- }
- break;
- case 'l':
- {
- switch ( input.LA(2) ) {
- case 't':
- {
- int LA32_106 = input.LA(3);
-
- if ( (LA32_106=='.'||(LA32_106>='0' && LA32_106<='9')||(LA32_106>='A' && LA32_106<='Z')||LA32_106=='_'||(LA32_106>='a' && LA32_106<='z')) ) {
- alt32=47;
- }
- else {
- alt32=30;}
- }
- break;
- case 'e':
- {
- int LA32_107 = input.LA(3);
-
- if ( (LA32_107=='q') ) {
- int LA32_146 = input.LA(4);
-
- if ( (LA32_146=='.'||(LA32_146>='0' && LA32_146<='9')||(LA32_146>='A' && LA32_146<='Z')||LA32_146=='_'||(LA32_146>='a' && LA32_146<='z')) ) {
- alt32=47;
- }
- else {
- alt32=32;}
- }
- else {
- alt32=47;}
- }
- break;
- default:
- alt32=47;}
-
- }
- break;
- case '^':
- {
- alt32=35;
- }
- break;
- case '~':
- {
- alt32=36;
- }
- break;
- case '*':
- {
- alt32=37;
- }
- break;
- case '/':
- {
- alt32=38;
- }
- break;
- case 'd':
- {
- int LA32_44 = input.LA(2);
-
- if ( (LA32_44=='i') ) {
- int LA32_108 = input.LA(3);
-
- if ( (LA32_108=='v') ) {
- int LA32_147 = input.LA(4);
-
- if ( (LA32_147=='i') ) {
- int LA32_171 = input.LA(5);
-
- if ( (LA32_171=='d') ) {
- int LA32_193 = input.LA(6);
-
- if ( (LA32_193=='e') ) {
- int LA32_204 = input.LA(7);
-
- if ( (LA32_204=='.'||(LA32_204>='0' && LA32_204<='9')||(LA32_204>='A' && LA32_204<='Z')||LA32_204=='_'||(LA32_204>='a' && LA32_204<='z')) ) {
- alt32=47;
- }
- else {
- alt32=38;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- break;
- case '-':
- {
- int LA32_45 = input.LA(2);
-
- if ( ((LA32_45>='0' && LA32_45<='9')) ) {
- alt32=1;
- }
- else {
- alt32=40;}
- }
- break;
- case 'P':
- {
- int LA32_46 = input.LA(2);
-
- if ( (LA32_46=='L') ) {
- int LA32_110 = input.LA(3);
-
- if ( (LA32_110=='U') ) {
- int LA32_148 = input.LA(4);
-
- if ( (LA32_148=='S') ) {
- int LA32_172 = input.LA(5);
-
- if ( (LA32_172=='.'||(LA32_172>='0' && LA32_172<='9')||(LA32_172>='A' && LA32_172<='Z')||LA32_172=='_'||(LA32_172>='a' && LA32_172<='z')) ) {
- alt32=47;
- }
- else {
- alt32=39;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- break;
- case 'p':
- {
- int LA32_47 = input.LA(2);
-
- if ( (LA32_47=='l') ) {
- int LA32_111 = input.LA(3);
-
- if ( (LA32_111=='u') ) {
- int LA32_149 = input.LA(4);
-
- if ( (LA32_149=='s') ) {
- int LA32_173 = input.LA(5);
-
- if ( (LA32_173=='.'||(LA32_173>='0' && LA32_173<='9')||(LA32_173>='A' && LA32_173<='Z')||LA32_173=='_'||(LA32_173>='a' && LA32_173<='z')) ) {
- alt32=47;
- }
- else {
- alt32=39;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- break;
- case 'm':
- {
- switch ( input.LA(2) ) {
- case 'o':
- {
- int LA32_112 = input.LA(3);
-
- if ( (LA32_112=='d') ) {
- int LA32_150 = input.LA(4);
-
- if ( (LA32_150=='.'||(LA32_150>='0' && LA32_150<='9')||(LA32_150>='A' && LA32_150<='Z')||LA32_150=='_'||(LA32_150>='a' && LA32_150<='z')) ) {
- alt32=47;
- }
- else {
- alt32=41;}
- }
- else {
- alt32=47;}
- }
- break;
- case 'i':
- {
- int LA32_113 = input.LA(3);
-
- if ( (LA32_113=='n') ) {
- int LA32_151 = input.LA(4);
-
- if ( (LA32_151=='u') ) {
- int LA32_174 = input.LA(5);
-
- if ( (LA32_174=='s') ) {
- int LA32_194 = input.LA(6);
-
- if ( (LA32_194=='.'||(LA32_194>='0' && LA32_194<='9')||(LA32_194>='A' && LA32_194<='Z')||LA32_194=='_'||(LA32_194>='a' && LA32_194<='z')) ) {
- alt32=47;
- }
- else {
- alt32=40;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- else {
- alt32=47;}
- }
- break;
- default:
- alt32=47;}
-
- }
- break;
- case '%':
- {
- alt32=41;
- }
- break;
- case '?':
- {
- alt32=42;
- }
- break;
- case ':':
- {
- alt32=43;
- }
- break;
- case '\'':
- {
- int LA32_52 = input.LA(2);
-
- if ( (LA32_52=='\t'||LA32_52=='\r'||(LA32_52>=' ' && LA32_52<='~')) ) {
- alt32=47;
- }
- else {
- alt32=44;}
- }
- break;
- case '\"':
- {
- int LA32_53 = input.LA(2);
-
- if ( (LA32_53=='\t'||LA32_53=='\r'||(LA32_53>=' ' && LA32_53<='~')) ) {
- alt32=46;
- }
- else {
- alt32=45;}
- }
- break;
- case 'H':
- case 'J':
- case 'K':
- case 'Q':
- case 'S':
- case 'U':
- case 'V':
- case 'W':
- case 'X':
- case 'Y':
- case 'Z':
- case '_':
- case 'b':
- case 'c':
- case 'h':
- case 'i':
- case 'j':
- case 'k':
- case 'q':
- case 's':
- case 'u':
- case 'v':
- case 'w':
- case 'x':
- case 'y':
- case 'z':
- {
- alt32=47;
- }
- break;
- case '$':
- {
- alt32=48;
- }
- break;
- case '\t':
- case '\n':
- case '\r':
- case ' ':
- {
- alt32=49;
- }
- break;
- default:
- NoViableAltException nvae =
- new NoViableAltException("1:1: Tokens : ( NUMBER | BIND | IF | DO | RULE | CLASS | METHOD | LINE | ENDRULE | NOTHING | TRUE | FALSE | RETURN | THROW | LPAREN | RPAREN | LSQUARE | RSQUARE | LBRACE | RBRACE | SEPR | DOT | ASSIGN | OR | AND | NOT | EQ | NEQ | GT | LT | GEQ | LEQ | BOR | BAND | BXOR | TWIDDLE | MUL | DIV | PLUS | MINUS | MOD | TERN_IF | COLON | QUOTE | DQUOTE | STRING | SYMBOL | DOLLARSYM | WS );", 32, 0, input);
-
- throw nvae;
- }
-
- switch (alt32) {
- case 1 :
- // dd/grammar/ECAToken.g:1:10: NUMBER
- {
- mNUMBER();
-
- }
- break;
- case 2 :
- // dd/grammar/ECAToken.g:1:17: BIND
- {
- mBIND();
-
- }
- break;
- case 3 :
- // dd/grammar/ECAToken.g:1:22: IF
- {
- mIF();
-
- }
- break;
- case 4 :
- // dd/grammar/ECAToken.g:1:25: DO
- {
- mDO();
-
- }
- break;
- case 5 :
- // dd/grammar/ECAToken.g:1:28: RULE
- {
- mRULE();
-
- }
- break;
- case 6 :
- // dd/grammar/ECAToken.g:1:33: CLASS
- {
- mCLASS();
-
- }
- break;
- case 7 :
- // dd/grammar/ECAToken.g:1:39: METHOD
- {
- mMETHOD();
-
- }
- break;
- case 8 :
- // dd/grammar/ECAToken.g:1:46: LINE
- {
- mLINE();
-
- }
- break;
- case 9 :
- // dd/grammar/ECAToken.g:1:51: ENDRULE
- {
- mENDRULE();
-
- }
- break;
- case 10 :
- // dd/grammar/ECAToken.g:1:59: NOTHING
- {
- mNOTHING();
-
- }
- break;
- case 11 :
- // dd/grammar/ECAToken.g:1:67: TRUE
- {
- mTRUE();
-
- }
- break;
- case 12 :
- // dd/grammar/ECAToken.g:1:72: FALSE
- {
- mFALSE();
-
- }
- break;
- case 13 :
- // dd/grammar/ECAToken.g:1:78: RETURN
- {
- mRETURN();
-
- }
- break;
- case 14 :
- // dd/grammar/ECAToken.g:1:85: THROW
- {
- mTHROW();
-
- }
- break;
- case 15 :
- // dd/grammar/ECAToken.g:1:91: LPAREN
- {
- mLPAREN();
-
- }
- break;
- case 16 :
- // dd/grammar/ECAToken.g:1:98: RPAREN
- {
- mRPAREN();
-
- }
- break;
- case 17 :
- // dd/grammar/ECAToken.g:1:105: LSQUARE
- {
- mLSQUARE();
-
- }
- break;
- case 18 :
- // dd/grammar/ECAToken.g:1:113: RSQUARE
- {
- mRSQUARE();
-
- }
- break;
- case 19 :
- // dd/grammar/ECAToken.g:1:121: LBRACE
- {
- mLBRACE();
-
- }
- break;
- case 20 :
- // dd/grammar/ECAToken.g:1:128: RBRACE
- {
- mRBRACE();
-
- }
- break;
- case 21 :
- // dd/grammar/ECAToken.g:1:135: SEPR
- {
- mSEPR();
-
- }
- break;
- case 22 :
- // dd/grammar/ECAToken.g:1:140: DOT
- {
- mDOT();
-
- }
- break;
- case 23 :
- // dd/grammar/ECAToken.g:1:144: ASSIGN
- {
- mASSIGN();
-
- }
- break;
- case 24 :
- // dd/grammar/ECAToken.g:1:151: OR
- {
- mOR();
-
- }
- break;
- case 25 :
- // dd/grammar/ECAToken.g:1:154: AND
- {
- mAND();
-
- }
- break;
- case 26 :
- // dd/grammar/ECAToken.g:1:158: NOT
- {
- mNOT();
-
- }
- break;
- case 27 :
- // dd/grammar/ECAToken.g:1:162: EQ
- {
- mEQ();
-
- }
- break;
- case 28 :
- // dd/grammar/ECAToken.g:1:165: NEQ
- {
- mNEQ();
-
- }
- break;
- case 29 :
- // dd/grammar/ECAToken.g:1:169: GT
- {
- mGT();
-
- }
- break;
- case 30 :
- // dd/grammar/ECAToken.g:1:172: LT
- {
- mLT();
-
- }
- break;
- case 31 :
- // dd/grammar/ECAToken.g:1:175: GEQ
- {
- mGEQ();
-
- }
- break;
- case 32 :
- // dd/grammar/ECAToken.g:1:179: LEQ
- {
- mLEQ();
-
- }
- break;
- case 33 :
- // dd/grammar/ECAToken.g:1:183: BOR
- {
- mBOR();
-
- }
- break;
- case 34 :
- // dd/grammar/ECAToken.g:1:187: BAND
- {
- mBAND();
-
- }
- break;
- case 35 :
- // dd/grammar/ECAToken.g:1:192: BXOR
- {
- mBXOR();
-
- }
- break;
- case 36 :
- // dd/grammar/ECAToken.g:1:197: TWIDDLE
- {
- mTWIDDLE();
-
- }
- break;
- case 37 :
- // dd/grammar/ECAToken.g:1:205: MUL
- {
- mMUL();
-
- }
- break;
- case 38 :
- // dd/grammar/ECAToken.g:1:209: DIV
- {
- mDIV();
-
- }
- break;
- case 39 :
- // dd/grammar/ECAToken.g:1:213: PLUS
- {
- mPLUS();
-
- }
- break;
- case 40 :
- // dd/grammar/ECAToken.g:1:218: MINUS
- {
- mMINUS();
-
- }
- break;
- case 41 :
- // dd/grammar/ECAToken.g:1:224: MOD
- {
- mMOD();
-
- }
- break;
- case 42 :
- // dd/grammar/ECAToken.g:1:228: TERN_IF
- {
- mTERN_IF();
-
- }
- break;
- case 43 :
- // dd/grammar/ECAToken.g:1:236: COLON
- {
- mCOLON();
-
- }
- break;
- case 44 :
- // dd/grammar/ECAToken.g:1:242: QUOTE
- {
- mQUOTE();
-
- }
- break;
- case 45 :
- // dd/grammar/ECAToken.g:1:248: DQUOTE
- {
- mDQUOTE();
-
- }
- break;
- case 46 :
- // dd/grammar/ECAToken.g:1:255: STRING
- {
- mSTRING();
-
- }
- break;
- case 47 :
- // dd/grammar/ECAToken.g:1:262: SYMBOL
- {
- mSYMBOL();
-
- }
- break;
- case 48 :
- // dd/grammar/ECAToken.g:1:269: DOLLARSYM
- {
- mDOLLARSYM();
-
- }
- break;
- case 49 :
- // dd/grammar/ECAToken.g:1:279: WS
- {
- mWS();
-
- }
- break;
-
- }
-
- }
-
-
- protected DFA6 dfa6 = new DFA6(this);
- protected DFA29 dfa29 = new DFA29(this);
- static final String DFA6_eotS =
- "\2\uffff\2\4\2\uffff\1\4";
- static final String DFA6_eofS =
- "\7\uffff";
- static final String DFA6_minS =
- "\1\53\1\60\2\56\2\uffff\1\56";
- static final String DFA6_maxS =
- "\2\71\1\56\1\71\2\uffff\1\71";
- static final String DFA6_acceptS =
- "\4\uffff\1\1\1\2\1\uffff";
- static final String DFA6_specialS =
- "\7\uffff}>";
- static final String[] DFA6_transitionS = {
- "\1\1\1\uffff\1\1\2\uffff\1\2\11\3",
- "\1\2\11\3",
- "\1\5",
- "\1\5\1\uffff\12\6",
- "",
- "",
- "\1\5\1\uffff\12\6"
- };
-
- static final short[] DFA6_eot = DFA.unpackEncodedString(DFA6_eotS);
- static final short[] DFA6_eof = DFA.unpackEncodedString(DFA6_eofS);
- static final char[] DFA6_min = DFA.unpackEncodedStringToUnsignedChars(DFA6_minS);
- static final char[] DFA6_max = DFA.unpackEncodedStringToUnsignedChars(DFA6_maxS);
- static final short[] DFA6_accept = DFA.unpackEncodedString(DFA6_acceptS);
- static final short[] DFA6_special = DFA.unpackEncodedString(DFA6_specialS);
- static final short[][] DFA6_transition;
-
- static {
- int numStates = DFA6_transitionS.length;
- DFA6_transition = new short[numStates][];
- for (int i=0; i<numStates; i++) {
- DFA6_transition[i] = DFA.unpackEncodedString(DFA6_transitionS[i]);
- }
- }
-
- class DFA6 extends DFA {
-
- public DFA6(BaseRecognizer recognizer) {
- this.recognizer = recognizer;
- this.decisionNumber = 6;
- this.eot = DFA6_eot;
- this.eof = DFA6_eof;
- this.min = DFA6_min;
- this.max = DFA6_max;
- this.accept = DFA6_accept;
- this.special = DFA6_special;
- this.transition = DFA6_transition;
- }
- public String getDescription() {
- return "64:1: NUMBER : ( INTEGER | FLOAT );";
- }
- }
- static final String DFA29_eotS =
- "\1\uffff\2\3\2\uffff";
- static final String DFA29_eofS =
- "\5\uffff";
- static final String DFA29_minS =
- "\1\101\2\56\2\uffff";
- static final String DFA29_maxS =
- "\3\172\2\uffff";
- static final String DFA29_acceptS =
- "\3\uffff\1\2\1\1";
- static final String DFA29_specialS =
- "\5\uffff}>";
- static final String[] DFA29_transitionS = {
- "\32\1\4\uffff\1\1\1\uffff\32\1",
- "\1\4\1\uffff\12\2\7\uffff\32\2\4\uffff\1\2\1\uffff\32\2",
- "\1\4\1\uffff\12\2\7\uffff\32\2\4\uffff\1\2\1\uffff\32\2",
- "",
- ""
- };
-
- static final short[] DFA29_eot = DFA.unpackEncodedString(DFA29_eotS);
- static final short[] DFA29_eof = DFA.unpackEncodedString(DFA29_eofS);
- static final char[] DFA29_min = DFA.unpackEncodedStringToUnsignedChars(DFA29_minS);
- static final char[] DFA29_max = DFA.unpackEncodedStringToUnsignedChars(DFA29_maxS);
- static final short[] DFA29_accept = DFA.unpackEncodedString(DFA29_acceptS);
- static final short[] DFA29_special = DFA.unpackEncodedString(DFA29_specialS);
- static final short[][] DFA29_transition;
-
- static {
- int numStates = DFA29_transitionS.length;
- DFA29_transition = new short[numStates][];
- for (int i=0; i<numStates; i++) {
- DFA29_transition[i] = DFA.unpackEncodedString(DFA29_transitionS[i]);
- }
- }
-
- class DFA29 extends DFA {
-
- public DFA29(BaseRecognizer recognizer) {
- this.recognizer = recognizer;
- this.decisionNumber = 29;
- this.eot = DFA29_eot;
- this.eof = DFA29_eof;
- this.min = DFA29_min;
- this.max = DFA29_max;
- this.accept = DFA29_accept;
- this.special = DFA29_special;
- this.transition = DFA29_transition;
- }
- public String getDescription() {
- return "282:1: fragment DOTSYM : ( BARESYM DOT DOTSYM | BARESYM );";
- }
- }
-
-
-}
\ No newline at end of file
+}
Added: labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/grammar/ParseNode.java
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/grammar/ParseNode.java (rev 0)
+++ labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/grammar/ParseNode.java 2008-10-16 07:28:17 UTC (rev 23471)
@@ -0,0 +1,530 @@
+package org.jboss.jbossts.orchestration.rule.grammar;
+
+/**
+ * Class used by the JavaCUP parser to construct a parse tree.
+ */
+public abstract class ParseNode
+{
+ /*
+ * tags for different types of parse nodes
+ */
+ public final static int ARRAY = 0;
+ public final static int ASSIGN = 1;
+ public final static int BIND = 2;
+ public final static int BINOP = 3;
+ public final static int BOOLEAN_LITERAL = 4;
+ public final static int COMMA = 5;
+ public final static int COLON = 6;
+ public final static int FIELD = 7;
+ public final static int FLOAT_LITERAL = 8;
+ public final static int IDENTIFIER = 9;
+ public final static int INTEGER_LITERAL = 10;
+ public final static int METH = 11;
+ public final static int NOTHING = 12;
+ public final static int PATH = 13;
+ public final static int RETURN = 14;
+ public final static int SEMI = 15;
+ public final static int STRING_LITERAL = 16;
+ public final static int TERNOP = 17;
+ public final static int THROW = 18;
+ public final static int UNOP = 19;
+ /* tags for operators */
+ public final static int AND = 30;
+ public final static int BAND = 31;
+ public final static int BOR = 32;
+ public final static int BXOR = 33;
+ public final static int DIV = 34;
+ public final static int DOLLAR = 35;
+ public final static int EQ = 36;
+ public final static int GE = 37;
+ public final static int GT = 38;
+ public final static int LE = 39;
+ public final static int LT = 40;
+ public final static int MINUS = 41;
+ public final static int MOD = 42;
+ public final static int MUL = 43;
+ public final static int NE = 44;
+ public final static int NOT = 45;
+ public final static int OR = 46;
+ public final static int PLUS = 47;
+ public final static int TWIDDLE = 48;
+ public final static int UMINUS = 49;
+ public final static int COND = 50;
+
+ /**
+ * the type tag for this node
+ */
+ private int tag;
+
+ /**
+ * the line position fo rthis node
+ */
+
+ private int line;
+
+ /**
+ * the column position for this node
+ */
+ private int column;
+
+ /**
+ * generic constructor
+ * @param tag identifies the type of this node
+ * @param line identifies the start line for this node's text
+ * @param column identifies the start columen for this node's text
+ */
+ protected ParseNode(int tag, int line, int column)
+ {
+ this.tag = tag;
+ this.line = line;
+ this.column = column;
+ }
+
+ /**
+ * get the tag for this node
+ * @return the tag for this node
+ */
+
+ public int getTag() {
+ return tag;
+ }
+
+ /**
+ * get the line position for this node
+ * @return the line position for this node
+ */
+ public int getLine() {
+ return line;
+ }
+
+ /**
+ * get the column position for this node
+ * @return the column position for this node
+ */
+ public int getColumn() {
+ return column;
+ }
+
+ /**
+ * get the child count for this node
+ * @return the child count for this node
+ */
+ public abstract int getChildCount();
+
+ /**
+ * get the nth child for this node or null if the index exceeds the child count
+ * @return the nth child for this node
+ */
+ public abstract Object getChild(int idx);
+
+ /**
+ * get the display representation of this node
+ * @return the display representation of this node
+ */
+ public abstract String getText();
+
+ /**
+ * get a string representing the position for this node
+ * @return a string representing the position for this node
+ */
+ public String getPos() {
+ return " @ " + line + "." + column;
+ }
+
+ /**
+ * create a simple node for a builtin token
+ * @param tag identifies the type of this node
+ * @param line identifies the start line for this node's text
+ * @param column identifies the start columen for this node's text
+ * @return a simple node for a builtin token
+ */
+ public static ParseNode node(int tag, int line, int column)
+ {
+ return new NullaryNode(tag, line, column);
+ }
+
+ /**
+ * create a simple node for a builtin token
+ * @param tag identifies the type of this node
+ * @param line identifies the start line for this node's text
+ * @param column identifies the start columen for this node's text
+ * @return a simple node for a builtin token
+ */
+ public static ParseNode node(int tag, int line, int column, Object child0)
+ {
+ return new UnaryNode(tag, line, column, child0);
+ }
+
+ public static ParseNode node(int tag, int line, int column, Object child0, Object child1)
+ {
+ return new BinaryNode(tag, line, column, child0, child1);
+ }
+
+ public static ParseNode node(int tag, int line, int column, Object child0, Object child1, Object child2)
+ {
+ return new TernaryNode(tag, line, column, child0, child1, child2);
+ }
+
+ public static ParseNode node(int tag, int line, int column, Object child0, Object child1, Object child2, Object child3)
+ {
+ return new QuaternaryNode(tag, line, column, child0, child1, child2, child3);
+ }
+
+ /**
+ * a parse node with no children
+ */
+ private static class NullaryNode extends ParseNode
+ {
+ public NullaryNode(int tag, int line, int column)
+ {
+ super(tag, line, column);
+ }
+
+ /**
+ * get the child count for this node
+ *
+ * @return the child count for this node
+ */
+ public int getChildCount() {
+ return 0;
+ }
+
+ /**
+ * get the nth child for this node or null if the index exceeds the child count
+ *
+ * @return the nth child for this node
+ */
+ public Object getChild(int idx) {
+ return null;
+ }
+
+ /**
+ * get the display representation of this node
+ *
+ * @return athe display representation of this node
+ */
+ public String getText() {
+ int tag = getTag();
+ switch(tag) {
+ case NOTHING:
+ return "NOTHING";
+ case AND:
+ return "&&";
+ case BAND:
+ return "&";
+ case BOR:
+ return "|";
+ case BXOR:
+ return "^";
+ case DIV:
+ return "/";
+ case DOLLAR:
+ return "$";
+ case EQ:
+ return "==";
+ case GE:
+ return ">=";
+ case GT:
+ return ">";
+ case LE:
+ return "<=";
+ case LT:
+ return "<";
+ case MINUS:
+ return "-";
+ case MOD:
+ return "%";
+ case MUL:
+ return "*";
+ case NE:
+ return "!=";
+ case NOT:
+ return "!";
+ case OR:
+ return "||";
+ case PLUS:
+ return "+";
+ case TWIDDLE:
+ return "~";
+ case UMINUS:
+ return "-";
+ default:
+ System.out.println("NullaryNode.getText() : Unexpected tag " + tag);
+ return "???";
+ }
+ }
+ }
+
+
+ /**
+ * a parse node with one child
+ */
+ private static class UnaryNode extends ParseNode
+ {
+ private Object child0;
+
+ public UnaryNode(int tag, int line, int column, Object child0)
+ {
+ super(tag, line, column);
+ this.child0 = child0;
+ }
+
+ /**
+ * get the child count for this node
+ *
+ * @return the child count for this node
+ */
+ public int getChildCount() {
+ return 1;
+ }
+
+ /**
+ * get the nth child for this node or null if the index exceeds the child count
+ *
+ * @return the nth child for this node
+ */
+ public Object getChild(int idx) {
+ if (idx == 0) {
+ return child0;
+ }
+
+ return null;
+ }
+
+ /**
+ * get a string representing the display representation of this node
+ *
+ * @return a string representing the display representation of this node
+ */
+ public String getText() {
+ int tag = getTag();
+ switch(tag) {
+ case BOOLEAN_LITERAL:
+ return child0.toString();
+ case FLOAT_LITERAL:
+ return child0.toString();
+ case INTEGER_LITERAL:
+ return child0.toString();
+ case RETURN:
+ return "RETURN";
+ case STRING_LITERAL:
+ return child0.toString();
+ default:
+ System.out.println("UnaryNode.getText() : Unexpected tag " + tag);
+ return "???";
+ }
+ }
+ }
+
+ /**
+ * a parse node with two children
+ */
+ private static class BinaryNode extends ParseNode
+ {
+ private Object child0;
+ private Object child1;
+
+ public BinaryNode(int tag, int line, int column, Object child0, Object child1)
+ {
+ super(tag, line, column);
+ this.child0 = child0;
+ this.child1 = child1;
+ }
+
+ /**
+ * get the child count for this node
+ *
+ * @return the child count for this node
+ */
+ public int getChildCount() {
+ return 2;
+ }
+
+ /**
+ * get the nth child for this node or null if the index exceeds the child count
+ *
+ * @return the nth child for this node
+ */
+ public Object getChild(int idx) {
+ switch (idx) {
+ case 0:
+ return child0;
+ case 1:
+ return child1;
+ }
+
+ return null;
+ }
+
+ /**
+ * get the display representation of this node
+ *
+ * @return the display representation of this node
+ */
+ public String getText() {
+ int tag = getTag();
+ switch(tag) {
+ case ARRAY:
+ return ((ParseNode)child0).getText() + "[]";
+ case ASSIGN:
+ return "=";
+ case BIND:
+ return "BIND";
+ case COLON:
+ return ((ParseNode)child0).getText();
+ case FIELD:
+ return "." + ((ParseNode)child1).getText();
+ case IDENTIFIER:
+ {
+ String text = (String)child0;
+ // include path prefix
+ ParseNode next = (ParseNode)child1;
+ while (next != null) {
+ text = ((ParseNode)next).getText() + "." + text;
+ next = (ParseNode)next.getChild(1);
+ }
+ return text;
+ }
+ case PATH:
+ return (String)child0;
+ case SEMI:
+ return ";";
+ case THROW:
+ return "THROW";
+ case UNOP:
+ return ((ParseNode)child0).getText();
+ default:
+ System.out.println("BinaryNode.getText() : Unexpected tag " + tag);
+ return "???";
+}
+ }
+ }
+
+ /**
+ * a parse node with three children
+ */
+ private static class TernaryNode extends ParseNode
+ {
+ private Object child0;
+ private Object child1;
+ private Object child2;
+
+ public TernaryNode(int tag, int line, int column, Object child0, Object child1, Object child2)
+ {
+ super(tag, line, column);
+ this.child0 = child0;
+ this.child1 = child1;
+ this.child2 = child2;
+ }
+
+ /**
+ * get the child count for this node
+ *
+ * @return the child count for this node
+ */
+ public int getChildCount() {
+ return 3;
+ }
+
+ /**
+ * get the nth child for this node or null if the index exceeds the child count
+ *
+ * @return the nth child for this node
+ */
+ public Object getChild(int idx) {
+ switch (idx) {
+ case 0:
+ return child0;
+ case 1:
+ return child1;
+ case 2:
+ return child2;
+ }
+
+ return null;
+ }
+
+ /**
+ * get the display representation of this node
+ *
+ * @return the display representation of this node
+ */
+ public String getText() {
+ int tag = getTag();
+ switch(tag) {
+ case BINOP:
+ return ((ParseNode)child0).getText();
+ case METH:
+ return ((ParseNode)child0).getText();
+ case TERNOP:
+ return "?";
+ default:
+ System.out.println("TernaryNode.getText() : Unexpected tag " + tag);
+ return "???";
+ }
+ }
+ }
+
+ /**
+ * a parse node with four children
+ */
+ private static class QuaternaryNode extends ParseNode
+ {
+ private Object child0;
+ private Object child1;
+ private Object child2;
+ private Object child3;
+
+ public QuaternaryNode(int tag, int line, int column, Object child0, Object child1, Object child2, Object child3)
+ {
+ super(tag, line, column);
+ this.child0 = child0;
+ this.child1 = child1;
+ this.child2 = child2;
+ this.child3 = child3;
+ }
+
+ /**
+ * get the child count for this node
+ *
+ * @return the child count for this node
+ */
+ public int getChildCount() {
+ return 2;
+ }
+
+ /**
+ * get the nth child for this node or null if the index exceeds the child count
+ *
+ * @return the nth child for this node
+ */
+ public Object getChild(int idx) {
+ switch (idx) {
+ case 0:
+ return child0;
+ case 1:
+ return child1;
+ case 2:
+ return child2;
+ case 3:
+ return child3;
+ }
+
+ return null;
+ }
+
+ /**
+ * get the display representation of this node
+ *
+ * @return the display representation of this node
+ */
+ public String getText() {
+ int tag = getTag();
+ switch(tag) {
+ default:
+ System.out.println("QuaternaryNode.getText() : Unexpected tag " + tag);
+ return "???";
+ }
+ }
+ }
+}
Added: labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/grammar/sym.java
===================================================================
--- labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/grammar/sym.java (rev 0)
+++ labs/jbosstm/workspace/adinn/orchestration/src/org/jboss/jbossts/orchestration/rule/grammar/sym.java 2008-10-16 07:28:17 UTC (rev 23471)
@@ -0,0 +1,85 @@
+
+//----------------------------------------------------
+// The following code was generated by CUP v0.10k
+// Thu Oct 16 08:21:59 BST 2008
+//----------------------------------------------------
+
+package org.jboss.jbossts.orchestration.rule.grammar;
+
+/** CUP generated class containing symbol constants. */
+public class sym {
+ /* terminals */
+ public static final int STRING_LITERAL = 41;
+ public static final int GE = 24;
+ public static final int UMINUS = 36;
+ public static final int LPAREN = 8;
+ public static final int SEMI = 12;
+ public static final int MINUS = 32;
+ public static final int BXOR = 28;
+ public static final int RPAREN = 9;
+ public static final int BOOLEAN_LITERAL = 40;
+ public static final int NOT = 34;
+ public static final int AND = 19;
+ public static final int LT = 20;
+ public static final int OR = 18;
+ public static final int COMMA = 13;
+ public static final int THROW = 7;
+ public static final int BAND = 27;
+ public static final int DIV = 30;
+ public static final int PLUS = 31;
+ public static final int ASSIGN = 15;
+ public static final int IF = 3;
+ public static final int DOT = 14;
+ public static final int LE = 21;
+ public static final int BIND = 2;
+ public static final int EOF = 0;
+ public static final int RETURN = 6;
+ public static final int error = 1;
+ public static final int MUL = 29;
+ public static final int MOD = 33;
+ public static final int TWIDDLE = 35;
+ public static final int EQ = 22;
+ public static final int COLON = 17;
+ public static final int BOR = 26;
+ public static final int LSQUARE = 10;
+ public static final int RSQUARE = 11;
+ public static final int DOLLAR = 37;
+ public static final int NE = 23;
+ public static final int TERN_IF = 16;
+ public static final int NOTHING = 5;
+ public static final int FLOAT_LITERAL = 38;
+ public static final int GT = 25;
+ public static final int DO = 4;
+ public static final int IDENTIFIER = 42;
+ public static final int INTEGER_LITERAL = 39;
+
+ /* non terminals */
+ static final int action_expr = 10;
+ static final int array_idx_list = 22;
+ static final int expr = 12;
+ static final int field_expr = 17;
+ static final int simple_name = 25;
+ static final int $START = 0;
+ static final int simple_expr = 21;
+ static final int actions = 8;
+ static final int bind_sym = 6;
+ static final int eca = 2;
+ static final int action_expr_list = 9;
+ static final int binary_oper_expr = 14;
+ static final int expr_field_expr = 18;
+ static final int path = 26;
+ static final int ternary_oper_expr = 13;
+ static final int binding = 5;
+ static final int expr_meth_expr = 20;
+ static final int expr_list = 11;
+ static final int event = 3;
+ static final int condition = 7;
+ static final int eca_rule = 1;
+ static final int array_expr = 16;
+ static final int unary_oper_expr = 15;
+ static final int meth_expr = 19;
+ static final int array_idx = 23;
+ static final int bindings = 4;
+ static final int name = 24;
+}
+
More information about the jboss-svn-commits
mailing list