Java 类jdk.nashorn.internal.runtime.JSErrorType 实例源码

项目:OpenJSharp    文件:AbstractParser.java   
/**
 * Report an error.
 *
 * @param errorType  The error type
 * @param message    Error message.
 * @return ParserException upon failure. Caller should throw and not ignore
 */
protected final ParserException error(final JSErrorType errorType, final String message) {
    // TODO - column needs to account for tabs.
    final int position = Token.descPosition(token);
    final int column = position - linePosition;
    final String formatted = ErrorManager.format(message, source, line, column, token);
    return new ParserException(errorType, formatted, source, line, column, token);
}
项目:OpenJSharp    文件:Parser.java   
private RuntimeNode referenceError(final Expression lhs, final Expression rhs, final boolean earlyError) {
    if (earlyError) {
        throw error(JSErrorType.REFERENCE_ERROR, AbstractParser.message("invalid.lvalue"), lhs.getToken());
    }
    final ArrayList<Expression> args = new ArrayList<>();
    args.add(lhs);
    if (rhs == null) {
        args.add(LiteralNode.newInstance(lhs.getToken(), lhs.getFinish()));
    } else {
        args.add(rhs);
    }
    args.add(LiteralNode.newInstance(lhs.getToken(), lhs.getFinish(), lhs.toString()));
    return new RuntimeNode(lhs.getToken(), lhs.getFinish(), RuntimeNode.Request.REFERENCE_ERROR, args);
}
项目:OpenJSharp    文件:AssignSymbols.java   
private void throwParserException(final String message, final Node origin) {
    if (origin == null) {
        throw new ParserException(message);
    }
    final Source source = compiler.getSource();
    final long token = origin.getToken();
    final int line = source.getLine(origin.getStart());
    final int column = source.getColumn(origin.getStart());
    final String formatted = ErrorManager.format(message, source, line, column, token);
    throw new ParserException(JSErrorType.SYNTAX_ERROR, formatted, source, line, column, token);
}
项目:openjdk-jdk10    文件:AbstractParser.java   
/**
 * Report an error.
 *
 * @param errorType  The error type
 * @param message    Error message.
 * @return ParserException upon failure. Caller should throw and not ignore
 */
protected final ParserException error(final JSErrorType errorType, final String message) {
    // TODO - column needs to account for tabs.
    final int position = Token.descPosition(token);
    final int column = position - linePosition;
    final String formatted = ErrorManager.format(message, source, line, column, token);
    return new ParserException(errorType, formatted, source, line, column, token);
}
项目:openjdk-jdk10    文件:JSONParser.java   
ParserException error(final String message, final int start, final int length) throws ParserException {
    final long token     = Token.toDesc(STRING, start, length);
    final int  pos       = Token.descPosition(token);
    final Source src     = Source.sourceFor("<json>", source);
    final int  lineNum   = src.getLine(pos);
    final int  columnNum = src.getColumn(pos);
    final String formatted = ErrorManager.format(message, src, lineNum, columnNum, token);
    return new ParserException(JSErrorType.SYNTAX_ERROR, formatted, src, lineNum, columnNum, token);
}
项目:openjdk-jdk10    文件:Parser.java   
private RuntimeNode referenceError(final Expression lhs, final Expression rhs, final boolean earlyError) {
    if (env._parse_only || earlyError) {
        throw error(JSErrorType.REFERENCE_ERROR, AbstractParser.message("invalid.lvalue"), lhs.getToken());
    }
    final ArrayList<Expression> args = new ArrayList<>();
    args.add(lhs);
    if (rhs == null) {
        args.add(LiteralNode.newInstance(lhs.getToken(), lhs.getFinish()));
    } else {
        args.add(rhs);
    }
    args.add(LiteralNode.newInstance(lhs.getToken(), lhs.getFinish(), lhs.toString()));
    return new RuntimeNode(lhs.getToken(), lhs.getFinish(), RuntimeNode.Request.REFERENCE_ERROR, args);
}
项目:openjdk-jdk10    文件:AssignSymbols.java   
private void throwParserException(final String message, final Node origin) {
    if (origin == null) {
        throw new ParserException(message);
    }
    final Source source = compiler.getSource();
    final long token = origin.getToken();
    final int line = source.getLine(origin.getStart());
    final int column = source.getColumn(origin.getStart());
    final String formatted = ErrorManager.format(message, source, line, column, token);
    throw new ParserException(JSErrorType.SYNTAX_ERROR, formatted, source, line, column, token);
}
项目:openjdk9    文件:AbstractParser.java   
/**
 * Report an error.
 *
 * @param errorType  The error type
 * @param message    Error message.
 * @return ParserException upon failure. Caller should throw and not ignore
 */
