The JEQL Language Specification

Functions and Commands

Functions and commands are the primary way of providing extensible computation in JEQL. Built-in functions and commands provide a rich set of functionality.

Functions and commands are one of the primary extension points for JEQL. New functions and commands may be supplied as Java classes. These are loaded dynamically via import statements.

Functions

function-call ::= function-name ( [ expr ] { , expr } )
function-name ::= [ Identifier Classname . ] Identifier Function name

Functions are components of
expressions. They accept zero or more values as arguments, and compute a return value. They are executed at the point they are encountered during the execution of an expression.

There are several kinds of functions, which have different semantics and can be used in different locations in scripts.

Functions may throw exceptions.

Many of JEQL's built-in functions map directly to methods in common Java classes and libraries. Since JEQL is not object-oriented, a JEQL function which maps to a Java method takes the Java class object as the first parameter.

Commands

command ::= command-name [ parameter-arg ] { parameter }
command-name ::= Identifier
parameter ::= Identifier: [ parameter-arg ]
parameter-arg ::= expr | query-expr

Commands are statements. They are executed at the point they are encountered in a script.

Commands provide a syntactically flexible and convenient way to interface to external procedures and Java classes, since they provide named, optional parameters and multiple return values.

Command names are always capitalized, and may use camel-case.

Commands take zero or more named parameters. Parameters may be either mandatory or optional. If optional parameters are not supplied, the command may use a default value. Parameters take zero or one arguments. The argument is an expression.

In addition to its named parameters, a command may accept an anonymous parameter. Anonymous parameters allow a more compact syntax for commonly supplied parameters. This parameter does not require a name to be specified. The argument to the anonymous parameter is supplied immediately following the command name.

There are three kinds of parameters:

Commands may throw exceptions if an error is encountered during their execution.