private Node[] processFromExpression()
{
// "candidate [AS] alias"
// This will create a node of type "Node.CLASS" and child of type "Node.NAME" (alias)
processExpression();
Node id = stack.pop();
StringBuilder className = new StringBuilder(id.getNodeValue().toString());
while (id.getChildNodes().size() > 0)
{
id = id.getFirstChild();
className.append(".").append(id.getNodeValue().toString());
}
String alias = p.parseIdentifier();
if (alias != null && alias.equalsIgnoreCase("AS"))
{
alias = p.parseIdentifier();
}
if (alias == null)
{
alias = "this";
}
// Create candidate class node with alias, and put at top of stack
Node classNode = new Node(NodeType.CLASS, className.toString());
Node aliasNode = new Node(NodeType.NAME, alias);
classNode.insertChildNode(aliasNode);
stack.push(classNode);
return new Node[] {classNode};
}