C# Class AsynqFramework.CodeWriter.CodeWriterBase

Mostrar archivo Open project: JamesDunne/Asynq

Protected Properties

Property Type Description
indentLevel int
output List

Public Methods

Method Description
Clone ( ) : CodeWriterBase
CodeWriterBase ( ) : System
Format ( TextWriter tw, string indentString, int indentationLevel, string newLine ) : void

Formats the code as plain-text to a TextWriter with the specified indentation and new-line settings.

Indent ( ) : void

Increase the indentation level for the next line.

Output ( OutputToken tok ) : OutputToken
Output ( string text ) : OutputToken
Output ( string text, TokenType type ) : OutputToken
Output ( string text, TokenType type, object state ) : OutputToken
OutputWithDepth ( string text, TokenType type, int depth ) : OutputToken
Reset ( ) : void
ToString ( ) : string
ToString ( string indentString, int indentationLevel, string newLine ) : string
Unindent ( ) : void

Decrease the indentation level for the next line.

WriteComment ( string cm ) : void

Writes a C# comment to the output.

WriteIdentifier ( string id ) : void

Writes a C# identifier to the output.

WriteKeyword ( string kw ) : void

Writes a C# keyword to the output.

WriteNewline ( ) : void

Writes a new line to the output followed by the indentation string.

WriteOperator ( string op ) : void

Writes operator characters to the output, such as parentheses and other non-alphanumeric/non-whitespace characters.

WritePrimitive ( byte value ) : void
WritePrimitive ( char value ) : void
WritePrimitive ( decimal value ) : void
WritePrimitive ( double value ) : void
WritePrimitive ( float value ) : void
WritePrimitive ( int value ) : void
WritePrimitive ( long value ) : void
WritePrimitive ( sbyte value ) : void
WritePrimitive ( short value ) : void
WritePrimitive ( string value ) : void
WritePrimitive ( uint value ) : void
WritePrimitive ( ulong value ) : void
WritePrimitive ( ushort value ) : void
WriteType ( Type ty ) : void

Writes the name of a type to the output. It will be formatted as a C# primitive type name if applicable.

WriteValue ( Type vType, object value ) : void

Writes a C# constant value to the output.

WriteWhitespace ( string ws ) : void

Writes whitespace characters to the output.

Protected Methods

Method Description
CodeWriterBase ( int indentLevel, List tokens ) : System
InitializeWriter ( ) : void

Private Methods

Method Description
escapeCSharp ( string value ) : string

Method Details

Clone() public method

public Clone ( ) : CodeWriterBase
return CodeWriterBase

CodeWriterBase() public method

public CodeWriterBase ( ) : System
return System

CodeWriterBase() protected method

protected CodeWriterBase ( int indentLevel, List tokens ) : System
indentLevel int
tokens List
return System

Format() public method

Formats the code as plain-text to a TextWriter with the specified indentation and new-line settings.
public Format ( TextWriter tw, string indentString, int indentationLevel, string newLine ) : void
tw System.IO.TextWriter TextWriter to write the output to
indentString string The indentation string to use per each level of indentation, defaults to 4 spaces.
indentationLevel int The level of indentation to start at, defaults to 0.
newLine string The environment-specific new-line delimiter string to use, defaults to Environment.NewLine.
return void

Indent() public method

Increase the indentation level for the next line.
public Indent ( ) : void
return void

InitializeWriter() protected method

protected InitializeWriter ( ) : void
return void

Output() public method

public Output ( OutputToken tok ) : OutputToken
tok OutputToken
return OutputToken

Output() public method

public Output ( string text ) : OutputToken
text string
return OutputToken

Output() public method

public Output ( string text, TokenType type ) : OutputToken
text string
type TokenType
return OutputToken

Output() public method

public Output ( string text, TokenType type, object state ) : OutputToken
text string
type TokenType
state object
return OutputToken

OutputWithDepth() public method

public OutputWithDepth ( string text, TokenType type, int depth ) : OutputToken
text string
type TokenType
depth int
return OutputToken

Reset() public method

public Reset ( ) : void
return void

ToString() public method

public ToString ( ) : string
return string

ToString() public method

public ToString ( string indentString, int indentationLevel, string newLine ) : string
indentString string
indentationLevel int
newLine string
return string

Unindent() public method

Decrease the indentation level for the next line.
public Unindent ( ) : void
return void

WriteComment() public method

Writes a C# comment to the output.
public WriteComment ( string cm ) : void
cm string Comment text, must be a // single line comment or be a /* block comment */ form.
return void

WriteIdentifier() public method

Writes a C# identifier to the output.
public WriteIdentifier ( string id ) : void
id string
return void

WriteKeyword() public method

Writes a C# keyword to the output.
public WriteKeyword ( string kw ) : void
kw string
return void

WriteNewline() public method

Writes a new line to the output followed by the indentation string.
public WriteNewline ( ) : void
return void

WriteOperator() public method

Writes operator characters to the output, such as parentheses and other non-alphanumeric/non-whitespace characters.
public WriteOperator ( string op ) : void
op string
return void

WritePrimitive() public method

public WritePrimitive ( byte value ) : void
value byte
return void

WritePrimitive() public method

public WritePrimitive ( char value ) : void
value char
return void

WritePrimitive() public method

public WritePrimitive ( decimal value ) : void
value decimal
return void

WritePrimitive() public method

public WritePrimitive ( double value ) : void
value double
return void

WritePrimitive() public method

public WritePrimitive ( float value ) : void
value float
return void

WritePrimitive() public method

public WritePrimitive ( int value ) : void
value int
return void

WritePrimitive() public method

public WritePrimitive ( long value ) : void
value long
return void

WritePrimitive() public method

public WritePrimitive ( sbyte value ) : void
value sbyte
return void

WritePrimitive() public method

public WritePrimitive ( short value ) : void
value short
return void

WritePrimitive() public method

public WritePrimitive ( string value ) : void
value string
return void

WritePrimitive() public method

public WritePrimitive ( uint value ) : void
value uint
return void

WritePrimitive() public method

public WritePrimitive ( ulong value ) : void
value ulong
return void

WritePrimitive() public method

public WritePrimitive ( ushort value ) : void
value ushort
return void

WriteType() public method

Writes the name of a type to the output. It will be formatted as a C# primitive type name if applicable.
public WriteType ( Type ty ) : void
ty System.Type
return void

WriteValue() public method

Writes a C# constant value to the output.
public WriteValue ( Type vType, object value ) : void
vType System.Type
value object
return void

WriteWhitespace() public method

Writes whitespace characters to the output.
public WriteWhitespace ( string ws ) : void
ws string
return void

Property Details

indentLevel protected_oe property

protected int indentLevel
return int

output protected_oe property

protected List output
return List