C# Class Microsoft.Zing.Replacer

This class aids in code generation by making substitutions in a given tree. It will be extended as needed to deal with additional types of substitution. See the static methods on the class for a description of what is supported.
Inheritance: System.Compiler.StandardVisitor
Afficher le fichier Open project: ZingModelChecker/Zing Class Usage Examples

Méthodes publiques

Méthode Description
Replace ( System.Compiler.Node node, System.Compiler.Identifier oldName, System.Compiler.Node newNode ) : void

Within "node", replace occurrences of identifiers matching oldName (by value) with the given newNode. newNode must be an expression.

Replace ( System.Compiler.Node node, string labelName, System.Compiler.Block block ) : void

Within "node", find a labeled statement whose label matches the given string, and replace it with the supplied statement block.

Replace ( System.Compiler.Node node, string oldName, System.Compiler.Node newNode ) : void

Within "node", replace identifiers matching the value of oldName with the given newNode (of type Expression).

VisitAttributeList ( AttributeList attributes ) : AttributeList
VisitConstruct ( System.Compiler.Construct cons ) : System.Compiler.Expression
VisitIdentifier ( System.Compiler.Identifier identifier ) : System.Compiler.Expression
VisitLabeledStatement ( System.Compiler.LabeledStatement lStatement ) : System.Compiler.Statement
VisitLocalDeclaration ( System.Compiler.LocalDeclaration localDeclaration ) : System.Compiler.LocalDeclaration
VisitLocalDeclarationsStatement ( System.Compiler.LocalDeclarationsStatement localDeclarations ) : System.Compiler.Statement
VisitMemberBinding ( System.Compiler.MemberBinding memberBinding ) : System.Compiler.Expression
VisitQualifiedIdentifier ( System.Compiler.QualifiedIdentifier qualifiedIdentifier ) : System.Compiler.Expression
VisitTypeExpression ( System.Compiler.TypeExpression typeExpression ) : System.Compiler.TypeExpression
VisitTypeNode ( System.Compiler.TypeNode typeNode ) : System.Compiler.TypeNode
VisitTypeReference ( System.Compiler.TypeNode type ) : System.Compiler.TypeNode
VisitUnknownNodeType ( System.Compiler.Node node ) : System.Compiler.Node

Private Methods

Méthode Description
Replacer ( System.Compiler.Identifier oldName, System.Compiler.Node newNode ) : System

Method Details

Replace() public static méthode

Within "node", replace occurrences of identifiers matching oldName (by value) with the given newNode. newNode must be an expression.
public static Replace ( System.Compiler.Node node, System.Compiler.Identifier oldName, System.Compiler.Node newNode ) : void
node System.Compiler.Node
oldName System.Compiler.Identifier
newNode System.Compiler.Node
Résultat void

Replace() public static méthode

Within "node", find a labeled statement whose label matches the given string, and replace it with the supplied statement block.
public static Replace ( System.Compiler.Node node, string labelName, System.Compiler.Block block ) : void
node System.Compiler.Node
labelName string
block System.Compiler.Block
Résultat void

Replace() public static méthode

Within "node", replace identifiers matching the value of oldName with the given newNode (of type Expression).
public static Replace ( System.Compiler.Node node, string oldName, System.Compiler.Node newNode ) : void
node System.Compiler.Node
oldName string
newNode System.Compiler.Node
Résultat void

VisitAttributeList() public méthode

public VisitAttributeList ( AttributeList attributes ) : AttributeList
attributes AttributeList
Résultat AttributeList

VisitConstruct() public méthode

public VisitConstruct ( System.Compiler.Construct cons ) : System.Compiler.Expression
cons System.Compiler.Construct
Résultat System.Compiler.Expression

VisitIdentifier() public méthode

public VisitIdentifier ( System.Compiler.Identifier identifier ) : System.Compiler.Expression
identifier System.Compiler.Identifier
Résultat System.Compiler.Expression

VisitLabeledStatement() public méthode

public VisitLabeledStatement ( System.Compiler.LabeledStatement lStatement ) : System.Compiler.Statement
lStatement System.Compiler.LabeledStatement
Résultat System.Compiler.Statement

VisitLocalDeclaration() public méthode

public VisitLocalDeclaration ( System.Compiler.LocalDeclaration localDeclaration ) : System.Compiler.LocalDeclaration
localDeclaration System.Compiler.LocalDeclaration
Résultat System.Compiler.LocalDeclaration

VisitLocalDeclarationsStatement() public méthode

public VisitLocalDeclarationsStatement ( System.Compiler.LocalDeclarationsStatement localDeclarations ) : System.Compiler.Statement
localDeclarations System.Compiler.LocalDeclarationsStatement
Résultat System.Compiler.Statement

VisitMemberBinding() public méthode

public VisitMemberBinding ( System.Compiler.MemberBinding memberBinding ) : System.Compiler.Expression
memberBinding System.Compiler.MemberBinding
Résultat System.Compiler.Expression

VisitQualifiedIdentifier() public méthode

public VisitQualifiedIdentifier ( System.Compiler.QualifiedIdentifier qualifiedIdentifier ) : System.Compiler.Expression
qualifiedIdentifier System.Compiler.QualifiedIdentifier
Résultat System.Compiler.Expression

VisitTypeExpression() public méthode

public VisitTypeExpression ( System.Compiler.TypeExpression typeExpression ) : System.Compiler.TypeExpression
typeExpression System.Compiler.TypeExpression
Résultat System.Compiler.TypeExpression

VisitTypeNode() public méthode

public VisitTypeNode ( System.Compiler.TypeNode typeNode ) : System.Compiler.TypeNode
typeNode System.Compiler.TypeNode
Résultat System.Compiler.TypeNode

VisitTypeReference() public méthode

public VisitTypeReference ( System.Compiler.TypeNode type ) : System.Compiler.TypeNode
type System.Compiler.TypeNode
Résultat System.Compiler.TypeNode

VisitUnknownNodeType() public méthode

public VisitUnknownNodeType ( System.Compiler.Node node ) : System.Compiler.Node
node System.Compiler.Node
Résultat System.Compiler.Node