[12 - Tree Grammar] Add AssignCount grammar and adjust ANTLR build config

This commit is contained in:
2020-06-12 16:06:34 +02:00
parent a9d5c76b78
commit 448d7ac32a
7 changed files with 1416 additions and 135 deletions

2
.idea/modules.xml generated
View File

@@ -2,8 +2,10 @@
<project version="4"> <project version="4">
<component name="ProjectModuleManager"> <component name="ProjectModuleManager">
<modules> <modules>
<module fileurl="file://$PROJECT_DIR$/CC-Praxis-Antlr Baumgrammatiken/CC-Praxis-Antlr Baumgrammatiken.iml" filepath="$PROJECT_DIR$/CC-Praxis-Antlr Baumgrammatiken/CC-Praxis-Antlr Baumgrammatiken.iml" />
<module fileurl="file://$PROJECT_DIR$/CC-Praxis-Antlr Baumgrammatiken-Leer/CC-Praxis-Antlr Baumgrammatiken-Leer.iml" filepath="$PROJECT_DIR$/CC-Praxis-Antlr Baumgrammatiken-Leer/CC-Praxis-Antlr Baumgrammatiken-Leer.iml" /> <module fileurl="file://$PROJECT_DIR$/CC-Praxis-Antlr Baumgrammatiken-Leer/CC-Praxis-Antlr Baumgrammatiken-Leer.iml" filepath="$PROJECT_DIR$/CC-Praxis-Antlr Baumgrammatiken-Leer/CC-Praxis-Antlr Baumgrammatiken-Leer.iml" />
<module fileurl="file://$PROJECT_DIR$/CC-Praxis-Antlr Parser fuer X-Leer/CC-Praxis-Antlr Parser fuer X-Leer.iml" filepath="$PROJECT_DIR$/CC-Praxis-Antlr Parser fuer X-Leer/CC-Praxis-Antlr Parser fuer X-Leer.iml" /> <module fileurl="file://$PROJECT_DIR$/CC-Praxis-Antlr Parser fuer X-Leer/CC-Praxis-Antlr Parser fuer X-Leer.iml" filepath="$PROJECT_DIR$/CC-Praxis-Antlr Parser fuer X-Leer/CC-Praxis-Antlr Parser fuer X-Leer.iml" />
<module fileurl="file://$PROJECT_DIR$/CC-Praxis-Antlr X Uebersetzer-Leer/CC-Praxis-Antlr X Uebersetzer-Leer.iml" filepath="$PROJECT_DIR$/CC-Praxis-Antlr X Uebersetzer-Leer/CC-Praxis-Antlr X Uebersetzer-Leer.iml" />
<module fileurl="file://$PROJECT_DIR$/ÜB-Praxis-JFlex Scanner für AS-Leer/ÜB-Praxis-JFlex Scanner für AS-Leer.iml" filepath="$PROJECT_DIR$/ÜB-Praxis-JFlex Scanner für AS-Leer/ÜB-Praxis-JFlex Scanner für AS-Leer.iml" /> <module fileurl="file://$PROJECT_DIR$/ÜB-Praxis-JFlex Scanner für AS-Leer/ÜB-Praxis-JFlex Scanner für AS-Leer.iml" filepath="$PROJECT_DIR$/ÜB-Praxis-JFlex Scanner für AS-Leer/ÜB-Praxis-JFlex Scanner für AS-Leer.iml" />
</modules> </modules>
</component> </component>

View File

@@ -2,7 +2,7 @@
<configuration default="false" name="Run Antlr Builder" type="Application" factoryName="Application"> <configuration default="false" name="Run Antlr Builder" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" value="org.antlr.Tool" /> <option name="MAIN_CLASS_NAME" value="org.antlr.Tool" />
<module name="CC-Praxis-Antlr Parser fuer X-Leer" /> <module name="CC-Praxis-Antlr Parser fuer X-Leer" />
<option name="PROGRAM_PARAMETERS" value="-o &quot;$ModuleSourcePath$/de/dhbw/compiler/antlrxparser/&quot; &quot;$ModuleSourcePath$/de/dhbw/compiler/antlrxparser/X.g&quot;" /> <option name="PROGRAM_PARAMETERS" value="-o &quot;$FileDir$&quot; &quot;$FilePath$&quot;" />
<option name="WORKING_DIRECTORY" value="$ContentRoot$" /> <option name="WORKING_DIRECTORY" value="$ContentRoot$" />
<method v="2" /> <method v="2" />
</configuration> </configuration>

212
.idea/workspace.xml generated
View File

