|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.erights.e.elang.evm.ParseNode | +--org.erights.e.elang.evm.ENode | +--org.erights.e.elang.evm.EExpr | +--org.erights.e.elang.evm.ObjectExpr
Safe: BNF: "def" litString [ "implements" eExpr* ] "{" method* [ matcher ] "}"
Yields an object that closes over the current scope, and responds to requests by dispatching to one of its matching methods, or to a matcher if provided and no methods match.
org.erights.e.elang.evm.DefineExpr
Field Summary | |
private static ValueGuard |
AuditorGuard
|
private FlexSet |
myAuditorCache
|
private EExpr[] |
myAuditorExprs
|
private String |
myDocComment
|
private EScript |
myEScript
|
private EMethodTable |
myOptEMTableCache
|
private NounExpr[] |
myOptFieldInits
|
private String |
myOptFQN
|
Fields inherited from class org.erights.e.elang.evm.ENode |
|
Fields inherited from class org.erights.e.elang.evm.ParseNode |
NUM_PR, PR_ASSIGN, PR_CALL, PR_COMP, PR_EEXPR, PR_LISTPATT, PR_ORDER, PR_PATTERN, PR_PRIM, PR_START |
Constructor Summary | |
ObjectExpr(SourceSpan optSpan,
String docComment,
String optFQN,
EExpr[] auditorExprs,
EScript eScript)
Enabled: |
|
ObjectExpr(SourceSpan optSpan,
String docComment,
String optFQN,
EExpr[] auditorExprs,
EScript eScript,
NounExpr[] fieldNouns)
Enabled: |
Method Summary | |
ConstList |
auditors()
Enabled: |
protected StaticScope |
computeStaticScope()
The left-to-right sum of the auditors + the eScript. |
private EMethodTable |
eMethodTable()
|
EScript |
eScript()
Enabled: |
String |
getFQName()
Enabled: Call only after a fully qualified name has been assigned |
String |
getOptFQN()
Enabled: |
boolean |
matchBind(ConstList args,
Object specimen,
FlexList bindings)
Enabled: |
(package private) NounExpr[] |
optFieldNouns()
Return the nouns used to initialize instance fields from the outer scope. |
protected Object |
subEval(EvalContext ctx,
boolean forValue)
The recursive part that does the work |
void |
subPrintOn(TextWriter out,
int priority)
Enabled: |
Object |
welcome(ETreeVisitor visitor)
Enabled: |
Methods inherited from class org.erights.e.elang.evm.EExpr |
__printOn, appendAllTo, appendTo, eval, eval, evalBool, printAsBlockOn, substitute, transform |
Methods inherited from class org.erights.e.elang.evm.ENode |
cleanCopy, copy, getOptPatternMap, getOptScopeMap, getPatternMap, getScopeMap, qbuild, setPatternMap, setScopeMap, staticScope, synEnv |
Methods inherited from class org.erights.e.elang.evm.ParseNode |
asText, getOptSpan, lnPrintOn, lnPrintOn, matchBind, matchBind, matchBind, printListOn, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private final String myDocComment
private final String myOptFQN
private final EExpr[] myAuditorExprs
private final FlexSet myAuditorCache
private final EScript myEScript
private final NounExpr[] myOptFieldInits
private transient EMethodTable myOptEMTableCache
private static final ValueGuard AuditorGuard
Constructor Detail |
public ObjectExpr(SourceSpan optSpan, String docComment, String optFQN, EExpr[] auditorExprs, EScript eScript)
public ObjectExpr(SourceSpan optSpan, String docComment, String optFQN, EExpr[] auditorExprs, EScript eScript, NounExpr[] fieldNouns)
Method Detail |
public Object welcome(ETreeVisitor visitor)
welcome
in class ENode
NounExpr[] optFieldNouns()
Will be non-null after the appropriate compilation transformation.
public String getOptFQN()
protected StaticScope computeStaticScope()
Note that the instance variable are only the variables used by the eScript, not the variables used by the objectExpr as a whole, since the auditor expressions are evaluated in the instantiating environment.
computeStaticScope
in class ENode
protected Object subEval(EvalContext ctx, boolean forValue)
EExpr
subEval
in class EExpr
public boolean matchBind(ConstList args, Object specimen, FlexList bindings)
matchBind
in interface MatchMaker
matchBind
in class ParseNode
public void subPrintOn(TextWriter out, int priority) throws IOException
subPrintOn
in class ParseNode
IOException
public String getFQName()
public ConstList auditors()
public EScript eScript()
private EMethodTable eMethodTable()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |