|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--org.erights.e.elang.syntax.BaseENodeBuilder
|
+--org.erights.e.elang.syntax.ENodeBuilder
Untamed:
| Field Summary | |
private static EExpr |
__BREAK
|
private static EExpr |
__CONTINUE
|
private static EExpr |
__RETURN
|
private static EExpr |
ANY
|
private static EExpr |
BOOLEAN
|
private static EExpr |
COMPARER
|
private static EExpr |
DEFINESLOT
|
private static EExpr |
EE
|
private static EExpr |
EQUALIZER
|
private static EExpr |
FALSE
|
private static EExpr |
LOOP
|
private static EExpr |
MAKE_LIST
|
private static EExpr |
MAKE_MAP
|
private static EExpr |
MAKE_MSG
|
private static EExpr |
MAKE_ORDERED_SPACE
|
private static EExpr |
MAKE_PARAM
|
private static EExpr |
MAKE_PROT
|
private HilbertHotel |
myHilbert
|
private static EExpr[] |
NO_EEXPRS
|
private static EExpr |
NULL
|
private static EExpr |
PROMISE_ALL_FULFILLED
|
private static EExpr |
REF
|
private static EExpr |
SETTABLE
|
private static EExpr |
THROW
|
private static EExpr |
TRUE
|
private static EExpr |
VOID
|
| Fields inherited from class org.erights.e.elang.syntax.BaseENodeBuilder |
myLexer, myProps |
| Constructor Summary | |
ENodeBuilder(ConstMap props,
LexerFace lexer)
Enabled: |
|
| Method Summary | |
Object[] |
accumBody(Object verb,
Object rnValue)
Enabled: |
Object[] |
accumFor(Object assoc,
Object collExpr,
Object accumBody)
Enabled: |
Object[] |
accumIf(Object condExpr,
Object accumBody)
Enabled: |
EExpr |
accumulate(Object starterExpr,
Object accumulator)
Enabled: |
Object[] |
accumWhile(Object condExpr,
Object accumBody)
Enabled: |
private EExpr[] |
antiCycle(FlexMap conflicts)
Expand a left-pattern and an rValue that might cause a circularity into a sequence of expressions without this circularity, except that the place for the expression itself has a null as a placeholder. |
EExpr |
asBigAs(Object x,
Object y)
Enabled: |
EExpr |
assign(Object lValue,
Object rValue)
Enabled: |
Assoc |
assoc(Object key,
Object value)
Enabled: |
Pattern |
atNoun(Object token)
Enabled: When an at-hole is '@ |
Pattern |
bindDefiner(Object identOrStr)
Enabled: |
Pattern |
bindDefiner(Object identOrStr,
Object valueGuardExpr)
Enabled: |
EExpr |
call(Object recipientExpr,
Object verbPos,
String verb,
Object args)
Enabled: |
EExpr |
classExpr(Object doco,
Object classHead,
Object mBody)
Enabled: |
EExpr |
condAnd(Object left,
Object right)
Enabled: left && right => { if (left) { if (right) { [&nameOut, ...] } else { null } } else { null } } =~ [&nameOut, ...] |
EExpr |
condOr(Object left,
Object right)
Enabled: left || right => { if (left) { null =~ [right's outNames - left's outNames] [&nameOut, ...] } else if (right) { null =~ [left's outNames - right's outNames] [&nameOut, ...] } else { null } } =~ [&nameOut, ...] |
EExpr |
define(Object pattern,
Object rValue)
Enabled: |
Matcher |
delegatex(Object bodyExpr)
Enabled: delegate{expr} expands to match [verb, args] { E call(expr, verb, args) } |
EExpr |
dollarNoun(Object token)
Enabled: When a dollar-hole is '$ |
EExpr |
doMeta(Object keyword,
Object verb,
Object args)
Enabled: |
EExpr |
doMeta(Object keyword,
Object verbPos,
String verb,
Object args)
Enabled: |
EExpr |
doMetaSend(Object keyword,
Object verb,
Object args)
Enabled: |
EExpr |
doMetaSend(Object keyword,
Object verbPos,
String verb,
Object args)
Enabled: |
EExpr |
ejector(Object ejNoun)
Enabled: |
EExpr |
ejector(Object ejNoun,
Object valExpr)
Enabled: |
Assoc |
exporter(Object nounExpr)
Enabled: |
Pattern |
finalPattern(Object str)
Enabled: |
EExpr |
forward(Object identOrStr)
Enabled: A forward declaration. |
EExpr |
forx(Object assoc,
Object collExpr,
Object mBody)
Enabled: |
EExpr |
geq(Object x,
Object y)
Enabled: |
EExpr |
get__BREAK()
Enabled: |
EExpr |
get__CONTINUE()
Enabled: |
EExpr |
get__RETURN()
Enabled: |
EExpr |
getNULL()
Enabled: |
EExpr |
getVOID()
Enabled: |
EExpr |
greaterThan(Object x,
Object y)
Enabled: |
private Astro |
ident(Object original,
String newStr)
Makes an identifier token whose value is 'newStr', and whose source is derived from 'original'. |
EExpr |
ifx(Object condExpr,
Object thenExpr)
Enabled: |
Assoc |
importer(Object namerPatt)
Enabled: |
EExpr |
leq(Object x,
Object y)
Enabled: |
EExpr |
lessThan(Object x,
Object y)
Enabled: |
private EExpr[] |
lValuePair(EExpr lValue)
Return a pair of an optional prelude expression and an access expression, used to access of modify an lValue without recomputing the lValue expression. |
EExpr |
macro(Object macroName,
Object optMacroArg,
Object macroBody,
Object optNextMacro)
Enabled: |
Astro |
mangle(Object ident,
String suffix)
Enabled: Mangles an identifier into a variable name by appending a known suffix. |
EExpr |
map(Object assocList)
Enabled: [a => b, c => d] expands to __makeMap fromPairs([[a, b], [c, d]) This exapansion satisfies the requirement that it preserves order. |
Pattern |
mapPattern(Object assocList,
Object optRestPatt)
Enabled: |
private EExpr |
matchExpr(Matcher[] matchers,
Astro varName,
EExpr optOtherwise)
|
EExpr |
methObject(Object decl,
Object msgPatt,
Object bodyExpr,
boolean bindReturn)
Enabled: For defining an eScript that consists of exactly one method |
private EScriptDecl |
methScriptDecl(Object msgPatt,
Object bodyExpr,
boolean bindReturn)
For defining an eScript that consists of exactly one method |
EExpr |
mod(Object val,
Object nModulus)
Enabled: |
EExpr |
mType(Object doco,
Object verb,
Object pTypes,
Object optRetType)
Enabled: |
private Astro |
newTemp(Object identOrString)
generate 'unique' temporary variable names for transformations. |
EExpr |
not(Object x)
Enabled: |
EExpr |
object(Object decl,
Object script)
Enabled: |
private EExpr |
object(String docComment,
Object optOName,
EExpr optSuperExpr,
EExpr[] impls,
EScriptDecl script)
|
ObjDecl |
oDecl(Object optExtends,
Object auditors)
Enabled: |
ObjDecl |
oDecl(Object doco,
Object optOName,
Object oldODecl)
Enabled: |
(package private) Matcher |
optMatcher(Object matchers)
|
private EExpr |
oType(LiteralExpr docComment,
Object optOName,
Pattern optAuditorPatt,
EExpr optExtends,
EExpr auditorTuple,
EExpr msgTuple)
|
EExpr |
oType(Object doco,
Object oName,
Object mTypes)
Enabled: |
EExpr |
oType(Object doco,
Object optOName,
Object optAudit,
Object decl,
Object mTypes)
Enabled: |
private EExpr |
oTypeBase(LiteralExpr docComment,
Pattern optGuardPatt,
Pattern optAuditorPatt,
EExpr qualName,
EExpr auditorTuple,
EExpr msgTuple)
|
Pattern |
patternEquals(Object eExpr)
Enabled: (== eExpr) expands to (specimen ? specimen == eExpr) |
Astro |
prop(Object propertyName)
Enabled: Used to transform 'a.name' into 'a.getName(args)'. |
EExpr |
pType(Object optName,
Object optType)
Enabled: |
EExpr |
quasiExpr(Object syntax,
Object quasiList)
Enabled: syntax`foo $bar baz $zip zorp` expands to syntax_quasiParser \ valueMaker("foo ${0} baz ${1} zorp") \ substitute([bar, zip]) |
QuasiLiteralExpr |
quasiLiteralExpr()
Enabled: $$ expands to ${0} |
QuasiLiteralExpr |
quasiLiteralExpr(Object litIndex)
Enabled: |
QuasiLiteralPatt |
quasiLiteralPatt(Object litIndex)
Enabled: |
Pattern |
quasiPattern(Object syntax,
Object quasiList)
Enabled: syntax`foo $bar baz @zip zorp` expands to q ? (syntax__quasiParser \ matchMaker("foo ${0} baz @{0} zorp") \ matchBind([bar], q) =~ [zip]) |
QuasiPatternExpr |
quasiPatternExpr(Object litIndex)
Enabled: |
QuasiPatternPatt |
quasiPatternPatt(Object litIndex)
Enabled: |
EExpr |
same(Object x,
Object y)
Enabled: |
EExpr |
send(Object recipientExpr,
Object verbPos,
String verb,
Object args)
Enabled: |
EExpr |
sequence(Object x,
Object y)
Enabled: |
EExpr |
sequence(Object x,
Object y,
Object z)
Enabled: |
Pattern |
slotDefiner(Object name)
Enabled: |
EExpr |
slotExpr(Object eExpr)
Enabled: |
private Pattern |
slotsPattern(Object[] names)
Given an array of names, return a tuple pattern that will bind all these names to slots when matched with an array of slots with the same shape. |
private EExpr |
slotsTuple(Object[] names)
Given an array of names, return an expression that will make a tuple from the slots of the variables of these names |
EExpr |
switchx(Object specimen,
Object matchers)
Enabled: switch (eExpr) { match pattern1 { body1 } match pattern2 { body2 } } expands to { def temp = eExpr if (temp =~ pattern1) { body1 } else if (temp =~ pattern2) { body2 } else { throw("no match: " + temp) } } |
EExpr |
thru(Object start,
Object stop)
Enabled: |
EExpr |
thunk(Object doco,
Object bodyExpr)
Enabled: Expands to |
EExpr |
till(Object start,
Object bound)
Enabled: |
EMethodNode |
to(Object doco,
Object msgPatt,
Object bodyExpr)
Enabled: |
EExpr |
tryx(Object eExpr,
Object catchers,
Object optFinally)
Enabled: |
EExpr |
tuple(Object argList)
Enabled: [x, y, z] expands to __makeList(x, y, z) |
EExpr |
update(Object lValue,
Object verb,
Object rnValue)
Enabled: |
EExpr |
uriExpr(Object uriToken)
Enabled: uriToken must be a URI, and have both protocol and body. |
EExpr |
uriExpr(Object uriStartToken,
Object uriBodyExpr)
Enabled: uriStartToken must be a URIStart, and must have a protocol, but no body. |
Astro |
varName(Object identOrStr)
Enabled: Make vacancies for new temporary variable names. |
Pattern |
varPattern(Object name)
Enabled: |
EExpr |
when(Object headList,
Object bodyExpr,
Object catchers,
Object optFinally)
Enabled: |
private EExpr |
whenBase(EExpr eExpr,
ObjDecl objDecl,
Pattern patt1,
EExpr resultGuard,
EExpr body1,
Object catchers,
Object optFinally)
Then when statement base-case expands as follows: |
private EExpr |
whenList(EExpr[] eExprs,
ObjDecl objDecl,
Pattern[] patts,
EExpr resultGuard,
EExpr body1,
Object catchers,
Object optFinally)
Then normal when statement syntax expands as follows: |
EExpr |
whilex(Object condExpr,
Object bodyExpr)
Enabled: The while loop expands as follows: while (cond) { body } expands to escape __break { __loop( def _() :boolean { if (cond) { escape __continue { body } true } else { false } }) } |
| Methods inherited from class org.erights.e.elang.syntax.BaseENodeBuilder |
antiPocket, append, call, cdrPattern, docComment, escape, exprs, finalPattern, hide, ident, idStr, ifx, ignore, list, list, list, list, list, listPattern, literal, matchBind, matcher, methHead, method, noun, object, oDecl, pocket, reserved, send, sequence, suchThat, syntaxError, typedArray, varPattern, vTable, with |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.erights.e.elang.syntax.BaseEBuilder |
antiPocket, append, call, cdrPattern, escape, finalPattern, hide, ifx, ignore, list, list, list, list, list, listPattern, literal, matchBind, matcher, methHead, method, oDecl, pocket, reserved, send, sequence, suchThat, varPattern, vTable, with |
| Field Detail |
private static final EExpr NULL
private static final EExpr FALSE
private static final EExpr TRUE
private static final EExpr THROW
private static final EExpr LOOP
private static final EExpr MAKE_LIST
private static final EExpr MAKE_MAP
private static final EExpr MAKE_PROT
private static final EExpr MAKE_MSG
private static final EExpr MAKE_PARAM
private static final EExpr SETTABLE
private static final EExpr DEFINESLOT
private static final EExpr ANY
private static final EExpr VOID
private static final EExpr BOOLEAN
private static final EExpr MAKE_ORDERED_SPACE
private static final EExpr EQUALIZER
private static final EExpr COMPARER
private static final EExpr REF
private static final EExpr EE
private static final EExpr PROMISE_ALL_FULFILLED
private static final EExpr __BREAK
private static final EExpr __CONTINUE
private static final EExpr __RETURN
private static final EExpr[] NO_EEXPRS
private final HilbertHotel myHilbert
| Constructor Detail |
public ENodeBuilder(ConstMap props,
LexerFace lexer)
| Method Detail |
public EExpr getNULL()
getNULL in interface EBuilderpublic EExpr getVOID()
getVOID in interface EBuilderpublic EExpr get__BREAK()
get__BREAK in interface EBuilderpublic EExpr get__CONTINUE()
get__CONTINUE in interface EBuilderpublic EExpr get__RETURN()
get__RETURN in interface EBuilder
public EExpr assign(Object lValue,
Object rValue)
assign in interface BaseEBuilderassign in class BaseENodeBuilderprivate EExpr[] lValuePair(EExpr lValue)
In expanding
x[foo()][bar()] += 3
it's important that x[foo()] and bar() only be
evaluated once. This evaluation happens in the prelude, leaving the
resulting values in temporary variables, let's say t1 and
t2 used by the access expression.
The access expression would then be t1[t2], ie, t1.get(t2). By the assignment rules, when such an expression appears on the left side of an assignment, it gets transformed approximately into t1.put(t2, newValue). (Actually, the assignment transform also arranges for the value of the assignment to be the value the rValue evaluated to.)
lValuePair can only be applied to NounExprs and CallExprs.
public EExpr update(Object lValue,
Object verb,
Object rnValue)
update in interface EBuilderpublic EExpr slotExpr(Object eExpr)
slotExpr in interface BaseEBuilderslotExpr in class BaseENodeBuilder
public EExpr call(Object recipientExpr,
Object verbPos,
String verb,
Object args)
call in interface EBuilder
public EExpr send(Object recipientExpr,
Object verbPos,
String verb,
Object args)
send in interface EBuilderpublic EExpr not(Object x)
not in interface EBuilder
public EExpr doMeta(Object keyword,
Object verb,
Object args)
doMeta in interface EBuilder
public EExpr doMeta(Object keyword,
Object verbPos,
String verb,
Object args)
doMeta in interface EBuilder
public EExpr doMetaSend(Object keyword,
Object verb,
Object args)
doMetaSend in interface EBuilder
public EExpr doMetaSend(Object keyword,
Object verbPos,
String verb,
Object args)
doMetaSend in interface EBuilder
public EExpr classExpr(Object doco,
Object classHead,
Object mBody)
classExpr in interface EBuilder
public EExpr condAnd(Object left,
Object right)
condAnd in interface EBuilder
public EExpr condOr(Object left,
Object right)
condOr in interface EBuilderprivate EExpr[] antiCycle(FlexMap conflicts)
public EExpr define(Object pattern,
Object rValue)
define in interface BaseEBuilderdefine in class BaseENodeBuilderpublic Pattern atNoun(Object token)
atNoun in interface EBuilderpublic Pattern finalPattern(Object str)
finalPattern in interface EBuilderpublic Pattern varPattern(Object name)
varPattern in interface EBuilderpublic Pattern slotDefiner(Object name)
slotDefiner in interface EBuilderpublic EExpr dollarNoun(Object token)
dollarNoun in interface EBuilder
private Astro ident(Object original,
String newStr)
'original' might be a String, an identifier token (an Astro), a CallExpr, or a SendExpr.