| java.lang.Object java.io.Reader gnu.text.Lexer
All known Subclasses: gnu.kawa.xslt.XslTranslator, gnu.xquery.lang.XQParser, gnu.kawa.lispexpr.LispReader, gnu.ecmascript.Lexer,
Lexer | public class Lexer extends Reader (Code) | | Framework for implementing lexical scanners and parsers.
author: Per Bothner |
Method Summary | |
public boolean | checkErrors(PrintWriter out, int max) Returns true if any error were seen. | public boolean | checkNext(char ch) Check if the next character matches a given character.
Parameters: ch - The character to match against. | public void | clearErrors() | public void | close() | public void | eofError(String msg) | public void | eofError(String message, int startLine, int startColumn) | public void | error(char severity, String filename, int line, int column, String message) | public void | error(char severity, String message) | public void | error(String message) | public void | fatal(String message) | public int | getColumnNumber() | public SourceError | getErrors() | public int | getLineNumber() | public SourceMessages | getMessages() | public String | getName() | final public LineBufferedReader | getPort() | public boolean | isInteractive() | public void | mark() Start tentative parsing. | public int | peek() | public void | popNesting(char save) | public char | pushNesting(char promptChar) Enter a nested expression.
This is used in interactive mode to control whether to continue
past end of line, depending on whether the expression is incomplete.
Parameters: promptChar - Used in prompt string to indicate type of nesting. | public int | read() | public int | read(char[] buf, int offset, int length) | public static long | readDigitsInBuffer(LineBufferedReader port, int radix) | public int | readOptionalExponent() Read an optional signed integer. | public void | reset() Stop tentative parsing. | public boolean | seenErrors() | public void | setInteractive(boolean v) | public void | setMessages(SourceMessages messages) | public void | skip() | protected void | skip_quick() | public void | tokenBufferAppend(int ch) Append one character to tokenBuffer, resizing it if need be. | public void | unread(int ch) | protected void | unread() | protected void | unread_quick() |
interactive | protected boolean interactive(Code) | | |
nesting | protected int nesting(Code) | | |
tokenBuffer | public char[] tokenBuffer(Code) | | For building tokens of various kinds.
|
tokenBufferLength | public int tokenBufferLength(Code) | | The number of chars of tokenBuffer that are used.
|
checkErrors | public boolean checkErrors(PrintWriter out, int max)(Code) | | Returns true if any error were seen. Prints and clears the errors.
Parameters: out - where to write the error message to Parameters: max - maximum number of messages to print (can be 0) |
checkNext | public boolean checkNext(char ch) throws java.io.IOException(Code) | | Check if the next character matches a given character.
Parameters: ch - The character to match against. if the character read matchesOn a match, the position is advanced following that character. |
clearErrors | public void clearErrors()(Code) | | |
error | public void error(char severity, String filename, int line, int column, String message)(Code) | | |
getColumnNumber | public int getColumnNumber()(Code) | | |
getLineNumber | public int getLineNumber()(Code) | | |
isInteractive | public boolean isInteractive()(Code) | | |
popNesting | public void popNesting(char save)(Code) | | Exit a nested expression, reversing pushNesting
Parameters: save - Saved values return by prior pushNesting |
pushNesting | public char pushNesting(char promptChar)(Code) | | Enter a nested expression.
This is used in interactive mode to control whether to continue
past end of line, depending on whether the expression is incomplete.
Parameters: promptChar - Used in prompt string to indicate type of nesting. The previous value of promptChar, to be passed to popNesting. |
readDigitsInBuffer | public static long readDigitsInBuffer(LineBufferedReader port, int radix)(Code) | | Read digits, up to the first non-digit or the buffer limit
the digits seen as a non-negative long, or -1 on overflow |
readOptionalExponent | public int readOptionalExponent() throws java.io.IOException(Code) | | Read an optional signed integer.
If there is no integer in the input stream, return 1.
For excessively large exponents, return Integer.MIN_VALUE
or Integer.MAX_VALUE.
|
seenErrors | public boolean seenErrors()(Code) | | |
setInteractive | public void setInteractive(boolean v)(Code) | | |
tokenBufferAppend | public void tokenBufferAppend(int ch)(Code) | | Append one character to tokenBuffer, resizing it if need be.
|
|
|