return FALSE;
}
public Object visit(Anonymous node, Object data) {
Expression expression = null;
ExpressionNamespace ns = (ExpressionNamespace)data;
String expr = node.name;
int hash = node.name.hashCode();
String exprAutoName = null;
if (hash >= 0) {
exprAutoName = "__AW__"+hash;
} else {
exprAutoName = "__AW____"+(-1*hash);
}
if (ns.getExpression(exprAutoName) != null) {
return new StringBuffer(exprAutoName);
}
// register it
if (expr.startsWith("execution(")) {
expression = ns.createExecutionExpression(
expr.substring(10, expr.length()-1),
"", exprAutoName
);
} else if (expr.startsWith("call(")) {
expression = ns.createCallExpression(
expr.substring(5, expr.length()-1),
"", exprAutoName
);
} else if (expr.startsWith("cflow(")) {
expression = ns.createCflowExpression(
expr.substring(6, expr.length()-1),
"", exprAutoName
);
} else if (expr.startsWith("set(")) {
expression = ns.createSetExpression(
expr.substring(4, expr.length()-1),
"", exprAutoName
);
} else if (expr.startsWith("get(")) {
expression = ns.createGetExpression(
expr.substring(4, expr.length()-1),
"", exprAutoName
);
} else if (expr.startsWith("class(")) {
expression = ns.createClassExpression(
expr.substring(6, expr.length()-1),
"", exprAutoName
);
} else if (expr.startsWith("handler(")) {
expression = ns.createHandlerExpression(
expr.substring(8, expr.length()-1),
"", exprAutoName
);
} else if (expr.startsWith("attribute(")) {
expression = ns.createAttributeExpression(
expr.substring(10, expr.length()-1),
exprAutoName
);
} else {
throw new RuntimeException("unknown anonymous: "+expr);
}
// register the expression
ns.registerExpression(expression);
return new StringBuffer(exprAutoName);
}