protected final ParserException error(final JSErrorType errorType, final String message) {
    // TODO - column needs to account for tabs.
    final int position = Token.descPosition(token);
    final int column = position - linePosition;
    final String formatted = ErrorManager.format(message, source, line, column, token);
    return new ParserException(errorType, formatted, source, line, column, token);
}
项目:openjdk9    文件:JSONParser.java   
ParserException error(final String message, final int start, final int length) throws ParserException {
    final long token     = Token.toDesc(STRING, start, length);
    final int  pos       = Token.descPosition(token);
    final Source src     = Source.sourceFor("<json>", source);
    final int  lineNum   = src.getLine(pos);
    final int  columnNum = src.getColumn(pos);
    final String formatted = ErrorManager.format(message, src, lineNum, columnNum, token);
    return new ParserException(JSErrorType.SYNTAX_ERROR, formatted, src, lineNum, columnNum, token);
}
项目:openjdk9    文件:Parser.java   
private RuntimeNode referenceError(final Expression lhs, final Expression rhs, final boolean earlyError) {
    if (earlyError) {
        throw error(JSErrorType.REFERENCE_ERROR, AbstractParser.message("invalid.lvalue"), lhs.getToken());
    }
    final ArrayList<Expression> args = new ArrayList<>();
    args.add(lhs);
    if (rhs == null) {
        args.add(LiteralNode.newInstance(lhs.getToken(), lhs.getFinish()));
    } else {
        args.add(rhs);
    }
    args.add(LiteralNode.newInstance(lhs.getToken(), lhs.getFinish(), lhs.toString()));
    return new RuntimeNode(lhs.getToken(), lhs.getFinish(), RuntimeNode.Request.REFERENCE_ERROR, args);
}
项目:openjdk9    文件:AssignSymbols.java   
private void throwParserException(final String message, final Node origin) {
    if (origin == null) {
        throw new ParserException(message);
    }
    final Source source = compiler.getSource();
    final long token = origin.getToken();
    final int line = source.getLine(origin.getStart());
    final int column = source.getColumn(origin.getStart());
    final String formatted = ErrorManager.format(message, source, line, column, token);
    throw new ParserException(JSErrorType.SYNTAX_ERROR, formatted, source, line, column, token);
}
项目:kaziranga    文件:AbstractParser.java   
/**
 * Report an error.
 *
 * @param errorType  The error type
 * @param message    Error message.
 * @return ParserException upon failure. Caller should throw and not ignore
 */
protected final ParserException error(final JSErrorType errorType, final String message) {
    // TODO - column needs to account for tabs.
    final int position = Token.descPosition(token);
    final int column = position - linePosition;
    final String formatted = ErrorManager.format(message, source, line, column, token);
    return new ParserException(errorType, formatted, source, line, column, token);
}
项目:kaziranga    文件:JSONParser.java   
ParserException error(final String message, final int start, final int length) throws ParserException {
    final long token     = Token.toDesc(STRING, start, length);
    final int  pos       = Token.descPosition(token);
    final Source src     = Source.sourceFor("<json>", source);
    final int  lineNum   = src.getLine(pos);
    final int  columnNum = src.getColumn(pos);
    final String formatted = ErrorManager.format(message, src, lineNum, columnNum, token);
    return new ParserException(JSErrorType.SYNTAX_ERROR, formatted, src, lineNum, columnNum, token);
}
项目:kaziranga    文件:Parser.java   
private RuntimeNode referenceError(final Expression lhs, final Expression rhs, final boolean earlyError) {
    if (earlyError) {
        throw error(JSErrorType.REFERENCE_ERROR, AbstractParser.message("invalid.lvalue"), lhs.getToken());
    }
    final ArrayList<Expression> args = new ArrayList<>();
    args.add(lhs);
    if (rhs == null) {
        args.add(LiteralNode.newInstance(lhs.getToken(), lhs.getFinish()));
    } else {
        args.add(rhs);
    }
    args.add(LiteralNode.newInstance(lhs.getToken(), lhs.getFinish(), lhs.toString()));
    return new RuntimeNode(lhs.getToken(), lhs.getFinish(), RuntimeNode.Request.REFERENCE_ERROR, args);
}
项目:kaziranga    文件:AssignSymbols.java   
private void throwParserException(final String message, final Node origin) {
    if (origin == null) {
        throw new ParserException(message);
    }
    final Source source = compiler.getSource();
    final long token = origin.getToken();
    final int line = source.getLine(origin.getStart());
    final int column = source.getColumn(origin.getStart());
    final String formatted = ErrorManager.format(message, source, line, column, token);
    throw new ParserException(JSErrorType.SYNTAX_ERROR, formatted, source, line, column, token);
}
项目:lookaside_java-1.8.0-openjdk    文件:AbstractParser.java   
/**
 * Report an error.
 *
 * @param errorType  The error type
 * @param message    Error message.
 * @return ParserException upon failure. Caller should throw and not ignore
 */
