C# Class Pytocs.CodeModel.CodeGenerator

显示文件 Open project: uxmal/pytocs Class Usage Examples

Public Methods

Method Description
Appl ( CodeExpression fn ) : CodeExpression
Assign ( CodeExpression lhs, CodeExpression rhs ) : CodeAssignStatement
BinOp ( CodeExpression l, CodeOperatorType op, CodeExpression r ) : CodeBinaryOperatorExpression
CatchClause ( string localName, CodeTypeReference type, System.Action generateClauseBody ) : CodeCatchClause
Class ( string name, IEnumerable baseClasses, System.Action body ) : CodeTypeDeclaration
CodeGenerator ( CodeCompileUnit unt, string modulePath, string moduleName ) : System
Continue ( ) : void
DoWhile ( System.Action generateBody, CodeExpression exp ) : CodePostTestLoopStatement
EnsureImport ( string nmespace ) : void
EscapeKeywordName ( string name ) : string
Field ( string fieldName ) : CodeMemberField
Foreach ( CodeExpression exp, CodeExpression list, System.Action xlatLoopBody ) : CodeStatement
LambdaMethod ( IEnumerable parms, System.Action body ) : CodeMemberMethod
ListInitializer ( IEnumerable exprs ) : CodeExpression
SideEffect ( CodeExpression exp ) : CodeStatement
Try ( System.Action genTryStatements, IEnumerable catchClauses, System.Action genFinallyStatements ) : CodeTryCatchFinallyStatement
TypeRefExpr ( string typeName ) : CodeExpression
Using ( string @namespace ) : void
Using ( string alias, string @namespace ) : void
While ( CodeExpression exp, System.Action generateBody ) : CodePreTestLoopStatement

Private Methods

Method Description
Access ( CodeExpression exp, string fieldName ) : CodeExpression
Aref ( CodeExpression exp, CodeExpression indices ) : CodeArrayIndexerExpression
Break ( ) : void
Comment ( string comment ) : CodeCommentStatement
Constructor ( IEnumerable parms, System.Action body ) : CodeConstructor
CustomAttr ( CodeTypeReference typeRef ) : CodeAttributeDeclaration
Field ( string fieldName, CodeExpression initializer ) : CodeMemberField
GenerateMethodBody ( CodeMemberMethod method, System.Action body ) : void
If ( CodeExpression test, System.Action xlatThen, System.Action xlatElse ) : CodeConditionStatement
Lambda ( CodeExpression args, CodeExpression expr ) : CodeExpression
Lambda ( CodeExpression args, List stmts ) : CodeExpression
Method ( string name, IEnumerable parms, System.Action body ) : CodeMemberMethod
Param ( Type type, string name ) : CodeParameterDeclarationExpression
Param ( Type type, string name, CodeExpression defaultValue ) : CodeParameterDeclarationExpression
Return ( CodeExpression e = null ) : void
StaticMethod ( string name, IEnumerable parms, System.Action body ) : CodeMemberMethod
Throw ( ) : CodeThrowExceptionStatement
Throw ( CodeExpression codeExpression ) : CodeThrowExceptionStatement
TypeRef ( string typeName ) : CodeTypeReference
Using ( IEnumerable initializers, System.Action xlatUsingBody ) : CodeUsingStatement
Yield ( CodeExpression exp ) : CodeYieldStatement

Method Details

Appl() public method

public Appl ( CodeExpression fn ) : CodeExpression
fn CodeExpression
return CodeExpression

Assign() public method

public Assign ( CodeExpression lhs, CodeExpression rhs ) : CodeAssignStatement
lhs CodeExpression
rhs CodeExpression
return CodeAssignStatement

BinOp() public method

public BinOp ( CodeExpression l, CodeOperatorType op, CodeExpression r ) : CodeBinaryOperatorExpression
l CodeExpression
op CodeOperatorType
r CodeExpression
return CodeBinaryOperatorExpression

CatchClause() public method

public CatchClause ( string localName, CodeTypeReference type, System.Action generateClauseBody ) : CodeCatchClause
localName string
type CodeTypeReference
generateClauseBody System.Action
return CodeCatchClause

Class() public method

public Class ( string name, IEnumerable baseClasses, System.Action body ) : CodeTypeDeclaration
name string
baseClasses IEnumerable
body System.Action
return CodeTypeDeclaration

CodeGenerator() public method

public CodeGenerator ( CodeCompileUnit unt, string modulePath, string moduleName ) : System
unt CodeCompileUnit
modulePath string
moduleName string
return System

Continue() public method

public Continue ( ) : void
return void

DoWhile() public method

public DoWhile ( System.Action generateBody, CodeExpression exp ) : CodePostTestLoopStatement
generateBody System.Action
exp CodeExpression
return CodePostTestLoopStatement

EnsureImport() public method

public EnsureImport ( string nmespace ) : void
nmespace string
return void

EscapeKeywordName() public method

public EscapeKeywordName ( string name ) : string
name string
return string

Field() public method

public Field ( string fieldName ) : CodeMemberField
fieldName string
return CodeMemberField

Foreach() public method

public Foreach ( CodeExpression exp, CodeExpression list, System.Action xlatLoopBody ) : CodeStatement
exp CodeExpression
list CodeExpression
xlatLoopBody System.Action
return CodeStatement

LambdaMethod() public method

public LambdaMethod ( IEnumerable parms, System.Action body ) : CodeMemberMethod
parms IEnumerable
body System.Action
return CodeMemberMethod

ListInitializer() public method

public ListInitializer ( IEnumerable exprs ) : CodeExpression
exprs IEnumerable
return CodeExpression

SideEffect() public method

public SideEffect ( CodeExpression exp ) : CodeStatement
exp CodeExpression
return CodeStatement

Try() public method

public Try ( System.Action genTryStatements, IEnumerable catchClauses, System.Action genFinallyStatements ) : CodeTryCatchFinallyStatement
genTryStatements System.Action
catchClauses IEnumerable
genFinallyStatements System.Action
return CodeTryCatchFinallyStatement

TypeRefExpr() public method

public TypeRefExpr ( string typeName ) : CodeExpression
typeName string
return CodeExpression

Using() public method

public Using ( string @namespace ) : void
@namespace string
return void

Using() public method

public Using ( string alias, string @namespace ) : void
alias string
@namespace string
return void

While() public method

public While ( CodeExpression exp, System.Action generateBody ) : CodePreTestLoopStatement
exp CodeExpression
generateBody System.Action
return CodePreTestLoopStatement