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

Node for the root of a parse tree.
Node for the root of a parse tree. It contains the statements and functions in the script, and a list of Comment nodes associated with the script as a whole. Node type is Rhino.Token.SCRIPT .

Note that the tree itself does not store errors. To collect the parse errors and warnings, pass an Rhino.ErrorReporter to the Rhino.Parser via the Rhino.CompilerEnvirons .

Наследование: ScriptNode
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
AddComment ( Comment comment ) : void

Add a comment to the comment set.

Add a comment to the comment set.

AstRoot ( ) : System
AstRoot ( int pos ) : System
CheckParentLinks ( ) : void

Debugging function to check that the parser has set the parent link for every node in the tree.

Debugging function to check that the parser has set the parent link for every node in the tree.

DebugPrint ( ) : string

A debug-printer that includes comments (at the end).

A debug-printer that includes comments (at the end).

GetComments ( ) : ICollection

Returns comment set

IsInStrictMode ( ) : bool
SetComments ( ICollection comments ) : void

Sets comment list, and updates the parent of each entry to point to this node.

Sets comment list, and updates the parent of each entry to point to this node. Replaces any existing comments.

SetInStrictMode ( bool inStrictMode ) : void
ToSource ( int depth ) : string
VisitAll ( NodeVisitor visitor ) : void

Visits the AST nodes, then the comment nodes.

Visits the AST nodes, then the comment nodes. This method is equivalent to calling ScriptNode.Visit(NodeVisitor) , then VisitComments(NodeVisitor) . The return value is ignored while visiting comment nodes.

VisitComments ( NodeVisitor visitor ) : void

Visits the comment nodes in the order they appear in the source code.

Visits the comment nodes in the order they appear in the source code. The comments are not visited by the ScriptNode.Visit(NodeVisitor) function - you must use this function to visit them.

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

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

Add a comment to the comment set.
Add a comment to the comment set.
/// if comment is /// null ///
public AddComment ( Comment comment ) : void
comment Comment the comment node.
Результат void

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

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

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

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

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

Debugging function to check that the parser has set the parent link for every node in the tree.
Debugging function to check that the parser has set the parent link for every node in the tree.
if a parent link is missing
public CheckParentLinks ( ) : void
Результат void

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

A debug-printer that includes comments (at the end).
A debug-printer that includes comments (at the end).
public DebugPrint ( ) : string
Результат string

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

Returns comment set
public GetComments ( ) : ICollection
Результат ICollection

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

public IsInStrictMode ( ) : bool
Результат bool

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

Sets comment list, and updates the parent of each entry to point to this node.
Sets comment list, and updates the parent of each entry to point to this node. Replaces any existing comments.
public SetComments ( ICollection comments ) : void
comments ICollection /// comment list. can be /// null /// . ///
Результат void

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

public SetInStrictMode ( bool inStrictMode ) : void
inStrictMode bool
Результат void

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

public ToSource ( int depth ) : string
depth int
Результат string

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

Visits the AST nodes, then the comment nodes.
Visits the AST nodes, then the comment nodes. This method is equivalent to calling ScriptNode.Visit(NodeVisitor) , then VisitComments(NodeVisitor) . The return value is ignored while visiting comment nodes.
public VisitAll ( NodeVisitor visitor ) : void
visitor NodeVisitor the callback object.
Результат void

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

Visits the comment nodes in the order they appear in the source code.
Visits the comment nodes in the order they appear in the source code. The comments are not visited by the ScriptNode.Visit(NodeVisitor) function - you must use this function to visit them.
public VisitComments ( NodeVisitor visitor ) : void
visitor NodeVisitor /// the callback object. It is passed each comment node. /// The return value is ignored. ///
Результат void