public class StatementExpression extends AbstractRegularExpression
ANY_CHAR, ANY_CHAR_EOL, ANY_SIGN, AT_LEAST, AT_MOST, DEBUG, DOUBLE, EOL, EXACTLY, INTEGER, NEGATIVE, NON_NULL, POSITIVE, STRICTLY_NEGATIVE, STRICTLY_POSITIVE, WHITE_SPACES, WHITE_SPACES_OR_EOL
Constructor and Description |
---|
StatementExpression(java.lang.String leftHandSide,
java.lang.String equalSymbol,
java.lang.String postfix,
int type,
int sign) |
Modifier and Type | Method and Description |
---|---|
java.lang.Number |
getValue()
Return the value of the RHS, wrapped in a Number (either Integer or Double)
|
boolean |
interpret(Context c)
Parses this expression, possibly using the given Context to fetch the String to interpret
if this Expression is a leaf expression.
|
java.lang.String |
toString() |
action
public StatementExpression(java.lang.String leftHandSide, java.lang.String equalSymbol, java.lang.String postfix, int type, int sign)
leftHandSide
- aka name of a variableequalSymbol
- e.g. "=" or "->" etc...postfix
- marks the end of the numerical expression (can be null, see NumericalExpression comments)type
- type of numerical value (DOUBLE or INTEGER)sign
- constraints laid on the sign of numerical values (ANY_SIGN, POSITIVE, ...)
A typical use would be : StatementExpression("dash", "=", null, "pt_1", DOUBLE, POSITIVE)public boolean interpret(Context c) throws REParserException
AbstractRegularExpression
interpret
in class AbstractRegularExpression
REParserException.IncompleteSequence
- if any expression but the first one wasn't found
Whether TRUE or FALSE, calls action with key="&" and value=value of number found (of type Number)REParserException
- if an error occur during parsingpublic java.lang.Number getValue()
public java.lang.String toString()
toString
in class java.lang.Object
Submit a bug : syd@jpicedt.org