|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectai.krr.SyntaxAdaptableSymbol
public abstract class SyntaxAdaptableSymbol
This class implements the foundations for symbolic programming in Java.
Constructor Summary | |
---|---|
SyntaxAdaptableSymbol()
|
Method Summary | |
---|---|
boolean |
isBooleanSymbol()
This function tests whether this Symbol is a BooleanSymbol . |
boolean |
isNamedSymbol()
This function tests whether this Symbol is a NamedSymbol . |
boolean |
isNumericSymbol()
This function tests whether this Symbol is a NumericSymbol . |
void |
prettyPrint(int indent,
java.io.Writer w,
inf.compilers.SyntaxAdaptor sa)
This function can be used write this SyntaxAdaptable object to the given Writer. |
static Symbol |
read(java.io.Reader r,
inf.compilers.SyntaxAdaptor<SyntaxAdaptableSymbol> sa)
This function can be used to read a Symbol from the given Reader. |
void |
write(java.io.Writer w,
inf.compilers.SyntaxAdaptor sa)
This function can be used write this logical Symbol to the given Writer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface ai.krr.Symbol |
---|
getClassOrderIndex |
Methods inherited from interface java.lang.Comparable |
---|
compareTo |
Constructor Detail |
---|
public SyntaxAdaptableSymbol()
Method Detail |
---|
public void write(java.io.Writer w, inf.compilers.SyntaxAdaptor sa) throws inf.compilers.ExpressivenessException, java.io.IOException
This function can be used write this logical Symbol to the given Writer. The syntax in which it is written is defined by the SyntaxAdaptor that is also given to this function.
write
in interface inf.compilers.SyntaxAdaptable
w
- the Writer to which this Symbol is writtensa
- the SyntaxAdaptor that determines the syntax
inf.compilers.ExpressivenessException
- if the syntax does not support this type
of Symbol
java.io.IOException
- if writing to the Writer failspublic void prettyPrint(int indent, java.io.Writer w, inf.compilers.SyntaxAdaptor sa) throws inf.compilers.ExpressivenessException, java.io.IOException
This function can be used write this SyntaxAdaptable object to the given Writer. The syntax is the same as for normal writing. The only difference is the inclusion of extra space and newlines for better readability.
prettyPrint
in interface inf.compilers.SyntaxAdaptable
indent
- the amount of indentation for the first linew
- the Writer to which this Symbol is writtensa
- the SyntaxAdaptor that determines the syntax
inf.compilers.ExpressivenessException
- if the syntax does not support this type
of Symbol
java.io.IOException
- if writing to the Writer failspublic boolean isBooleanSymbol()
This function tests whether this Symbol is a BooleanSymbol
. This
default implementation always returns false.
isBooleanSymbol
in interface Symbol
public boolean isNumericSymbol()
This function tests whether this Symbol is a NumericSymbol
. This
default implementation always returns false.
isNumericSymbol
in interface Symbol
public boolean isNamedSymbol()
This function tests whether this Symbol is a NamedSymbol
. This
default implementation always returns false.
isNamedSymbol
in interface Symbol
public static Symbol read(java.io.Reader r, inf.compilers.SyntaxAdaptor<SyntaxAdaptableSymbol> sa) throws inf.compilers.ExpressivenessException, java.text.ParseException, java.io.IOException
This function can be used to read a Symbol from the given Reader. The given SyntaxAdaptor determines the exact Syntax that will be used.
r
- the Reader from which characters forming the Symbol are readsa
- the SyntaxAdaptor defining the syntax and used for parsing
inf.compilers.ExpressivenessException
java.text.ParseException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |