anvil.script.expression
Class LinkNode

java.lang.Object
  |
  +--anvil.script.expression.Node
        |
        +--anvil.script.expression.LinkNode
All Implemented Interfaces:
ReferenceResolver

public class LinkNode
extends Node
implements ReferenceResolver

class LinkNode


Field Summary
protected  Parent _args
           
protected  int _index
           
protected  Location _location
           
protected  Name _name
           
protected  int _role
           
protected  ModuleStatement _script
           
protected  Statement _statement
           
static int ASSIGN
           
static int DECLARE
           
static int DECLARE_STATIC
           
static int GET
           
static int NEW
           
 
Fields inherited from class anvil.script.expression.Node
DELETE, EXPR_ADD, EXPR_AND, EXPR_ARRAY, EXPR_ASSIGN, EXPR_ASSIGN_ADD, EXPR_ASSIGN_CONCAT, EXPR_ASSIGN_DIVIDE, EXPR_ASSIGN_INIT, EXPR_ASSIGN_MODULO, EXPR_ASSIGN_MULTIPLY, EXPR_ASSIGN_SUBST, EXPR_ASSIGN_SUBTRACT, EXPR_ATTRIBUTE, EXPR_BOOLEAN_CAST, EXPR_CALL, EXPR_CLASSOF, EXPR_CLONE, EXPR_COMPARE, EXPR_COMPARISON_CHAIN, EXPR_CONCATENATION, EXPR_CONDITIONAL, EXPR_CONSTANT, EXPR_CONSTANT_VARIABLE, EXPR_COPY, EXPR_DEFAULT_MAPPING, EXPR_DEFINED, EXPR_DELETE, EXPR_DIVIDE, EXPR_EMPTY_REFERENCE, EXPR_EQUAL, EXPR_EXACT_EQUAL, EXPR_EXACT_NOT_EQUAL, EXPR_FLOAT_CAST, EXPR_FOREACH, EXPR_GREATER, EXPR_GREATER_EQUAL, EXPR_HAS, EXPR_IMPORT, EXPR_IN, EXPR_INT_CAST, EXPR_INVOKE, EXPR_IS, EXPR_LESS, EXPR_LESS_EQUAL, EXPR_LINK, EXPR_LIST, EXPR_MAPPING, EXPR_MATCH, EXPR_MODULO, EXPR_MULTIPLY, EXPR_NAMED, EXPR_NAMESPACE, EXPR_NEW, EXPR_NO_MATCH, EXPR_NOT, EXPR_NOT_EQUAL, EXPR_OR, EXPR_PIPE, EXPR_POSTFIX_DECREMENT, EXPR_POSTFIX_INCREMENT, EXPR_PREFIX_DECREMENT, EXPR_PREFIX_INCREMENT, EXPR_RANGE, EXPR_REFERENCE, EXPR_SELECT, EXPR_SIZEOF, EXPR_SPLICE, EXPR_STRING_BUFFER, EXPR_STRING_CAST, EXPR_SUBTRACT, EXPR_SYMBOL, EXPR_THIS, EXPR_THUNK, EXPR_TYPE, EXPR_TYPEOF, EXPR_UNARY_MINUS, EXPR_UNARY_PLUS, EXPR_VARIABLE, EXPR_XOR, GET_BOOLEAN, GET_REF, GET_TYPE, GET_UNREF, NONE
 
Constructor Summary
LinkNode(Statement stmt, Location location, Name name)
           
LinkNode(Statement stmt, Location location, Name name, Parent args, int role)
           
 
Method Summary
protected  void checkAccess(ErrorListener listener, Type type)
           
protected  void checkArguments(ErrorListener context, CompilableFunction function)
           
protected  Node classConstruct(ErrorListener listener, Scope scope)
           
 void compile(ByteCompiler context, int operation)
           
protected  Node construct(ErrorListener listener, Scope scope)
           
protected  Parent consumeArgs()
           
protected  java.lang.String consumeSymbol()
           
protected  Node doLink(ErrorListener listener)
           
 Any eval()
           
protected  Node explicitThisConstruct(ErrorListener listener, ClassType classtype)
           
protected  Type followImports(ErrorListener listener, Type type)
           
 Location getLocation()
           
 java.lang.String getReference()
           
 boolean hasArgs()
           
protected  boolean hasMoreSymbols()
           
 boolean isConstant()
           
 Node link(ErrorListener listener)
           
protected  Type lookupLibrary(ErrorListener context)
           
protected  Node newCallNode(ErrorListener listener, CompilableFunction function, Parent parameters)
           
protected  Node newConstantVariableNode(ErrorListener listener, ConstantVariableType type)
           
protected  Node newConstruct(ErrorListener listener, ClassType target)
           
protected  Node newInlinedCallNode(ErrorListener listener, FunctionStatement context, FunctionStatement function, Parent parameters)
           
protected  Node newInlinedFunctionNode(ErrorListener listener, FunctionStatement context, FunctionStatement function)
           
protected  Node newMemberVariableNode(ErrorListener listener, ClassType target, ClassType context, MemberVariableType type)
           
