C# Class Pytocs.Translate.MethodGenerator

Generates code for a Python function definition.
Mostrar archivo Open project: uxmal/pytocs Class Usage Examples

Protected Properties

Property Type Description
args List
f FunctionDef
fnName string
gen Pytocs.CodeModel.CodeGenerator
stmtXlat StatementTranslator
xlat ExpTranslator

Public Methods

Method Description
Generate ( ) : CodeMemberMethod
MethodGenerator ( FunctionDef f, string fnName, List args, bool isStatic, CodeGenerator gen ) : System

Protected Methods

Method Description
Generate ( CodeParameterDeclarationExpression parms ) : CodeMemberMethod
GenerateDefaultArgMethod ( CodeParameterDeclarationExpression argList, CodeExpression paramList ) : void
GenerateTupleParameterUnpackers ( CodeMemberMethod method ) : void
Xlat ( SuiteStatement suite ) : void

Private Methods

Method Description
CreateFunctionParameters ( IEnumerable parameters ) : CodeParameterDeclarationExpression[]
GenerateDefaultArgMethod ( int iFirstDefault ) : void
GenerateFunctionParameter ( Parameter ta ) : CodeParameterDeclarationExpression
GenerateTupleParameterType ( List list ) : CodeTypeReference
GenerateTupleParameterUnpacker ( Parameter p, int i, CodeExpression tuplePath, CodeMemberMethod method ) : void

Method Details

Generate() public method

public Generate ( ) : CodeMemberMethod
return CodeMemberMethod

Generate() protected method

protected Generate ( CodeParameterDeclarationExpression parms ) : CodeMemberMethod
parms CodeParameterDeclarationExpression
return CodeMemberMethod

GenerateDefaultArgMethod() protected method

protected GenerateDefaultArgMethod ( CodeParameterDeclarationExpression argList, CodeExpression paramList ) : void
argList CodeParameterDeclarationExpression
paramList CodeExpression
return void

GenerateTupleParameterUnpackers() protected method

protected GenerateTupleParameterUnpackers ( CodeMemberMethod method ) : void
method CodeMemberMethod
return void

MethodGenerator() public method

public MethodGenerator ( FunctionDef f, string fnName, List args, bool isStatic, CodeGenerator gen ) : System
f FunctionDef
fnName string
args List
isStatic bool
gen Pytocs.CodeModel.CodeGenerator
return System

Xlat() protected method

protected Xlat ( SuiteStatement suite ) : void
suite SuiteStatement
return void

Property Details

args protected_oe property

protected List args
return List

f protected_oe property

protected FunctionDef f
return FunctionDef

fnName protected_oe property

protected string fnName
return string

gen protected_oe property

protected CodeGenerator,Pytocs.CodeModel gen
return Pytocs.CodeModel.CodeGenerator

stmtXlat protected_oe property

protected StatementTranslator,Pytocs.Translate stmtXlat
return StatementTranslator

xlat protected_oe property

protected ExpTranslator xlat
return ExpTranslator