Back


Adding a new package

If you have some major new functionality to add you may prefer to create a new package rather than extend one of the standard ones. It's only a little more dificult. The main thing to note is that each package is uniquely identified by its package name with the initial letter set to upper case and the rest lower case.

Each package needs to conform to an overall structure. Part of this is a set of subdirectories:

condition
handler
keyword
runtime
value

None of these need to have any files in them, but they do have to be present.

There are also some class files that may have to be present. Suppose your new package is called extra; here are the required classes (don't forget to include the capital L):

linguist/extra/ExtraLErrors.class
linguist/extra/ExtraLGetCondition.class
linguist/extra/ExtraLGetValue.class

You can model each of these on the ones in the basic package.

To use the new package, simply add the line

package extra

At the top of your script. The compiler will pick up the package automatically when it can't find a keyword, value or condition in any of the preceeding packages named in that script.

There's no need for your special package(s) to reside inside the main Linguist directory or JAR file. You are free to maintain them separately and keep the standard part of Linguist in another place. You can put linguist.jar into your JRE extensions directoryor use the -cp option, as in:

java -cp .;linguist.jar LS MyScript.lrun (for Windows; in Unix the semicolon is a colon)


Back New, Courier"> create table for Customer