{
productionnode.linenumber = locator.getLineNumber();
productionnode.columnnumber = locator.getColumnNumber();
}
ShiftAction shiftaction = ancestor.state.getShiftAction(productionnode.symbol);
if (shiftaction!=null)
{
StateNode newstatenode = getStateNode(current, shiftaction.state, ancestor);
if (newstatenode==null)
{
System.out.println("new state node: new state="+automaton.indexOf(shiftaction.state)+
" ancestor state="+automaton.indexOf(ancestor.state));
newstatenode = new StateNode(shiftaction.state, ancestor, productionnode);
current.push(newstatenode);
}
else
{
System.out.println("merging state node");
ProductionNode oldproductionnode = (ProductionNode)newstatenode.treenode;
if (grammar.getPriority(oldproductionnode.production)>grammar.getPriority(production))
{
System.out.println("priority("+production+") < priority("+
oldproductionnode.production+")");
newstatenode.treenode = productionnode;
}
else
System.out.println("priority("+production+") >= priority("+
oldproductionnode.production+")");
}
}
}
}
}
Stack dummy = next;
next = current;
current = dummy;
System.out.println("Current states");
for (int i = 0; i<current.size(); i++)
System.out.println(current.get(i));
System.out.println();
/* ==================================== Shift =================================== */
TokenNode tokennode = new TokenNode(symbol, text);
if (locator!=null)
{
tokennode.linenumber = locator.getLineNumber();
tokennode.columnnumber = locator.getColumnNumber();
}
while (!current.isEmpty())
{
StateNode statenode = (StateNode)current.pop();
ShiftAction shiftaction = statenode.state.getShiftAction(symbol);
if (shiftaction!=null)
{
if ((log!=null) && (log.isDebugEnabled()))
log.debug(