Search in sources :

Example 1 with ThrowStmtToken

use of org.develnext.jphp.core.tokenizer.token.stmt.ThrowStmtToken in project jphp by jphp-compiler.

the class ThrowGenerator method getToken.

@Override
public ThrowStmtToken getToken(Token current, ListIterator<Token> iterator) {
    if (current instanceof ThrowStmtToken) {
        ThrowStmtToken result = (ThrowStmtToken) current;
        ExprStmtToken exception = analyzer.generator(SimpleExprGenerator.class).getToken(nextToken(iterator), iterator, Separator.SEMICOLON, null);
        if (exception == null)
            unexpectedToken(iterator.previous());
        result.setException(exception);
        return result;
    }
    return null;
}
Also used : ExprStmtToken(org.develnext.jphp.core.tokenizer.token.stmt.ExprStmtToken) SimpleExprGenerator(org.develnext.jphp.core.syntax.generators.manually.SimpleExprGenerator) ThrowStmtToken(org.develnext.jphp.core.tokenizer.token.stmt.ThrowStmtToken)

Aggregations

SimpleExprGenerator (org.develnext.jphp.core.syntax.generators.manually.SimpleExprGenerator)1 ExprStmtToken (org.develnext.jphp.core.tokenizer.token.stmt.ExprStmtToken)1 ThrowStmtToken (org.develnext.jphp.core.tokenizer.token.stmt.ThrowStmtToken)1