public final class ClosureExpression extends ContextReferencingExpression
Modifier and Type | Class and Description |
---|---|
static class |
ClosureExpression.ClosureArgAst |
Constructor and Description |
---|
ClosureExpression(ASTInfo info,
ClosureType closureType,
Expression expression,
java.util.List<java.lang.String> argNames) |
Modifier and Type | Method and Description |
---|---|
<T,E extends java.lang.Throwable> |
accept(ExpressionVisitor<T,E> visitor)
Accepts visitor.
|
protected java.lang.Object |
basicInterpret(Interpreter interpreter,
InterpreterStackTrace stackTrace)
Interpret expression.
|
Field[] |
createFields(ClosureType closureType) |
java.util.List<ClosureExpression.ClosureArgAst> |
getArgAsts()
Returns the list of argument AST nodes.
|
java.util.List<java.lang.String> |
getArgNames()
Returns the argument names.
|
java.util.Map<java.lang.String,ASTNode> |
getArgTypeRanges()
Returns the map of argument type ranges.
|
int |
getArgumentCount()
Returns the number of arguments.
|
Expression |
getExpression()
Returns the body expression.
|
java.lang.String |
getNodeText()
Returns the text of this node.
|
ClosureType |
getType()
Returns the return type.
|
boolean |
isBodyCreatingNonModuleContextObjects()
Returns
true if the body expression creates non-module context objects,
e.g. |
boolean |
isModuleContextClosure()
Returns
true if the closure is not referencing
non-module variables from outside scope and no methods (if
it is in a method body). |
boolean |
isReferencingNonModuleContext()
Returns
true if the closure is referencing
non-module variables from outside scope and or methods (if
it is in a method body). |
createANTLRParser, doInterpret, evalCondition, evaluateToExpressions, executeCompiled, getCompiled, getDebugLine, getIdentifierAst, getParseTimeConstant, getPrimaryRange, getPropertySelectorRange, getRange, getResultExpression, getResultExpressions, interpret, interpretInCurrentNamespace, isCreatingNonModuleContextObjects, isParseTimeConstant, requiresNewNamespace, setCompiled, showInFullText, showInSurroundingText, showInText, toExpressions
getFullText, getLine, getText, toString
contains, getBeginIndex, getEndIndex, getLength
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getFullText, getLine, getText
contains, getBeginIndex, getEndIndex, getLength
public ClosureExpression(ASTInfo info, ClosureType closureType, Expression expression, java.util.List<java.lang.String> argNames)
info
- closureType
- expression
- argNames
- java.lang.NullPointerException
- if expression
or argNames
is nulljava.lang.IllegalArgumentException
- if argNames
contains nullpublic ClosureType getType()
Expression
getType
in class Expression
public Expression getExpression()
public int getArgumentCount()
public java.util.List<java.lang.String> getArgNames()
public boolean isModuleContextClosure()
true
if the closure is not referencing
non-module variables from outside scope and no methods (if
it is in a method body).true
if the closure is referencing
only the module contextpublic boolean isReferencingNonModuleContext()
ContextReferencingExpression
true
if the closure is referencing
non-module variables from outside scope and or methods (if
it is in a method body).isReferencingNonModuleContext
in class ContextReferencingExpression
true
if the closure is referencing
enclosing non-module contextpublic boolean isBodyCreatingNonModuleContextObjects()
true
if the body expression creates non-module context objects,
e.g. closures or references that reference non-module variables.true
if the body expression creates non-module context objectspublic java.lang.String getNodeText()
ASTNode
getNodeText
in interface ASTNode
getNodeText
in class ASTNodeImpl
public <T,E extends java.lang.Throwable> T accept(ExpressionVisitor<T,E> visitor) throws E extends java.lang.Throwable
Expression
accept
in class Expression
E
E extends java.lang.Throwable
protected java.lang.Object basicInterpret(Interpreter interpreter, InterpreterStackTrace stackTrace)
Expression
basicInterpret
in class Expression
public Field[] createFields(ClosureType closureType)
closureType
- public java.util.Map<java.lang.String,ASTNode> getArgTypeRanges()
public java.util.List<ClosureExpression.ClosureArgAst> getArgAsts()
Copyright © 2007-2020 Whitestein Technologies. All Rights Reserved.