C# Class Rhino.Ast.ScriptNode

Base type for AstRoot and FunctionNode nodes, which need to collect much of the same information.
Inheritance: Scope
Afficher le fichier Open project: hazzik/Rhino.Net Class Usage Examples

Méthodes publiques

Méthode Description
AddFunction ( FunctionNode fnNode ) : int

Adds a FunctionNode to the functions table for codegen. Does not set the parent of the node.

AddRegExp ( RegExpLiteral re ) : void

Called by IRFactory to add a RegExp to the regexp table.

Called by IRFactory to add a RegExp to the regexp table.

FlattenSymbolTable ( bool flattenAllTables ) : void

Assign every symbol a unique integer index.

Assign every symbol a unique integer index. Generate arrays of variable names and constness that can be indexed by those indices.

GetBaseLineno ( ) : int
GetCompilerData ( ) : object
GetEncodedSource ( ) : string

Returns a canonical version of the source for this script or function, for use in implementing the Object.toSource method of JavaScript objects. This source encoding is only recorded during code generation. It must be passed back to Rhino.Decompiler.Decompile(string, int, Rhino.UintMap) to construct the human-readable source string.

Given a parsed AST, you can always convert it to source code using the AstNode.ToSource() method, although it's not guaranteed to produce exactly the same results as Object.toSource with respect to formatting, parenthesization and other details.

GetEncodedSourceEnd ( ) : int

Returns the end offset of the encoded source.

Returns the end offset of the encoded source. Only valid if GetEncodedSource() returns non- null .

GetEncodedSourceStart ( ) : int

Returns the start offset of the encoded source.

Returns the start offset of the encoded source. Only valid if GetEncodedSource() returns non- null .

GetEndLineno ( ) : int
GetFunctionCount ( ) : int
GetFunctionNode ( int i ) : FunctionNode
GetFunctions ( ) : IList
GetIndexForNameNode ( Node nameNode ) : int
GetNextTempName ( ) : string
GetParamAndVarConst ( ) : bool[]
GetParamAndVarCount ( ) : int
GetParamAndVarNames ( ) : string[]
GetParamCount ( ) : int
GetParamOrVarName ( int index ) : string
GetRegexpCount ( ) : int
GetRegexpFlags ( int index ) : string
GetRegexpString ( int index ) : string
GetSourceName ( ) : string

Returns the URI, path or descriptive text indicating the origin of this script's source code.

Returns the URI, path or descriptive text indicating the origin of this script's source code.

GetSymbols ( ) : IList
ScriptNode ( ) : System
ScriptNode ( int pos ) : System
SetBaseLineno ( int lineno ) : void

Sets base (starting) line number for this script or function.

Sets base (starting) line number for this script or function. This is a one-time operation, and throws an exception if the line number has already been set.

SetCompilerData ( object data ) : void
SetEncodedSource ( string encodedSource ) : void

Used by the code generator.

Used by the code generator.

SetEncodedSourceBounds ( int start, int end ) : void

Used by code generator.

Used by code generator.

SetEncodedSourceEnd ( int end ) : void

Used by code generator.

Used by code generator.

SetEncodedSourceStart ( int start ) : void

Used by code generator.

Used by code generator.

SetEndLineno ( int lineno ) : void
SetSourceName ( string sourceName ) : void

Sets the URI, path or descriptive text indicating the origin of this script's source code.

Sets the URI, path or descriptive text indicating the origin of this script's source code.

SetSymbols ( IList symbols ) : void
Visit ( NodeVisitor v ) : void

Private Methods

Méthode Description
AddSymbol ( Symbol symbol ) : void

Method Details

AddFunction() public méthode

Adds a FunctionNode to the functions table for codegen. Does not set the parent of the node.
public AddFunction ( FunctionNode fnNode ) : int
fnNode FunctionNode
Résultat int

AddRegExp() public méthode

Called by IRFactory to add a RegExp to the regexp table.
Called by IRFactory to add a RegExp to the regexp table.
public AddRegExp ( RegExpLiteral re ) : void
re RegExpLiteral
Résultat void

FlattenSymbolTable() public méthode

Assign every symbol a unique integer index.
Assign every symbol a unique integer index. Generate arrays of variable names and constness that can be indexed by those indices.
public FlattenSymbolTable ( bool flattenAllTables ) : void
flattenAllTables bool /// if true, flatten all symbol tables, /// included nested block scope symbol tables. If false, just flatten the /// script's or function's symbol table. ///
Résultat void

GetBaseLineno() public méthode

public GetBaseLineno ( ) : int
Résultat int

GetCompilerData() public méthode

