|
Venice 0.7beta | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mov.parser.Parser
public class Parser
Parse a string into an executable expression. This class acts as a gatekeeper to the Gondala language which is used to perform manipulations on stock market quotes.
ROOT_EXPR = [SUB_EXPR]+ EXPR = SUB_EXPR | "{" [SUB_EXPR]+ "}" SUB_EXPR = BOOLEAN_EXPR [ LOGIC BOOLEAN_EXPR ] LOGIC = "and" | "or" BOOLEAN_EXPR = ADD_EXPR [ RELATION ADD_EXPR ] RELATION = "==" | "<=" | ">=" | "<" | ">" | "!=" ADD_EXPR = MULTIPLY_EXPR [ ADD_OPERATOR MULTIPLY_EXPR ] ADD_OPERATION = "-" | "+" MULTIPLY_EXPR = FACTOR [ MULTIPLY_OPERATOR FACTOR ] MULTIPLY_OPERATOR = "*" | "/" FACTOR = STRING | VARIABLE | NUMBER | FUNCTION | FLOW_CONTROL | QUOTE | "(" SUB_EXPR ")" STRING = "{a-zA-Z0-9}*" NUMBER = ["-"]{0-9}+ ["." {0-9}+] | "true" | "false" VARIABLE_NAME = {a-zA-Z}{a-zA-Z0-9_}* TYPE = "boolean" | "float" | "int" VARIABLE = [["const"] [TYPE]] VARIABLE_NAME ["=" SUB_EXPR] QUOTE = "open" | "close" | "low" | "high" | "volume" FUNCTION = "lag" "(" QUOTE ["," SUB_EXPR] ")" | "min" "(" QUOTE "," SUB_EXPR ["," SUB_EXPR] ")" | "max" "(" QUOTE "," SUB_EXPR ["," SUB_EXPR] ")" | "avg" "(" QUOTE "," SUB_EXPR ["," SUB_EXPR] ")" | "sd" "(" QUOTE "," SUB_EXPR ["," SUB_EXPR] ")" | "sum" "(" QUOTE "," SUB_EXPR ["," SUB_EXPR] ")" | "rsi" "(" [SUB_EXPR ["," SUB_EXPR]] ")" | "not" "(" SUB_EXPR ")" | "percent" "(" SUB_EXPR "," SUB_EXPR ")" | "dayofweek" "(" ")" | "dayofyear" "(" ")" | "day" "(" ")" | "month" "(" ")" | "year" "(" ")" | "sqrt" "(" SUB_EXPR ")" | "abs" "(" SUB_EXPR ")" | "corr" "(" STRING "," QUOTE "," SUB_EXPR ["," SUB_EXPR] ")" "ema" "(" QUOTE "," SUB_EXPR ["," SUB_EXPR] ["," SUB_EXPR] ")" "bol_lower" "(" QUOTE "," SUB_EXPR ["," SUB_EXPR] ")" | "bol_upper" "(" QUOTE "," SUB_EXPR ["," SUB_EXPR] ")" | "macd" "(" QUOTE ["," SUB_EXPR] ")" | "momentum" "(" QUOTE "," SUB_EXPR ["," SUB_EXPR] ")" | "obv" "(" SUB_EXPR ["," SUB_EXPR] ["," SUB_EXPR] ")" | "sd" "(" QUOTE "," SUB_EXPR ["," SUB_EXPR] ")" | "sin" "(" SUB_EXPR ")" | "cos" "(" SUB_EXPR ")" | "log" "(" SUB_EXPR ")" | "exp" "(" SUB_EXPR ")" | "dayfromstart" "(" ")" | "capital" "(" ")" | "stockcapital" "(" ")" | "trend" (" QUOTE "," SUB_EXPR ["," SUB_EXPR] ")" FLOW_CONTROL = "if" "(" SUB_EXPR ")" EXPR "else" EXPR | "for" "(" SUB_EXPR ";" SUB_EXPR ";" SUB_EXPR ")" EXPR | "while" "(" SUB_EXPR ")" EXPR
Method Summary | |
---|---|
static Expression |
parse(java.lang.String string)
Parse the given string into an executable expression. |
static Expression |
parse(Variables variables,
java.lang.String string)
Parse the given string into an executable expression. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Expression parse(Variables variables, java.lang.String string) throws ExpressionException
variables
- any predefined variables.string
- the string to parse.
ExpressionException
- if there was an error parsing the expression.public static Expression parse(java.lang.String string) throws ExpressionException
string
- the string to parse.
ExpressionException
- if there was an error parsing the expression.
|
Venice 0.7beta | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |