use of org.develnext.jphp.core.tokenizer.token.SemicolonToken in project jphp by jphp-compiler.
the class NamespaceGenerator method processBody.
protected void processBody(NamespaceStmtToken namespace, ListIterator<Token> iterator) {
Token next = nextToken(iterator);
if (next instanceof SemicolonToken) {
List<Token> tree = analyzer.process(iterator);
namespace.setTree(tree);
namespace.setTokenRegistered(true);
} else if (isOpenedBrace(next, BraceExprToken.Kind.BLOCK)) {
boolean done = false;
List<Token> tree = new ArrayList<Token>();
while (iterator.hasNext()) {
Token item = analyzer.processNext(iterator);
if (isClosedBrace(item, BraceExprToken.Kind.BLOCK)) {
done = true;
break;
}
tree.add(item);
}
if (!done)
nextToken(iterator);
namespace.setTree(tree);
} else
unexpectedToken(next);
}
Aggregations