Eclipse Plug-in for Authoring and Debugging Higher-order Rewriting Takahide Nogayama
Contents Overview Prepare CRSX sample source code Rule file editor Debug tool for CRSX rewriting Prepare CRSX sample source code The simplest sample “Calc” Open rule file with eclipse plug-in Install eclipse plug-in for CRSX
Overview Rule file editor Debug tool Highlighting Outlining Syntax checking Debug tool Iterative rewriting Break point against rules
The Simplest Sample “Calc” Download crsx22.zip from http://sourceforge.net/projects/crsx/ Unzip crsx22.zip Run CRSX to calculate “1 + 2 + 3” $unzip crsx22.zip $java -jar crsx.jar -cp src “grammar={'net.sf.crsx.samples.calc.CalcParser'}” rules=samples/calc/interpret.crs category=P “term=1 + 2 + 3” 6 1 + 2 + 3 1 + 5 6
Open crs rule file with rule editor Start eclipse Create java project and copy files under crsx19 Right click samples/calc/interpret.crs Notify syntax error Jump by clicking outline Highlight syntax
Debug Tool for CRSX Rewriting (1) Right click rule file Select “CRSX”, and “Start iterative rewriting” (Perspective will be changed to “CRSX perspective”) Set arguments into “program arguments” text field Click “Start” button
Debug Tool for CRSX Rewriting (1) For each clicking “Next” button, one rewriting rule is applied to term 1 + 2 + 3 1 + 5 6
Debug Scenario Minus rule has a bug. The right term must be $[Minus, #I1, #I2] Assuming the Calc rule has a bug. (The right term of minus rule is Plus) A rule developer realizes the result of rewriting “1 + 2 – 3” is “6”. But it should be “0”. He wants to know which rule has issue. The developer starts iterative rewriting. The developer can find out the minus rule has an issue because the result of minus operator is 5 which is not expected. The result of “2 – 3” must be “-1” but is 5
Install Eclipse Plug-in for CRSX Prerequisite eclipse for java Doroid font Install Start eclipse Select “Help”, “Install New Software” Add repository CRSX http://crsx.sourceforge.net/eclipse-plugin/site.xml Click Next
Uninstall Eclipse Plug-in for CRSX Start eclipse Select “Help”, “About Eclipse” Click “Installation Details” button Click “Installed Software” tab Select “CRSX eclipse future” Click “Uninstall” button