gnu.kawa.lispexpr
public class LispReader extends Lexer
Field Summary | |
---|---|
protected boolean | finalColonIsKeyword True if "IDENTIFIER:" should be treated as a keyword. |
protected boolean | initialColonIsKeyword True if ":IDENTIFIER" should be treated as a keyword. |
protected boolean | seenEscapes If true, then tokenbuffer contains escaped characters.
|
static int | SCM_NUMBERS |
static char | TOKEN_ESCAPE_CHAR |
Constructor Summary | |
---|---|
LispReader(LineBufferedReader port) | |
LispReader(LineBufferedReader port, SourceMessages messages) |
Method Summary | |
---|---|
Object | handleToken(int startPos, int endPos, ReadTable rtable) Classify and return a token in tokenBuffer from startPos to endPos. |
static Object | lookupUnit(String name) Resolve a unit name, if possible.
|
protected Object | makeNil() |
protected Object | makePair(Object car, int line, int column) |
Object | makePair(Object car, Object cdr) |
static Object | parseNumber(char[] buffer, int start, int count, char exactness, int radix, int flags) Parse a number. |
static Object | readCharacter(LispReader reader) |
Object | readCommand() Read a "command" - a top-level expression or declaration.
|
int | readEscape() Reads a C-style String escape sequence.
|
int | readEscape(int c) |
void | readNestedComment(char c1, char c2) Read a #|...|#-style comment (which may contain other nested comments).
|
static Object | readNumberWithRadix(int previous, LispReader reader, int radix) Read a number from a LispReader |
Object | readObject() |
Object | readObject(int c) |
static SimpleVector | readSimpleVector(LispReader reader, char kind) |
static Object | readSpecial(LispReader reader) |
Object | readValues(int ch, ReadTable rtable) |
Object | readValues(int ch, ReadTableEntry entry, ReadTable rtable) May return zero or multiple values. |
protected Object | returnSymbol(int startPos, int endPos, ReadTable rtable) |
protected void | setCdr(Object pair, Object cdr) |
protected boolean | validPostfixLookupStart(ReadTable rtable) |
Parameters: buffer contains the characters of the number start startinging index of the number in the buffer count number of characters in buffer to use exactness either 'i' or 'I' force an inexact result, either 'e' or 'E' force an exact result, '\0' yields an inact or inexact depending on the form of the literal, while ' ' is like '\0' but does not allow more exactness specifiers. radix the number base to use or 0 if unspecified
Returns: the number if a valid number; null or a String-valued error message if if there was some error parsing the number.
Parameters: previous number of characters already pushed on tokenBuffer reader LispReader to read from radix base to use or -1 if unspecified