com.google.javascript.rhino
Class ScriptOrFnNode
java.lang.Object
com.google.javascript.rhino.Node
com.google.javascript.rhino.ScriptOrFnNode
- All Implemented Interfaces:
- Serializable, Cloneable
- Direct Known Subclasses:
- FunctionNode
public class ScriptOrFnNode
- extends Node
- See Also:
- Serialized Form
Fields inherited from class com.google.javascript.rhino.Node |
ATTRIBUTE_FLAG, BOTH, BRACELESS_TYPE, BREAK_PROP, CASEARRAY_PROP, CASES_PROP, CATCH_SCOPE_PROP, CODEOFFSET_PROP, COLUMN_BITS, COLUMN_MASK, CONTINUE_PROP, DEBUGSOURCE_PROP, DECR_FLAG, DEFAULT_PROP, DESCENDANTS_FLAG, DIRECT_EVAL, DIRECTCALL_PROP, DIRECTIVES, EMPTY_BLOCK, ENUM_PROP, FINALLY_PROP, FIXUPS_PROP, FLAG_ARGUMENTS_UNMODIFIED, FLAG_GLOBAL_STATE_UNMODIFIED, FLAG_LOCAL_RESULTS, FLAG_NO_THROWS, FLAG_THIS_UNMODIFIED, FREE_CALL, FUNCTION_PROP, INCRDECR_PROP, IS_CONSTANT_NAME, IS_DISPATCHER, IS_NAMESPACE, IS_OPTIONAL_PARAM, IS_VAR_ARGS_PARAM, ISNUMBER_PROP, JSDOC_INFO_PROP, LABEL_ID_PROP, LABEL_PROP, LAST_PROP, LASTUSE_PROP, LEFT, LOCAL_BLOCK_PROP, LOCAL_PROP, LOCALCOUNT_PROP, MAX_COLUMN_NUMBER, MEMBER_TYPE_PROP, NAME_PROP, NO_SIDE_EFFECTS, NON_SPECIALCALL, OBJECT_IDS_PROP, OPT_ARG_NAME, ORIGINALNAME_PROP, PARENTHESIZED_PROP, POST_FLAG, PROPERTY_FLAG, QUOTED_PROP, REGEXP_PROP, RIGHT, SIDE_EFFECT_FLAGS, SIDE_EFFECTS_ALL, SIDE_EFFECTS_FLAGS_MASK, SKIP_INDEXES_PROP, SOURCENAME_PROP, SPECIAL_PROP_PROP, SPECIALCALL_EVAL, SPECIALCALL_PROP, SPECIALCALL_WITH, SYNTHETIC_BLOCK_PROP, TARGET_PROP, TARGETBLOCK_PROP, TEMP_PROP, TYPE_PROP, USES_PROP, VAR_ARGS_NAME, VARIABLE_PROP, VARS_PROP |
Methods inherited from class com.google.javascript.rhino.Node |
addChildAfter, addChildBefore, addChildrenToBack, addChildrenToFront, addChildToBack, addChildToFront, addSuppression, appendStringTree, checkTreeEquals, checkTreeEqualsSilent, checkTreeTypeAwareEqualsSilent, children, cloneNode, clonePropsFrom, cloneTree, copyInformationFrom, copyInformationFromForTree, detachChildren, detachFromParent, extractCharno, extractLineno, getAncestor, getAncestors, getBooleanProp, getCharno, getChildAtIndex, getChildBefore, getChildCount, getDirectives, getDouble, getExistingIntProp, getFirstChild, getIntProp, getJsDocBuilderForNode, getJSDocInfo, getJSType, getLastChild, getLastSibling, getLineno, getNext, getParent, getProp, getQualifiedName, getSideEffectFlags, getString, getType, hasChild, hasChildren, hasMoreThanOneChild, hasOneChild, hasSideEffects, isEquivalentTo, isLocalResultCall, isNoSideEffectsCall, isOnlyModifiesThisCall, isOptionalArg, isQualifiedName, isQuotedString, isSyntheticBlock, isUnscopedQualifiedName, isVarArgs, mergeLineCharNo, newNumber, newNumber, newString, newString, newString, newString, putBooleanProp, putIntProp, putProp, removeChild, removeChildAfter, removeChildren, removeFirstChild, removeProp, replaceChild, replaceChildAfter, setCharno, setDirectives, setDouble, setIsSyntheticBlock, setJSDocInfo, setJSType, setLineno, setOptionalArg, setQuotedString, setSideEffectFlags, setSideEffectFlags, setString, setType, setVarArgs, setWasEmptyNode, siblings, tokenToName, toString, toString, toStringTree, wasEmptyNode |
NO_DUPLICATE
public static final int NO_DUPLICATE
- See Also:
- Constant Field Values
DUPLICATE_VAR
public static final int DUPLICATE_VAR
- See Also:
- Constant Field Values
DUPLICATE_PARAMETER
public static final int DUPLICATE_PARAMETER
- See Also:
- Constant Field Values
DUPLICATE_CONST
public static final int DUPLICATE_CONST
- See Also:
- Constant Field Values
ScriptOrFnNode
public ScriptOrFnNode(int nodeType)
ScriptOrFnNode
public ScriptOrFnNode(int nodeType,
int lineno,
int charno)
getSourceName
public final String getSourceName()
setSourceName
public final void setSourceName(String sourceName)
getEncodedSourceStart
public final int getEncodedSourceStart()
getEncodedSourceEnd
public final int getEncodedSourceEnd()
setEncodedSourceBounds
public final void setEncodedSourceBounds(int start,
int end)
getBaseLineno
public final int getBaseLineno()
setBaseLineno
public final void setBaseLineno(int lineno)
getEndLineno
public final int getEndLineno()
setEndLineno
public final void setEndLineno(int lineno)
getFunctionCount
public final int getFunctionCount()
getFunctionNode
public final FunctionNode getFunctionNode(int i)
addFunction
public final int addFunction(FunctionNode fnNode)
getRegexpCount
public final int getRegexpCount()
getRegexpString
public final String getRegexpString(int index)
getRegexpFlags
public final String getRegexpFlags(int index)
addRegexp
public final int addRegexp(String string,
String flags)
hasParamOrVar
public final boolean hasParamOrVar(String name)
getParamOrVarIndex
public final int getParamOrVarIndex(String name)
getParamOrVarName
public final String getParamOrVarName(int index)
getParamCount
public final int getParamCount()
getParamAndVarCount
public final int getParamAndVarCount()
getParamAndVarNames
public final String[] getParamAndVarNames()
getParamAndVarConst
public final boolean[] getParamAndVarConst()
addParam
public final void addParam(String name)
addVar
public final int addVar(String name)
- This function adds a variable to the set of var declarations for a
function (or script). This returns an indicator of a duplicate that
overrides a formal parameter (false if this dups a parameter).
- Parameters:
name
- variable name
- Returns:
- 1 if the name is not any form of duplicate, 0 if it duplicates a
non-parameter, -1 if it duplicates a parameter and -2 if it duplicates a
const.
addConst
public final boolean addConst(String name)
removeParamOrVar
public final void removeParamOrVar(String name)
getCompilerData
public final Object getCompilerData()
setCompilerData
public final void setCompilerData(Object data)