Package gnu.kawa.lispexpr
Class ReadTable
- java.lang.Object
-
- gnu.kawa.util.RangeTable
-
- gnu.kawa.lispexpr.ReadTable
-
- All Implemented Interfaces:
Cloneable
public class ReadTable extends RangeTable
-
-
Field Summary
Fields Modifier and Type Field Description static intCONSTITUENTstatic intdefaultBracketModeDefault value to pass to setBracketMode() unless overridden.intextraFlagsprotected booleanfinalColonIsKeywordTrue if "IDENTIFIER:" should be treated as a keyword.protected booleanhexEscapeAfterBackslashControl whether we should handle R6RS inline hex escape.static intILLEGALKinds of characters.protected booleaninitialColonIsKeywordTrue if ":IDENTIFIER" should be treated as a keyword.static intMULTIPLE_ESCAPEstatic intNON_TERMINATING_MACROcharpostfixLookupOperatorA characterXsuch thatPreXWord -> ($lookup$ Pre 'Word), ifX > 0.static intSINGLE_ESCAPEstatic intTERMINATING_MACROstatic intWHITESPACE
-
Constructor Summary
Constructors Constructor Description ReadTable()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ReadTablecreateInitial()Create a new ReadTable and initialize it appropriately for Common Lisp.static ReadTablegetCurrent()ObjectgetReaderCtor(String key)Resolve a SRFI-10 constructor tags to a functions.voidinitialize(boolean sharpIsTerminating)ReadTableEntrylookup(int ch)protected ObjectmakeSymbol(String name)voidputReaderCtor(String key, Type type)Add a mapping for a SRFI-10 constructor tag.voidputReaderCtor(String key, Procedure proc)Add a mapping for a SRFI-10 constructor tag.voidputReaderCtorFld(String key, String cname, String fname)Map a SRFI-10 constructor tag to Procedure-valued lazy fieldvoidsetBracketMode()Specify how '[' and ']' are handled.voidsetBracketMode(int mode)Specify how'['and']'(and'<') are handled.static voidsetCurrent(ReadTable rt)voidsetFinalColonIsKeyword(boolean whenFinal)Set whether "IDENTIFIER:" should be treated as a keyword.voidsetInitialColonIsKeyword(boolean whenInitial)Set whether ":IDENTIFIER" should be treated as a keyword.
-
-
-
Field Detail
-
ILLEGAL
public static final int ILLEGAL
Kinds of characters.- See Also:
- Constant Field Values
-
WHITESPACE
public static final int WHITESPACE
- See Also:
- Constant Field Values
-
CONSTITUENT
public static final int CONSTITUENT
- See Also:
- Constant Field Values
-
SINGLE_ESCAPE
public static final int SINGLE_ESCAPE
- See Also:
- Constant Field Values
-
MULTIPLE_ESCAPE
public static final int MULTIPLE_ESCAPE
- See Also:
- Constant Field Values
-
TERMINATING_MACRO
public static final int TERMINATING_MACRO
- See Also:
- Constant Field Values
-
NON_TERMINATING_MACRO
public static final int NON_TERMINATING_MACRO
- See Also:
- Constant Field Values
-
defaultBracketMode
public static int defaultBracketMode
Default value to pass to setBracketMode() unless overridden.
-
postfixLookupOperator
public char postfixLookupOperator
A characterXsuch thatPreXWord -> ($lookup$ Pre 'Word), ifX > 0.
-
initialColonIsKeyword
protected boolean initialColonIsKeyword
True if ":IDENTIFIER" should be treated as a keyword.
-
finalColonIsKeyword
protected boolean finalColonIsKeyword
True if "IDENTIFIER:" should be treated as a keyword.
-
extraFlags
public int extraFlags
-
hexEscapeAfterBackslash
protected boolean hexEscapeAfterBackslash
Control whether we should handle R6RS inline hex escape. I.e."\x"<hexdigits>";".
-
-
Method Detail
-
setInitialColonIsKeyword
public void setInitialColonIsKeyword(boolean whenInitial)
Set whether ":IDENTIFIER" should be treated as a keyword.
-
setFinalColonIsKeyword
public void setFinalColonIsKeyword(boolean whenFinal)
Set whether "IDENTIFIER:" should be treated as a keyword.
-
initialize
public void initialize(boolean sharpIsTerminating)
-
createInitial
public static ReadTable createInitial()
Create a new ReadTable and initialize it appropriately for Common Lisp.
-
setBracketMode
public void setBracketMode(int mode)
Specify how'['and']'(and'<') are handled. The value -2 means[a b c]is($bracket-list$ a b c)andf[a b]is($bracket-apply$ f a b). The value -1 means that '[' and ']' are plain token constituents. The value 0 means that '[' and ']' are equivalent to '(' and ')'. The value 1 means that '[' and ']' are equivalent to '(' and ')', except within a token starting with'<',in which case they are constituents. This is so'['is non-terminating when reading say'<char[]>'
-
setBracketMode
public void setBracketMode()
Specify how '[' and ']' are handled. Unless overridden, uses defaultBracketMode.
-
putReaderCtor
public void putReaderCtor(String key, Procedure proc)
Add a mapping for a SRFI-10 constructor tag.
-
putReaderCtor
public void putReaderCtor(String key, Type type)
Add a mapping for a SRFI-10 constructor tag.
-
putReaderCtorFld
public void putReaderCtorFld(String key, String cname, String fname)
Map a SRFI-10 constructor tag to Procedure-valued lazy field
-
getReaderCtor
public Object getReaderCtor(String key)
Resolve a SRFI-10 constructor tags to a functions.
-
getCurrent
public static ReadTable getCurrent()
-
setCurrent
public static void setCurrent(ReadTable rt)
-
lookup
public ReadTableEntry lookup(int ch)
-
-