C# Class 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 .

Inheritance: ScriptNode
Show file Open project: hazzik/Rhino.Net Class Usage Examples

Public Methods

Method Description
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.

Method Details

AddComment() public method

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.
return void

AstRoot() public method

public AstRoot ( ) : System
return System

AstRoot() public method

public AstRoot ( int pos ) : System
pos int
return System

CheckParentLinks() public method

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
return void

DebugPrint() public method

A debug-printer that includes comments (at the end).
A debug-printer that includes comments (at the end).
public DebugPrint ( ) : string
return string

GetComments() public method

Returns comment set
public GetComments ( ) : ICollection
return ICollection

IsInStrictMode() public method

public IsInStrictMode ( ) : bool
return bool

SetComments() public method

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 /// . ///
return void

SetInStrictMode() public method

public SetInStrictMode ( bool inStrictMode ) : void
inStrictMode bool
return void

ToSource() public method

public ToSource ( int depth ) : string
depth int
return string

VisitAll() public method

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.
return void

VisitComments() public method

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. ///
return void