C# Class XSharp.CodeDom.XSharpCodeGenerator

Show file Open project: X-Sharp/XSharpPublic Class Usage Examples

Public Methods

Method Description
XSharpCodeGenerator ( ) : System

Protected Methods

Method Description
CmdArgsFromParameters ( CompilerParameters options ) : string
ContinueOnNewLine ( string st ) : void
CreateEscapedIdentifier ( string value ) : string
CreateValidIdentifier ( string value ) : string
GenerateArgumentReferenceExpression ( CodeArgumentReferenceExpression e ) : void
GenerateArrayCreateExpression ( CodeArrayCreateExpression e ) : void
GenerateArrayIndexerExpression ( CodeArrayIndexerExpression e ) : void
GenerateAssignStatement ( CodeAssignStatement e ) : void
GenerateAttachEventStatement ( System.CodeDom.CodeAttachEventStatement e ) : void
GenerateAttributeDeclarationsEnd ( CodeAttributeDeclarationCollection attributes ) : void
GenerateAttributeDeclarationsStart ( CodeAttributeDeclarationCollection attributes ) : void
GenerateBaseReferenceExpression ( System.CodeDom.CodeBaseReferenceExpression e ) : void
GenerateCastExpression ( CodeCastExpression e ) : void
GenerateComment ( CodeComment e ) : void
GenerateCompileUnitEnd ( CodeCompileUnit e ) : void
GenerateCompileUnitStart ( CodeCompileUnit e ) : void
GenerateConditionStatement ( CodeConditionStatement e ) : void
GenerateConstructor ( CodeConstructor e, CodeTypeDeclaration c ) : void
GenerateDelegateCreateExpression ( CodeDelegateCreateExpression e ) : void
GenerateDelegateInvokeExpression ( CodeDelegateInvokeExpression e ) : void
GenerateEntryPointMethod ( CodeEntryPointMethod e, CodeTypeDeclaration c ) : void
GenerateEvent ( CodeMemberEvent e, CodeTypeDeclaration c ) : void
GenerateEventReferenceExpression ( CodeEventReferenceExpression e ) : void
GenerateExpressionStatement ( CodeExpressionStatement e ) : void
GenerateField ( CodeMemberField e ) : void
GenerateFieldReferenceExpression ( CodeFieldReferenceExpression e ) : void
GenerateGotoStatement ( CodeGotoStatement e ) : void
GenerateIndexerExpression ( CodeIndexerExpression e ) : void
GenerateIterationStatement ( CodeIterationStatement e ) : void
GenerateLabeledStatement ( CodeLabeledStatement e ) : void
GenerateLinePragmaEnd ( CodeLinePragma e ) : void
GenerateLinePragmaStart ( CodeLinePragma e ) : void
GenerateMethod ( CodeMemberMethod e, CodeTypeDeclaration c ) : void
GenerateMethodInvokeExpression ( CodeMethodInvokeExpression e ) : void
GenerateMethodReferenceExpression ( CodeMethodReferenceExpression e ) : void
GenerateMethodReturnStatement ( CodeMethodReturnStatement e ) : void
GenerateNamespace ( CodeNamespace e ) : void
GenerateNamespaceEnd ( CodeNamespace e ) : void
GenerateNamespaceImport ( CodeNamespaceImport e ) : void
GenerateNamespaceStart ( CodeNamespace e ) : void
GenerateObjectCreateExpression ( CodeObjectCreateExpression e ) : void
GenerateParameterDeclarationExpression ( CodeParameterDeclarationExpression e ) : void
GenerateProperty ( CodeMemberProperty e, CodeTypeDeclaration c ) : void
GeneratePropertyReferenceExpression ( CodePropertyReferenceExpression e ) : void
GeneratePropertySetValueReferenceExpression ( System.CodeDom.CodePropertySetValueReferenceExpression e ) : void
GenerateRemoveEventStatement ( CodeRemoveEventStatement e ) : void
GenerateSnippetExpression ( CodeSnippetExpression e ) : void
GenerateSnippetMember ( CodeSnippetTypeMember e ) : void
GenerateThisReferenceExpression ( System.CodeDom.CodeThisReferenceExpression e ) : void
GenerateThrowExceptionStatement ( CodeThrowExceptionStatement e ) : void
GenerateTryCatchFinallyStatement ( CodeTryCatchFinallyStatement e ) : void
GenerateTypeConstructor ( CodeTypeConstructor e ) : void
GenerateTypeEnd ( CodeTypeDeclaration e ) : void
GenerateTypeStart ( CodeTypeDeclaration e ) : void
GenerateVariableDeclarationStatement ( CodeVariableDeclarationStatement e ) : void
GenerateVariableReferenceExpression ( CodeVariableReferenceExpression e ) : void
GetTypeOutput ( CodeTypeReference typeRef ) : string
IsValidIdentifier ( string value ) : bool
OutputAttributeArgument ( CodeAttributeArgument arg ) : void
OutputMemberAccessModifier ( MemberAttributes attributes ) : void
OutputMemberScopeModifier ( MemberAttributes attributes ) : void
OutputOperator ( CodeBinaryOperatorType op ) : void
OutputType ( CodeTypeReference typeRef ) : void
ProcessCompilerOutputLine ( CompilerResults results, string line ) : void
QuoteSnippetString ( string value ) : string
Supports ( GeneratorSupport support ) : bool

Private Methods

Method Description
BuildGenericArguments ( CodeTypeReferenceCollection typeArguments, int start, int len ) : String
EmitGenericTypeArgs ( CodeTypeReferenceCollection typeArgs ) : void
GenerateAttributes ( CodeAttributeDeclarationCollection attributes ) : void
GenerateAttributes ( CodeAttributeDeclarationCollection attributes, string prefix ) : void
GenerateAttributes ( CodeAttributeDeclarationCollection attributes, string prefix, bool inLine ) : void
GetBaseTypeOutput ( CodeTypeReference typeRef ) : string
OutputGenericArguments ( CodeTypeReferenceCollection typeArguments ) : void
OutputGenericParameters ( CodeTypeParameterCollection typeParameters ) : void
OutputTypeAttributes ( CodeTypeDeclaration e ) : void

Method Details

CmdArgsFromParameters() protected method

protected CmdArgsFromParameters ( CompilerParameters options ) : string
options System.CodeDom.Compiler.CompilerParameters
return string

ContinueOnNewLine() protected method

protected ContinueOnNewLine ( string st ) : void
st string
return void

CreateEscapedIdentifier() protected method

protected CreateEscapedIdentifier ( string value ) : string
value string
return string

CreateValidIdentifier() protected method

protected CreateValidIdentifier ( string value ) : string
value string
return string

GenerateArgumentReferenceExpression() protected method

protected GenerateArgumentReferenceExpression ( CodeArgumentReferenceExpression e ) : void
e System.CodeDom.CodeArgumentReferenceExpression
return void

GenerateArrayCreateExpression() protected method

protected GenerateArrayCreateExpression ( CodeArrayCreateExpression e ) : void
e System.CodeDom.CodeArrayCreateExpression
return void

GenerateArrayIndexerExpression() protected method

protected GenerateArrayIndexerExpression ( CodeArrayIndexerExpression e ) : void
e System.CodeDom.CodeArrayIndexerExpression
return void

GenerateAssignStatement() protected method

protected GenerateAssignStatement ( CodeAssignStatement e ) : void
e System.CodeDom.CodeAssignStatement
return void

GenerateAttachEventStatement() protected method

protected GenerateAttachEventStatement ( System.CodeDom.CodeAttachEventStatement e ) : void
e System.CodeDom.CodeAttachEventStatement
return void

GenerateAttributeDeclarationsEnd() protected method

protected GenerateAttributeDeclarationsEnd ( CodeAttributeDeclarationCollection attributes ) : void
attributes System.CodeDom.CodeAttributeDeclarationCollection
return void

GenerateAttributeDeclarationsStart() protected method

protected GenerateAttributeDeclarationsStart ( CodeAttributeDeclarationCollection attributes ) : void
attributes System.CodeDom.CodeAttributeDeclarationCollection
return void

GenerateBaseReferenceExpression() protected method

protected GenerateBaseReferenceExpression ( System.CodeDom.CodeBaseReferenceExpression e ) : void
e System.CodeDom.CodeBaseReferenceExpression
return void

GenerateCastExpression() protected method

protected GenerateCastExpression ( CodeCastExpression e ) : void
e System.CodeDom.CodeCastExpression
return void

GenerateComment() protected method

protected GenerateComment ( CodeComment e ) : void
e System.CodeDom.CodeComment
return void

GenerateCompileUnitEnd() protected method

protected GenerateCompileUnitEnd ( CodeCompileUnit e ) : void
e System.CodeDom.CodeCompileUnit
return void

GenerateCompileUnitStart() protected method

protected GenerateCompileUnitStart ( CodeCompileUnit e ) : void
e System.CodeDom.CodeCompileUnit
return void

GenerateConditionStatement() protected method

protected GenerateConditionStatement ( CodeConditionStatement e ) : void
e System.CodeDom.CodeConditionStatement
return void

GenerateConstructor() protected method

protected GenerateConstructor ( CodeConstructor e, CodeTypeDeclaration c ) : void
e System.CodeDom.CodeConstructor
c System.CodeDom.CodeTypeDeclaration
return void

GenerateDelegateCreateExpression() protected method

protected GenerateDelegateCreateExpression ( CodeDelegateCreateExpression e ) : void
e System.CodeDom.CodeDelegateCreateExpression
return void

GenerateDelegateInvokeExpression() protected method

protected GenerateDelegateInvokeExpression ( CodeDelegateInvokeExpression e ) : void
e System.CodeDom.CodeDelegateInvokeExpression
return void

GenerateEntryPointMethod() protected method

protected GenerateEntryPointMethod ( CodeEntryPointMethod e, CodeTypeDeclaration c ) : void
e System.CodeDom.CodeEntryPointMethod
c System.CodeDom.CodeTypeDeclaration
return void

GenerateEvent() protected method

protected GenerateEvent ( CodeMemberEvent e, CodeTypeDeclaration c ) : void
e System.CodeDom.CodeMemberEvent
c System.CodeDom.CodeTypeDeclaration
return void

GenerateEventReferenceExpression() protected method

protected GenerateEventReferenceExpression ( CodeEventReferenceExpression e ) : void
e System.CodeDom.CodeEventReferenceExpression
return void

GenerateExpressionStatement() protected method

protected GenerateExpressionStatement ( CodeExpressionStatement e ) : void
e System.CodeDom.CodeExpressionStatement
return void

GenerateField() protected method

protected GenerateField ( CodeMemberField e ) : void
e System.CodeDom.CodeMemberField
return void

GenerateFieldReferenceExpression() protected method

protected GenerateFieldReferenceExpression ( CodeFieldReferenceExpression e ) : void
e System.CodeDom.CodeFieldReferenceExpression
return void

GenerateGotoStatement() protected method

protected GenerateGotoStatement ( CodeGotoStatement e ) : void
e System.CodeDom.CodeGotoStatement
return void

GenerateIndexerExpression() protected method

protected GenerateIndexerExpression ( CodeIndexerExpression e ) : void
e System.CodeDom.CodeIndexerExpression
return void

GenerateIterationStatement() protected method

protected GenerateIterationStatement ( CodeIterationStatement e ) : void
e System.CodeDom.CodeIterationStatement
return void

GenerateLabeledStatement() protected method

protected GenerateLabeledStatement ( CodeLabeledStatement e ) : void
e System.CodeDom.CodeLabeledStatement
return void

GenerateLinePragmaEnd() protected method

protected GenerateLinePragmaEnd ( CodeLinePragma e ) : void
e System.CodeDom.CodeLinePragma
return void

GenerateLinePragmaStart() protected method

protected GenerateLinePragmaStart ( CodeLinePragma e ) : void
e System.CodeDom.CodeLinePragma
return void

GenerateMethod() protected method

protected GenerateMethod ( CodeMemberMethod e, CodeTypeDeclaration c ) : void
e System.CodeDom.CodeMemberMethod
c System.CodeDom.CodeTypeDeclaration
return void

GenerateMethodInvokeExpression() protected method

protected GenerateMethodInvokeExpression ( CodeMethodInvokeExpression e ) : void
e System.CodeDom.CodeMethodInvokeExpression
return void

GenerateMethodReferenceExpression() protected method

protected GenerateMethodReferenceExpression ( CodeMethodReferenceExpression e ) : void
e System.CodeDom.CodeMethodReferenceExpression
return void

GenerateMethodReturnStatement() protected method

protected GenerateMethodReturnStatement ( CodeMethodReturnStatement e ) : void
e System.CodeDom.CodeMethodReturnStatement
return void

GenerateNamespace() protected method

protected GenerateNamespace ( CodeNamespace e ) : void
e System.CodeDom.CodeNamespace
return void

GenerateNamespaceEnd() protected method

protected GenerateNamespaceEnd ( CodeNamespace e ) : void
e System.CodeDom.CodeNamespace
return void

GenerateNamespaceImport() protected method

protected GenerateNamespaceImport ( CodeNamespaceImport e ) : void
e System.CodeDom.CodeNamespaceImport
return void

GenerateNamespaceStart() protected method

protected GenerateNamespaceStart ( CodeNamespace e ) : void
e System.CodeDom.CodeNamespace
return void

GenerateObjectCreateExpression() protected method

protected GenerateObjectCreateExpression ( CodeObjectCreateExpression e ) : void
e System.CodeDom.CodeObjectCreateExpression
return void