@@ -1,18 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="a11aa5c4-505d-4bfb-9e81-72367c118bbe" name="Default Changelist" comment="" />
<list default="true" id="a11aa5c4-505d-4bfb-9e81-72367c118bbe" name="Default Changelist" comment=""> <list default="true" id="a11aa5c4-505d-4bfb-9e81-72367c118bbe" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/modules.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/modules.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/runConfigurations/Run_Antlr_builder.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/runConfigurations/Run_Antlr_builder.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/CC-Praxis-Antlr Parser fuer X-Leer/X.tokens" beforeDir="false" afterPath="$PROJECT_DIR$/CC-Praxis-Antlr Parser fuer X-Leer/X.tokens" afterDir="false" /> <change beforePath="$PROJECT_DIR$/CC-Praxis-Antlr Baumgrammatiken-Leer/src/de/dhbw/compiler/antlrxtreegrammar/AntlrXTreeGrammarMain.java" beforeDir="false" afterPath="$PROJECT_DIR$/CC-Praxis-Antlr Baumgrammatiken-Leer/src/de/dhbw/compiler/antlrxtreegrammar/AntlrXTreeGrammarMain.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/CC-Praxis-Antlr Parser fuer X-Leer/src/de/dhbw/compiler/antlrxparser/X.g" beforeDir="false" afterPath="$PROJECT_DIR$/CC-Praxis-Antlr Parser fuer X-Leer/src/de/dhbw/compiler/antlrxparser/X.g" afterDir="false" /> <change beforePath="$PROJECT_DIR$/CC-Praxis-Antlr Baumgrammatiken-Leer/src/de/dhbw/compiler/antlrxtreegrammar/AssignCount.g" beforeDir="false" afterPath="$PROJECT_DIR$/CC-Praxis-Antlr Baumgrammatiken-Leer/src/de/dhbw/compiler/antlrxtreegrammar/AssignCount.g" afterDir="false" />
<change beforePath="$PROJECT_DIR$/CC-Praxis-Antlr Parser fuer X-Leer/src/de/dhbw/compiler/antlrxparser/XLexer.java" beforeDir="false" afterPath="$PROJECT_DIR$/CC-Praxis-Antlr Parser fuer X-Leer/src/de/dhbw/compiler/antlrxparser/XLexer.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/CC-Praxis-Antlr Baumgrammatiken-Leer/src/de/dhbw/compiler/antlrxtreegrammar/AssignCount.java" beforeDir="false" afterPath="$PROJECT_DIR$/CC-Praxis-Antlr Baumgrammatiken-Leer/src/de/dhbw/compiler/antlrxtreegrammar/AssignCount.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/CC-Praxis-Antlr Parser fuer X-Leer/src/de/dhbw/compiler/antlrxparser/XParser.java" beforeDir="false" afterPath="$PROJECT_DIR$/CC-Praxis-Antlr Parser fuer X-Leer/src/de/dhbw/compiler/antlrxparser/XParser.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/CC-Praxis-Antlr Baumgrammatiken-Leer/src/de/dhbw/compiler/antlrxtreegrammar/AssignCount.tokens" beforeDir="false" afterPath="$PROJECT_DIR$/CC-Praxis-Antlr Baumgrammatiken-Leer/src/de/dhbw/compiler/antlrxtreegrammar/AssignCount.tokens" afterDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/CC-Praxis-Antlr Parser fuer X-Leer/de/dhbw/compiler/antlrxparser/X.g" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/CC-Praxis-Antlr Parser fuer X-Leer/de/dhbw/compiler/antlrxparser/X.g" afterDir="false" /> <change beforePath="$PROJECT_DIR$/CC-Praxis-Antlr Baumgrammatiken-Leer/src/de/dhbw/compiler/antlrxtreegrammar/XLexer.java" beforeDir="false" afterPath="$PROJECT_DIR$/CC-Praxis-Antlr Baumgrammatiken-Leer/src/de/dhbw/compiler/antlrxtreegrammar/XLexer.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/CC-Praxis-Antlr Parser fuer X-Leer/de/dhbw/compiler/antlrxparser/XLexer$DFA4.class" beforeDir="false" /> <change beforePath="$PROJECT_DIR$/CC-Praxis-Antlr Baumgrammatiken-Leer/src/de/dhbw/compiler/antlrxtreegrammar/XParser.java" beforeDir="false" afterPath="$PROJECT_DIR$/CC-Praxis-Antlr Baumgrammatiken-Leer/src/de/dhbw/compiler/antlrxtreegrammar/XParser.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/CC-Praxis-Antlr Parser fuer X-Leer/de/dhbw/compiler/antlrxparser/XLexer.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/CC-Praxis-Antlr Parser fuer X-Leer/de/dhbw/compiler/antlrxparser/XLexer.class" afterDir="false" /> <change beforePath="$PROJECT_DIR$/CC-Praxis-Antlr Baumgrammatiken-Leer/src/de/dhbw/compiler/antlrxtreegrammar/XTreeGrammar.g" beforeDir="false" afterPath="$PROJECT_DIR$/CC-Praxis-Antlr Baumgrammatiken-Leer/src/de/dhbw/compiler/antlrxtreegrammar/XTreeGrammar.g" afterDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/CC-Praxis-Antlr Parser fuer X-Leer/de/dhbw/compiler/antlrxparser/XParser$program_return.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/CC-Praxis-Antlr Parser fuer X-Leer/de/dhbw/compiler/antlrxparser/XParser$program_return.class" afterDir="false" /> <change beforePath="$PROJECT_DIR$/CC-Praxis-Antlr Baumgrammatiken-Leer/src/de/dhbw/compiler/antlrxtreegrammar/XTreeGrammar.java" beforeDir="false" afterPath="$PROJECT_DIR$/CC-Praxis-Antlr Baumgrammatiken-Leer/src/de/dhbw/compiler/antlrxtreegrammar/XTreeGrammar.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/CC-Praxis-Antlr Parser fuer X-Leer/de/dhbw/compiler/antlrxparser/XParser.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/CC-Praxis-Antlr Parser fuer X-Leer/de/dhbw/compiler/antlrxparser/XParser.class" afterDir="false" /> <change beforePath="$PROJECT_DIR$/CC-Praxis-Antlr Baumgrammatiken-Leer/src/de/dhbw/compiler/antlrxtreegrammar/XTreeGrammar.tokens" beforeDir="false" afterPath="$PROJECT_DIR$/CC-Praxis-Antlr Baumgrammatiken-Leer/src/de/dhbw/compiler/antlrxtreegrammar/XTreeGrammar.tokens" afterDir="false" />
<change beforePath="$PROJECT_DIR$/CC-Praxis-Antlr Baumgrammatiken-Leer/src/de/dhbw/compiler/antlrxtreegrammar/test/AssignCountTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/CC-Praxis-Antlr Baumgrammatiken-Leer/src/de/dhbw/compiler/antlrxtreegrammar/test/AssignCountTest.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/CC-Praxis-Antlr Baumgrammatiken-Leer/src/de/dhbw/compiler/antlrxtreegrammar/test/ParseTreeTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/CC-Praxis-Antlr Baumgrammatiken-Leer/src/de/dhbw/compiler/antlrxtreegrammar/test/ParseTreeTest.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/CC-Praxis-Antlr Baumgrammatiken-Leer/src/de/dhbw/compiler/antlrxtreegrammar/test/TokenStreamTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/CC-Praxis-Antlr Baumgrammatiken-Leer/src/de/dhbw/compiler/antlrxtreegrammar/test/TokenStreamTest.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/CC-Praxis-Antlr Baumgrammatiken-Leer/src/de/dhbw/compiler/antlrxtreegrammar/test/TreeGrammarTreeTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/CC-Praxis-Antlr Baumgrammatiken-Leer/src/de/dhbw/compiler/antlrxtreegrammar/test/TreeGrammarTreeTest.java" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -33,12 +38,55 @@
<property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" /> <property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
<property name="WebServerToolWindowFactoryState" value="false" /> <property name="WebServerToolWindowFactoryState" value="false" />
<property name="aspect.path.notification.shown" value="true" /> <property name="aspect.path.notification.shown" value="true" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/CC-Praxis-Antlr Baumgrammatiken-Leer" /> <property name="last_opened_file_path" value="$PROJECT_DIR$/CC-Praxis-Antlr Baumgrammatiken" />
<property name="project.structure.last.edited" value="Modules" /> <property name="project.structure.last.edited" value="Modules" />
<property name="project.structure.proportion" value="0.15429688" /> <property name="project.structure.proportion" value="0.15429688" />
<property name="project.structure.side.proportion" value="0.2" /> <property name="project.structure.side.proportion" value="0.2" />
</component> </component>
<component name="RunManager" selected="JUnit.TestAntlrXParser1"> <component name="RunManager" selected="JUnit.TestAntlrXAssignCount1">
<configuration name="AntlrXTreeGrammarMain" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="de.dhbw.compiler.antlrxtreegrammar.AntlrXTreeGrammarMain" />
<module name="CC-Praxis-Antlr Baumgrammatiken-Leer" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="de.dhbw.compiler.antlrxtreegrammar.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="TestAntlrXAssignCount" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
<module name="CC-Praxis-Antlr Baumgrammatiken-Leer" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="de.dhbw.compiler.antlrxtreegrammar.test.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<option name="PACKAGE_NAME" value="de.dhbw.compiler.antlrxtreegrammar.test" />
<option name="MAIN_CLASS_NAME" value="de.dhbw.compiler.antlrxtreegrammar.test.TestAntlrXAssignCount" />
<option name="TEST_OBJECT" value="class" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="TestAntlrXAssignCount1" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
<module name="CC-Praxis-Antlr Baumgrammatiken-Leer" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="de.dhbw.compiler.antlrxtreegrammar.test.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<option name="PACKAGE_NAME" value="de.dhbw.compiler.antlrxtreegrammar.test" />
<option name="MAIN_CLASS_NAME" value="de.dhbw.compiler.antlrxtreegrammar.test.TestAntlrXAssignCount1" />
<option name="TEST_OBJECT" value="class" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="TestAntlrXParser1" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true"> <configuration name="TestAntlrXParser1" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
<module name="CC-Praxis-Antlr Parser fuer X-Leer" /> <module name="CC-Praxis-Antlr Parser fuer X-Leer" />
<useClassPathOnly /> <useClassPathOnly />
@@ -58,22 +106,6 @@
<option name="Make" enabled="true" /> <option name="Make" enabled="true" />
</method> </method>
</configuration> </configuration>
<configuration name="TestAntlrXParser1.program00BeginEnd" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
<module name="CC-Praxis-Antlr Parser fuer X-Leer" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="de.dhbw.compiler.antlrxparser.test.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<option name="PACKAGE_NAME" value="de.dhbw.compiler.antlrxparser.test" />
<option name="MAIN_CLASS_NAME" value="de.dhbw.compiler.antlrxparser.test.TestAntlrXParser1" />
<option name="METHOD_NAME" value="program00BeginEnd" />
<option name="TEST_OBJECT" value="method" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="TestAntlrXScanner1" type="JUnit" factoryName="JUnit" nameIsGenerated="true"> <configuration name="TestAntlrXScanner1" type="JUnit" factoryName="JUnit" nameIsGenerated="true">
<module name="CC-Praxis-Antlr Parser fuer X-Leer" /> <module name="CC-Praxis-Antlr Parser fuer X-Leer" />
<useClassPathOnly /> <useClassPathOnly />
@@ -112,22 +144,6 @@
<option name="Make" enabled="true" /> <option name="Make" enabled="true" />
</method> </method>
</configuration> </configuration>
<configuration name="TestAntlrXScanner1.tokenREAD" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
<module name="CC-Praxis-Antlr Parser fuer X-Leer" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="de.dhbw.compiler.antlrxparser.test.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<option name="PACKAGE_NAME" value="de.dhbw.compiler.antlrxparser.test" />
<option name="MAIN_CLASS_NAME" value="de.dhbw.compiler.antlrxparser.test.TestAntlrXScanner1" />
<option name="METHOD_NAME" value="tokenREAD" />
<option name="TEST_OBJECT" value="method" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="TestAntlrXScanner1.tokenStringConst" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true"> <configuration name="TestAntlrXScanner1.tokenStringConst" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
<module name="CC-Praxis-Antlr Parser fuer X-Leer" /> <module name="CC-Praxis-Antlr Parser fuer X-Leer" />
<extension name="coverage"> <extension name="coverage">
@@ -146,26 +162,21 @@
</configuration> </configuration>
<list> <list>
<item itemvalue="Application.Run Antlr Builder" /> <item itemvalue="Application.Run Antlr Builder" />
<item itemvalue="JUnit.TestAntlrXScanner1.tokenASSIGN" /> <item itemvalue="Application.AntlrXTreeGrammarMain" />
<item itemvalue="JUnit.TestAntlrXScanner1" /> <item itemvalue="JUnit.TestAntlrXScanner1" />
<item itemvalue="JUnit.TestAntlrXScanner1.tokenREAD" /> <item itemvalue="JUnit.TestAntlrXScanner1.tokenASSIGN" />
<item itemvalue="JUnit.TestAntlrXParser1" /> <item itemvalue="JUnit.TestAntlrXParser1" />
<item itemvalue="JUnit.TestAntlrXParser1.program00BeginEnd" />
<item itemvalue="JUnit.TestAntlrXScanner1.tokenStringConst" /> <item itemvalue="JUnit.TestAntlrXScanner1.tokenStringConst" />
<item itemvalue="JUnit.TestAntlrXAssignCount" />
<item itemvalue="JUnit.TestAntlrXAssignCount1" />
</list> </list>
<recent_temporary> <recent_temporary>
<list> <list>
<<<<<<< Updated upstream <item itemvalue="JUnit.TestAntlrXAssignCount1" />
<item itemvalue="JUnit.TestAntlrXAssignCount" />
<item itemvalue="Application.AntlrXTreeGrammarMain" />
<item itemvalue="JUnit.TestAntlrXParser1" /> <item itemvalue="JUnit.TestAntlrXParser1" />
<item itemvalue="JUnit.TestAntlrXScanner1.tokenStringConst" /> <item itemvalue="JUnit.TestAntlrXScanner1.tokenStringConst" />
<item itemvalue="JUnit.TestAntlrXParser1.program00BeginEnd" />
=======
<item itemvalue="JUnit.TestAntlrXParser1.program00BeginEnd" />
<item itemvalue="JUnit.TestAntlrXScanner1.tokenStringConst" />
<item itemvalue="JUnit.TestAntlrXScanner1" />
<item itemvalue="JUnit.TestAntlrXParser1" />
>>>>>>> Stashed changes
<item itemvalue="JUnit.TestAntlrXScanner1.tokenREAD" />
</list> </list>
</recent_temporary> </recent_temporary>
</component> </component>
@@ -181,14 +192,12 @@
<updated>1591172713288</updated> <updated>1591172713288</updated>
<workItem from="1591172719978" duration="202000" /> <workItem from="1591172719978" duration="202000" />
<workItem from="1591172941402" duration="220000" /> <workItem from="1591172941402" duration="220000" />
<<<<<<< Updated upstream
<workItem from="1591174233890" duration="9316000" /> <workItem from="1591174233890" duration="9316000" />
<workItem from="1591183629705" duration="4405000" /> <workItem from="1591183629705" duration="4405000" />
======= <workItem from="1591771652663" duration="1715000" />
<workItem from="1591174233890" duration="8126000" /> <workItem from="1591962621113" duration="4935000" />
<workItem from="1591182692118" duration="1868000" /> <workItem from="1591970247448" duration="49000" />
<workItem from="1591263665308" duration="16000" /> <workItem from="1591970308877" duration="300000" />
>>>>>>> Stashed changes
</task> </task>
<servers /> <servers />
</component> </component>
@@ -204,88 +213,63 @@
<screen x="0" y="0" width="1920" height="1040" /> <screen x="0" y="0" width="1920" height="1040" />
</state> </state>
<state x="570" y="121" key="#TestAntlrXScanner1.tokenASSIGN/0.0.1920.1040@0.0.1920.1040" timestamp="1591175187591" /> <state x="570" y="121" key="#TestAntlrXScanner1.tokenASSIGN/0.0.1920.1040@0.0.1920.1040" timestamp="1591175187591" />
<<<<<<< Updated upstream <state x="-1471" y="200" width="1471" height="691" key="#com.intellij.execution.impl.EditConfigurationsDialog" timestamp="1591969874169">
<state x="-37" y="200" width="1471" height="691" key="#com.intellij.execution.impl.EditConfigurationsDialog" timestamp="1591184444701"> <screen x="-1920" y="0" width="1920" height="1040" />
<screen x="0" y="0" width="1920" height="1040" />
</state> </state>
<state x="184" y="112" key="#com.intellij.execution.impl.EditConfigurationsDialog/0.0.1440.900@0.0.1440.900" timestamp="1591172899381" /> <state x="184" y="112" key="#com.intellij.execution.impl.EditConfigurationsDialog/0.0.1440.900@0.0.1440.900" timestamp="1591172899381" />
<state x="-1471" y="200" key="#com.intellij.execution.impl.EditConfigurationsDialog/0.0.1920.1040/-1920.0.1920.1040@0.0.1920.1040" timestamp="1591969874169" />
<state x="-37" y="200" width="1471" height="691" key="#com.intellij.execution.impl.EditConfigurationsDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1591184444701" /> <state x="-37" y="200" width="1471" height="691" key="#com.intellij.execution.impl.EditConfigurationsDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1591184444701" />
<state x="92" y="92" width="1736" height="856" key="#com.intellij.execution.junit2.states.ComparisonFailureState$DiffDialog" timestamp="1591185724270"> <state x="92" y="92" width="1736" height="856" key="#com.intellij.execution.junit2.states.ComparisonFailureState$DiffDialog" timestamp="1591185724270">
<screen x="0" y="0" width="1920" height="1040" /> <screen x="0" y="0" width="1920" height="1040" />
</state> </state>
<state x="92" y="92" width="1736" height="856" key="#com.intellij.execution.junit2.states.ComparisonFailureState$DiffDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1591185724270" /> <state x="92" y="92" width="1736" height="856" key="#com.intellij.execution.junit2.states.ComparisonFailureState$DiffDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1591185724270" />
<state x="700" y="183" key="#com.intellij.ide.macro.MacrosDialog" timestamp="1591184444196"> <state x="736" y="315" key="#com.intellij.fileTypes.FileTypeChooser" timestamp="1591968475348">
<screen x="0" y="0" width="1920" height="1040" /> <screen x="0" y="0" width="1920" height="1040" />
</state> </state>
<state x="736" y="315" key="#com.intellij.fileTypes.FileTypeChooser/0.0.1920.1040/-1920.0.1920.1040@0.0.1920.1040" timestamp="1591968475348" />
<state x="1003" y="171" key="#com.intellij.ide.macro.MacrosDialog" timestamp="1591969389618">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state x="1003" y="171" key="#com.intellij.ide.macro.MacrosDialog/0.0.1920.1040/-1920.0.1920.1040@0.0.1920.1040" timestamp="1591969389618" />
<state x="700" y="183" key="#com.intellij.ide.macro.MacrosDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1591184444196" /> <state x="700" y="183" key="#com.intellij.ide.macro.MacrosDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1591184444196" />
<state x="700" y="233" key="FileChooserDialogImpl" timestamp="1591771754519"> <state x="690" y="267" key="#com.intellij.refactoring.safeDelete.UnsafeUsagesDialog" timestamp="1591969353358">
<screen x="0" y="0" width="1920" height="1040" /> <screen x="0" y="0" width="1920" height="1040" />
</state> </state>
<state x="700" y="233" key="FileChooserDialogImpl/0.0.1920.1040/-1920.0.1920.1040@0.0.1920.1040" timestamp="1591771754519" /> <state x="690" y="267" key="#com.intellij.refactoring.safeDelete.UnsafeUsagesDialog/0.0.1920.1040/-1920.0.1920.1040@0.0.1920.1040" timestamp="1591969353358" />
<state x="700" y="233" key="FileChooserDialogImpl" timestamp="1591968457509">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state x="700" y="233" key="FileChooserDialogImpl/0.0.1920.1040/-1920.0.1920.1040@0.0.1920.1040" timestamp="1591968457509" />
<state x="700" y="233" key="FileChooserDialogImpl/0.0.1920.1040@0.0.1920.1040" timestamp="1591184758908" /> <state x="700" y="233" key="FileChooserDialogImpl/0.0.1920.1040@0.0.1920.1040" timestamp="1591184758908" />
<state width="916" height="398" key="GridCell.Tab.0.bottom" timestamp="1591188037708"> <state width="1877" height="178" key="GridCell.Tab.0.bottom" timestamp="1591970233761">
<screen x="0" y="0" width="1920" height="1040" /> <screen x="0" y="0" width="1920" height="1040" />
</state> </state>
<state width="1398" height="245" key="GridCell.Tab.0.bottom/0.0.1440.900@0.0.1440.900" timestamp="1591173185826" /> <state width="1398" height="245" key="GridCell.Tab.0.bottom/0.0.1440.900@0.0.1440.900" timestamp="1591173185826" />
<state width="1877" height="178" key="GridCell.Tab.0.bottom/0.0.1920.1040/-1920.0.1920.1040@0.0.1920.1040" timestamp="1591970233761" />
<state width="916" height="398" key="GridCell.Tab.0.bottom/0.0.1920.1040@0.0.1920.1040" timestamp="1591188037708" /> <state width="916" height="398" key="GridCell.Tab.0.bottom/0.0.1920.1040@0.0.1920.1040" timestamp="1591188037708" />
<state width="916" height="398" key="GridCell.Tab.0.center" timestamp="1591188037708"> <state width="1877" height="178" key="GridCell.Tab.0.center" timestamp="1591970233761">
<screen x="0" y="0" width="1920" height="1040" /> <screen x="0" y="0" width="1920" height="1040" />
</state> </state>
<state width="1398" height="245" key="GridCell.Tab.0.center/0.0.1440.900@0.0.1440.900" timestamp="1591173185825" /> <state width="1398" height="245" key="GridCell.Tab.0.center/0.0.1440.900@0.0.1440.900" timestamp="1591173185825" />
<state width="1877" height="178" key="GridCell.Tab.0.center/0.0.1920.1040/-1920.0.1920.1040@0.0.1920.1040" timestamp="1591970233761" />
<state width="916" height="398" key="GridCell.Tab.0.center/0.0.1920.1040@0.0.1920.1040" timestamp="1591188037708" /> <state width="916" height="398" key="GridCell.Tab.0.center/0.0.1920.1040@0.0.1920.1040" timestamp="1591188037708" />
<state width="916" height="398" key="GridCell.Tab.0.left" timestamp="1591188037708"> <state width="1877" height="178" key="GridCell.Tab.0.left" timestamp="1591970233761">
<screen x="0" y="0" width="1920" height="1040" /> <screen x="0" y="0" width="1920" height="1040" />
</state> </state>
<state width="1398" height="245" key="GridCell.Tab.0.left/0.0.1440.900@0.0.1440.900" timestamp="1591173185825" /> <state width="1398" height="245" key="GridCell.Tab.0.left/0.0.1440.900@0.0.1440.900" timestamp="1591173185825" />
<state width="1877" height="178" key="GridCell.Tab.0.left/0.0.1920.1040/-1920.0.1920.1040@0.0.1920.1040" timestamp="1591970233761" />
<state width="916" height="398" key="GridCell.Tab.0.left/0.0.1920.1040@0.0.1920.1040" timestamp="1591188037708" /> <state width="916" height="398" key="GridCell.Tab.0.left/0.0.1920.1040@0.0.1920.1040" timestamp="1591188037708" />
<state width="916" height="398" key="GridCell.Tab.0.right" timestamp="1591188037708"> <state width="1877" height="178" key="GridCell.Tab.0.right" timestamp="1591970233761">
<screen x="0" y="0" width="1920" height="1040" /> <screen x="0" y="0" width="1920" height="1040" />
</state> </state>
<state width="1398" height="245" key="GridCell.Tab.0.right/0.0.1440.900@0.0.1440.900" timestamp="1591173185826" /> <state width="1398" height="245" key="GridCell.Tab.0.right/0.0.1440.900@0.0.1440.900" timestamp="1591173185826" />
<state width="1877" height="178" key="GridCell.Tab.0.right/0.0.1920.1040/-1920.0.1920.1040@0.0.1920.1040" timestamp="1591970233761" />
<state width="916" height="398" key="GridCell.Tab.0.right/0.0.1920.1040@0.0.1920.1040" timestamp="1591188037708" /> <state width="916" height="398" key="GridCell.Tab.0.right/0.0.1920.1040@0.0.1920.1040" timestamp="1591188037708" />
<state x="447" y="180" width="915" height="587" key="NewModule_or_Project.wizard" timestamp="1591771765782"> <state x="447" y="180" width="688" height="753" key="NewModule_or_Project.wizard" timestamp="1591968463391">
<screen x="0" y="0" width="1920" height="1040" /> <screen x="0" y="0" width="1920" height="1040" />
=======
<state x="184" y="125" key="#com.intellij.execution.impl.EditConfigurationsDialog" timestamp="1591184492286">
<screen x="0" y="23" width="1440" height="821" />
</state>
<state x="184" y="112" key="#com.intellij.execution.impl.EditConfigurationsDialog/0.0.1440.900@0.0.1440.900" timestamp="1591172899381" />
<state x="245" y="129" key="#com.intellij.execution.impl.EditConfigurationsDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1591178569825" />
<state x="184" y="125" key="#com.intellij.execution.impl.EditConfigurationsDialog/0.23.1440.821@0.23.1440.821" timestamp="1591184492286" />
<state x="92" y="92" width="1736" height="856" key="#com.intellij.execution.junit2.states.ComparisonFailureState$DiffDialog" timestamp="1591178570191">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state x="92" y="92" width="1736" height="856" key="#com.intellij.execution.junit2.states.ComparisonFailureState$DiffDialog/0.0.1920.1040@0.0.1920.1040" timestamp="1591178570191" />
<state width="1398" height="211" key="GridCell.Tab.0.bottom" timestamp="1591184646781">
<screen x="0" y="23" width="1440" height="821" />
</state>
<state width="1398" height="245" key="GridCell.Tab.0.bottom/0.0.1440.900@0.0.1440.900" timestamp="1591173185826" />
<state width="914" height="268" key="GridCell.Tab.0.bottom/0.0.1920.1040@0.0.1920.1040" timestamp="1591182426442" />
<state width="1398" height="211" key="GridCell.Tab.0.bottom/0.23.1440.821@0.23.1440.821" timestamp="1591184646781" />
<state width="1398" height="211" key="GridCell.Tab.0.center" timestamp="1591184646781">
<screen x="0" y="23" width="1440" height="821" />
</state>
<state width="1398" height="245" key="GridCell.Tab.0.center/0.0.1440.900@0.0.1440.900" timestamp="1591173185825" />
<state width="914" height="268" key="GridCell.Tab.0.center/0.0.1920.1040@0.0.1920.1040" timestamp="1591182426442" />
<state width="1398" height="211" key="GridCell.Tab.0.center/0.23.1440.821@0.23.1440.821" timestamp="1591184646781" />
<state width="1398" height="211" key="GridCell.Tab.0.left" timestamp="1591184646780">
<screen x="0" y="23" width="1440" height="821" />
</state>
<state width="1398" height="245" key="GridCell.Tab.0.left/0.0.1440.900@0.0.1440.900" timestamp="1591173185825" />
<state width="914" height="268" key="GridCell.Tab.0.left/0.0.1920.1040@0.0.1920.1040" timestamp="1591182426442" />
<state width="1398" height="211" key="GridCell.Tab.0.left/0.23.1440.821@0.23.1440.821" timestamp="1591184646780" />
<state width="1398" height="211" key="GridCell.Tab.0.right" timestamp="1591184646781">
<screen x="0" y="23" width="1440" height="821" />
</state>
<state width="1398" height="245" key="GridCell.Tab.0.right/0.0.1440.900@0.0.1440.900" timestamp="1591173185826" />
<state width="914" height="268" key="GridCell.Tab.0.right/0.0.1920.1040@0.0.1920.1040" timestamp="1591182426442" />
<state width="1398" height="211" key="GridCell.Tab.0.right/0.23.1440.821@0.23.1440.821" timestamp="1591184646781" />
<state x="335" y="156" width="915" height="587" key="NewModule_or_Project.wizard" timestamp="1591172753823">
<screen x="0" y="0" width="1440" height="900" />
>>>>>>> Stashed changes
</state> </state>
<state x="335" y="156" width="915" height="587" key="NewModule_or_Project.wizard/0.0.1440.900@0.0.1440.900" timestamp="1591172753823" /> <state x="335" y="156" width="915" height="587" key="NewModule_or_Project.wizard/0.0.1440.900@0.0.1440.900" timestamp="1591172753823" />
<state x="447" y="180" key="NewModule_or_Project.wizard/0.0.1920.1040/-1920.0.1920.1040@0.0.1920.1040" timestamp="1591771765782" /> <state x="447" y="180" width="688" height="753" key="NewModule_or_Project.wizard/0.0.1920.1040/-1920.0.1920.1040@0.0.1920.1040" timestamp="1591968463391" />
<state x="447" y="180" key="NewModule_or_Project.wizard/0.0.1920.1040@0.0.1920.1040" timestamp="1591184776491" /> <state x="447" y="180" key="NewModule_or_Project.wizard/0.0.1920.1040@0.0.1920.1040" timestamp="1591184776491" />
<state x="551" y="139" key="RollbackChangesDialog" timestamp="1591772152949"> <state x="551" y="139" key="RollbackChangesDialog" timestamp="1591772152949">
<screen x="0" y="0" width="1920" height="1040" /> <screen x="0" y="0" width="1920" height="1040" />
@@ -296,5 +280,9 @@
</state> </state>
<state x="208" y="31" key="SettingsEditor/0.0.1440.900@0.0.1440.900" timestamp="1591172804318" /> <state x="208" y="31" key="SettingsEditor/0.0.1440.900@0.0.1440.900" timestamp="1591172804318" />
<state x="277" y="36" key="SettingsEditor/0.0.1920.1040@0.0.1920.1040" timestamp="1591184318089" /> <state x="277" y="36" key="SettingsEditor/0.0.1920.1040@0.0.1920.1040" timestamp="1591184318089" />
<state x="623" y="225" width="672" height="678" key="search.everywhere.popup" timestamp="1591969820924">
<screen x="0" y="0" width="1920" height="1040" />
</state>
<state x="623" y="225" width="672" height="678" key="search.everywhere.popup/0.0.1920.1040/-1920.0.1920.1040@0.0.1920.1040" timestamp="1591969820924" />
</component> </component>
</project> </project>

