System.out.println("add firstset");
String symbol = ((Element)item.pattern).getSymbol();
System.out.println("pattern="+item.pattern);
Definition definition = ((Definition)definitions.get(item.pattern));
PatternSet firstSet = grammar.getFirstSet(symbol);
for (PatternIterator pattern = firstSet.getPattern(); pattern.hasNext();)
{
Pattern firstPattern = pattern.next();
//Definition definition = ((Definition)definitions.get(firstSet.getPattern(l)));
if (definition.getLastSet().contains(item.pattern))
state.addItem(new Item(symbol, firstPattern, Item.SHIFT, item.lookahead));
for (PatternIterator lookaheads = item.pattern.getSuccessors(); lookaheads.hasNext();)
{
Pattern lookahead = lookaheads.next();