C# Class System.CodeDom.Compiler.CodeGenerator

Inheritance: ICodeGenerator
Mostra file Open project: dotnet/corefx Class Usage Examples

Public Methods

Method Description
GenerateCodeFromMember ( CodeTypeMember member, TextWriter writer, CodeGeneratorOptions options ) : void
IsValidLanguageIndependentIdentifier ( string value ) : bool
ValidateIdentifiers ( CodeObject e ) : void

Protected Methods

Method Description
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 ( CodeAttachEventStatement e ) : void
GenerateAttributeDeclarationsEnd ( CodeAttributeDeclarationCollection attributes ) : void
GenerateAttributeDeclarationsStart ( CodeAttributeDeclarationCollection attributes ) : void
GenerateBaseReferenceExpression ( CodeBaseReferenceExpression e ) : void
GenerateBinaryOperatorExpression ( CodeBinaryOperatorExpression e ) : void
GenerateCastExpression ( CodeCastExpression e ) : void
GenerateComment ( CodeComment e ) : void
GenerateCommentStatement ( CodeCommentStatement e ) : void
GenerateCommentStatements ( CodeCommentStatementCollection e ) : void
GenerateCompileUnit ( CodeCompileUnit e ) : void
GenerateCompileUnitEnd ( CodeCompileUnit e ) : void
GenerateCompileUnitStart ( CodeCompileUnit e ) : void
GenerateConditionStatement ( CodeConditionStatement e ) : void
GenerateConstructor ( CodeConstructor e, CodeTypeDeclaration c ) : void
GenerateDecimalValue ( decimal d ) : void
GenerateDefaultValueExpression ( CodeDefaultValueExpression e ) : void
GenerateDelegateCreateExpression ( CodeDelegateCreateExpression e ) : void
GenerateDelegateInvokeExpression ( CodeDelegateInvokeExpression e ) : void
GenerateDirectionExpression ( CodeDirectionExpression e ) : void
GenerateDirectives ( CodeDirectiveCollection directives ) : void
GenerateDoubleValue ( double d ) : void
GenerateEntryPointMethod ( CodeEntryPointMethod e, CodeTypeDeclaration c ) : void
GenerateEvent ( CodeMemberEvent e, CodeTypeDeclaration c ) : void
GenerateEventReferenceExpression ( CodeEventReferenceExpression e ) : void
GenerateExpression ( CodeExpression 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
GenerateNamespaceImports ( CodeNamespace e ) : void
GenerateNamespaceStart ( CodeNamespace e ) : void
GenerateNamespaces ( CodeCompileUnit e ) : void
GenerateObjectCreateExpression ( CodeObjectCreateExpression e ) : void
GenerateParameterDeclarationExpression ( CodeParameterDeclarationExpression e ) : void
GeneratePrimitiveExpression ( CodePrimitiveExpression e ) : void
GenerateProperty ( CodeMemberProperty e, CodeTypeDeclaration c ) : void
GeneratePropertyReferenceExpression ( CodePropertyReferenceExpression e ) : void
GeneratePropertySetValueReferenceExpression ( CodePropertySetValueReferenceExpression e ) : void
GenerateRemoveEventStatement ( CodeRemoveEventStatement e ) : void
GenerateSingleFloatValue ( float s ) : void
GenerateSnippetCompileUnit ( CodeSnippetCompileUnit e ) : void
GenerateSnippetExpression ( CodeSnippetExpression e ) : void
GenerateSnippetMember ( CodeSnippetTypeMember e ) : void
GenerateSnippetStatement ( CodeSnippetStatement e ) : void
GenerateStatement ( CodeStatement e ) : void
GenerateStatements ( CodeStatementCollection stmts ) : void
GenerateThisReferenceExpression ( CodeThisReferenceExpression e ) : void
GenerateThrowExceptionStatement ( CodeThrowExceptionStatement e ) : void
GenerateTryCatchFinallyStatement ( CodeTryCatchFinallyStatement e ) : void
GenerateTypeConstructor ( CodeTypeConstructor e ) : void
GenerateTypeEnd ( CodeTypeDeclaration e ) : void
GenerateTypeOfExpression ( CodeTypeOfExpression e ) : void
GenerateTypeReferenceExpression ( CodeTypeReferenceExpression e ) : void
GenerateTypeStart ( CodeTypeDeclaration e ) : void
GenerateTypes ( CodeNamespace e ) : void
GenerateVariableDeclarationStatement ( CodeVariableDeclarationStatement e ) : void
GenerateVariableReferenceExpression ( CodeVariableReferenceExpression e ) : void
GetTypeOutput ( CodeTypeReference value ) : string
IsValidIdentifier ( string value ) : bool
OutputAttributeArgument ( CodeAttributeArgument arg ) : void
OutputAttributeDeclarations ( CodeAttributeDeclarationCollection attributes ) : void
OutputDirection ( FieldDirection dir ) : void
OutputExpressionList ( CodeExpressionCollection expressions ) : void
OutputExpressionList ( CodeExpressionCollection expressions, bool newlineBetweenItems ) : void
OutputFieldScopeModifier ( MemberAttributes attributes ) : void
OutputIdentifier ( string ident ) : void
OutputMemberAccessModifier ( MemberAttributes attributes ) : void
OutputMemberScopeModifier ( MemberAttributes attributes ) : void
OutputOperator ( CodeBinaryOperatorType op ) : void
OutputParameters ( CodeParameterDeclarationExpressionCollection parameters ) : void
OutputType ( CodeTypeReference typeRef ) : void
OutputTypeAttributes ( TypeAttributes attributes, bool isStruct, bool isEnum ) : void
OutputTypeNamePair ( CodeTypeReference typeRef, string name ) : void
QuoteSnippetString ( string value ) : string
Supports ( GeneratorSupport support ) : bool
ValidateIdentifier ( string value ) : void

Private Methods

Method Description
GenerateConstructors ( CodeTypeDeclaration e ) : void
GenerateEvents ( CodeTypeDeclaration e ) : void
GenerateFields ( CodeTypeDeclaration e ) : void
GenerateMethods ( CodeTypeDeclaration e ) : void
GenerateNestedTypes ( CodeTypeDeclaration e ) : void
GenerateProperties ( CodeTypeDeclaration e ) : void
GenerateSnippetMembers ( CodeTypeDeclaration e ) : void
GenerateType ( CodeTypeDeclaration e ) : void
GenerateTypeConstructors ( CodeTypeDeclaration e ) : void
GenerateTypeMember ( CodeTypeMember member, CodeTypeDeclaration declaredType ) : void
ICodeGenerator ( GeneratorSupport support ) : bool
ICodeGenerator ( string value ) : bool
ICodeGenerator ( CodeTypeReference type ) : string
ICodeGenerator ( string value ) : string
ICodeGenerator ( CodeCompileUnit e, TextWriter w, CodeGeneratorOptions o ) : void
ICodeGenerator ( CodeExpression e, TextWriter w, CodeGeneratorOptions o ) : void
ICodeGenerator ( CodeNamespace e, TextWriter w, CodeGeneratorOptions o ) : void
ICodeGenerator ( CodeStatement e, TextWriter w, CodeGeneratorOptions o ) : void
ICodeGenerator ( CodeTypeDeclaration e, TextWriter w, CodeGeneratorOptions o ) : void
ICodeGenerator ( string value ) : void
IsValidLanguageIndependentTypeName ( string value ) : bool

Method Details

ContinueOnNewLine() protected method

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

CreateEscapedIdentifier() protected abstract method

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

CreateValidIdentifier() protected abstract method

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

GenerateArgumentReferenceExpression() protected abstract method

protected abstract GenerateArgumentReferenceExpression ( CodeArgumentReferenceExpression e ) : void
e CodeArgumentReferenceExpression
return void

GenerateArrayCreateExpression() protected abstract method

protected abstract GenerateArrayCreateExpression ( CodeArrayCreateExpression e ) : void
e CodeArrayCreateExpression
return void

GenerateArrayIndexerExpression() protected abstract method

protected abstract GenerateArrayIndexerExpression ( CodeArrayIndexerExpression e ) : void
e CodeArrayIndexerExpression
return void

GenerateAssignStatement() protected abstract method

protected abstract GenerateAssignStatement ( CodeAssignStatement e ) : void
e CodeAssignStatement
return void

GenerateAttachEventStatement() protected abstract method

protected abstract GenerateAttachEventStatement ( CodeAttachEventStatement e ) : void
e CodeAttachEventStatement
return void

GenerateAttributeDeclarationsEnd() protected abstract method

protected abstract GenerateAttributeDeclarationsEnd ( CodeAttributeDeclarationCollection attributes ) : void
attributes CodeAttributeDeclarationCollection
return void

GenerateAttributeDeclarationsStart() protected abstract method

protected abstract GenerateAttributeDeclarationsStart ( CodeAttributeDeclarationCollection attributes ) : void
attributes CodeAttributeDeclarationCollection
return void

GenerateBaseReferenceExpression() protected abstract method

protected abstract GenerateBaseReferenceExpression ( CodeBaseReferenceExpression e ) : void
e CodeBaseReferenceExpression
return void

GenerateBinaryOperatorExpression() protected method

protected GenerateBinaryOperatorExpression ( CodeBinaryOperatorExpression e ) : void
e CodeBinaryOperatorExpression
return void

GenerateCastExpression() protected abstract method

protected abstract GenerateCastExpression ( CodeCastExpression e ) : void
e CodeCastExpression
return void

GenerateCodeFromMember() public method

public GenerateCodeFromMember ( CodeTypeMember member, TextWriter writer, CodeGeneratorOptions options ) : void
member CodeTypeMember
writer TextWriter
options CodeGeneratorOptions
return void

GenerateComment() protected abstract method

protected abstract GenerateComment ( CodeComment e ) : void
e CodeComment
return void

GenerateCommentStatement() protected method

protected GenerateCommentStatement ( CodeCommentStatement e ) : void
e CodeCommentStatement
return void

GenerateCommentStatements() protected method

protected GenerateCommentStatements ( CodeCommentStatementCollection e ) : void
e CodeCommentStatementCollection
return void

GenerateCompileUnit() protected method

protected GenerateCompileUnit ( CodeCompileUnit e ) : void
e CodeCompileUnit
return void

GenerateCompileUnitEnd() protected method

protected GenerateCompileUnitEnd ( CodeCompileUnit e ) : void
e CodeCompileUnit
return void

GenerateCompileUnitStart() protected method

protected GenerateCompileUnitStart ( CodeCompileUnit e ) : void
e CodeCompileUnit
return void

GenerateConditionStatement() protected abstract method

protected abstract GenerateConditionStatement ( CodeConditionStatement e ) : void
e CodeConditionStatement
return void

GenerateConstructor() protected abstract method

protected abstract GenerateConstructor ( CodeConstructor e, CodeTypeDeclaration c ) : void
e CodeConstructor
c CodeTypeDeclaration
return void

GenerateDecimalValue() protected method

protected GenerateDecimalValue ( decimal d ) : void
d decimal
return void

GenerateDefaultValueExpression() protected method

protected GenerateDefaultValueExpression ( CodeDefaultValueExpression e ) : void
e CodeDefaultValueExpression
return void

GenerateDelegateCreateExpression() protected abstract method

protected abstract GenerateDelegateCreateExpression ( CodeDelegateCreateExpression e ) : void
e CodeDelegateCreateExpression
return void

GenerateDelegateInvokeExpression() protected abstract method

protected abstract GenerateDelegateInvokeExpression ( CodeDelegateInvokeExpression e ) : void
e CodeDelegateInvokeExpression
return void

GenerateDirectionExpression() protected method

protected GenerateDirectionExpression ( CodeDirectionExpression e ) : void
e CodeDirectionExpression
return void

GenerateDirectives() protected method

protected GenerateDirectives ( CodeDirectiveCollection directives ) : void
directives CodeDirectiveCollection
return void

GenerateDoubleValue() protected method

protected GenerateDoubleValue ( double d ) : void
d double
return void

GenerateEntryPointMethod() protected abstract method

protected abstract GenerateEntryPointMethod ( CodeEntryPointMethod e, CodeTypeDeclaration c ) : void
e CodeEntryPointMethod
c CodeTypeDeclaration
return void

GenerateEvent() protected abstract method

protected abstract GenerateEvent ( CodeMemberEvent e, CodeTypeDeclaration c ) : void
e CodeMemberEvent
c CodeTypeDeclaration
return void

GenerateEventReferenceExpression() protected abstract method

protected abstract GenerateEventReferenceExpression ( CodeEventReferenceExpression e ) : void
e CodeEventReferenceExpression
return void

GenerateExpression() protected method

protected GenerateExpression ( CodeExpression e ) : void
e CodeExpression
return void

GenerateExpressionStatement() protected abstract method

protected abstract GenerateExpressionStatement ( CodeExpressionStatement e ) : void
e CodeExpressionStatement
return void

GenerateField() protected abstract method

protected abstract GenerateField ( CodeMemberField e ) : void
e CodeMemberField
return void

GenerateFieldReferenceExpression() protected abstract method

protected abstract GenerateFieldReferenceExpression ( CodeFieldReferenceExpression e ) : void
e CodeFieldReferenceExpression
return void

GenerateGotoStatement() protected abstract method

protected abstract GenerateGotoStatement ( CodeGotoStatement e ) : void
e CodeGotoStatement
return void

GenerateIndexerExpression() protected abstract method

protected abstract GenerateIndexerExpression ( CodeIndexerExpression e ) : void
e CodeIndexerExpression
return void

GenerateIterationStatement() protected abstract method

protected abstract GenerateIterationStatement ( CodeIterationStatement e ) : void
e CodeIterationStatement
return void

GenerateLabeledStatement() protected abstract method

protected abstract GenerateLabeledStatement ( CodeLabeledStatement e ) : void
e CodeLabeledStatement
return void

GenerateLinePragmaEnd() protected abstract method

protected abstract GenerateLinePragmaEnd ( CodeLinePragma e ) : void
e CodeLinePragma
return void

GenerateLinePragmaStart() protected abstract method

protected abstract GenerateLinePragmaStart ( CodeLinePragma e ) : void
e CodeLinePragma
return void

GenerateMethod() protected abstract method

protected abstract GenerateMethod ( CodeMemberMethod e, CodeTypeDeclaration c ) : void
e CodeMemberMethod
c CodeTypeDeclaration
return void

GenerateMethodInvokeExpression() protected abstract method

protected abstract GenerateMethodInvokeExpression ( CodeMethodInvokeExpression e ) : void
e CodeMethodInvokeExpression
return void

GenerateMethodReferenceExpression() protected abstract method

protected abstract GenerateMethodReferenceExpression ( CodeMethodReferenceExpression e ) : void
e CodeMethodReferenceExpression
return void

GenerateMethodReturnStatement() protected abstract method

protected abstract GenerateMethodReturnStatement ( CodeMethodReturnStatement e ) : void
e CodeMethodReturnStatement
return void

GenerateNamespace() protected method

protected GenerateNamespace ( CodeNamespace e ) : void
e CodeNamespace
return void

GenerateNamespaceEnd() protected abstract method

protected abstract GenerateNamespaceEnd ( CodeNamespace e ) : void
e CodeNamespace
return void

GenerateNamespaceImport() protected abstract method

protected abstract GenerateNamespaceImport ( CodeNamespaceImport e ) : void
e CodeNamespaceImport
return void

GenerateNamespaceImports() protected method

protected GenerateNamespaceImports ( CodeNamespace e ) : void
e CodeNamespace
return void

GenerateNamespaceStart() protected abstract method

protected abstract GenerateNamespaceStart ( CodeNamespace e ) : void
e CodeNamespace
return void

GenerateNamespaces() protected method

protected GenerateNamespaces ( CodeCompileUnit e ) : void
e CodeCompileUnit
return void

GenerateObjectCreateExpression() protected abstract method

protected abstract GenerateObjectCreateExpression ( CodeObjectCreateExpression e ) : void
e CodeObjectCreateExpression
return void

GenerateParameterDeclarationExpression() protected method

protected GenerateParameterDeclarationExpression ( CodeParameterDeclarationExpression e ) : void
e CodeParameterDeclarationExpression
return void

GeneratePrimitiveExpression() protected method

protected GeneratePrimitiveExpression ( CodePrimitiveExpression e ) : void
e CodePrimitiveExpression
return void

GenerateProperty() protected abstract method

protected abstract GenerateProperty ( CodeMemberProperty e, CodeTypeDeclaration c ) : void
e CodeMemberProperty
c CodeTypeDeclaration
return void

GeneratePropertyReferenceExpression() protected abstract method

protected abstract GeneratePropertyReferenceExpression ( CodePropertyReferenceExpression e ) : void
e CodePropertyReferenceExpression
return void

GeneratePropertySetValueReferenceExpression() protected abstract method

protected abstract GeneratePropertySetValueReferenceExpression ( CodePropertySetValueReferenceExpression e ) : void
e CodePropertySetValueReferenceExpression
return void

GenerateRemoveEventStatement() protected abstract method

protected abstract GenerateRemoveEventStatement ( CodeRemoveEventStatement e ) : void
e CodeRemoveEventStatement
return void

GenerateSingleFloatValue() protected method

protected GenerateSingleFloatValue ( float s ) : void
s float
return void

GenerateSnippetCompileUnit() protected method

protected GenerateSnippetCompileUnit ( CodeSnippetCompileUnit e ) : void
e CodeSnippetCompileUnit
return void

GenerateSnippetExpression() protected abstract method

protected abstract GenerateSnippetExpression ( CodeSnippetExpression e ) : void
e CodeSnippetExpression
return void

GenerateSnippetMember() protected abstract method

protected abstract GenerateSnippetMember ( CodeSnippetTypeMember e ) : void
e CodeSnippetTypeMember
return void

GenerateSnippetStatement() protected method

protected GenerateSnippetStatement ( CodeSnippetStatement e ) : void
e CodeSnippetStatement
return void

GenerateStatement() protected method

protected GenerateStatement ( CodeStatement e ) : void
e CodeStatement
return void

GenerateStatements() protected method

protected GenerateStatements ( CodeStatementCollection stmts ) : void
stmts CodeStatementCollection
return void

GenerateThisReferenceExpression() protected abstract method

protected abstract GenerateThisReferenceExpression ( CodeThisReferenceExpression e ) : void
e CodeThisReferenceExpression
return void

GenerateThrowExceptionStatement() protected abstract method

protected abstract GenerateThrowExceptionStatement ( CodeThrowExceptionStatement e ) : void
e CodeThrowExceptionStatement
return void

GenerateTryCatchFinallyStatement() protected abstract method

protected abstract GenerateTryCatchFinallyStatement ( CodeTryCatchFinallyStatement e ) : void
e CodeTryCatchFinallyStatement
return void

GenerateTypeConstructor() protected abstract method

protected abstract GenerateTypeConstructor ( CodeTypeConstructor e ) : void
e CodeTypeConstructor
return void

GenerateTypeEnd() protected abstract method

protected abstract GenerateTypeEnd ( CodeTypeDeclaration e ) : void
e CodeTypeDeclaration
return void

GenerateTypeOfExpression() protected method

protected GenerateTypeOfExpression ( CodeTypeOfExpression e ) : void
e CodeTypeOfExpression
return void

GenerateTypeReferenceExpression() protected method

protected GenerateTypeReferenceExpression ( CodeTypeReferenceExpression e ) : void
e CodeTypeReferenceExpression
return void

GenerateTypeStart() protected abstract method

protected abstract GenerateTypeStart ( CodeTypeDeclaration e ) : void
e CodeTypeDeclaration
return void

GenerateTypes() protected method

protected GenerateTypes ( CodeNamespace e ) : void
e CodeNamespace
return void

GenerateVariableDeclarationStatement() protected abstract method

protected abstract GenerateVariableDeclarationStatement ( CodeVariableDeclarationStatement e ) : void
e CodeVariableDeclarationStatement
return void

GenerateVariableReferenceExpression() protected abstract method

protected abstract GenerateVariableReferenceExpression ( CodeVariableReferenceExpression e ) : void
e CodeVariableReferenceExpression
return void

GetTypeOutput() protected abstract method

protected abstract GetTypeOutput ( CodeTypeReference value ) : string
value CodeTypeReference
return string

IsValidIdentifier() protected abstract method

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

IsValidLanguageIndependentIdentifier() public static method

public static IsValidLanguageIndependentIdentifier ( string value ) : bool
value string
return bool

OutputAttributeArgument() protected method

protected OutputAttributeArgument ( CodeAttributeArgument arg ) : void
arg CodeAttributeArgument
return void

OutputAttributeDeclarations() protected method

protected OutputAttributeDeclarations ( CodeAttributeDeclarationCollection attributes ) : void
attributes CodeAttributeDeclarationCollection
return void

OutputDirection() protected method

protected OutputDirection ( FieldDirection dir ) : void
dir FieldDirection
return void

OutputExpressionList() protected method

protected OutputExpressionList ( CodeExpressionCollection expressions ) : void
expressions CodeExpressionCollection
return void

OutputExpressionList() protected method

protected OutputExpressionList ( CodeExpressionCollection expressions, bool newlineBetweenItems ) : void
expressions CodeExpressionCollection
newlineBetweenItems bool
return void

OutputFieldScopeModifier() protected method

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

OutputIdentifier() protected method

protected OutputIdentifier ( string ident ) : void
ident string
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

OutputParameters() protected method

protected OutputParameters ( CodeParameterDeclarationExpressionCollection parameters ) : void
parameters CodeParameterDeclarationExpressionCollection
return void

OutputType() protected abstract method

protected abstract OutputType ( CodeTypeReference typeRef ) : void
typeRef CodeTypeReference
return void

OutputTypeAttributes() protected method

protected OutputTypeAttributes ( TypeAttributes attributes, bool isStruct, bool isEnum ) : void
attributes TypeAttributes
isStruct bool
isEnum bool
return void

OutputTypeNamePair() protected method

protected OutputTypeNamePair ( CodeTypeReference typeRef, string name ) : void
typeRef CodeTypeReference
name string
return void

QuoteSnippetString() protected abstract method

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

Supports() protected abstract method

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

ValidateIdentifier() protected method

protected ValidateIdentifier ( string value ) : void
value string
return void

ValidateIdentifiers() public static method

public static ValidateIdentifiers ( CodeObject e ) : void
e CodeObject
return void