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
ファイルを表示 Open project: ZingModelChecker/Zing Class Usage Examples

Public Methods

Method 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

Method Description
Replacer ( System.Compiler.Identifier oldName, System.Compiler.Node newNode ) : System

Method Details

Replace() public static method

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

Replace() public static method

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

Replace() public static method

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

VisitAttributeList() public method

public VisitAttributeList ( AttributeList attributes ) : AttributeList
attributes AttributeList
return AttributeList

VisitConstruct() public method

public VisitConstruct ( System.Compiler.Construct cons ) : System.Compiler.Expression
cons System.Compiler.Construct
return System.Compiler.Expression

VisitIdentifier() public method

public VisitIdentifier ( System.Compiler.Identifier identifier ) : System.Compiler.Expression
identifier System.Compiler.Identifier
return System.Compiler.Expression

VisitLabeledStatement() public method

public VisitLabeledStatement ( System.Compiler.LabeledStatement lStatement ) : System.Compiler.Statement
lStatement System.Compiler.LabeledStatement
return System.Compiler.Statement

VisitLocalDeclaration() public method

public VisitLocalDeclaration ( System.Compiler.LocalDeclaration localDeclaration ) : System.Compiler.LocalDeclaration
localDeclaration System.Compiler.LocalDeclaration
return System.Compiler.LocalDeclaration

VisitLocalDeclarationsStatement() public method

public VisitLocalDeclarationsStatement ( System.Compiler.LocalDeclarationsStatement localDeclarations ) : System.Compiler.Statement
localDeclarations System.Compiler.LocalDeclarationsStatement
return System.Compiler.Statement

VisitMemberBinding() public method

public VisitMemberBinding ( System.Compiler.MemberBinding memberBinding ) : System.Compiler.Expression
memberBinding System.Compiler.MemberBinding
return System.Compiler.Expression

VisitQualifiedIdentifier() public method

public VisitQualifiedIdentifier ( System.Compiler.QualifiedIdentifier qualifiedIdentifier ) : System.Compiler.Expression
qualifiedIdentifier System.Compiler.QualifiedIdentifier
return System.Compiler.Expression

VisitTypeExpression() public method

public VisitTypeExpression ( System.Compiler.TypeExpression typeExpression ) : System.Compiler.TypeExpression
typeExpression System.Compiler.TypeExpression
return System.Compiler.TypeExpression

VisitTypeNode() public method

public VisitTypeNode ( System.Compiler.TypeNode typeNode ) : System.Compiler.TypeNode
typeNode System.Compiler.TypeNode
return System.Compiler.TypeNode

VisitTypeReference() public method

public VisitTypeReference ( System.Compiler.TypeNode type ) : System.Compiler.TypeNode
type System.Compiler.TypeNode
return System.Compiler.TypeNode

VisitUnknownNodeType() public method

public VisitUnknownNodeType ( System.Compiler.Node node ) : System.Compiler.Node
node System.Compiler.Node
return System.Compiler.Node