protected final ParserException error(final JSErrorType errorType, final String message) {
    // TODO - column needs to account for tabs.
    final int position = Token.descPosition(token);
    final int column = position - linePosition;
    final String formatted = ErrorManager.format(message, source, line, column, token);
    return new ParserException(errorType, formatted, source, line, column, token);
}
项目:lookaside_java-1.8.0-openjdk    文件:JSONParser.java   
ParserException error(final String message, final int start, final int length) throws ParserException {
    final long token     = Token.toDesc(STRING, start, length);
    final int  pos       = Token.descPosition(token);
    final Source src     = Source.sourceFor("<json>", source);
    final int  lineNum   = src.getLine(pos);
    final int  columnNum = src.getColumn(pos);
    final String formatted = ErrorManager.format(message, src, lineNum, columnNum, token);
    return new ParserException(JSErrorType.SYNTAX_ERROR, formatted, src, lineNum, columnNum, token);
}
项目:lookaside_java-1.8.0-openjdk    文件:Parser.java   
private RuntimeNode referenceError(final Expression lhs, final Expression rhs, final boolean earlyError) {
    if (earlyError) {
        throw error(JSErrorType.REFERENCE_ERROR, AbstractParser.message("invalid.lvalue"), lhs.getToken());
    }
    final ArrayList<Expression> args = new ArrayList<>();
    args.add(lhs);
    if (rhs == null) {
        args.add(LiteralNode.newInstance(lhs.getToken(), lhs.getFinish()));
    } else {
        args.add(rhs);
    }
    args.add(LiteralNode.newInstance(lhs.getToken(), lhs.getFinish(), lhs.toString()));
    return new RuntimeNode(lhs.getToken(), lhs.getFinish(), RuntimeNode.Request.REFERENCE_ERROR, args);
}
项目:lookaside_java-1.8.0-openjdk    文件:AssignSymbols.java   
private void throwParserException(final String message, final Node origin) {
    if (origin == null) {
        throw new ParserException(message);
    }
    final Source source = compiler.getSource();
    final long token = origin.getToken();
    final int line = source.getLine(origin.getStart());
    final int column = source.getColumn(origin.getStart());
    final String formatted = ErrorManager.format(message, source, line, column, token);
    throw new ParserException(JSErrorType.SYNTAX_ERROR, formatted, source, line, column, token);
}
项目:jdk8u_nashorn    文件:AbstractParser.java   
/**
 * Report an error.
 *
 * @param errorType  The error type
 * @param message    Error message.
 * @return ParserException upon failure. Caller should throw and not ignore
 */
protected final ParserException error(final JSErrorType errorType, final String message) {
    // TODO - column needs to account for tabs.
    final int position = Token.descPosition(token);
    final int column = position - linePosition;
    final String formatted = ErrorManager.format(message, source, line, column, token);
    return new ParserException(errorType, formatted, source, line, column, token);
}
项目:jdk8u_nashorn    文件:JSONParser.java   
ParserException error(final String message, final int start, final int length) throws ParserException {
    final long token     = Token.toDesc(STRING, start, length);
    final int  pos       = Token.descPosition(token);
    final Source src     = Source.sourceFor("<json>", source);
    final int  lineNum   = src.getLine(pos);
    final int  columnNum = src.getColumn(pos);
    final String formatted = ErrorManager.format(message, src, lineNum, columnNum, token);
    return new ParserException(JSErrorType.SYNTAX_ERROR, formatted, src, lineNum, columnNum, token);
}
项目:jdk8u_nashorn    文件:Parser.java   
private RuntimeNode referenceError(final Expression lhs, final Expression rhs, final boolean earlyError) {
    if (earlyError) {
        throw error(JSErrorType.REFERENCE_ERROR, AbstractParser.message("invalid.lvalue"), lhs.getToken());
    }
    final ArrayList<Expression> args = new ArrayList<>();
    args.add(lhs);
    if (rhs == null) {
        args.add(LiteralNode.newInstance(lhs.getToken(), lhs.getFinish()));
    } else {
        args.add(rhs);
    }
    args.add(LiteralNode.newInstance(lhs.getToken(), lhs.getFinish(), lhs.toString()));
    return new RuntimeNode(lhs.getToken(), lhs.getFinish(), RuntimeNode.Request.REFERENCE_ERROR, args);
}
项目:jdk8u_nashorn    文件:AssignSymbols.java   
private void throwParserException(final String message, final Node origin) {
    if (origin == null) {
        throw new ParserException(message);
    }
    final Source source = compiler.getSource();
    final long token = origin.getToken();
    final int line = source.getLine(origin.getStart());
    final int column = source.getColumn(origin.getStart());
    final String formatted = ErrorManager.format(message, source, line, column, token);
    throw new ParserException(JSErrorType.SYNTAX_ERROR, formatted, source, line, column, token);
}
项目:infobip-open-jdk-8    文件:AbstractParser.java   
/**
 * Report an error.
 *
 * @param errorType  The error type
 * @param message    Error message.
 * @return ParserException upon failure. Caller should throw and not ignore
 */
protected final ParserException error(final JSErrorType errorType, final String message) {
    // TODO - column needs to account for tabs.
    final int position = Token.descPosition(token);
    final int column = position - linePosition;
    final String formatted = ErrorManager.format(message, source, line, column, token);
    return new ParserException(errorType, formatted, source, line, column, token);
}
项目:infobip-open-jdk-8    文件:Parser.java   
private RuntimeNode referenceError(final Expression lhs, final Expression rhs, final boolean earlyError) {
    if (earlyError) {
        throw error(JSErrorType.REFERENCE_ERROR, AbstractParser.message("invalid.lvalue"), lhs.getToken());
    }
    final ArrayList<Expression> args = new ArrayList<>();
    args.add(lhs);
    if (rhs == null) {
        args.add(LiteralNode.newInstance(lhs.getToken(), lhs.getFinish()));
    } else {
        args.add(rhs);
    }
    args.add(LiteralNode.newInstance(lhs.getToken(), lhs.getFinish(), lhs.toString()));
    return new RuntimeNode(lhs.getToken(), lhs.getFinish(), RuntimeNode.Request.REFERENCE_ERROR, args);
}
项目:infobip-open-jdk-8    文件:AssignSymbols.java   
private void throwParserException(final String message, final Node origin) {
    if (origin == null) {
        throw new ParserException(message);
    }
    final Source source = compiler.getSource();
    final long token = origin.getToken();
    final int line = source.getLine(origin.getStart());
    final int column = source.getColumn(origin.getStart());
    final String formatted = ErrorManager.format(message, source, line, column, token);
    throw new ParserException(JSErrorType.SYNTAX_ERROR, formatted, source, line, column, token);
}
项目:OLD-OpenJDK8    文件:AbstractParser.java   
/**
 * Report an error.
 *
 * @param errorType  The error type
 * @param message    Error message.
 * @return ParserException upon failure. Caller should throw and not ignore
 */
protected final ParserException error(final JSErrorType errorType, final String message) {
    // TODO - column needs to account for tabs.
    final int position = Token.descPosition(token);
    final int column = position - linePosition;
    final String formatted = ErrorManager.format(message, source, line, column, token);
    return new ParserException(errorType, formatted, source, line, column, token);
}
项目:OLD-OpenJDK8    文件:Parser.java   
private RuntimeNode referenceError(final Expression lhs, final Expression rhs, final boolean earlyError) {
    if (earlyError) {
        throw error(JSErrorType.REFERENCE_ERROR, AbstractParser.message("invalid.lvalue"), lhs.getToken());
    }
    final ArrayList<Expression> args = new ArrayList<>();
    args.add(lhs);
    if (rhs == null) {
        args.add(LiteralNode.newInstance(lhs.getToken(), lhs.getFinish()));
    } else {
        args.add(rhs);
    }
    args.add(LiteralNode.newInstance(lhs.getToken(), lhs.getFinish(), lhs.toString()));
    return new RuntimeNode(lhs.getToken(), lhs.getFinish(), RuntimeNode.Request.REFERENCE_ERROR, args);
}
项目:nashorn-backport    文件:AbstractParser.java   
/**
 * Report an error.
 *
 * @param errorType  The error type
 * @param message    Error message.
 * @return ParserException upon failure. Caller should throw and not ignore
 */
protected final ParserException error(final JSErrorType errorType, final String message) {
    // TODO - column needs to account for tabs.
    final int position = Token.descPosition(token);
    final int column = position - linePosition;
    final String formatted = ErrorManager.format(message, source, line, column, token);
    return new ParserException(errorType, formatted, source, line, column, token);
}
项目:nashorn-backport    文件:Parser.java   
private RuntimeNode referenceError(final Expression lhs, final Expression rhs, final boolean earlyError) {
    if (earlyError) {
        throw error(JSErrorType.REFERENCE_ERROR, AbstractParser.message("invalid.lvalue"), lhs.getToken());
    }
    final ArrayList<Expression> args = new ArrayList<>();
    args.add(lhs);
    if (rhs == null) {
        args.add(LiteralNode.newInstance(lhs.getToken(), lhs.getFinish()));
    } else {
        args.add(rhs);
    }
    args.add(LiteralNode.newInstance(lhs.getToken(), lhs.getFinish(), lhs.toString()));
    return new RuntimeNode(lhs.getToken(), lhs.getFinish(), RuntimeNode.Request.REFERENCE_ERROR, args);
}
项目:nashorn    文件:AbstractParser.java   
/**
 * Report an error.
 *
 * @param errorType  The error type
 * @param message    Error message.
 * @return ParserException upon failure. Caller should throw and not ignore
 */
protected final ParserException error(final JSErrorType errorType, final String message) {
    // TODO - column needs to account for tabs.
    final int position = Token.descPosition(token);
    final int column = position - linePosition;
    final String formatted = ErrorManager.format(message, source, line, column, token);
    return new ParserException(errorType, formatted, source, line, column, token);
}
项目:nashorn    文件:Parser.java   
private RuntimeNode referenceError(final Expression lhs, final Expression rhs, final boolean earlyError) {
    if (earlyError) {
        throw error(JSErrorType.REFERENCE_ERROR, AbstractParser.message("invalid.lvalue"), lhs.getToken());
    }
    final ArrayList<Expression> args = new ArrayList<>();
    args.add(lhs);
    if (rhs == null) {
        args.add(LiteralNode.newInstance(lhs.getToken(), lhs.getFinish()));
    } else {
        args.add(rhs);
    }
    args.add(LiteralNode.newInstance(lhs.getToken(), lhs.getFinish(), lhs.toString()));
    return new RuntimeNode(lhs.getToken(), lhs.getFinish(), RuntimeNode.Request.REFERENCE_ERROR, args);
}
项目:OpenJSharp    文件:AbstractParser.java   
/**
 * Report an error.
 *
 * @param errorType  The error type
 * @param message    Error message.
 * @param errorToken Offending token.
 * @return ParserException upon failure. Caller should throw and not ignore
 */
protected final ParserException error(final JSErrorType errorType, final String message, final long errorToken) {
    final int position  = Token.descPosition(errorToken);
    final int lineNum   = source.getLine(position);
    final int columnNum = source.getColumn(position);
    final String formatted = ErrorManager.format(message, source, lineNum, columnNum, errorToken);
    return new ParserException(errorType, formatted, source, lineNum, columnNum, errorToken);
}
项目:OpenJSharp    文件:Lexer.java   
/**
 * Generate a runtime exception
 *
 * @param message       error message
 * @param type          token type
 * @param start         start position of lexed error
 * @param length        length of lexed error
 * @throws ParserException  unconditionally
 */
