public final class WithNode extends Statement
with statements.| Constructor and Description |
|---|
WithNode(int lineNumber,
long token,
int finish,
Expression expression,
Block body)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
Node |
accept(LexicalContext lc,
NodeVisitor<? extends LexicalContext> visitor)
Assist in IR navigation.
|
<R> R |
accept(LexicalContext lc,
TranslatorNodeVisitor<? extends LexicalContext,R> visitor) |
Node |
accept(NodeVisitor<? extends LexicalContext> visitor)
Provides a means to navigate the IR.
|
<R> R |
accept(TranslatorNodeVisitor<? extends LexicalContext,R> visitor)
Provides a means to navigate the IR.
|
Block |
getBody()
Get the body of this WithNode
|
Expression |
getExpression()
Get the expression of this WithNode
|
boolean |
isCompletionValueNeverEmpty() |
boolean |
isTerminal()
Is this a terminal statement, i.e.
|
WithNode |
setBody(LexicalContext lc,
Block body)
Reset the body of this with node
|
WithNode |
setExpression(LexicalContext lc,
Expression expression)
Reset the expression of this with node
|
void |
toString(StringBuilder sb,
boolean printType)
Print logic that decides whether to show the optimistic type or not - for example it should
not be printed after just parse, when it hasn't been computed, or has been set to a trivially
provable value
|
getLineNumber, hasGoto, hasTerminalFlagsclone, equals, getFinish, getSourceOrder, getStart, getToken, hashCode, isAssignment, isLoop, isTokenType, tokenType, toString, toStringpublic WithNode(int lineNumber,
long token,
int finish,
Expression expression,
Block body)
lineNumber - Line number of the headertoken - First tokenfinish - Character index of the last tokenexpression - With expressionbody - Body of with nodepublic Node accept(LexicalContext lc, NodeVisitor<? extends LexicalContext> visitor)
visitor - IR navigating visitor.lc - lexical contextpublic <R> R accept(LexicalContext lc, TranslatorNodeVisitor<? extends LexicalContext,R> visitor)
public boolean isTerminal()
StatementisTerminal in interface TerminalisTerminal in class Statementpublic void toString(StringBuilder sb, boolean printType)
Nodepublic Block getBody()
public WithNode setBody(LexicalContext lc, Block body)
lc - lexical contextbody - new bodypublic Expression getExpression()
public WithNode setExpression(LexicalContext lc, Expression expression)
lc - lexical contextexpression - new expressionpublic boolean isCompletionValueNeverEmpty()
isCompletionValueNeverEmpty in class Statementemptypublic final Node accept(NodeVisitor<? extends LexicalContext> visitor)
Nodeaccept in interface LexicalContextNodeaccept in class Nodevisitor - Node visitor.public final <R> R accept(TranslatorNodeVisitor<? extends LexicalContext,R> visitor)
Nodeaccept in interface LexicalContextNodeaccept in class Nodevisitor - Node visitor.