GenerateParameterDeclarationExpression() protected method

protected GenerateParameterDeclarationExpression ( CodeParameterDeclarationExpression e ) : void
e System.CodeDom.CodeParameterDeclarationExpression
return void

GenerateProperty() protected method

protected GenerateProperty ( CodeMemberProperty e, CodeTypeDeclaration c ) : void
e System.CodeDom.CodeMemberProperty
c System.CodeDom.CodeTypeDeclaration
return void

GeneratePropertyReferenceExpression() protected method

protected GeneratePropertyReferenceExpression ( CodePropertyReferenceExpression e ) : void
e System.CodeDom.CodePropertyReferenceExpression
return void

GeneratePropertySetValueReferenceExpression() protected method

protected GeneratePropertySetValueReferenceExpression ( System.CodeDom.CodePropertySetValueReferenceExpression e ) : void
e System.CodeDom.CodePropertySetValueReferenceExpression
return void

GenerateRemoveEventStatement() protected method

protected GenerateRemoveEventStatement ( CodeRemoveEventStatement e ) : void
e System.CodeDom.CodeRemoveEventStatement
return void

GenerateSnippetExpression() protected method

protected GenerateSnippetExpression ( CodeSnippetExpression e ) : void
e System.CodeDom.CodeSnippetExpression
return void

GenerateSnippetMember() protected method

protected GenerateSnippetMember ( CodeSnippetTypeMember e ) : void
e System.CodeDom.CodeSnippetTypeMember
return void

GenerateThisReferenceExpression() protected method

protected GenerateThisReferenceExpression ( System.CodeDom.CodeThisReferenceExpression e ) : void
e System.CodeDom.CodeThisReferenceExpression
return void

GenerateThrowExceptionStatement() protected method

protected GenerateThrowExceptionStatement ( CodeThrowExceptionStatement e ) : void
e System.CodeDom.CodeThrowExceptionStatement
return void

GenerateTryCatchFinallyStatement() protected method

protected GenerateTryCatchFinallyStatement ( CodeTryCatchFinallyStatement e ) : void
e System.CodeDom.CodeTryCatchFinallyStatement
return void

GenerateTypeConstructor() protected method

protected GenerateTypeConstructor ( CodeTypeConstructor e ) : void
e System.CodeDom.CodeTypeConstructor
return void

GenerateTypeEnd() protected method

protected GenerateTypeEnd ( CodeTypeDeclaration e ) : void
e System.CodeDom.CodeTypeDeclaration
return void

GenerateTypeStart() protected method

protected GenerateTypeStart ( CodeTypeDeclaration e ) : void
e System.CodeDom.CodeTypeDeclaration
return void

GenerateVariableDeclarationStatement() protected method

protected GenerateVariableDeclarationStatement ( CodeVariableDeclarationStatement e ) : void
e System.CodeDom.CodeVariableDeclarationStatement
return void

GenerateVariableReferenceExpression() protected method

protected GenerateVariableReferenceExpression ( CodeVariableReferenceExpression e ) : void
e System.CodeDom.CodeVariableReferenceExpression
return void

GetTypeOutput() protected method

protected GetTypeOutput ( CodeTypeReference typeRef ) : string
typeRef System.CodeDom.CodeTypeReference
return string

IsValidIdentifier() protected method

protected IsValidIdentifier ( string value ) : bool
value string
return bool

OutputAttributeArgument() protected method

protected OutputAttributeArgument ( CodeAttributeArgument arg ) : void
arg System.CodeDom.CodeAttributeArgument
return void

OutputMemberAccessModifier() protected method

protected OutputMemberAccessModifier ( MemberAttributes attributes ) : void
attributes MemberAttributes
return void

OutputMemberScopeModifier() protected method

protected OutputMemberScopeModifier ( MemberAttributes attributes ) : void
attributes MemberAttributes
return void

OutputOperator() protected method

protected OutputOperator ( CodeBinaryOperatorType op ) : void
op CodeBinaryOperatorType
return void

OutputType() protected method

protected OutputType ( CodeTypeReference typeRef ) : void
typeRef System.CodeDom.CodeTypeReference
return void

ProcessCompilerOutputLine() protected method

protected ProcessCompilerOutputLine ( CompilerResults results, string line ) : void
results System.CodeDom.Compiler.CompilerResults
line string
return void

QuoteSnippetString() protected method

protected QuoteSnippetString ( string value ) : string
value string
return string

Supports() protected method

protected Supports ( GeneratorSupport support ) : bool
support GeneratorSupport
return bool

XSharpCodeGenerator() public method

public XSharpCodeGenerator ( ) : System
return System