protected  Node newStaticInvokeNode(ErrorListener listener, ClassType target, ClassType context, MethodType method, Parent parameters)
           
protected  Node newStaticVariableNode(ErrorListener listener, StaticVariableType type)
           
protected  Node newThisNode(ErrorListener listener, ClassType context, ClassType type)
           
protected  Node newTypeNode(ErrorListener listener, Type type)
           
protected  Node onFunction(ErrorListener listener, Type type)
           
 Node optimize()
           
protected  int peekKind()
           
protected  java.lang.String peekSymbol()
           
 Type resolveReference(ErrorListener listener)
           
 void setRole(int role)
           
protected  Node superConstruct(ErrorListener listener)
           
protected  int symbolsLeft()
           
 java.lang.String toString()
           
 java.lang.String toString(boolean withArgs)
           
 int typeOf()
           
 
Methods inherited from class anvil.script.expression.Node
check, compile, isAssignable, isUpdatable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

GET

public static final int GET
See Also:
Constant Field Values

ASSIGN

public static final int ASSIGN
See Also:
Constant Field Values

DECLARE

public static final int DECLARE
See Also:
Constant Field Values

DECLARE_STATIC

public static final int DECLARE_STATIC
See Also:
Constant Field Values

NEW

public static final int NEW
See Also:
Constant Field Values

_script

protected ModuleStatement _script

_statement

protected Statement _statement

_location

protected Location _location

_name

protected Name _name

_index

protected int _index

_args

protected Parent _args

_role

protected int _role
Constructor Detail

LinkNode

public LinkNode(Statement stmt,
                Location location,
                Name name,
                Parent args,
                int role)

LinkNode

public LinkNode(Statement stmt,
                Location location,
                Name name)
Method Detail

setRole

public void setRole(int role)

typeOf

public int typeOf()
Overrides:
typeOf in class Node

isConstant

public boolean isConstant()
Overrides:
isConstant in class Node

optimize

public Node optimize()
Overrides:
optimize in class Node

toString

public java.lang.String toString()
Overrides:
toString in class Node

toString

public java.lang.String toString(boolean withArgs)

consumeArgs

protected Parent consumeArgs()

hasArgs

public boolean hasArgs()

consumeSymbol

protected java.lang.String consumeSymbol()

peekSymbol

protected java.lang.String peekSymbol()

peekKind

protected int peekKind()

symbolsLeft

protected int symbolsLeft()

hasMoreSymbols

protected boolean hasMoreSymbols()

checkAccess

protected void checkAccess(ErrorListener listener,
                           Type type)

newTypeNode

protected Node newTypeNode(ErrorListener listener,
                           Type type)

newConstantVariableNode

protected Node newConstantVariableNode(ErrorListener listener,
                                       ConstantVariableType type)

newStaticVariableNode

protected Node newStaticVariableNode(ErrorListener listener,
                                     StaticVariableType type)

newThisNode

protected Node newThisNode(ErrorListener listener,
                           ClassType context,
                           ClassType type)

newMemberVariableNode

protected Node newMemberVariableNode(ErrorListener listener,
                                     ClassType target,
                                     ClassType context,
                                     MemberVariableType type)

newStaticInvokeNode

protected Node newStaticInvokeNode(ErrorListener listener,
                                   ClassType target,
                                   ClassType context,
                                   MethodType method,
                                   Parent parameters)

newInlinedCallNode

protected Node newInlinedCallNode(ErrorListener listener,
                                  FunctionStatement context,
                                  FunctionStatement function,
                                  Parent parameters)

newInlinedFunctionNode

protected Node newInlinedFunctionNode(ErrorListener listener,
                                      FunctionStatement context,
                                      FunctionStatement function)

newCallNode

protected Node newCallNode(ErrorListener listener,
                           CompilableFunction function,
                           Parent parameters)

checkArguments

protected void checkArguments(ErrorListener context,
                              CompilableFunction function)

lookupLibrary

protected Type lookupLibrary(ErrorListener context)

explicitThisConstruct

protected Node explicitThisConstruct(ErrorListener listener,
                                     ClassType classtype)

classConstruct

protected Node classConstruct(ErrorListener listener,
                              Scope scope)

followImports

protected Type followImports(ErrorListener listener,
                             Type type)

onFunction

protected Node onFunction(ErrorListener listener,
                          Type type)

construct

protected Node construct(ErrorListener listener,
                         Scope scope)

superConstruct

protected Node superConstruct(ErrorListener listener)

newConstruct

protected Node newConstruct(ErrorListener listener,
                            ClassType target)

doLink

protected Node doLink(ErrorListener listener)

link

public Node link(ErrorListener listener)

getReference

public java.lang.String getReference()
Specified by:
getReference in interface ReferenceResolver

getLocation

public Location getLocation()
Specified by:
getLocation in interface ReferenceResolver

resolveReference

public Type resolveReference(ErrorListener listener)
Specified by:
resolveReference in interface ReferenceResolver

eval

public Any eval()
Overrides:
eval in class Node

compile

public void compile(ByteCompiler context,
                    int operation)
Overrides:
compile in class Node