C# Класс Rhino.Ast.ScriptNode

Base type for AstRoot and FunctionNode nodes, which need to collect much of the same information.
Наследование: Scope
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
AddSymbol ( Symbol symbol ) : void

Описание методов

AddFunction() публичный Метод

Adds a FunctionNode to the functions table for codegen. Does not set the parent of the node.
public AddFunction ( FunctionNode fnNode ) : int
fnNode FunctionNode
Результат int

AddRegExp() публичный Метод

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
Результат void

FlattenSymbolTable() публичный Метод

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. ///
Результат void

GetBaseLineno() публичный Метод

public GetBaseLineno ( ) : int
Результат int

GetCompilerData() публичный Метод

public GetCompilerData ( ) : object
Результат object

GetEncodedSource() публичный Метод

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
Результат string

GetEncodedSourceEnd() публичный Метод

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
Результат int

GetEncodedSourceStart() публичный Метод

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
Результат int

GetEndLineno() публичный Метод

public GetEndLineno ( ) : int
Результат int

GetFunctionCount() публичный Метод

public GetFunctionCount ( ) : int
Результат int

GetFunctionNode() публичный Метод

public GetFunctionNode ( int i ) : FunctionNode
i int
Результат FunctionNode

GetFunctions() публичный Метод

public GetFunctions ( ) : IList
Результат IList

GetIndexForNameNode() публичный Метод

public GetIndexForNameNode ( Node nameNode ) : int
nameNode Node
Результат int

GetNextTempName() публичный Метод

public GetNextTempName ( ) : string
Результат string

GetParamAndVarConst() публичный Метод

public GetParamAndVarConst ( ) : bool[]
Результат bool[]

GetParamAndVarCount() публичный Метод

public GetParamAndVarCount ( ) : int
Результат int

GetParamAndVarNames() публичный Метод

public GetParamAndVarNames ( ) : string[]
Результат string[]

GetParamCount() публичный Метод

public GetParamCount ( ) : int
Результат int

GetParamOrVarName() публичный Метод

public GetParamOrVarName ( int index ) : string
index int
Результат string

GetRegexpCount() публичный Метод

public GetRegexpCount ( ) : int
Результат int

GetRegexpFlags() публичный Метод

public GetRegexpFlags ( int index ) : string
index int
Результат string

GetRegexpString() публичный Метод

public GetRegexpString ( int index ) : string
index int
Результат string

GetSourceName() публичный Метод

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
Результат string

GetSymbols() публичный Метод

public GetSymbols ( ) : IList
Результат IList

ScriptNode() публичный Метод

public ScriptNode ( ) : System
Результат System

ScriptNode() публичный Метод

public ScriptNode ( int pos ) : System
pos int
Результат System

SetBaseLineno() публичный Метод

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
Результат void

SetCompilerData() публичный Метод

public SetCompilerData ( object data ) : void
data object
Результат void

SetEncodedSource() публичный Метод

Used by the code generator.
Used by the code generator.
public SetEncodedSource ( string encodedSource ) : void
encodedSource string
Результат void

SetEncodedSourceBounds() публичный Метод

Used by code generator.
Used by code generator.
public SetEncodedSourceBounds ( int start, int end ) : void
start int
end int
Результат void

SetEncodedSourceEnd() публичный Метод

Used by code generator.
Used by code generator.
public SetEncodedSourceEnd ( int end ) : void
end int
Результат void

SetEncodedSourceStart() публичный Метод

Used by code generator.
Used by code generator.
public SetEncodedSourceStart ( int start ) : void
start int
Результат void

SetEndLineno() публичный Метод

public SetEndLineno ( int lineno ) : void
lineno int
Результат void

SetSourceName() публичный Метод

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
Результат void

SetSymbols() публичный Метод

public SetSymbols ( IList symbols ) : void
symbols IList
Результат void

Visit() публичный Метод

public Visit ( NodeVisitor v ) : void
v NodeVisitor
Результат void