Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Appendix A Syntax of the Rules Language : Syntax of Rules

Syntax of Rules
Supported Syntax
The rules language supports the following syntax within rules:
<rule> ::=
    <rule declaration> <condition list> <action list> <exception list>
<rule declaration> ::=
   <rule header> [<local name declaration>]
<rule header> ::=
   <rule name> [<rule header argument list>] ;
<rule header argument list> ::=
   (<rule argument name> {,<rule argument name>})
<local name declaration> ::=
   LOCAL <local name> {,<local name>} ;
<condition list> ::=
   {<condition>;}
<condition> ::=
   [<not>] <logical value>
   <expression> <relational operator in condition> <expression>
<logical value> ::=
   <field of a table>
   <rule argument name>
   <function call>
<action list> ::=
   <action> {<action>}
<exception list> ::=
   {<on exception>}
<on exception> ::=   ON <exception designation> : {<action>}
<action> ::=
   <statement> ;
<statement> ::=
   <assignment>
   <rule invocation>
   <function return>
   <table access statement>
   <synchronous processing>
   <output processing>
   <signal exception>
   <asynchronous call>
   <iterative processing>
<assignment> ::=
   <assignment target> = <expression>
   <assignment-by-name>
<assignment target> ::=
   <field of a table>
   <local name>
<assignment-by-name> ::=
   <table reference> .* = <table reference> .*
   <table reference> .* = NULL
<rule invocation> ::=
   <invocation> <invocation specification> [<invocation arguments>]
<invocation> ::=
   CALL
   EXECUTE [IN <browse specification>]
   TRANSFERCALL [IN <browse specification>]
<invocation specification> ::=
   <rule name>
   <rule argument name>
   <table name> . <field name>
<invocation arguments> ::=
   <argument list>
   WHERE <where argument list>
<where argument list> ::=
   <where argument item> {<and> <where argument item>}
<where argument item> ::=
   <identifier> = <expression>
<function return> ::=
   RETURN ( <expression>
<table access statement> ::=
   <get statement>
   <insert statement>
   <replace statement>
   <delete statement>
   <forall statement>
<get statement> ::=
   GET <occurrence specification> [<table order>] [WITH MINLOCK]
<occurrence specification> ::=
   <table specification> [WHERE <where predicate>]
<table specification> ::=
   <table name> [<argument list>]
   <rule argument name> [<argument list>]
   <table name> . <field name> [<argument list>]
<where predicate> ::=
   <where not expression> {<logical operator> <where not expression>}
<where not expression> ::=
   [<not>] <where expression>
<where expression> ::=
   <where relation>
   (<where predicate>)
<where relation> ::=
   <field reference> <relational operator> <where expression>
<where expression> ::=
   [<unary operator>] <where expression term> {<add operator> <where expression term>}
<where expression term> ::=
   <where expression factor> {<multiplication operator>
   <where expression factor>}
<where expression factor> ::=
   <where expression primary> [<exponent operator> <where
   expression primary>]
<where expression primary> ::=
   (<where expression>)
   <where field of a table>
   <rule argument name>
   <local name>
   <function call>
   <literal>
<where field of a table> ::=
   <where table reference> . <field reference>
<where parameter list> ::=
   <where parameter item> {<and> <where parameter item>}
<where parameter item> ::=
   <table parameter name> = <expression>
<where table reference> ::=
   *
   <table name>
   (<rule argument name>)
   (<table name> . <field name>)
<insert statement> ::=
   INSERT <table specification> [WHERE <where parameter list>]
<replace statement> ::=
   REPLACE <table specification> [WHERE <where parameter list>]
<delete statement> ::=
   DELETE <table specification> [WHERE <where primary key>]
<where primary key> ::=
   <primary key> = <expression>
<primary key> ::=
   <field name>
<forall statement> ::=
   FORALL <occurrence specification> [ <table order>] [<until
   specification> ]: <for action list> END
<until specification> ::=
   UNTIL <exceptions>
<exceptions> ::=
   <exception designation> {<or> <exception designation>}
<exception designation> ::=
   <exception name> [<table name>]
<exception name> ::=
   <identifier>
<for action list> ::=
   <for action> ; }
<for action> ::=
   <assignment>
   <rule invocation>
   <table access statement>
   <output processing>
   <asynchronous call>
   <iterative processing>   COMMIT
<table order> ::=
   <table order item> {AND <table order item>}
<table order item> ::=
   ORDERED [<ordering>] <field reference>
<ordering> ::=
   ASCENDING
   DESCENDING
<synchronous processing> ::=
   COMMIT
   ROLLBACK
<output processing> ::=
   <PRINT> <report reference>
   DISPLAY <screen reference> [<and option>]
<report reference> ::=
   <report name>
   <table name> . <field name>
   <rule argument name>
<report name> ::=
   <identifier>
<screen reference> ::=
   <screen name>
   <table name> . <field name>
   <rule argument name>
<screen name> ::=
   <identifier>
<and option> ::=
   <and> TRANSFERCALL [IN <browse specification>] <invocation
   specification> [<invocation arguments>]
<signal exception> ::=
   SIGNAL <exception name>
<asynchronous call> ::=
   SCHEDULE [IN <browse specification>] [<queue
   specification>] <rule name> [<call arguments>]
<browse specification> ::=
   BROWSE
   UPDATE
<queue specification> ::=
   TO <expression>
<iterative processing> ::=
<until statement> ::=
   UNTIL <exceptions> [DISPLAY<screen reference>]:{<action>} END
<field reference> ::=
   <field name>
   (<rule argument name>)
   (<table name> . <field name>)
<table parameter name> ::=
   <identifier>
<function call> ::=
   <function name> [<argument list>]
<argument list> ::=
   (<expression> {,<expression>})
<expression> ::=
   [<unary op>] <expression term> {<add operator>
   <expression term>}
<expression term> ::=
   <expression factor> {<multiplication operator> <expression
   factor>}
<expression factor> ::=
   <expression primary> [<exponent operator> <expression
   primary>]
<expression primary> ::=
   <expression>
   <field of a table>
   <rule argument name>
   <local name>
   <function call>
   <literal>
<field of a table> ::=
   <table reference> . <field reference>
<table reference> ::=
   <table name>
   (<rule argument name>)
   (<table name> . <field name>)
<rule name> ::=
   <identifier>
<function name> ::=
   <identifier><rule argument name> ::=
   <identifier>
<table name> ::=
   <identifier>
<field name> ::=
   <identifier>
<local name> ::=
   <identifier><unary operator> ::=
   -
   +
<add operator> ::=
   +
   -
   ||
<multiplication operator> ::=
   *
   /
<exponent operator> ::=
   **
<logical operator> ::=
   <and>
   <or>
<and> ::=
   AND
   &
<or> ::=
   OR
   |
<not> ::=
   NOT    ¬
<relational operator in section> ::=
   <relational operator in condition>
   LIKE
<relational operator in condition> ::=
   =
   ¬=
   >
   >=
   <
   <=
<literal> ::=
   <string literal>
   <numeric literal>
   NULL
The keyword NULL can appear only by itself and not as an operand in an expression. For example, it is syntactically incorrect to write NULL + 1.

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved