|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hecl.CodeThing
public class CodeThing
The CodeThing
class implements a chunk of "compiled" code
including multiple "Stanzas", or individual commands.
Field Summary | |
---|---|
boolean |
marksubst
|
Method Summary | |
---|---|
void |
addStanza(Interp interp,
Thing[] argv,
int lineno)
The addStanza method adds a new command and its arguments. |
RealThing |
deepcopy()
CodeThing's deepcopy method makes a copy of all
the stanzas, which in turn copy all their objects. |
protected static Thing |
doCodeSubst(Interp interp,
Thing thing)
doCodeSubst takes a code Thing and runs it, returning the
result. |
protected static Thing |
doGroupSubst(Interp interp,
Thing thing)
doGroupSubst runs substitutions on 'groups' of things,
such as "foo $foo [foo]". |
protected static Thing |
doSubstSubst(Interp interp,
Thing thing)
doSubstSubst runs substitutions on things of the
SubstThing type, which means $foo or &foo in Hecl. |
static CodeThing |
get(Interp interp,
Thing thing)
get returns a CodeThing object from any kind of Thing - or
returns an error. |
java.lang.String |
getStringRep()
The getStringRep method returns a String representation of
the commands it represents. |
Thing |
run(Interp interp)
The run method runs the CodeThing. |
java.lang.String |
thingclass()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public boolean marksubst
Method Detail |
---|
public java.lang.String thingclass()
thingclass
in interface RealThing
public static CodeThing get(Interp interp, Thing thing) throws HeclException
get
returns a CodeThing object from any kind of Thing - or
returns an error.
interp
- an Interp
valuething
- a Thing
value
CodeThing
value
HeclException
- if an error occurspublic RealThing deepcopy() throws HeclException
deepcopy
method makes a copy of all
the stanzas, which in turn copy all their objects.
deepcopy
in interface RealThing
RealThing
value
HeclException
- if an error occursprotected static Thing doCodeSubst(Interp interp, Thing thing) throws HeclException
doCodeSubst
takes a code Thing and runs it, returning the
result. This is used for substitution in situations like this: "foo [bar]
baz", where the substitution needs to be run every time, but the block
can't be broken up. doCodeSubst operates on the [bar] word in the above
case.
interp
- an Interp
valuething
- a Thing
value
Thing
value
HeclException
- if an error occursprotected static Thing doSubstSubst(Interp interp, Thing thing) throws HeclException
doSubstSubst
runs substitutions on things of the
SubstThing type, which means $foo or &foo in Hecl.
interp
- an Interp
valuething
- a Thing
value
Thing
value
HeclException
- if an error occursprotected static Thing doGroupSubst(Interp interp, Thing thing) throws HeclException
doGroupSubst
runs substitutions on 'groups' of things,
such as "foo $foo [foo]". The group can't be broken up, so it needs to be
substituted together by subst'ing the individual components.
interp
- an Interp
valuething
- a Thing
value
Thing
value
HeclException
- if an error occurspublic void addStanza(Interp interp, Thing[] argv, int lineno)
addStanza
method adds a new command and its arguments.
interp
- Interp
valueargv
- Thing[]
valuepublic Thing run(Interp interp) throws HeclException
run
method runs the CodeThing.
interp
- Interp
value
HeclException
- if an error occurspublic java.lang.String getStringRep()
getStringRep
method returns a String representation of
the commands it represents.
getStringRep
in interface RealThing
String
value.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |