@Override protected void getterIdentifierError(ISourcePosition position, String identifier) { throw new SyntaxException(PID.BAD_IDENTIFIER, position, "identifier " + identifier + " is not valid to get", identifier); }
public SyntaxException(PID pid, String file, int line, String lastLine, String message, Object... data) { super(prepareMessage(message, lastLine)); this.pid = pid; this.file = file; this.line = line; }
switch (e.getPid()) { case UNKNOWN_ENCODING: case NOT_ASCII_COMPATIBLE: throw runtime.newArgumentError(e.getMessage()); default: StringBuilder buffer = new StringBuilder(100); buffer.append(e.getFile()).append(':'); buffer.append(e.getLine() + 1).append(": "); buffer.append(e.getMessage());
switch (e.getPid()) { case UNKNOWN_ENCODING: case NOT_ASCII_COMPATIBLE: throw runtime.newArgumentError(e.getMessage()); default: StringBuilder buffer = new StringBuilder(100); buffer.append(e.getPosition().getFile()).append(':'); buffer.append(e.getPosition().getStartLine() + 1).append(": "); buffer.append(e.getMessage());
switch (e.getPid()) { case UNKNOWN_ENCODING: case NOT_ASCII_COMPATIBLE: throw runtime.newArgumentError(e.getMessage()); default: StringBuilder buffer = new StringBuilder(100); buffer.append(e.getFile()).append(':'); buffer.append(e.getLine() + 1).append(": "); buffer.append(e.getMessage());
switch (e.getPid()) { case UNKNOWN_ENCODING: case NOT_ASCII_COMPATIBLE: throw runtime.newArgumentError(e.getMessage()); default: StringBuilder buffer = new StringBuilder(100); buffer.append(e.getPosition().getFile()).append(':'); buffer.append(e.getPosition().getStartLine() + 1).append(": "); buffer.append(e.getMessage());
@Override protected void getterIdentifierError(ISourcePosition position, String identifier) { throw new SyntaxException(PID.BAD_IDENTIFIER, position, "identifier " + identifier + " is not valid to get", identifier); }
public SyntaxException(PID pid, String file, int line, String lastLine, String message, Object... data) { super(prepareMessage(message, lastLine)); this.pid = pid; this.file = file; this.line = line; }
public void allowDubyExtension(ISourcePosition position) { throw new SyntaxException(PID.DUBY_EXTENSIONS_OFF, position, lexer.getCurrentLine(), "Duby extensions not configured"); }
public SyntaxException(PID pid, ISourcePosition position, String lastLine, String message, Object... data) { super(prepareMessage(message, lastLine)); this.pid = pid; this.position = position; }
private void mixedEscape(RubyYaccLexer lexer, Encoding foundEncoding, Encoding parserEncoding) { throw new SyntaxException(PID.MIXED_ENCODING,lexer.getPosition(), "", foundEncoding + " mixed within " + parserEncoding); }
public SyntaxException(PID pid, ISourcePosition position, String lastLine, String message, Object... data) { super(prepareMessage(message, lastLine)); this.pid = pid; this.position = position; }
protected void getterIdentifierError(ISourcePosition position, String identifier) { throw new SyntaxException(PID.BAD_IDENTIFIER, position, lexer.getCurrentLine(), "identifier " + identifier + " is not valid", identifier); }
protected void getterIdentifierError(ISourcePosition position, String identifier) { throw new SyntaxException(PID.BAD_IDENTIFIER, position, lexer.getCurrentLine(), "identifier " + identifier + " is not valid", identifier); }
private void mixedEscape(RubyYaccLexer lexer, Encoding foundEncoding, Encoding parserEncoding) { throw new SyntaxException(PID.MIXED_ENCODING,lexer.getPosition(), "", foundEncoding + " mixed within " + parserEncoding); }
public void allowDubyExtension(ISourcePosition position) { throw new SyntaxException(PID.DUBY_EXTENSIONS_OFF, position, lexer.getCurrentLine(), "Duby extensions not configured"); }
public void backrefAssignError(Node node) { if (node instanceof NthRefNode) { String varName = "$" + ((NthRefNode) node).getMatchNumber(); throw new SyntaxException(PID.INVALID_ASSIGNMENT, node.getPosition(), "Can't set variable " + varName + '.', varName); } else if (node instanceof BackRefNode) { String varName = "$" + ((BackRefNode) node).getType(); throw new SyntaxException(PID.INVALID_ASSIGNMENT, node.getPosition(), "Can't set variable " + varName + '.', varName); } }
/** * generate parsing error */ public void yyerror(String message) { throw new SyntaxException(PID.GRAMMAR_ERROR, lexer.getPosition(), lexer.getCurrentLine(), message); }
private void syntaxError(LexerSource src) { throw new SyntaxException(PID.STRING_MARKER_MISSING, src.getPosition(), src.getCurrentLine(), "can't find string \"" + marker + "\" anywhere before EOF", marker); } }
public void backrefAssignError(Node node) { if (node instanceof NthRefNode) { String varName = "$" + ((NthRefNode) node).getMatchNumber(); throw new SyntaxException(PID.INVALID_ASSIGNMENT, node.getPosition(), "Can't set variable " + varName + '.', varName); } else if (node instanceof BackRefNode) { String varName = "$" + ((BackRefNode) node).getType(); throw new SyntaxException(PID.INVALID_ASSIGNMENT, node.getPosition(), "Can't set variable " + varName + '.', varName); } }