protected void error(final String message, final TokenType type, final int start, final int length) throws ParserException {
    final long token     = Token.toDesc(type, start, length);
    final int  pos       = Token.descPosition(token);
    final int  lineNum   = source.getLine(pos);
    final int  columnNum = source.getColumn(pos);
    final String formatted = ErrorManager.format(message, source, lineNum, columnNum, token);
    throw new ParserException(JSErrorType.SYNTAX_ERROR, formatted, source, lineNum, columnNum, token);
}
项目:openjdk-jdk10    文件:AbstractParser.java   
/**
 * Report an error.
 *
 * @param errorType  The error type
 * @param message    Error message.
 * @param errorToken Offending token.
 * @return ParserException upon failure. Caller should throw and not ignore
 */
protected final ParserException error(final JSErrorType errorType, final String message, final long errorToken) {
    final int position  = Token.descPosition(errorToken);
    final int lineNum   = source.getLine(position);
    final int columnNum = source.getColumn(position);
    final String formatted = ErrorManager.format(message, source, lineNum, columnNum, errorToken);
    return new ParserException(errorType, formatted, source, lineNum, columnNum, errorToken);
}
项目:openjdk-jdk10    文件:Lexer.java   
/**
 * Generate a runtime exception
 *
 * @param message       error message
 * @param type          token type
 * @param start         start position of lexed error
 * @param length        length of lexed error
 * @throws ParserException  unconditionally
 */
protected void error(final String message, final TokenType type, final int start, final int length) throws ParserException {
    final long token     = Token.toDesc(type, start, length);
    final int  pos       = Token.descPosition(token);
    final int  lineNum   = source.getLine(pos);
    final int  columnNum = source.getColumn(pos);
    final String formatted = ErrorManager.format(message, source, lineNum, columnNum, token);
    throw new ParserException(JSErrorType.SYNTAX_ERROR, formatted, source, lineNum, columnNum, token);
}
项目:openjdk9    文件:AbstractParser.java   
/**
 * Report an error.
 *
 * @param errorType  The error type
 * @param message    Error message.
 * @param errorToken Offending token.
 * @return ParserException upon failure. Caller should throw and not ignore
 */
protected final ParserException error(final JSErrorType errorType, final String message, final long errorToken) {
    final int position  = Token.descPosition(errorToken);
    final int lineNum   = source.getLine(position);
    final int columnNum = source.getColumn(position);
    final String formatted = ErrorManager.format(message, source, lineNum, columnNum, errorToken);
    return new ParserException(errorType, formatted, source, lineNum, columnNum, errorToken);
}
项目:openjdk9    文件:Lexer.java   
/**
 * Generate a runtime exception
 *
 * @param message       error message
 * @param type          token type
 * @param start         start position of lexed error
 * @param length        length of lexed error
 * @throws ParserException  unconditionally
 */
protected void error(final String message, final TokenType type, final int start, final int length) throws ParserException {
    final long token     = Token.toDesc(type, start, length);
    final int  pos       = Token.descPosition(token);
    final int  lineNum   = source.getLine(pos);
    final int  columnNum = source.getColumn(pos);
    final String formatted = ErrorManager.format(message, source, lineNum, columnNum, token);
    throw new ParserException(JSErrorType.SYNTAX_ERROR, formatted, source, lineNum, columnNum, token);
}
项目:kaziranga    文件:AbstractParser.java   
/**
 * Report an error.
 *
 * @param errorType  The error type
 * @param message    Error message.
 * @param errorToken Offending token.
 * @return ParserException upon failure. Caller should throw and not ignore
 */
protected final ParserException error(final JSErrorType errorType, final String message, final long errorToken) {
    final int position  = Token.descPosition(errorToken);
    final int lineNum   = source.getLine(position);
    final int columnNum = source.getColumn(position);
    final String formatted = ErrorManager.format(message, source, lineNum, columnNum, errorToken);
    return new ParserException(errorType, formatted, source, lineNum, columnNum, errorToken);
}
项目:kaziranga    文件:Lexer.java   
/**
 * Generate a runtime exception
 *
 * @param message       error message
 * @param type          token type
 * @param start         start position of lexed error
 * @param length        length of lexed error
 * @throws ParserException  unconditionally
 */
protected void error(final String message, final TokenType type, final int start, final int length) throws ParserException {
    final long token     = Token.toDesc(type, start, length);
    final int  pos       = Token.descPosition(token);
    final int  lineNum   = source.getLine(pos);
    final int  columnNum = source.getColumn(pos);
    final String formatted = ErrorManager.format(message, source, lineNum, columnNum, token);
    throw new ParserException(JSErrorType.SYNTAX_ERROR, formatted, source, lineNum, columnNum, token);
}