org.jruby.compiler
Class ASTInspector

java.lang.Object
  extended by org.jruby.compiler.ASTInspector

public class ASTInspector
extends java.lang.Object

Author:
headius

Field Summary
static int BACKREF
           
static int BLOCK_ARG
           
static int CLASS
           
static int CLASS_VAR
           
static int CLOSURE
           
static int CONSTANT
           
static boolean ENABLED
           
static int EVAL
           
static int FRAME_AWARE
           
static java.util.Set<java.lang.String> FRAME_AWARE_METHODS
           
static int FRAME_BLOCK
           
static int FRAME_CLASS
           
static int FRAME_NAME
           
static int FRAME_SELF
           
static int FRAME_VISIBILITY
           
static int LASTLINE
           
static int METHOD
           
static int OPT_ARGS
           
static java.util.Set<java.lang.String> PRAGMAS
           
static int REST_ARG
           
static int SCOPE_AWARE
           
static int ZSUPER
           
 
Constructor Summary
ASTInspector()
           
 
Method Summary
 void disable()
           
 boolean getFlag(int modifier)
           
 boolean hasBlockArg()
           
 boolean hasClass()
           
 boolean hasClassVar()
           
 boolean hasClosure()
           
 boolean hasConstant()
           
 boolean hasFrameAwareMethods()
           
 boolean hasMethod()
          Whether the tree under inspection contains any method-table mutations, including def, defs, undef, and alias.
 boolean hasOptArgs()
           
 boolean hasRestArg()
           
 boolean hasScopeAwareMethods()
           
 void inspect(Node node)
           
 void integrate(ASTInspector other)
          Integrate the results of a separate inspection into the state of this inspector.
 boolean noFrame()
           
 void setFlag(int modifier)
           
static ASTInspector subInspect(Node... nodes)
          Perform an inspection of a subtree or set of subtrees separate from the parent inspection, to make independent decisions based on that subtree(s).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BLOCK_ARG

public static final int BLOCK_ARG
See Also:
Constant Field Values

CLOSURE

public static final int CLOSURE
See Also:
Constant Field Values

CLASS

public static final int CLASS
See Also:
Constant Field Values

METHOD

public static final int METHOD
See Also:
Constant Field Values

EVAL

public static final int EVAL
See Also:
Constant Field Values

FRAME_AWARE

public static final int FRAME_AWARE
See Also:
Constant Field Values

FRAME_SELF

public static final int FRAME_SELF
See Also:
Constant Field Values

FRAME_VISIBILITY

public static final int FRAME_VISIBILITY
See Also:
Constant Field Values

FRAME_BLOCK

public static final int FRAME_BLOCK
See Also:
Constant Field Values

FRAME_NAME

public static final int FRAME_NAME
See Also:
Constant Field Values

BACKREF

public static final int BACKREF
See Also:
Constant Field Values

LASTLINE

public static final int LASTLINE
See Also:
Constant Field Values

FRAME_CLASS

public static final int FRAME_CLASS
See Also:
Constant Field Values

OPT_ARGS

public static final int OPT_ARGS
See Also:
Constant Field Values

REST_ARG

public static final int REST_ARG
See Also:
Constant Field Values

SCOPE_AWARE

public static final int SCOPE_AWARE
See Also:
Constant Field Values

ZSUPER

public static final int ZSUPER
See Also:
Constant Field Values

CONSTANT

public static final int CONSTANT
See Also:
Constant Field Values

CLASS_VAR

public static final int CLASS_VAR
See Also:
Constant Field Values

FRAME_AWARE_METHODS

public static java.util.Set<java.lang.String> FRAME_AWARE_METHODS

PRAGMAS

public static java.util.Set<java.lang.String> PRAGMAS

ENABLED

public static final boolean ENABLED
Constructor Detail

ASTInspector

public ASTInspector()
Method Detail

disable

public void disable()

subInspect

public static ASTInspector subInspect(Node... nodes)
Perform an inspection of a subtree or set of subtrees separate from the parent inspection, to make independent decisions based on that subtree(s).

Parameters:
nodes - The child nodes to walk with a new inspector
Returns:
The new inspector resulting from the walk

getFlag

public boolean getFlag(int modifier)

setFlag

public void setFlag(int modifier)

integrate

public void integrate(ASTInspector other)
Integrate the results of a separate inspection into the state of this inspector.

Parameters:
other - The other inspector whose state to integrate.

inspect

public void inspect(Node node)

hasClass

public boolean hasClass()

hasClosure

public boolean hasClosure()

hasMethod

public boolean hasMethod()
Whether the tree under inspection contains any method-table mutations, including def, defs, undef, and alias.

Returns:
True if there are mutations, false otherwise

hasFrameAwareMethods

public boolean hasFrameAwareMethods()

hasScopeAwareMethods

public boolean hasScopeAwareMethods()

hasBlockArg

public boolean hasBlockArg()

hasOptArgs

public boolean hasOptArgs()

hasRestArg

public boolean hasRestArg()

hasConstant

public boolean hasConstant()

hasClassVar

public boolean hasClassVar()

noFrame

public boolean noFrame()


Copyright © 2002-2007 JRuby Team. All Rights Reserved.