Class CodeBuilder
Singleton class to help build class declarations.
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Compiler
Assembly: Microsoft.ML.Probabilistic.Compiler.dll
Syntax
public class CodeBuilder
Constructors
CodeBuilder()
Constructor
Declaration
protected CodeBuilder()
Fields
Instance
Singleton instance
Declaration
public static CodeBuilder Instance
Field Value
Type | Description |
---|---|
CodeBuilder |
replacement
Character replacements to make valid strings.
Declaration
public static readonly Dictionary<char, string> replacement
Field Value
Type | Description |
---|---|
Dictionary<Char, String> |
Methods
Add(IExpression[])
Creates an expression which is the sum of the given expressions
Declaration
public IExpression Add(params IExpression[] exprs)
Parameters
Type | Name | Description |
---|---|---|
IExpression[] | exprs | Input expression |
Returns
Type | Description |
---|---|
IExpression |
AddrDerefExpr()
Default constructor for an address dereference expression
Declaration
public virtual IAddressDereferenceExpression AddrDerefExpr()
Returns
Type | Description |
---|---|
IAddressDereferenceExpression |
AddrOutExpr()
Default constructor for address out expression
Declaration
public virtual IAddressOutExpression AddrOutExpr()
Returns
Type | Description |
---|---|
IAddressOutExpression | A new address out expression |
AddrRefExpr()
Default constructor for address ref expression
Declaration
public virtual IAddressReferenceExpression AddrRefExpr()
Returns
Type | Description |
---|---|
IAddressReferenceExpression | A new address ref expression |
AnonMethodExpr()
Default constructor for anonymous method expression
Declaration
public virtual IAnonymousMethodExpression AnonMethodExpr()
Returns
Type | Description |
---|---|
IAnonymousMethodExpression | A new anonymous method expression |
AnonMethodExpr(Type)
Creates an anonymous method expression
Declaration
public IAnonymousMethodExpression AnonMethodExpr(Type delegateType)
Parameters
Type | Name | Description |
---|---|---|
Type | delegateType | The delegate type |
Returns
Type | Description |
---|---|
IAnonymousMethodExpression |
ArrayCreateExpr()
Default constructor for array create expression
Declaration
public virtual IArrayCreateExpression ArrayCreateExpr()
Returns
Type | Description |
---|---|
IArrayCreateExpression | A new array create expression |
ArrayCreateExpr(IType, IExpression[])
Creates an array expression
Declaration
public IArrayCreateExpression ArrayCreateExpr(IType type, params IExpression[] sizes)
Parameters
Type | Name | Description |
---|---|---|
IType | type | Element type of array |
IExpression[] | sizes | Sizes of each dimension |
Returns
Type | Description |
---|---|
IArrayCreateExpression | Array expression |
ArrayCreateExpr(IType, IEnumerable<IExpression>)
Creates an array expression
Declaration
public IArrayCreateExpression ArrayCreateExpr(IType type, IEnumerable<IExpression> sizes)
Parameters
Type | Name | Description |
---|---|---|
IType | type | Element type of array |
IEnumerable<IExpression> | sizes | Sizes of each dimension |
Returns
Type | Description |
---|---|
IArrayCreateExpression | Array expression |
ArrayCreateExpr(Type, IExpression[])
Creates an array expression
Declaration
public IArrayCreateExpression ArrayCreateExpr(Type type, params IExpression[] sizes)
Parameters
Type | Name | Description |
---|---|---|
Type | type | Element type of array |
IExpression[] | sizes | Sizes of each dimension |
Returns
Type | Description |
---|---|
IArrayCreateExpression | Array expression |
ArrayCreateExpr(Type, IEnumerable<IExpression>)
Creates an array expression
Declaration
public IArrayCreateExpression ArrayCreateExpr(Type type, IEnumerable<IExpression> sizes)
Parameters
Type | Name | Description |
---|---|---|
Type | type | Element type of array |
IEnumerable<IExpression> | sizes | Sizes of each dimension |
Returns
Type | Description |
---|---|
IArrayCreateExpression | Array expression |
ArrayIndex(IExpression, IExpression[])
Creates an array index expression
Declaration
public IArrayIndexerExpression ArrayIndex(IExpression array, params IExpression[] indices)
Parameters
Type | Name | Description |
---|---|---|
IExpression | array | The array expression |
IExpression[] | indices | The indices |
Returns
Type | Description |
---|---|
IArrayIndexerExpression | Array index expression |
ArrayIndex(IExpression, IEnumerable<IExpression>)
Creates an array index expression
Declaration
public IArrayIndexerExpression ArrayIndex(IExpression array, IEnumerable<IExpression> indices)
Parameters
Type | Name | Description |
---|---|---|
IExpression | array | The array expression |
IEnumerable<IExpression> | indices | The indices |
Returns
Type | Description |
---|---|
IArrayIndexerExpression | Array index expression |
ArrayIndxrExpr()
Default constructor for array indexer expression
Declaration
public virtual IArrayIndexerExpression ArrayIndxrExpr()
Returns
Type | Description |
---|---|
IArrayIndexerExpression | A new array indexer expression |
ArrayType()
Default constructor for array type
Declaration
public virtual IArrayType ArrayType()
Returns
Type | Description |
---|---|
IArrayType | A new array type |
ArrayType(IType)
Creates an array type (of dimenion 1)
Declaration
public IArrayType ArrayType(IType type)
Parameters
Type | Name | Description |
---|---|---|
IType | type | Element type |
Returns
Type | Description |
---|---|
IArrayType | Array type |
ArrayType(IType, Int32)
Creates an array type
Declaration
public IArrayType ArrayType(IType type, int rank)
Parameters
Type | Name | Description |
---|---|---|
IType | type | Element type |
Int32 | rank | Rank of array |
Returns
Type | Description |
---|---|
IArrayType | Array type |
AssemblyRef()
Default constructor for an assembly reference
Declaration
public virtual IAssemblyReference AssemblyRef()
Returns
Type | Description |
---|---|
IAssemblyReference | A new assembly reference |
AssignExpr()
Default constructor for assign expression
Declaration
public virtual IAssignExpression AssignExpr()
Returns
Type | Description |
---|---|
IAssignExpression | A new assign expression |
AssignExpr(IExpression, IExpression)
Creates an assignment expression
Declaration
public IAssignExpression AssignExpr(IExpression target, IExpression expr)
Parameters
Type | Name | Description |
---|---|---|
IExpression | target | The target of the assignment |
IExpression | expr | The expression to assign |
Returns
Type | Description |
---|---|
IAssignExpression | Assignment expression |
AssignStmt(IExpression, IExpression)
Creates an assignment statement
Declaration
public IExpressionStatement AssignStmt(IExpression target, IExpression expr)
Parameters
Type | Name | Description |
---|---|---|
IExpression | target | The target of the assignment |
IExpression | expr | The expression to assign |
Returns
Type | Description |
---|---|
IExpressionStatement | Assignment statement |
BaseRefExpr()
Default constructor for base reference expression
Declaration
public virtual IBaseReferenceExpression BaseRefExpr()
Returns
Type | Description |
---|---|
IBaseReferenceExpression | A new base reference expression |
BinaryExpr()
Default constructor for binary expression
Declaration
public virtual IBinaryExpression BinaryExpr()
Returns
Type | Description |
---|---|
IBinaryExpression | A new binary expression |
BinaryExpr(BinaryOperator, IExpression[])
Creates an expression consisting of combining several expressions using a given binary operator
Declaration
public IExpression BinaryExpr(BinaryOperator op, params IExpression[] exprs)
Parameters
Type | Name | Description |
---|---|---|
BinaryOperator | op | The binary operator |
IExpression[] | exprs | The expressions |
Returns
Type | Description |
---|---|
IExpression |
BinaryExpr(IExpression, BinaryOperator, IExpression)
Creates a binary expression
Declaration
public IBinaryExpression BinaryExpr(IExpression left, BinaryOperator op, IExpression right)
Parameters
Type | Name | Description |
---|---|---|
IExpression | left | The expression to the left of the binary operator |
BinaryOperator | op | The binary operator |
IExpression | right | The expression to the right of the binary operator |
Returns
Type | Description |
---|---|
IBinaryExpression | The binary expression |
BlockExpr()
Default constructor for block expression
Declaration
public virtual IBlockExpression BlockExpr()
Returns
Type | Description |
---|---|
IBlockExpression | A new block expression |
BlockStmt()
Default constructor for block statement
Declaration
public virtual IBlockStatement BlockStmt()
Returns
Type | Description |
---|---|
IBlockStatement | A new block statement |
BreakStmt()
Default constructor for break statement
Declaration
public virtual IBreakStatement BreakStmt()
Returns
Type | Description |
---|---|
IBreakStatement | A new break statement |
BrokenForStatement(IForStatement)
Declaration
public IForStatement BrokenForStatement(IForStatement ifs)
Parameters
Type | Name | Description |
---|---|---|
IForStatement | ifs |
Returns
Type | Description |
---|---|
IForStatement |
CanCastExpr(IExpression, IType)
Creates an 'is' expression
Declaration
public ICanCastExpression CanCastExpr(IExpression expr, IType t)
Parameters
Type | Name | Description |
---|---|---|
IExpression | expr | Expression |
IType | t | Type to test against |
Returns
Type | Description |
---|---|
ICanCastExpression | 'is' expression |
CanCastExpr(IExpression, Type)
Creates an 'is' expression
Declaration
public ICanCastExpression CanCastExpr(IExpression expr, Type t)
Parameters
Type | Name | Description |
---|---|---|
IExpression | expr | Expression |
Type | t | Type to test against |
Returns
Type | Description |
---|---|
ICanCastExpression | 'is' expression |
Capitalise(String)
Capitalise a string
Declaration
public static string Capitalise(string s)
Parameters
Type | Name | Description |
---|---|---|
String | s | String to capitalise |
Returns
Type | Description |
---|---|
String | Capitalised string |
CastExpr()
Default constructor for cast expression
Declaration
public virtual ICastExpression CastExpr()
Returns
Type | Description |
---|---|
ICastExpression | A new cast expression |
CastExpr(IExpression, IType)
Creates a cast expression
Declaration
public ICastExpression CastExpr(IExpression expr, IType t)
Parameters
Type | Name | Description |
---|---|---|
IExpression | expr | Expression |
IType | t | Type to cast it to |
Returns
Type | Description |
---|---|
ICastExpression | Cast expression |
CastExpr(IExpression, Type)
Creates a cast expression
Declaration
public ICastExpression CastExpr(IExpression expr, Type t)
Parameters
Type | Name | Description |
---|---|---|
IExpression | expr | Expression |
Type | t | Type to cast it to |
Returns
Type | Description |
---|---|
ICastExpression | Cast expression |
CheckedExpr()
Default constructor for checked expression
Declaration
public virtual ICheckedExpression CheckedExpr()
Returns
Type | Description |
---|---|
ICheckedExpression | A new cast expression |
CheckedExpr(IExpression)
Creates a checked arithmetic expression
Declaration
public ICheckedExpression CheckedExpr(IExpression expr)
Parameters
Type | Name | Description |
---|---|---|
IExpression | expr | Expression |
Returns
Type | Description |
---|---|
ICheckedExpression | Checked expression |
Comment()
Default constructor for comment
Declaration
public virtual IComment Comment()
Returns
Type | Description |
---|---|
IComment | A new comment |
CommentStmt()
Default constructor for comment statement
Declaration
public virtual ICommentStatement CommentStmt()
Returns
Type | Description |
---|---|
ICommentStatement | A new comment statement |
CommentStmt(String)
Creates a comment statement
Declaration
public ICommentStatement CommentStmt(string text)
Parameters
Type | Name | Description |
---|---|---|
String | text | Text for the comment statement |
Returns
Type | Description |
---|---|
ICommentStatement | Comment statement |
CondCase()
Default constructor for condition case
Declaration
public virtual IConditionCase CondCase()
Returns
Type | Description |
---|---|
IConditionCase | A new condition case |
CondExpr()
Default constructor for condition expression
Declaration
public virtual IConditionExpression CondExpr()
Returns
Type | Description |
---|---|
IConditionExpression | A new condition expression |
CondStmt()
Default constructor for condition statement
Declaration
public virtual IConditionStatement CondStmt()
Returns
Type | Description |
---|---|
IConditionStatement | A new condition statement |
CondStmt(IExpression, IBlockStatement)
Creates a condition statement.
Declaration
public IConditionStatement CondStmt(IExpression condition, IBlockStatement thenBlock)
Parameters
Type | Name | Description |
---|---|---|
IExpression | condition | |
IBlockStatement | thenBlock |
Returns
Type | Description |
---|---|
IConditionStatement |
CondStmt(IExpression, IBlockStatement, IBlockStatement)
Creates a condition statement.
Declaration
public IConditionStatement CondStmt(IExpression condition, IBlockStatement thenBlock, IBlockStatement elseBlock)
Parameters
Type | Name | Description |
---|---|---|
IExpression | condition | |
IBlockStatement | thenBlock | |
IBlockStatement | elseBlock |
Returns
Type | Description |
---|---|
IConditionStatement |
ConstructorDecl()
Default constructor for constructor declaration
Declaration
public virtual IConstructorDeclaration ConstructorDecl()
Returns
Type | Description |
---|---|
IConstructorDeclaration | A new constructor declaration |
ConstructorDecl(MethodVisibility, IType, IParameterDeclaration[])
Creates a constructor declaration
Declaration
public IConstructorDeclaration ConstructorDecl(MethodVisibility vis, IType declaringType, params IParameterDeclaration[] pars)
Parameters
Type | Name | Description |
---|---|---|
MethodVisibility | vis | Visibility of the constructor |
IType | declaringType | Type being constructed |
IParameterDeclaration[] | pars | Parameters of the constructor |
Returns
Type | Description |
---|---|
IConstructorDeclaration | The constructor declaration |
ConstructorRef(Type, Type[])
Creates a constructor reference
Declaration
public IMethodReference ConstructorRef(Type t, Type[] types)
Parameters
Type | Name | Description |
---|---|---|
Type | t | Type |
Type[] | types | Parameter types for the constructor |
Returns
Type | Description |
---|---|
IMethodReference | The constructor reference |
ContainsExpression(IExpression, IExpression)
Returns true if the first expression contains the second one.
Declaration
public bool ContainsExpression(IExpression expr, IExpression exprFind)
Parameters
Type | Name | Description |
---|---|---|
IExpression | expr | The expression to search |
IExpression | exprFind | The expression to look for |
Returns
Type | Description |
---|---|
Boolean | True if the expression was found |
DefaultExpr()
Default(T) expression
Declaration
public virtual IDefaultExpression DefaultExpr()
Returns
Type | Description |
---|---|
IDefaultExpression |
DefaultExpr(IType)
default(T) expression
Declaration
public IDefaultExpression DefaultExpr(IType type)
Parameters
Type | Name | Description |
---|---|---|
IType | type |
Returns
Type | Description |
---|---|
IDefaultExpression |
DefaultExpr(Type)
default(T) expression
Declaration
public IDefaultExpression DefaultExpr(Type type)
Parameters
Type | Name | Description |
---|---|---|
Type | type |
Returns
Type | Description |
---|---|
IDefaultExpression |
DefCase()
Default constructor for default case
Declaration
public virtual IDefaultCase DefCase()
Returns
Type | Description |
---|---|
IDefaultCase | A new default case |
DelegateInvokeExpr()
Default constructor for a delegate invoke expression
Declaration
public virtual IDelegateInvokeExpression DelegateInvokeExpr()
Returns
Type | Description |
---|---|
IDelegateInvokeExpression |
EventDecl()
Default constructor for event declaration
Declaration
public virtual IEventDeclaration EventDecl()
Returns
Type | Description |
---|---|
IEventDeclaration | A new event declaration |
EventDecl(String, ITypeReference, IType)
Creates an event declaration
Declaration
public IEventDeclaration EventDecl(string name, ITypeReference eventType, IType declaringType)
Parameters
Type | Name | Description |
---|---|---|
String | name | Name of the property |
ITypeReference | eventType | Type of the event |
IType | declaringType | Declaring type |
Returns
Type | Description |
---|---|
IEventDeclaration | An event declaration |
EventDecl(String, Type, IMethodReference)
Creates an event declaration
Declaration
public IEventDeclaration EventDecl(string name, Type declaringType, IMethodReference invokeMethod)
Parameters
Type | Name | Description |
---|---|---|
String | name | Name of the property |
Type | declaringType | Type containing the event |
IMethodReference | invokeMethod | Method for clients to invoke the event |
Returns
Type | Description |
---|---|
IEventDeclaration | An event declaration |
EventRefExpr()
Default constructor for event reference expression
Declaration
public virtual IEventReferenceExpression EventRefExpr()
Returns
Type | Description |
---|---|
IEventReferenceExpression | A new event reference expression |
EventRefExpr(IEventDeclaration)
Creates an event reference expression
Declaration
public IEventReferenceExpression EventRefExpr(IEventDeclaration ed)
Parameters
Type | Name | Description |
---|---|---|
IEventDeclaration | ed | Event declaration |
Returns
Type | Description |
---|---|
IEventReferenceExpression | Event reference expression |
EventRefExpr(IExpression, IEventDeclaration)
Creates an event reference expression
Declaration
public IEventReferenceExpression EventRefExpr(IExpression target, IEventDeclaration ed)
Parameters
Type | Name | Description |
---|---|---|
IExpression | target | Target |
IEventDeclaration | ed | Event declaration |
Returns
Type | Description |
---|---|
IEventReferenceExpression | Event reference expression |
ExprCollection()
Default constructor for expression collection
Declaration
public virtual IList<IExpression> ExprCollection()
Returns
Type | Description |
---|---|
IList<IExpression> | A new expression collection |
ExprStatement()
Default constructor for expression statement
Declaration
public virtual IExpressionStatement ExprStatement()
Returns
Type | Description |
---|---|
IExpressionStatement | A new expression statement |
ExprStatement(IExpression)
Creates an expression statement
Declaration
public IExpressionStatement ExprStatement(IExpression expr)
Parameters
Type | Name | Description |
---|---|---|
IExpression | expr | The expression |
Returns
Type | Description |
---|---|
IExpressionStatement | Expression statement |
FieldDecl()
Default constructor for field declaration
Declaration
public virtual IFieldDeclaration FieldDecl()
Returns
Type | Description |
---|---|
IFieldDeclaration | A new field declaration |
FieldDecl(String, IType, IType)
Creates a new field declaration
Declaration
public IFieldDeclaration FieldDecl(string name, IType type, IType declaringType)
Parameters
Type | Name | Description |
---|---|---|
String | name | Name of the field |
IType | type | Code model type |
IType | declaringType | Declaring type |
Returns
Type | Description |
---|---|
IFieldDeclaration | Field declaration |
FieldDecl(String, Type, IType)
Creates a new field declaration
Declaration
public IFieldDeclaration FieldDecl(string name, Type type, IType declaringType)
Parameters
Type | Name | Description |
---|---|---|
String | name | Name of the field |
Type | type | Code model type |
IType | declaringType | Declaring type |
Returns
Type | Description |
---|---|
IFieldDeclaration | Field declaration |
FieldRef()
Default constructor for field reference
Declaration
public virtual IFieldReference FieldRef()
Returns
Type | Description |
---|---|
IFieldReference | A new field reference |
FieldRefExpr()
Default constructor for field reference expression
Declaration
public virtual IFieldReferenceExpression FieldRefExpr()
Returns
Type | Description |
---|---|
IFieldReferenceExpression | A new field reference expression |
FieldRefExpr(IExpression, IType, IType, String)
Creates a field reference expression
Declaration
public IFieldReferenceExpression FieldRefExpr(IExpression target, IType declaringType, IType fieldType, string name)
Parameters
Type | Name | Description |
---|---|---|
IExpression | target | Expression for type instance |
IType | declaringType | Declaring type |
IType | fieldType | Type of field |
String | name | Field name |
Returns
Type | Description |
---|---|
IFieldReferenceExpression | Field reference expression |
FieldRefExpr(IExpression, Type, String)
Creates a field reference expression
Declaration
public IFieldReferenceExpression FieldRefExpr(IExpression target, Type declaringType, string name)
Parameters
Type | Name | Description |
---|---|---|
IExpression | target | Expression for type instance |
Type | declaringType | Declaring type |
String | name | Field name |
Returns
Type | Description |
---|---|
IFieldReferenceExpression | Field reference expression |
FieldRefExpr(IFieldReference)
Creates a field reference expression
Declaration
public IFieldReferenceExpression FieldRefExpr(IFieldReference fr)
Parameters
Type | Name | Description |
---|---|---|
IFieldReference | fr | Field reference |
Returns
Type | Description |
---|---|
IFieldReferenceExpression | Field reference expression |
FireEventDecl(MethodVisibility, String, IEventDeclaration)
Create a method declaration for a method which allows clients to fire the event This is required because events can only be fired from the defining class
Declaration
public IMethodDeclaration FireEventDecl(MethodVisibility vis, string name, IEventDeclaration eventDecl)
Parameters
Type | Name | Description |
---|---|---|
MethodVisibility | vis | Method visibility |
String | name | Method name |
IEventDeclaration | eventDecl | The event declaration |
Returns
Type | Description |
---|---|
IMethodDeclaration | The method declaration |
ForEachStmt()
Default constructor for foreach statement
Declaration
public virtual IForEachStatement ForEachStmt()
Returns
Type | Description |
---|---|
IForEachStatement | A new foreach statement |
ForStmt()
Default constructor for a for statement
Declaration
public virtual IForStatement ForStmt()
Returns
Type | Description |
---|---|
IForStatement | A new for statement |
ForStmt(IForStatement)
Declaration
public IForStatement ForStmt(IForStatement ifs)
Parameters
Type | Name | Description |
---|---|---|
IForStatement | ifs |
Returns
Type | Description |
---|---|
IForStatement |
ForStmt(IVariableDeclaration, IExpression)
Creates a for loop statement
Declaration
public IForStatement ForStmt(IVariableDeclaration vd, IExpression size)
Parameters
Type | Name | Description |
---|---|---|
IVariableDeclaration | vd | Index variable declaration |
IExpression | size | Loop size |
Returns
Type | Description |
---|---|
IForStatement | For loop statement |
ForStmt(IVariableDeclaration, IExpression, IExpression)
Creates a for loop statement
Declaration
public IForStatement ForStmt(IVariableDeclaration vd, IExpression start, IExpression size)
Parameters
Type | Name | Description |
---|---|---|
IVariableDeclaration | vd | Index variable declaration |
IExpression | start | Start index |
IExpression | size | Loop size |
Returns
Type | Description |
---|---|
IForStatement | For loop statement |
FusedBlockStatement(IExpression)
Declaration
public IWhileStatement FusedBlockStatement(IExpression condition)
Parameters
Type | Name | Description |
---|---|---|
IExpression | condition |
Returns
Type | Description |
---|---|
IWhileStatement |
GenericMethodDecl(MethodVisibility, String, IType, IType, IEnumerable<IGenericParameter>, IParameterDeclaration[])
Create a generic method declaration
Declaration
public IMethodDeclaration GenericMethodDecl(MethodVisibility vis, string name, IType returnType, IType declaringType, IEnumerable<IGenericParameter> genericParams, params IParameterDeclaration[] pars)
Parameters
Type | Name | Description |
---|---|---|
MethodVisibility | vis | Method visibility |
String | name | Method name |
IType | returnType | Method's return code model type |
IType | declaringType | Method's declaring code model type |
IEnumerable<IGenericParameter> | genericParams | Type parameters in order |
IParameterDeclaration[] | pars | Method parameters |
Returns
Type | Description |
---|---|
IMethodDeclaration | The method declaration |
GenericMethodRef(MethodInfo)
Creates a generic method reference
Declaration
public IMethodReference GenericMethodRef(MethodInfo mi)
Parameters
Type | Name | Description |
---|---|---|
MethodInfo | mi | MethodInfo |
Returns
Type | Description |
---|---|
IMethodReference | Method reference |
GenericTypeParam(String)
Creates a generic type parameter
Declaration
public IGenericParameter GenericTypeParam(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | Type parameter name |
Returns
Type | Description |
---|---|
IGenericParameter |
IsMethodInstRef(IMethodReference)
Check if IMethodReference is MethodInstanceReference
Declaration
public virtual bool IsMethodInstRef(IMethodReference imr)
Parameters
Type | Name | Description |
---|---|---|
IMethodReference | imr |
Returns
Type | Description |
---|---|
Boolean | true if MathodInstanceReference |
IsTypeInstRef(ITypeReference)
Check if ITypeReference is TypeInstanceReference
Declaration
public virtual bool IsTypeInstRef(ITypeReference itr)
Parameters
Type | Name | Description |
---|---|---|
ITypeReference | itr |
Returns
Type | Description |
---|---|
Boolean | true if it is a TypeInstanceReference |
JaggedArrayIndex(IExpression, IEnumerable<IEnumerable<IExpression>>)
Creates an expression for a jagged array index
Declaration
public IExpression JaggedArrayIndex(IExpression expr, IEnumerable<IEnumerable<IExpression>> indices)
Parameters
Type | Name | Description |
---|---|---|
IExpression | expr | Unindexed expression |
IEnumerable<IEnumerable<IExpression>> | indices | Loop variable declarations |
Returns
Type | Description |
---|---|
IExpression | Indexed expression |
LiteralExpr()
Default constructor for literal expression
Declaration
public virtual ILiteralExpression LiteralExpr()
Returns
Type | Description |
---|---|
ILiteralExpression | A new literal expression |
LiteralExpr(Object)
Creates a literal expression
Declaration
public ILiteralExpression LiteralExpr(object value)
Parameters
Type | Name | Description |
---|---|---|
Object | value | The value of the literal expression |
Returns
Type | Description |
---|---|
ILiteralExpression | The literal expression |
MakeArrayType(Type, Int32)
Creates an array type
Declaration
public static Type MakeArrayType(Type tp, int rank)
Parameters
Type | Name | Description |
---|---|---|
Type | tp | Element type |
Int32 | rank | Rank of array |
Returns
Type | Description |
---|---|
Type | Array type |
MakeJaggedArrayType(Type, IList<IExpression[]>)
Creates a jagged array type
Declaration
public static Type MakeJaggedArrayType(Type elementType, IList<IExpression[]> sizes)
Parameters
Type | Name | Description |
---|---|---|
Type | elementType | Element type |
IList<IExpression[]> | sizes | Expressions for sizes of the sub-arrays |
Returns
Type | Description |
---|---|
Type | Jagged array type |
MakeValid(String)
Replace characters to make a valid identifier.
Declaration
public static string MakeValid(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | Identifier |
Returns
Type | Description |
---|---|
String | An alphanumeric string, starting with a letter. |
Method(IExpression, IMethodDeclaration, IExpression[])
Creates a call to a method
Declaration
public IMethodInvokeExpression Method(IExpression target, IMethodDeclaration imd, params IExpression[] args)
Parameters
Type | Name | Description |
---|---|---|
IExpression | target | Instance for method call |
IMethodDeclaration | imd | Method declaration |
IExpression[] | args | Argument expressions |
Returns
Type | Description |
---|---|
IMethodInvokeExpression | The method invoke expression |
Method(IExpression, IMethodReference, IExpression[])
Creates a call to a method
Declaration
public IMethodInvokeExpression Method(IExpression target, IMethodReference imr, params IExpression[] args)
Parameters
Type | Name | Description |
---|---|---|
IExpression | target | Instance for method call |
IMethodReference | imr | Method reference |
IExpression[] | args | Argument expressions |
Returns
Type | Description |
---|---|
IMethodInvokeExpression | The method invoke expression |
Method(IExpression, Delegate, IExpression[])
Creates a call to a method
Declaration
public IMethodInvokeExpression Method(IExpression target, Delegate d, params IExpression[] args)
Parameters
Type | Name | Description |
---|---|---|
IExpression | target | Instance for method call |
Delegate | d | Delegate for the method |
IExpression[] | args | Argument expressions |
Returns
Type | Description |
---|---|
IMethodInvokeExpression | The method invoke expression |
Method(IExpression, MethodInfo, IExpression[])
Creates a call to a method
Declaration
public IMethodInvokeExpression Method(IExpression target, MethodInfo mi, params IExpression[] args)
Parameters
Type | Name | Description |
---|---|---|
IExpression | target | Instance for method call |
MethodInfo | mi | Method info |
IExpression[] | args | Argument expressions |
Returns
Type | Description |
---|---|
IMethodInvokeExpression | The method invoke expression |
MethodDecl()
Default constructor for method declaration
Declaration
public virtual IMethodDeclaration MethodDecl()
Returns
Type | Description |
---|---|
IMethodDeclaration | A new method declaration |
MethodDecl(MethodVisibility, String, IType, IType, IParameterDeclaration[])
Create a method declaration
Declaration
public IMethodDeclaration MethodDecl(MethodVisibility vis, string name, IType returnType, IType declaringType, params IParameterDeclaration[] pars)
Parameters
Type | Name | Description |
---|---|---|
MethodVisibility | vis | Method visibility |
String | name | Method name |
IType | returnType | Method's return code model type |
IType | declaringType | Method's declaring code model type |
IParameterDeclaration[] | pars | Method parameters |
Returns
Type | Description |
---|---|
IMethodDeclaration | The method declaration |
MethodDecl(MethodVisibility, String, Type, IType, IParameterDeclaration[])
Create a method declaration
Declaration
public IMethodDeclaration MethodDecl(MethodVisibility vis, string name, Type returnType, IType declaringType, params IParameterDeclaration[] pars)
Parameters
Type | Name | Description |
---|---|---|
MethodVisibility | vis | Method visibility |
String | name | Method name |
Type | returnType | Method's return type |
IType | declaringType | Method's declaring type |
IParameterDeclaration[] | pars | Method parameters |
Returns
Type | Description |
---|---|
IMethodDeclaration | The method declaration |
MethodInstRef()
Default constructor for method instance reference
Declaration
public virtual IMethodReference MethodInstRef()
Returns
Type | Description |
---|---|
IMethodReference | A new method reference |
MethodInstRef(IType[])
Constructor for method instance reference
Declaration
public virtual IMethodReference MethodInstRef(IType[] paramTypes)
Parameters
Type | Name | Description |
---|---|---|
IType[] | paramTypes |
Returns
Type | Description |
---|---|
IMethodReference | A new method reference |
MethodInvkExpr()
Default constructor for method invoke expression
Declaration
public virtual IMethodInvokeExpression MethodInvkExpr()
Returns
Type | Description |
---|---|
IMethodInvokeExpression | A new method invoke expression |
MethodRef()
Default constructor for method reference
Declaration
public virtual IMethodReference MethodRef()
Returns
Type | Description |
---|---|
IMethodReference | A new method reference |
MethodRef(MethodInfo)
Creates a method reference
Declaration
public IMethodReference MethodRef(MethodInfo mi)
Parameters
Type | Name | Description |
---|---|---|
MethodInfo | mi | MethodInfo |
Returns
Type | Description |
---|---|
IMethodReference | Method reference |
MethodRefExpr()
Default constructor for method reference expression
Declaration
public virtual IMethodReferenceExpression MethodRefExpr()
Returns
Type | Description |
---|---|
IMethodReferenceExpression | A new method reference expression |
MethodReturnType(IType)
Default constructor for method return type
Declaration
public virtual IMethodReturnType MethodReturnType(IType type)
Parameters
Type | Name | Description |
---|---|---|
IType | type |
Returns
Type | Description |
---|---|
IMethodReturnType | A new method return type |
MethodRtrnStmt()
Default constructor for method return statement
Declaration
public virtual IMethodReturnStatement MethodRtrnStmt()
Returns
Type | Description |
---|---|
IMethodReturnStatement | A new method return statement |
NameSpace()
Default constructor for namespace
Declaration
public virtual INamespace NameSpace()
Returns
Type | Description |
---|---|
INamespace | A new namespace |
NestedForStmt(IReadOnlyList<IVariableDeclaration>, IReadOnlyList<IExpression>, out IForStatement)
Creates a nested for loop statement
Declaration
public IForStatement NestedForStmt(IReadOnlyList<IVariableDeclaration> indexVars, IReadOnlyList<IExpression> sizes, out IForStatement innerForStatement)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<IVariableDeclaration> | indexVars | Index variable declarations |
IReadOnlyList<IExpression> | sizes | Size expressions for each dimension |
IForStatement | innerForStatement | Inner for loop statement (output) |
Returns
Type | Description |
---|---|
IForStatement | Nested for loop statement |
NewJaggedArray(ICollection<IStatement>, IVariableDeclaration, IList<IVariableDeclaration[]>, IList<IExpression[]>, Int32)
Creates a new jagged array, consisting of a declaration and a nested loop allocating the sub-arrays.
Declaration
public IVariableDeclaration NewJaggedArray(ICollection<IStatement> addTo, IVariableDeclaration decl, IList<IVariableDeclaration[]> indexVars, IList<IExpression[]> sizes, int literalIndexingDepth = 0)
Parameters
Type | Name | Description |
---|---|---|
ICollection<IStatement> | addTo | |
IVariableDeclaration | decl | |
IList<IVariableDeclaration[]> | indexVars | |
IList<IExpression[]> | sizes | |
Int32 | literalIndexingDepth |
Returns
Type | Description |
---|---|
IVariableDeclaration |
NewObject(IType, IExpression[])
Creates object creation expression
Declaration
public IObjectCreateExpression NewObject(IType t, params IExpression[] pars)
Parameters
Type | Name | Description |
---|---|---|
IType | t | Type to create |
IExpression[] | pars | Expressions for constructor parameters |
Returns
Type | Description |
---|---|
IObjectCreateExpression | Object create expression |
NewObject(IType, IList<IExpression>)
Creates object creation expression
Declaration
public IObjectCreateExpression NewObject(IType t, IList<IExpression> iec)
Parameters
Type | Name | Description |
---|---|---|
IType | t | Type to create |
IList<IExpression> | iec | Exprssions for constructor parameters |
Returns
Type | Description |
---|---|
IObjectCreateExpression | Object create expression |
NewObject(Type, IExpression[])
Creates object creation expression
Declaration
public IObjectCreateExpression NewObject(Type t, params IExpression[] args)
Parameters
Type | Name | Description |
---|---|---|
Type | t | Type to create |
IExpression[] | args | Expressions for constructor parameters |
Returns
Type | Description |
---|---|
IObjectCreateExpression | Object create expression |
NewObject(Type, IList<IExpression>)
Creates object creation expression
Declaration
public IObjectCreateExpression NewObject(Type t, IList<IExpression> iec)
Parameters
Type | Name | Description |
---|---|---|
Type | t | Type to create |
IList<IExpression> | iec | Exprssions for constructor parameters |
Returns
Type | Description |
---|---|
IObjectCreateExpression | Object create expression |
NotExpr(IExpression)
Creates a boolean NOT expression
Declaration
public IUnaryExpression NotExpr(IExpression expr)
Parameters
Type | Name | Description |
---|---|---|
IExpression | expr | The expression to the right of the operator |
Returns
Type | Description |
---|---|
IUnaryExpression | The unary expression |
ObjCreateExpr()
Default constructor for object create expression
Declaration
public virtual IObjectCreateExpression ObjCreateExpr()
Returns
Type | Description |
---|---|
IObjectCreateExpression | A new object create expression |
Param(String, IType)
Creates a parameter declaration
Declaration
public IParameterDeclaration Param(string name, IType type)
Parameters
Type | Name | Description |
---|---|---|
String | name | Name of parameter |
IType | type | Type of parameter |
Returns
Type | Description |
---|---|
IParameterDeclaration | Parameter declaration |
Param(String, Type)
Creates a parameter declaration
Declaration
public IParameterDeclaration Param(string name, Type type)
Parameters
Type | Name | Description |
---|---|---|
String | name | Name of parameter |
Type | type | Type of parameter |
Returns
Type | Description |
---|---|
IParameterDeclaration | Parameter declaration |
ParamDecl()
Default constructor for parameter declaration
Declaration
public virtual IParameterDeclaration ParamDecl()
Returns
Type | Description |
---|---|
IParameterDeclaration | A new parameter declaration |
ParamRef()
Default constructor for argument reference expression
Declaration
public virtual IArgumentReferenceExpression ParamRef()
Returns
Type | Description |
---|---|
IArgumentReferenceExpression | A new argument reference expression |
ParamRef(IParameterReference)
Creates a parameter reference expression
Declaration
public IArgumentReferenceExpression ParamRef(IParameterReference pr)
Parameters
Type | Name | Description |
---|---|---|
IParameterReference | pr | Parameter reference |
Returns
Type | Description |
---|---|
IArgumentReferenceExpression | arameter reference expression |
PropDecl()
Default constructor for property declaration
Declaration
public virtual IPropertyDeclaration PropDecl()
Returns
Type | Description |
---|---|
IPropertyDeclaration | A new property declaration |
PropDecl(String, Type, IType, MethodVisibility)
Creates a property declaration with an empty get method and no set method
Declaration
public IPropertyDeclaration PropDecl(string name, Type propertyType, IType declaringType, MethodVisibility getMethodVisibility)
Parameters
Type | Name | Description |
---|---|---|
String | name | Name of the property |
Type | propertyType | Type of the property |
IType | declaringType | Type containing the property |
MethodVisibility | getMethodVisibility | Visibility of the get method |
Returns
Type | Description |
---|---|
IPropertyDeclaration | The property declaration with an empty get method and no set method |
PropDecl(String, Type, IType, MethodVisibility, MethodVisibility, out IExpression)
Creates a property declaration with an empty get method and set method
Declaration
public IPropertyDeclaration PropDecl(string name, Type propertyType, IType declaringType, MethodVisibility getMethodVisibility, MethodVisibility setMethodVisibility, out IExpression value)
Parameters
Type | Name | Description |
---|---|---|
String | name | Name of the property |
Type | propertyType | Type of the property |
IType | declaringType | Type containing the property |
MethodVisibility | getMethodVisibility | Visibility of the get method |
MethodVisibility | setMethodVisibility | Visibility of the set method |
IExpression | value | The value passed to the set method |
Returns
Type | Description |
---|---|
IPropertyDeclaration | The property declaration with an empty get method and set method |
PropIndxrExpr()
Default constructor for property indexer expression
Declaration
public virtual IPropertyIndexerExpression PropIndxrExpr()
Returns
Type | Description |
---|---|
IPropertyIndexerExpression | A new property indexer expression |
PropRef()
Default constructor for property reference
Declaration
public virtual IPropertyReference PropRef()
Returns
Type | Description |
---|---|
IPropertyReference | A new property reference |
PropRefExpr()
Default constructor for property reference expression
Declaration
public virtual IPropertyReferenceExpression PropRefExpr()
Returns
Type | Description |
---|---|
IPropertyReferenceExpression | A new property reference expression |
PropRefExpr(IExpression, IPropertyReference)
Creates a property reference expression
Declaration
public IPropertyReferenceExpression PropRefExpr(IExpression target, IPropertyReference pr)
Parameters
Type | Name | Description |
---|---|---|
IExpression | target | Instance expression |
IPropertyReference | pr | Declaration of the property |
Returns
Type | Description |
---|---|
IPropertyReferenceExpression | Property reference expression |
PropRefExpr(IExpression, Type, String)
Creates a property reference expression
Declaration
public IPropertyReferenceExpression PropRefExpr(IExpression expr, Type declaringType, string propName)
Parameters
Type | Name | Description |
---|---|---|
IExpression | expr | Instance expression |
Type | declaringType | Declaring type |
String | propName | Property name |
Returns
Type | Description |
---|---|
IPropertyReferenceExpression | Property reference expression |
PropRefExpr(IExpression, Type, String, Type)
Creates a property reference expression
Declaration
public IPropertyReferenceExpression PropRefExpr(IExpression expr, Type declaringType, string propName, Type propType)
Parameters
Type | Name | Description |
---|---|---|
IExpression | expr | Instance expression |
Type | declaringType | Declaring type |
String | propName | Property name |
Type | propType | Property type |
Returns
Type | Description |
---|---|
IPropertyReferenceExpression | Property reference expression |
RefType()
Default constructor for a reference type
Declaration
public virtual IReferenceType RefType()
Returns
Type | Description |
---|---|
IReferenceType | A new reference type |
RepeatStmt()
Default constructor for a repeat statement
Declaration
public virtual IRepeatStatement RepeatStmt()
Returns
Type | Description |
---|---|
IRepeatStatement | A new repeat statement |
RepeatStmt(IExpression)
Creates a repeat statement
Declaration
public IRepeatStatement RepeatStmt(IExpression count)
Parameters
Type | Name | Description |
---|---|---|
IExpression | count | Count i.e. number of repeats |
Returns
Type | Description |
---|---|
IRepeatStatement | Repeat statement |
ReplaceExpression(IExpression, IExpression, IExpression)
Finds and replaces one expression with another expression in a given expression
Declaration
public IExpression ReplaceExpression(IExpression expr, IExpression exprFind, IExpression exprReplace)
Parameters
Type | Name | Description |
---|---|---|
IExpression | expr | The expression |
IExpression | exprFind | The expression to be found |
IExpression | exprReplace | Replacement expression |
Returns
Type | Description |
---|---|
IExpression |
ReplaceExpression(IExpression, IExpression, IExpression, ref Int32)
Finds and replaces one expression with another expression in a given expression
Declaration
public IExpression ReplaceExpression(IExpression expr, IExpression exprFind, IExpression exprReplace, ref int replaceCount)
Parameters
Type | Name | Description |
---|---|---|
IExpression | expr | The expression |
IExpression | exprFind | The expression to be found |
IExpression | exprReplace | Replacement expression |
Int32 | replaceCount | Replacement count - passed by reference |
Returns
Type | Description |
---|---|
IExpression | The resulting expression |
ReplaceVariable(IExpression, IVariableDeclaration, IExpression, ref Int32)
Replaces references to 'ivdFind' with specified expression in the supplied expression.
Declaration
public IExpression ReplaceVariable(IExpression expr, IVariableDeclaration ivdFind, IExpression exprReplace, ref int replaceCount)
Parameters
Type | Name | Description |
---|---|---|
IExpression | expr | The expression |
IVariableDeclaration | ivdFind | Variable declaration to find |
IExpression | exprReplace | Replacement expression |
Int32 | replaceCount | Replacement count - passed by reference |
Returns
Type | Description |
---|---|
IExpression | The resulting expression |
ReplaceVariable(IExpression, IVariableDeclaration, IVariableDeclaration)
Replaces references to 'ivdFind' with 'ivdReplace' in the supplied expression.
Declaration
public IExpression ReplaceVariable(IExpression expr, IVariableDeclaration ivdFind, IVariableDeclaration ivdReplace)
Parameters
Type | Name | Description |
---|---|---|
IExpression | expr | The expression |
IVariableDeclaration | ivdFind | Variable declaration to find |
IVariableDeclaration | ivdReplace | Replacement variable declaration |
Returns
Type | Description |
---|---|
IExpression | The resulting expression |
Return()
Creates a return statement with no arguments
Declaration
public IMethodReturnStatement Return()
Returns
Type | Description |
---|---|
IMethodReturnStatement | The method return statement |
Return(IExpression)
Creates a return statement
Declaration
public IMethodReturnStatement Return(IExpression expr)
Parameters
Type | Name | Description |
---|---|---|
IExpression | expr | Expression for return statement |
Returns
Type | Description |
---|---|
IMethodReturnStatement | The method return statement |
StaticGenericMethod(Delegate, IExpression[])
Creates a call to a static generic method
Declaration
public IMethodInvokeExpression StaticGenericMethod(Delegate d, params IExpression[] args)
Parameters
Type | Name | Description |
---|---|---|
Delegate | d | The delegate |
IExpression[] | args | Argument expressions |
Returns
Type | Description |
---|---|
IMethodInvokeExpression | The method invoke expression |
StaticGenericMethod(Delegate, IType[], IExpression[])
Creates a call to a static generic method by replacing the type arguments in the method referred to by the delegate with the specified arguments. This allows the method to be referred to statically even when the generic arguments are not known at compile-time. By convention, the type arguments of the delegate method should be object or the highest level class which satisifies the type constraints.
Declaration
public IMethodInvokeExpression StaticGenericMethod(Delegate d, IType[] replacementGenericArgs, params IExpression[] args)
Parameters
Type | Name | Description |
---|---|---|
Delegate | d | Delegate |
IType[] | replacementGenericArgs | Replacement generic arguments |
IExpression[] | args | Argument expressions |
Returns
Type | Description |
---|---|
IMethodInvokeExpression | The method invoke expression |
StaticGenericMethod(Delegate, Type[], IExpression[])
Creates a call to a static generic method by replacing the type arguments in the method referred to by the delegate with the specified arguments. This allows the method to be referred to statically even when the generic arguments are not known at compile-time. By convention, the type arguments of the delegate method should be object or the highest level class which satisifies the type constraints.
Declaration
public IMethodInvokeExpression StaticGenericMethod(Delegate d, Type[] replacementGenericArgs, params IExpression[] args)
Parameters
Type | Name | Description |
---|---|---|
Delegate | d | Delegate |
Type[] | replacementGenericArgs | Replacement generic arguments |
IExpression[] | args | Argument expressions |
Returns
Type | Description |
---|---|
IMethodInvokeExpression | The method invoke expression |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | |
ArgumentNullException | |
ArgumentException |
StaticGenericMethod(MethodInfo, IExpression[])
Creates a call to a static generic method
Declaration
public IMethodInvokeExpression StaticGenericMethod(MethodInfo mi, params IExpression[] args)
Parameters
Type | Name | Description |
---|---|---|
MethodInfo | mi | The MethodInfo |
IExpression[] | args | Argument expressions |
Returns
Type | Description |
---|---|
IMethodInvokeExpression | The method invoke expression |
StaticMethod(IMethodReference, IExpression[])
Creates a call to a static method
Declaration
public IMethodInvokeExpression StaticMethod(IMethodReference imr, params IExpression[] args)
Parameters
Type | Name | Description |
---|---|---|
IMethodReference | imr | Method reference |
IExpression[] | args | Argument expressions |
Returns
Type | Description |
---|---|
IMethodInvokeExpression | The method invoke expression |
StaticMethod(Delegate, IExpression[])
Creates a call to a static method
Declaration
public IMethodInvokeExpression StaticMethod(Delegate d, params IExpression[] args)
Parameters
Type | Name | Description |
---|---|---|
Delegate | d | Delegate for the method |
IExpression[] | args | Argument expressions |
Returns
Type | Description |
---|---|
IMethodInvokeExpression | The method invoke expression |
StaticMethod(MethodInfo, IExpression[])
Creates a call to a static method
Declaration
public IMethodInvokeExpression StaticMethod(MethodInfo mi, params IExpression[] args)
Parameters
Type | Name | Description |
---|---|---|
MethodInfo | mi | MethodInfo instance |
IExpression[] | args | Argument expressions |
Returns
Type | Description |
---|---|
IMethodInvokeExpression | The method invoke expression |
StaticPropRefExpr(Type, String)
Declaration
public IPropertyReferenceExpression StaticPropRefExpr(Type declaringType, string propName)
Parameters
Type | Name | Description |
---|---|---|
Type | declaringType | |
String | propName |
Returns
Type | Description |
---|---|
IPropertyReferenceExpression |
StmtCollection()
Default constructor for statement collection
Declaration
public virtual IList<IStatement> StmtCollection()
Returns
Type | Description |
---|---|
IList<IStatement> | A new statement collection |
SwitchStmt()
Default constructor for switch statement
Declaration
public virtual ISwitchStatement SwitchStmt()
Returns
Type | Description |
---|---|
ISwitchStatement | A new switch statement |
ThisRefExpr()
Default constructor for 'this' refrence expression
Declaration
public virtual IThisReferenceExpression ThisRefExpr()
Returns
Type | Description |
---|---|
IThisReferenceExpression | A new this reference expression |
ThrowStmt()
Throw exception statement
Declaration
public virtual IThrowExceptionStatement ThrowStmt()
Returns
Type | Description |
---|---|
IThrowExceptionStatement |
ThrowStmt(IExpression)
Throw statement
Declaration
public IThrowExceptionStatement ThrowStmt(IExpression expr)
Parameters
Type | Name | Description |
---|---|---|
IExpression | expr | The expression to throw |
Returns
Type | Description |
---|---|
IThrowExceptionStatement |
ToMethod(IMethodReference)
Converts a code model method reference to a MethodBase
Declaration
public MethodBase ToMethod(IMethodReference imr)
Parameters
Type | Name | Description |
---|---|---|
IMethodReference | imr | Method reference |
Returns
Type | Description |
---|---|
MethodBase | Returns MethodBase if conversion is successful, null otherwise |
ToMethodThrows(IMethodReference)
Converts a code model method reference to a MethodBase
Declaration
public MethodBase ToMethodThrows(IMethodReference imr)
Parameters
Type | Name | Description |
---|---|---|
IMethodReference | imr | Method reference |
Returns
Type | Description |
---|---|
MethodBase | Returns MethodBase if conversion is successful, throws an exception otherwise |
ToType(IDotNetType)
Converts a code model type into a System.Reflection Type.
Declaration
public Type ToType(IDotNetType t)
Parameters
Type | Name | Description |
---|---|---|
IDotNetType | t |
Returns
Type | Description |
---|---|
Type |
ToTypeName(IDotNetType)
Get assembly qualified dotNET type name
Declaration
protected string ToTypeName(IDotNetType it)
Parameters
Type | Name | Description |
---|---|---|
IDotNetType | it | Code mode type |
Returns
Type | Description |
---|---|
String |
TypeDecl()
Default constructor for type declaration
Declaration
public virtual ITypeDeclaration TypeDecl()
Returns
Type | Description |
---|---|
ITypeDeclaration | A new type declaration |
TypeInstRef()
Default constructor for type instance reference
Declaration
public virtual ITypeReference TypeInstRef()
Returns
Type | Description |
---|---|
ITypeReference | A new type instance reference |
TypeOf(IType)
Creates a typeof expression
Declaration
public ITypeOfExpression TypeOf(IType t)
Parameters
Type | Name | Description |
---|---|---|
IType | t | Type |
Returns
Type | Description |
---|---|
ITypeOfExpression | Typeof expression |
TypeOfExpr()
Default constructor for typeof expression
Declaration
public virtual ITypeOfExpression TypeOfExpr()
Returns
Type | Description |
---|---|
ITypeOfExpression | A new typeof expression |
TypeRef()
Default constructor for a type reference
Declaration
public virtual ITypeReference TypeRef()
Returns
Type | Description |
---|---|
ITypeReference | A new type reference |
TypeRef(String, Type, IType)
Creates a type reference
Declaration
public IType TypeRef(string name, Type t, IType outerClass)
Parameters
Type | Name | Description |
---|---|---|
String | name | Name of the reference |
Type | t | Type |
IType | outerClass | The owner type if this is a generic parameter type, otherwise null |
Returns
Type | Description |
---|---|
IType | Type reference |
TypeRef(String, Type, IType, IType[])
Creates a type reference
Declaration
public ITypeReference TypeRef(string name, Type t, IType outerClass, params IType[] typeArguments)
Parameters
Type | Name | Description |
---|---|---|
String | name | Name of the reference |
Type | t | Type |
IType | outerClass | The owner type if this is a generic parameter type, otherwise null |
IType[] | typeArguments | Type arguments |
Returns
Type | Description |
---|---|
ITypeReference | Type reference |
TypeRef(Type)
Creates a type reference
Declaration
public IType TypeRef(Type t)
Parameters
Type | Name | Description |
---|---|---|
Type | t | The dotNET type |
Returns
Type | Description |
---|---|
IType |
TypeRefArray(IList<Type>)
Creates an array of type references
Declaration
public IType[] TypeRefArray(IList<Type> types)
Parameters
Type | Name | Description |
---|---|---|
IList<Type> | types | List of types |
Returns
Type | Description |
---|---|
IType[] | The array of types |
TypeRefExpr()
Default constructor for an assembly reference
Declaration
public virtual ITypeReferenceExpression TypeRefExpr()
Returns
Type | Description |
---|---|
ITypeReferenceExpression | A new type reference expression |
TypeRefExpr(IType)
Create a type reference expression
Declaration
public ITypeReferenceExpression TypeRefExpr(IType type)
Parameters
Type | Name | Description |
---|---|---|
IType | type | A type reference |
Returns
Type | Description |
---|---|
ITypeReferenceExpression | Type reference expression |
TypeRefExpr(Type)
Create a type reference expression
Declaration
public ITypeReferenceExpression TypeRefExpr(Type type)
Parameters
Type | Name | Description |
---|---|---|
Type | type | A type |
Returns
Type | Description |
---|---|
ITypeReferenceExpression | Type reference expression |
UnaryExpr()
Default constructor for unary expression
Declaration
public virtual IUnaryExpression UnaryExpr()
Returns
Type | Description |
---|---|
IUnaryExpression | A new unary expression |
UnaryExpr(UnaryOperator, IExpression)
Creates a unary expression
Declaration
public IUnaryExpression UnaryExpr(UnaryOperator op, IExpression expr)
Parameters
Type | Name | Description |
---|---|---|
UnaryOperator | op | The unary operator |
IExpression | expr | The input expression |
Returns
Type | Description |
---|---|
IUnaryExpression |
UsingStmt()
Default constructor for using statement
Declaration
public virtual IUsingStatement UsingStmt()
Returns
Type | Description |
---|---|
IUsingStatement | A new statement |
VarDecl()
Default constructor for variable declaration
Declaration
public virtual IVariableDeclaration VarDecl()
Returns
Type | Description |
---|---|
IVariableDeclaration | A new variable declaration |
VarDecl(String, IType)
Creates a variable declaration
Declaration
public IVariableDeclaration VarDecl(string name, IType tp)
Parameters
Type | Name | Description |
---|---|---|
String | name | Name of variable |
IType | tp | Type of variable |
Returns
Type | Description |
---|---|
IVariableDeclaration | Variable declaration |
VarDecl(String, Type)
Creates a variable declaration
Declaration
public IVariableDeclaration VarDecl(string name, Type tp)
Parameters
Type | Name | Description |
---|---|---|
String | name | Name of variable |
Type | tp | Type of variable |
Returns
Type | Description |
---|---|
IVariableDeclaration | Variable declaration |
VarDeclExpr()
Default constructor for variable declaration expression
Declaration
public virtual IVariableDeclarationExpression VarDeclExpr()
Returns
Type | Description |
---|---|
IVariableDeclarationExpression | A new variable declaration expression |
VarDeclExpr(IVariableDeclaration)
Creates a variable declaration expression
Declaration
public IVariableDeclarationExpression VarDeclExpr(IVariableDeclaration ivd)
Parameters
Type | Name | Description |
---|---|---|
IVariableDeclaration | ivd | Variable declaration |
Returns
Type | Description |
---|---|
IVariableDeclarationExpression | Variable declaration expression |
VarRef(IVariableDeclaration)
Constructor for variable reference
Declaration
public virtual IVariableReference VarRef(IVariableDeclaration ivd)
Parameters
Type | Name | Description |
---|---|---|
IVariableDeclaration | ivd | Variable declaration interface instance |
Returns
Type | Description |
---|---|
IVariableReference | new variable reference |
VarRefExpr()
Default constructor for variable reference expression
Declaration
public virtual IVariableReferenceExpression VarRefExpr()
Returns
Type | Description |
---|---|
IVariableReferenceExpression | A new variable reference expression |
VarRefExpr(IVariableReference)
Creates a variable reference expression
Declaration
public IVariableReferenceExpression VarRefExpr(IVariableReference ivr)
Parameters
Type | Name | Description |
---|---|---|
IVariableReference | ivr | Variable reference |
Returns
Type | Description |
---|---|
IVariableReferenceExpression | Variable reference expression |
VarRefExprArray(IList<IVariableDeclaration>)
Creates an array of variable reference expressions
Declaration
public IVariableReferenceExpression[] VarRefExprArray(IList<IVariableDeclaration> ivr)
Parameters
Type | Name | Description |
---|---|---|
IList<IVariableDeclaration> | ivr | A list of variable declarations |
Returns
Type | Description |
---|---|
IVariableReferenceExpression[] | Array of variable reference expressions |
VarRefExprArray(Int32)
Constructor for variable reference expression array
Declaration
public virtual IVariableReferenceExpression[] VarRefExprArray(int count)
Parameters
Type | Name | Description |
---|---|---|
Int32 | count | Number of variable reference expressions in the array |
Returns
Type | Description |
---|---|
IVariableReferenceExpression[] | A new variable reference expression array |
WhileStmt()
Default constructor for while statement
Declaration
public virtual IWhileStatement WhileStmt()
Returns
Type | Description |
---|---|
IWhileStatement | A new while statement |
WhileStmt(IExpression)
Declaration
public IWhileStatement WhileStmt(IExpression condition)
Parameters
Type | Name | Description |
---|---|---|
IExpression | condition |
Returns
Type | Description |
---|---|
IWhileStatement |
WhileStmt(IWhileStatement)
Declaration
public IWhileStatement WhileStmt(IWhileStatement iws)
Parameters
Type | Name | Description |
---|---|---|
IWhileStatement | iws |
Returns
Type | Description |
---|---|
IWhileStatement |