100 likes | 230 Views
Explore the Eclipse Plug-in for CRSX, designed for convenient authoring and debugging of higher-order rewriting rules. This comprehensive guide walks you through installing the plug-in, utilizing the rule file editor with syntax highlighting and checking, and using the debug tool to execute iterative rewriting. Learn to prepare sample source code, open rule files, and identify bugs in your rules with step-by-step instructions. Perfect for developers and researchers working on rewriting systems in Java.
E N D
Eclipse Plug-in for Authoring and Debugging Higher-order Rewriting Takahide Nogayama
Contents • Overview • 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
Rule file editor Highlighting Outlining Syntax checking Debug tool Iterative rewriting Break point against rules Overview
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
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 Install Eclipse Plug-in for CRSX
Uninstall Start eclipse Select “Help”, “About Eclipse” Click “Installation Details” button Click “Installed Software” tab Select “CRSX eclipse future” Click “Uninstall” button Uninstall Eclipse Plug-in for CRSX