The Language Syntax
The syntax for this language started with simple operations such as additions and subtractions in Cisco CRA 2.0.
After Cisco CRA 2.0, the language syntax was enhanced to provide more
programming capability by borrowing from the syntax of other languages such as
C++, C, and Java. For example, the expression syntax allows for
developing more complex expressions that use statements such as
for
,
while
,
if-then
,
switch
and
try/catch
which are popular in many programming
languages today.
The Unified CCX 8.0 Expression Language syntax is backwards compatible with the previous releases of the Expression Language.
Note | Although the notation in the Expression Language is identical to Java in many cases, it is different in other cases. Also the Expression Language adds more support for creating literals of complex objects and more operators for these complex objects. |
The language was enhanced to support the following:
-
All numerical operators
-
All boolean operators (
?:, |, ||, &, &&,
…) -
Variables manipulation operators (
=, +=, -=, ^=,
…) -
All primitive Java data types (
void, byte, short, float, double, int
, …) -
All numerical literals (
3I, 5L, 6.3E4F, 5.54D,
…) -
All BigInteger and BigDecimal literals (23IB, 45.5ID)
-
Hexadecimal numbers (
0x2A4, 0x2F44FL,
…) -
Additional prompt operators (substitute prompt, random prompt, day of week prompt, time of day prompt)
-
Additional document operators (day of week document, time of day document, …)
-
Additional grammar operators (compound grammars, indexing of compound grammars)
-
User document representation
-
Customizing some prompt generation (
$[23.33, C[FRF]],
…) -
Typecasting (
(int)23.33,
…) -
Block comments and line comments within the expression similar to C++ and Java
-
Creating user-specified objects using the new operator (
new java.util.Vector(),
…) -
Full array creation and indexing support (
new int[] {3, 4}, intVar[2], intVar.length,
…) -
Complex block expression with return statement (
{return 5 * 1000L;}
) -
Full Java-like statement support in complex block expression (
if, while, do-while, for, switch, try-catch-finally, throw, break, continue, default,
…) -
Full Java-like support for labels inside complex block expression (
{loop: while(true) {while (true) {break loop;}},
…) -
Local variable definition inside complex block expression (
{int j = 5; return j + 2;},
…)