Agent Building and Learning Environment

## ARL Editor for Eclipse

The ARL Editor for Eclipse is the first tooling released for Able as we move our Swing development environment to Eclipse. It supports text edit of ARL files with outline view, compiles when saving, and shows errors with markers and task entries. It can run or debug rulesets by configuring a launcher with the project and ruleset name. Any imported classes must be in the project classpath. Debug supports variables view (including working memory variable wm), setting and clearing breakpoints on rules, step into, over, and return at rule level in specific engines. A wizard to create ARL source is available at New->ABLE->AbleRuleset

### Installation

The ARL Editor is installed as part of the ABLE feature. The ABLE feature is installed by unzipping it into your `eclipse` directory such as:
`C:\ECLIPSE3.0\eclipse`.

Use Eclipse 3.0 which can be obtained at Eclipse.org or Rational Application Developer 6.0 which can be obtained from downloads or by IBM personnel at Jumpstart.

### Functions

The ARL Editor plugin consists of a custom editor for files of extension .arl, as well as debug and outline views.

- The ARL Editor highlights ARL terms and provides standard editor function such as cut/copy/paste, undo/redo, and search/replace. When a ruleset is saved, the ARL parser updates the tasks list with problems linked to lines in the ruleset.
- The Outline view shows the major ruleset sections and lists variables and rules. It is updated when the ruleset is saved.
- Select Debug... or Run... and configure an AbleRuleset to debug or run a ruleset. The Debug as and Run as shortcuts are not yet functional.
- Select File->New->Other->AbleRuleset to create a new ruleset.

### Examples

Example rulesets, data files, and helper classes are installed by creating a new example project.

### Highlighting

Highlighting is specified for various lines and words and is currently not customizable. The highlighting scheme follows these rules of thumb:

- Java keywords are bold magenta, the same as the default in the Java editor. Examples include: "class", "import", "new", "static", "void", "do", "else".
- ARL keywords are magenta, but not bolded; keywords, inference methods, fuzzy keywords, fuzzy hedges could be differentiated in the future. Examples include: "functions", "inputs", "library", "predicates", "ruleset", "setControlParameter", "using", "variables", "and", "not" "backward", "fuzzy", "Beta", "Gaussian", "Linear" "below", "extremely", "slightly", "somewhat"
- Java object types are bold khaki. Examples include: "Object", "Numeric", "Boolean", "Integer", "Double", "Float", "String".
- ARL object types are khaki. Examples include: "Categorical", "Continuous", "Discrete", "TimeStamp" .
- Rule labels are bold wheat. Examples include: ":", "L1:". The label must be adjacent to the colon to be highlighted.
- Ruleblock names are bold tuquoise. Examples include: "catch", "init", "process", "preProcess". User defined ruleblocks are not highlighted.
- Constants are bold blue. Examples include: "true", "false".
- Strings are blue; for example: "any string is blue".
- Comments are green; for example "// comments are green".
- JavaDoc comments are turquoise; for example, /** JavaDoc comments are turquoise */.
- Numbers are default black such as 12345.

### Tips

1. If you get a parsing error that a class or method cannot be resolved when saving a ruleset, try rebuilding the project containing that class. When you have "Build Automatically" unchecked, the project must be rebuilt for the ARL editor to pick up newly created classes or changes to existing Java classes.
2. After creating the Example ABLE project, go to the plugin.xml file and from the context menu select "PDE tools" and "Rebuild classpath". Rebuild the project next if you have unchecked "Build Automically". This should remove the "java.lang.Object not found" message. You may see "The import javax.servlet cannot be resolved" from the AbleWebActions class. You can ignore this if you are not interested in the web and template example, or include j2ee.jar to the runtime dependancies in the plugin.xml and repeat rebuilding the classpath and project.
3. To get rulesets using inner classes (JikesBT) to run in the J9 environment used for debug mode in WSAD, add this zip to the CLASSPATH:

       \eclipse\jre\lib\jclSC13\classes.zip

   It does not come with Eclipse but with WSAD 5.1 distribution - copy the dir\file to eclipse's jre\lib dir and everything works.