railo.transformer.cfml.expression
Class AbstrCFMLExprTransformer
java.lang.Object
railo.transformer.cfml.expression.AbstrCFMLExprTransformer
- Direct Known Subclasses:
- AbstrCFMLScriptTransformer
public abstract class AbstrCFMLExprTransformer
- extends Object
Der CFMLExprTransfomer implementiert das Interface ExprTransfomer,
er bildet die Parser Grammatik ab, die unten definiert ist.
Er erh¦lt als Eingabe CFML Code, als String oder CFMLString,
der einen CFML Expression erh¦lt und liefert ein CFXD Element zurck,
das diesen Ausdruck abbildet.
Mithilfe der FunctionLibメs, kann er Funktionsaufrufe,
die Teil eines Ausdruck sein knnen, erkennen und validieren.
Dies geschieht innerhalb der Methode function.
Falls ein Funktionsaufruf, einer Funktion innerhalb einer FunctionLib entspricht,
werden diese gegeneinander verglichen und der Aufruf wird als Build-In-Funktion bernommen,
andernfalls wird der Funktionsaufruf als User-Defined-Funktion interpretiert.
Die Klasse Cast, Operator und ElementFactory (siehe 3.2) helfen ihm beim erstellen des Ausgabedokument CFXD.
Parser Grammatik EBNF (Extended Backus-Naur Form)
transform = spaces impOp;
impOp = eqvOp {"imp" spaces eqvOp};
eqvOp = xorOp {"eqv" spaces xorOp};
xorOp = orOp {"xor" spaces orOp};
orOp = andOp {("or" | "||") spaces andOp};
(* "||" Existiert in CFMX nicht *)
andOp = notOp {("and" | "&&") spaces notOp};
(* "&&" Existiert in CFMX nicht *)
notOp = [("not"|"!") spaces] decsionOp;
(* "!" Existiert in CFMX nicht *)
decsionOp = concatOp {("neq"|"eq"|"gte"|"gt"|"lte"|"lt"|"ct"|
"contains"|"nct"|"does not contain") spaces concatOp};
(* "ct"=conatains und "nct"=does not contain; Existiert in CFMX nicht *)
concatOp = plusMinusOp {"&" spaces plusMinusOp};
plusMinusOp = modOp {("-"|"+") spaces modOp};
modOp = divMultiOp {("mod" | "%") spaces divMultiOp};
(* modulus operator , "%" Existiert in CFMX nicht *)
divMultiOp = expoOp {("*"|"/") spaces expoOp};
expoOp = clip {("exp"|"^") spaces clip};
(*exponent operator, " exp " Existiert in CFMX nicht *)
clip = ("(" spaces impOp ")" spaces) | checker;
checker = string | number | dynamic | sharp;
string = ("'" {"##"|"''"|"#" impOp "#"| ?-"#"-"'" } "'") |
(""" {"##"|""""|"#" impOp "#"| ?-"#"-""" } """);
number = ["+"|"-"] digit {digit} {"." digit {digit}};
digit = "0"|..|"9";
dynamic = "true" | "false" | "yes" | "no" | startElement
{("." identifier | "[" structElement "]")[function] };
startElement = identifier "(" functionArg ")" | scope | identifier;
scope = "variable" | "cgi" | "url" | "form" | "session" | "application" |
"arguments" | "cookie" | "client ";
identifier = (letter | "_") {letter | "_"|digit};
structElement = "[" impOp "]";
functionArg = [impOp{"," impOp}];
sharp = "#" checker "#";
spaces = {space};
space = "\s"|"\t"|"\f"|"\t"|"\n";
letter = "a"|..|"z"|"A"|..|"Z";
{"x"}= 0 bis n mal "x"
["x"]= 0 bis 1 mal "x"
("x" | "y")"z" = "xz" oder "yz"
CTX_OTHER
public static final short CTX_OTHER
- See Also:
- Constant Field Values
CTX_NONE
public static final short CTX_NONE
- See Also:
- Constant Field Values
CTX_IF
public static final short CTX_IF
- See Also:
- Constant Field Values
CTX_ELSE_IF
public static final short CTX_ELSE_IF
- See Also:
- Constant Field Values
CTX_ELSE
public static final short CTX_ELSE
- See Also:
- Constant Field Values
CTX_FOR
public static final short CTX_FOR
- See Also:
- Constant Field Values
CTX_WHILE
public static final short CTX_WHILE
- See Also:
- Constant Field Values
CTX_DO_WHILE
public static final short CTX_DO_WHILE
- See Also:
- Constant Field Values
CTX_CFC
public static final short CTX_CFC
- See Also:
- Constant Field Values
CTX_INTERFACE
public static final short CTX_INTERFACE
- See Also:
- Constant Field Values
CTX_FUNCTION
public static final short CTX_FUNCTION
- See Also:
- Constant Field Values
CTX_BLOCK
public static final short CTX_BLOCK
- See Also:
- Constant Field Values
CTX_FINALLY
public static final short CTX_FINALLY
- See Also:
- Constant Field Values
CTX_SWITCH
public static final short CTX_SWITCH
- See Also:
- Constant Field Values
CTX_TRY
public static final short CTX_TRY
- See Also:
- Constant Field Values
CTX_CATCH
public static final short CTX_CATCH
- See Also:
- Constant Field Values
CTX_TRANSACTION
public static final short CTX_TRANSACTION
- See Also:
- Constant Field Values
CTX_THREAD
public static final short CTX_THREAD
- See Also:
- Constant Field Values
CTX_SAVECONTENT
public static final short CTX_SAVECONTENT
- See Also:
- Constant Field Values
CTX_LOCK
public static final short CTX_LOCK
- See Also:
- Constant Field Values
CTX_LOOP
public static final short CTX_LOOP
- See Also:
- Constant Field Values
CTX_QUERY
public static final short CTX_QUERY
- See Also:
- Constant Field Values
CTX_ZIP
public static final short CTX_ZIP
- See Also:
- Constant Field Values
AbstrCFMLExprTransformer
public AbstrCFMLExprTransformer()
Copyright © 2012 Railo