View File

@@ -71,7 +71,7 @@ public class AntlrXTreeGrammarMain {
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
ANTLRInputStream input = new ANTLRInputStream(new ByteArrayInputStream(BEISPIELFOLIEN.getBytes())); ANTLRInputStream input = new ANTLRInputStream(new ByteArrayInputStream(TEST.getBytes()));
XLexer lexer = new XLexer(input); XLexer lexer = new XLexer(input);
XParser parser = new XParser(new CommonTokenStream(lexer)); XParser parser = new XParser(new CommonTokenStream(lexer));
CommonTree tree = parser.program().getTree(); CommonTree tree = parser.program().getTree();
@@ -80,8 +80,8 @@ public class AntlrXTreeGrammarMain {
XTreeGrammar treeGrammar = new XTreeGrammar(new CommonTreeNodeStream(tree)); XTreeGrammar treeGrammar = new XTreeGrammar(new CommonTreeNodeStream(tree));
tree = treeGrammar.program().getTree(); tree = treeGrammar.program().getTree();
// Z<>hle Zuweisungen // Zuweisungen
// TODO AssignCount count = new AssignCount(new CommonTreeNodeStream(tree));
System.out.printf("Assign count: %d%n", count.getCount());
} }
} }

View File

@@ -17,6 +17,24 @@ options {
} }
decl: ^(DECL ID ('int' | 'float' | 'string') 'read'? 'print'?);
decllist: ^(DECLLIST decl*);
program: 'todo'; expr: ^(('+' | '-' | '*' | '/') expr expr)
| ^(UMINUS (INTCONST | FLOATCONST))
| INTCONST | FLOATCONST | STRINGCONST | ID;
assignstat: ^(':=' ID expr) { count++; }; // FIXME Zählt nicht in AntlrXTreeGrammarMain, aber in Tests??
cond: ^(('<' | '>' | '=') expr expr);
condstat: ^('if' cond stat stat?);
whilestat: ^('while' cond stat);
forstat: ^('for' assignstat cond assignstat stat);
stat: assignstat | condstat | whilestat | forstat | statlist;
statlist: ^(STATLIST stat*);
program: ^('program' ID decllist statlist);

View File

@@ -40,7 +40,6 @@ STRINGCONST=16
UMINUS=17 UMINUS=17
WS=18 WS=18
ZERO=19 ZERO=19
T__46=46
'('=20 '('=20
')'=21 ')'=21
'*'=22 '*'=22
@@ -67,4 +66,3 @@ T__46=46
'string'=43 'string'=43
'then'=44 'then'=44
'while'=45 'while'=45
'todo'=46