|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.quasiliteral.quasiterm.QAstroArg
Untamed:
Field Summary | |
(package private) static ValueGuard |
EListGuard
|
(package private) static int[] |
EMPTY_INDEX
|
(package private) AstroBuilder |
myBuilder
|
(package private) SourceSpan |
myOptSpan
|
(package private) static long |
serialVersionUID
|
Fields inherited from interface org.erights.e.elib.tables.Selfless |
HONORARY, HONORED_NAMES |
Fields inherited from interface org.erights.e.elib.serial.PassByConstruction |
HONORARY, HONORED_NAMES |
Fields inherited from interface org.erights.e.elib.serial.Persistent |
HONORARY, HONORED_NAMES |
Constructor Summary | |
QAstroArg(AstroBuilder builder,
SourceSpan optSpan)
Enabled: |
Method Summary | |
void |
__printOn(TextWriter out)
Enabled: |
String |
asText()
Enabled: |
(package private) abstract void |
endShape(FlexList optBindings,
int[] prefix,
int shape)
For this subtree and this index elements, 'shape' is the number of index elements that have been successfully enumerated. |
abstract int |
getHeight()
Enabled: What's the longest distance to the bottom? |
SourceSpan |
getOptSpan()
Enabled: What source text was originally lexed or parsed to produce this node, or a representative token of this node? |
abstract int |
matchBindSlice(ConstList args,
ConstList specimenList,
FlexList bindings,
int[] index)
Enabled: |
abstract void |
prettyPrintOn(TextWriter out)
Enabled: |
abstract AstroArg |
qbuild(QuasiBuilder qbuilder)
Enabled: |
(package private) abstract int |
startShape(ConstList args,
FlexList optBindings,
int[] prefix,
int shapeSoFar)
For this substree and this index-prefix, what's the most number of index elements that should be enumerated? |
abstract ConstList |
substSlice(ConstList args,
int[] index)
Enabled: @param args Each arg[i] is of a type matched to the corresponding dollar-hole. |
String |
toString()
Suppressed: |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.erights.e.elib.tables.Selfless |
getSpreadUncall |
Field Detail |
static final long serialVersionUID
static final int[] EMPTY_INDEX
static final ValueGuard EListGuard
final AstroBuilder myBuilder
final SourceSpan myOptSpan
Constructor Detail |
public QAstroArg(AstroBuilder builder, SourceSpan optSpan)
builder
- For building the result of a substitute.optSpan
- Where is the source text this node was extracted from?Method Detail |
public abstract ConstList substSlice(ConstList args, int[] index)
index
- Further indexes after a hole's hole-num. For example,
If a dollar-hole's hole-num is 3 and index is [4,5], then
the dollar-hole would evaluate to args[3][4][5].
public abstract int matchBindSlice(ConstList args, ConstList specimenList, FlexList bindings, int[] index)
args
- See the doc on 'args' in #substitute(Object[],
String)
specimenList
- :(ConstList of(Astro))bindings
- Like 'args', but by extraction from specimenindex
- Further indexes after a hole's hole-num. For example,
If a dollar-hole's hole-num is 3 and index is [4,5], then
the dollar-hole would access args[3][4][5]. Similarly,
an at-hole with hole-num 3 would store into
bindings[3][4][5].
abstract int startShape(ConstList args, FlexList optBindings, int[] prefix, int shapeSoFar)
If this subtree has no dollar-holes, it should just return shapeSoFar. The initial shapeSoFar is -1 (meaning "indeterminate"), so a tree with no dollar-holes will just return -1. An non-ranking inner node (eg, a QTerm) just asks all its children, passing to each the shapeSoFar from the previous.
All the rest of the semantics is specific to dollar-hole, at-hole, or to raking nodes, so see the documentation there.
abstract void endShape(FlexList optBindings, int[] prefix, int shape)
For each prefix, startShape and endShape form the openning and closing brackets around calls to matchBindSlice or substSlice.
public SourceSpan getOptSpan()
getOptSpan
in interface AstroArg
public abstract AstroArg qbuild(QuasiBuilder qbuilder)
public abstract int getHeight()
A leaf node is height 1. All other nodes are one more than the height of their highest child. This is used for pretty printing.
public void __printOn(TextWriter out) throws IOException
IOException
public String toString()
toString
in class Object
public String asText()
public abstract void prettyPrintOn(TextWriter out) throws IOException
IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |