public class ClassNode extends Expression implements LexicalContextScope
| Modifier and Type | Field and Description |
|---|---|
static String |
PRIVATE_CONSTRUCTOR_BINDING_NAME |
| Constructor and Description |
|---|
ClassNode(long token,
int finish,
IdentNode ident,
Expression classHeritage,
PropertyNode constructor,
List<PropertyNode> classElements,
Scope scope,
int instanceFieldCount,
int staticFieldCount,
boolean hasPrivateMethods,
boolean hasPrivateInstanceMethods)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Node |
accept(LexicalContext lc,
NodeVisitor<? extends LexicalContext> visitor)
Accept function for the node given a lexical context.
|
<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.
|
List<PropertyNode> |
getClassElements()
Get method definitions except the constructor.
|
Expression |
getClassHeritage()
The expression of the
extends clause. |
PropertyNode |
getConstructor()
Get the constructor method definition.
|
IdentNode |
getIdent()
Class identifier.
|
int |
getInstanceFieldCount() |
Scope |
getScope() |
int |
getStaticFieldCount() |
boolean |
hasInstanceFields() |
boolean |
hasPrivateInstanceMethods() |
boolean |
hasPrivateMethods() |
boolean |
hasStaticFields() |
boolean |
isAnonymous() |
ClassNode |
setClassElements(List<PropertyNode> classElements) |
ClassNode |
setConstructor(PropertyNode constructor) |
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
|
getFinish, getFinishWithoutParens, getStart, getStartWithoutParens, isAlwaysFalse, isAlwaysTrue, isParenthesized, isSelfModifying, makeParenthesizedclone, equals, getSourceOrder, getToken, hashCode, isAssignment, isLoop, isTokenType, tokenType, toString, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitaccept, acceptpublic static final String PRIVATE_CONSTRUCTOR_BINDING_NAME
public ClassNode(long token,
int finish,
IdentNode ident,
Expression classHeritage,
PropertyNode constructor,
List<PropertyNode> classElements,
Scope scope,
int instanceFieldCount,
int staticFieldCount,
boolean hasPrivateMethods,
boolean hasPrivateInstanceMethods)
token - tokenfinish - finishpublic IdentNode getIdent()
public Expression getClassHeritage()
extends clause. Optional.public PropertyNode getConstructor()
public ClassNode setConstructor(PropertyNode constructor)
public List<PropertyNode> getClassElements()
public ClassNode setClassElements(List<PropertyNode> classElements)
public Node accept(LexicalContext lc, NodeVisitor<? extends LexicalContext> visitor)
LexicalContextNodeaccept in interface LexicalContextNodelc - lexical contextvisitor - node visitorpublic <R> R accept(LexicalContext lc, TranslatorNodeVisitor<? extends LexicalContext,R> visitor)
accept in interface LexicalContextNodepublic Scope getScope()
getScope in interface LexicalContextScopepublic boolean hasInstanceFields()
public int getInstanceFieldCount()
public boolean hasStaticFields()
public int getStaticFieldCount()
public boolean hasPrivateMethods()
public boolean hasPrivateInstanceMethods()
public boolean isAnonymous()
public void toString(StringBuilder sb, boolean printType)
Nodepublic 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.