C# Class Rosetta.AST.ProgramASTWalker

Walks a program AST node.
Inheritance: ASTWalker, IASTWalker
Show file Open project: andry-tino/Rosetta Class Usage Examples

Protected Properties

Property Type Description
program Rosetta.Translation.ProgramTranslationUnit

Public Methods

Method Description
Create ( CSharpSyntaxNode node, ASTWalkerContext context = null, Microsoft.CodeAnalysis.SemanticModel semanticModel = null ) : ProgramASTWalker

Factory method for class ProgramASTWalker.

ProgramASTWalker ( ProgramASTWalker other ) : System

Copy initializes a new instance of the ProgramASTWalker class.

For testability.

VisitClassDeclaration ( Microsoft.CodeAnalysis.CSharp.Syntax.ClassDeclarationSyntax node ) : void

This will cause an AST walker to be created, thus we don't need to go further deeper in the tree by visiting the node.

VisitInterfaceDeclaration ( InterfaceDeclarationSyntax node ) : void

VisitNamespaceDeclaration ( Microsoft.CodeAnalysis.CSharp.Syntax.NamespaceDeclarationSyntax node ) : void

This will cause an AST walker to be created, thus we don't need to go further deeper in the tree by visiting the node.

Walk ( ) : ITranslationUnit

Walk the whole tree starting from specified CSharpSyntaxNode and build the translation unit tree necessary for generating TypeScript output.

Protected Methods

Method Description
InvokeClassDeclarationVisited ( object sender, WalkerEventArgs e ) : void
InvokeEnumDeclarationVisited ( object sender, WalkerEventArgs e ) : void
InvokeInterfaceDeclarationVisited ( object sender, WalkerEventArgs e ) : void
InvokeNamespaceDeclarationVisited ( object sender, WalkerEventArgs e ) : void
ProgramASTWalker ( CSharpSyntaxNode node, ProgramTranslationUnit program, Microsoft.CodeAnalysis.SemanticModel semanticModel ) : System

Initializes a new instance of the ProgramASTWalker class.

Private Methods

Method Description
CreateWalkingContext ( ) : ASTWalkerContext

Method Details

Create() public static method

Factory method for class ProgramASTWalker.
public static Create ( CSharpSyntaxNode node, ASTWalkerContext context = null, Microsoft.CodeAnalysis.SemanticModel semanticModel = null ) : ProgramASTWalker
node CSharpSyntaxNode Used to initialize the walker.
context ASTWalkerContext The walking context.
semanticModel Microsoft.CodeAnalysis.SemanticModel The semantic model.
return ProgramASTWalker

InvokeClassDeclarationVisited() protected method

protected InvokeClassDeclarationVisited ( object sender, WalkerEventArgs e ) : void
sender object
e WalkerEventArgs
return void

InvokeEnumDeclarationVisited() protected method

protected InvokeEnumDeclarationVisited ( object sender, WalkerEventArgs e ) : void
sender object
e WalkerEventArgs
return void

InvokeInterfaceDeclarationVisited() protected method

protected InvokeInterfaceDeclarationVisited ( object sender, WalkerEventArgs e ) : void
sender object
e WalkerEventArgs
return void

InvokeNamespaceDeclarationVisited() protected method

protected InvokeNamespaceDeclarationVisited ( object sender, WalkerEventArgs e ) : void
sender object
e WalkerEventArgs
return void

ProgramASTWalker() protected method

Initializes a new instance of the ProgramASTWalker class.
protected ProgramASTWalker ( CSharpSyntaxNode node, ProgramTranslationUnit program, Microsoft.CodeAnalysis.SemanticModel semanticModel ) : System
node CSharpSyntaxNode
program Rosetta.Translation.ProgramTranslationUnit
semanticModel Microsoft.CodeAnalysis.SemanticModel The semantic model.
return System

ProgramASTWalker() public method

Copy initializes a new instance of the ProgramASTWalker class.
For testability.
public ProgramASTWalker ( ProgramASTWalker other ) : System
other ProgramASTWalker
return System

VisitClassDeclaration() public method

This will cause an AST walker to be created, thus we don't need to go further deeper in the tree by visiting the node.
public VisitClassDeclaration ( Microsoft.CodeAnalysis.CSharp.Syntax.ClassDeclarationSyntax node ) : void
node Microsoft.CodeAnalysis.CSharp.Syntax.ClassDeclarationSyntax
return void

VisitInterfaceDeclaration() public method

public VisitInterfaceDeclaration ( InterfaceDeclarationSyntax node ) : void
node InterfaceDeclarationSyntax
return void

VisitNamespaceDeclaration() public method

This will cause an AST walker to be created, thus we don't need to go further deeper in the tree by visiting the node.
public VisitNamespaceDeclaration ( Microsoft.CodeAnalysis.CSharp.Syntax.NamespaceDeclarationSyntax node ) : void
node Microsoft.CodeAnalysis.CSharp.Syntax.NamespaceDeclarationSyntax
return void

Walk() public method

Walk the whole tree starting from specified CSharpSyntaxNode and build the translation unit tree necessary for generating TypeScript output.
public Walk ( ) : ITranslationUnit
return ITranslationUnit

Property Details

program protected property

protected ProgramTranslationUnit,Rosetta.Translation program
return Rosetta.Translation.ProgramTranslationUnit