gov.llnl.babel.msg
Class ErrorFormatter
java.lang.Object
gov.llnl.babel.msg.ErrorFormatter
public class ErrorFormatter
extends java.lang.Object
static String | formatOffendingToken(String filename, Token t) - Generate two lines of text the first with line of specified by the token
the second some carets (^) pointing out the actual token
|
static String | formatOffendingTokens(String filename, Token begin, Token end) - Generate two lines of text; the first with line specified by the token range,
the second some carets (^) point out the offending tokens.
|
static void | formatParseError(ParseException e, String url)
|
formatOffendingToken
public static String formatOffendingToken(String filename,
Token t)
Generate two lines of text the first with line of specified by the token
the second some carets (^) pointing out the actual token
filename
- where the token was found (if null, then empty string returned)t
- token to highlight
- a two line string suitable for error messages or a message explaining
that the original contents of the file cannot be found.
formatOffendingTokens
public static String formatOffendingTokens(String filename,
Token begin,
Token end)
Generate two lines of text; the first with line specified by the token range,
the second some carets (^) point out the offending tokens. Note if the token
range spans more than one line, then only the first line is displayed.
filename
- where the token was found (if null, then empty string returned)begin
- first token to highlightend
- last token to highlight
formatParseError
public static void formatParseError(ParseException e,
String url)