Apache UIMA Ruta Guide and Reference - Apache UIMA - The ...
Apache UIMA Ruta Guide and Reference - Apache UIMA - The ...
Apache UIMA Ruta Guide and Reference - Apache UIMA - The ...
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
2.5.2. Number Expressions<br />
Number Expressions<br />
<strong>UIMA</strong> <strong>Ruta</strong> provides several possibilities to define number expressions. As expected, every<br />
number expression evaluates to a number. <strong>UIMA</strong> <strong>Ruta</strong> supports integer <strong>and</strong> floating-point numbers.<br />
A floating-point number can be in single or in double precision. To get a complete overview, have<br />
a look at the following syntax definition of number expressions.<br />
2.5.2.1. Definition:<br />
NumberExpression -> AdditiveExpression<br />
AdditiveExpression -> MultiplicativeExpression ( ( "+" | "-" )<br />
MultiplicativeExpression )*<br />
MultiplicativeExpression -> SimpleNumberExpression ( ( "*" | "/" | "%" )<br />
SimpleNumberExpression )*<br />
| ( "EXP" | "LOGN" | "SIN" | "COS" | "TAN" )<br />
"(" NumberExpression ")"<br />
SimpleNumberExpression -> "-"? ( DecimalLiteral | FloatingPointLiteral<br />
| NumberVariable) | "(" NumberExpression ")"<br />
DecimalLiteral -> ('0' | '1'..'9' Digit*) IntegerTypeSuffix?<br />
IntegerTypeSuffix -> ('l'|'L')<br />
FloatingPointLiteral -> Digit+ '.' Digit* Exponent? FloatTypeSuffix?<br />
| '.' Digit+ Exponent? FloatTypeSuffix?<br />
| Digit+ Exponent FloatTypeSuffix?<br />
| Digit+ Exponent? FloatTypeSuffix<br />
FloatTypeSuffix -> ('f'|'F'|'d'|'D')<br />
Exponent -> ('e'|'E') ('+'|'-')? Digit+<br />
Digit -> ('0'..'9')<br />
For more information on number variables, see Section 2.4.2, “Variables” [24] .<br />
2.5.2.2. Examples:<br />
98 // a integer number literal<br />
104 // a integer number literal<br />
170.02 // a floating-point number literal<br />
1.0845 // a floating-point number literal<br />
INT intVar1;<br />
INT intVar2;<br />
...<br />
Document{->ASSIGN(intVar1, 12 * intVar1 - SIN(intVar2))};<br />
2.5.3. String Expressions<br />
<strong>The</strong>re are two kinds of string expressions in <strong>UIMA</strong> <strong>Ruta</strong>.<br />
1. String literals: String literals are defined by any sequence of characters within quotation<br />
marks.<br />
2. String variables (see Section 2.4.2, “Variables” [24] )<br />
2.5.3.1. Definition:<br />
StringExpression -> SimpleStringExpression<br />
SimpleStringExpression -> StringLiteral ("+" StringExpression)*<br />
<strong>UIMA</strong> <strong>Ruta</strong> Version 2.0.1 <strong>Apache</strong> <strong>UIMA</strong> <strong>Ruta</strong> Language 27