public GetCompilerData ( ) : object
Résultat object

GetEncodedSource() public méthode

Returns a canonical version of the source for this script or function, for use in implementing the Object.toSource method of JavaScript objects. This source encoding is only recorded during code generation. It must be passed back to Rhino.Decompiler.Decompile(string, int, Rhino.UintMap) to construct the human-readable source string.

Given a parsed AST, you can always convert it to source code using the AstNode.ToSource() method, although it's not guaranteed to produce exactly the same results as Object.toSource with respect to formatting, parenthesization and other details.

public GetEncodedSource ( ) : string
Résultat string

GetEncodedSourceEnd() public méthode

Returns the end offset of the encoded source.
Returns the end offset of the encoded source. Only valid if GetEncodedSource() returns non- null .
public GetEncodedSourceEnd ( ) : int
Résultat int

GetEncodedSourceStart() public méthode

Returns the start offset of the encoded source.
Returns the start offset of the encoded source. Only valid if GetEncodedSource() returns non- null .
public GetEncodedSourceStart ( ) : int
Résultat int

GetEndLineno() public méthode

public GetEndLineno ( ) : int
Résultat int

GetFunctionCount() public méthode

public GetFunctionCount ( ) : int
Résultat int

GetFunctionNode() public méthode

public GetFunctionNode ( int i ) : FunctionNode
i int
Résultat FunctionNode

GetFunctions() public méthode

public GetFunctions ( ) : IList
Résultat IList

GetIndexForNameNode() public méthode

public GetIndexForNameNode ( Node nameNode ) : int
nameNode Node
Résultat int

GetNextTempName() public méthode

public GetNextTempName ( ) : string
Résultat string

GetParamAndVarConst() public méthode

public GetParamAndVarConst ( ) : bool[]
Résultat bool[]

GetParamAndVarCount() public méthode

public GetParamAndVarCount ( ) : int
Résultat int

GetParamAndVarNames() public méthode

public GetParamAndVarNames ( ) : string[]
Résultat string[]

GetParamCount() public méthode

public GetParamCount ( ) : int
Résultat int

GetParamOrVarName() public méthode

public GetParamOrVarName ( int index ) : string
index int
Résultat string

GetRegexpCount() public méthode

public GetRegexpCount ( ) : int
Résultat int

GetRegexpFlags() public méthode

public GetRegexpFlags ( int index ) : string
index int
Résultat string

GetRegexpString() public méthode

public GetRegexpString ( int index ) : string
index int
Résultat string

GetSourceName() public méthode

Returns the URI, path or descriptive text indicating the origin of this script's source code.
Returns the URI, path or descriptive text indicating the origin of this script's source code.
public GetSourceName ( ) : string
Résultat string

GetSymbols() public méthode

public GetSymbols ( ) : IList
Résultat IList

ScriptNode() public méthode

public ScriptNode ( ) : System
Résultat System

ScriptNode() public méthode

public ScriptNode ( int pos ) : System
pos int
Résultat System

SetBaseLineno() public méthode

Sets base (starting) line number for this script or function.
Sets base (starting) line number for this script or function. This is a one-time operation, and throws an exception if the line number has already been set.
public SetBaseLineno ( int lineno ) : void
lineno int
Résultat void

SetCompilerData() public méthode

public SetCompilerData ( object data ) : void
data object
Résultat void

SetEncodedSource() public méthode

Used by the code generator.
Used by the code generator.
public SetEncodedSource ( string encodedSource ) : void
encodedSource string
Résultat void

SetEncodedSourceBounds() public méthode

Used by code generator.
Used by code generator.
public SetEncodedSourceBounds ( int start, int end ) : void
start int
end int
Résultat void

SetEncodedSourceEnd() public méthode

Used by code generator.
Used by code generator.
public SetEncodedSourceEnd ( int end ) : void
end int
Résultat void

SetEncodedSourceStart() public méthode

Used by code generator.
Used by code generator.
public SetEncodedSourceStart ( int start ) : void
start int
Résultat void

SetEndLineno() public méthode

public SetEndLineno ( int lineno ) : void
lineno int
Résultat void

SetSourceName() public méthode

Sets the URI, path or descriptive text indicating the origin of this script's source code.
Sets the URI, path or descriptive text indicating the origin of this script's source code.
public SetSourceName ( string sourceName ) : void
sourceName string
Résultat void

SetSymbols() public méthode

public SetSymbols ( IList symbols ) : void
symbols IList
Résultat void

Visit() public méthode

public Visit ( NodeVisitor v ) : void
v NodeVisitor
Résultat void