Overview   Project   Class   Tree   Deprecated   Index 
SourceFlow 1.0.beta API Documentation
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD

Org.SourceFlow.C
Class CVariable

IComparable
   |
   +--CodeElement
         |
         +--CVariable

   in CVariable.cs

public class CVariable
extends CodeElement

A class generating a C variable declaration.


Field Summary
 override int Category
          Returns a numeric category number for the code element.
 const int CONST
          The const modifier constant.
 const int EXTERN
          The extern modifier constant.
 const int STATIC
          The static modifier constant.
   
Fields inherited from class CodeElement
Category
 
Constructor Summary
CVariable( string type, string name )
          Creates a new variable with the specified type and name.
CVariable( string type, bool array, string name )
          Creates a new variable with the specified type and name.
CVariable( int modifiers, string type, bool array, string name )
          Creates a new variable with the specified type and name.
 
Method Summary
 void AddComment( CComment comment )
          Adds a comment to this variable.
 void AddInitValue( string value )
          Adds an initialization value.
 override void Print( StreamWriter output, CodeStyle style, int indent )
          Prints the code element to the specified output stream.
 override string ToString()
          Returns the variable name.
   
Methods inherited from class CodeElement
CompareTo, Print, PrintSeparator
 

Field Detail

Category

public override int Category;
Returns a numeric category number for the code element. A lower category number implies that the code element should be placed before code elements with a higher category number within a declaration.
Returns:
the category number

CONST

public const int CONST;
The const modifier constant.

EXTERN

public const int EXTERN;
The extern modifier constant.

STATIC

public const int STATIC;
The static modifier constant.


Constructor Detail

CVariable

public CVariable( string type, string name );
Creates a new variable with the specified type and name.
Parameters:
type - the variable type
name - the variable name

CVariable

public CVariable( string type, bool array, string name );
Creates a new variable with the specified type and name.
Parameters:
type - the variable type
array - the array type flag
name - the variable name

CVariable

public CVariable( int modifiers, string type, bool array, string name );
Creates a new variable with the specified type and name.
Parameters:
modifiers - the modifier flags to use (or zero)
type - the variable type
array - the array type flag
name - the variable name


Method Detail

AddComment

public void AddComment( CComment comment );
Adds a comment to this variable.
Parameters:
comment - the comment to add

AddInitValue

public void AddInitValue( string value );
Adds an initialization value. For array types several initialization values can be added.
Parameters:
value - the value

Print

public override void Print( StreamWriter output, CodeStyle style, int indent );
Prints the code element to the specified output stream.
Parameters:
output - the output stream
style - the code style to use
indent - the indentation level

ToString

public override string ToString();
Returns the variable name.
Returns:
the variable name

 Overview   Project   Class   Tree   Deprecated   Index 
SourceFlow 1.0.beta API Documentation
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD