Nitro.BaseFragment Class Reference

Detailed Description

Represents the root node/fragment of all code.

Inheritance diagram for Nitro.BaseFragment:
Nitro.BracketFragment Nitro.CodeFragment

Public Member Functions

 BaseFragment (CodeLexer sr)
 
- Public Member Functions inherited from Nitro.BracketFragment
 BracketFragment ()
 
 BracketFragment (CodeLexer sr)
 Creates a new BracketFragment. More...
 
 BracketFragment (CodeLexer sr, bool readBracket)
 Creates a new BracketFragment. More...
 
override bool Typeable ()
 Defines if a fragment can be given a :TYPE. E.g. Brackets (for casting, (A):TYPE) and variables can. More...
 
override CompiledFragment Compile (CompiledMethod method)
 Attempts to compile this fragment into the given method. More...
 
bool CompileBody (CompiledMethod method)
 Attempts to compile this bracket to IL, assuming it is the body of a method. More...
 
override AddResult AddTo (CodeFragment to, CodeLexer sr)
 Adds this fragment as a child to the given fragment. It may be overriden by some types of fragment as they may wish to handle it differently. More...
 
override string ToString ()
 
- Public Member Functions inherited from Nitro.CodeFragment
void Error (string message)
 Throws an error, outputting the line number it occured on. More...
 
virtual bool IsMemberAccessor ()
 A value which states if this fragment accesses members (methods/fields) of something. More...
 
virtual int GetLineNumber ()
 Returns the line number this fragment came from. More...
 
void AddToStart (CodeFragment parent)
 Adds this code fragment to the beginning of the given parents child set. More...
 
void AddBefore (CodeFragment frag)
 Adds this code fragment as a child before the given one. More...
 
void AddAfter (CodeFragment frag)
 Adds this code fragment as a child after the given one. More...
 
void Remove ()
 Removes this fragment from its parent. More...
 
void AddChild (CodeFragment child)
 Adds the given fragment as a child of this one. More...
 
int ChildCount ()
 How many children does this fragment have? More...
 
override string ToString ()
 Converts this fragment into a code string. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Nitro.BracketFragment
static bool WillHandle (char character)
 Checks if the given character can be handled by a bracket fragment. More...
 
static int IsBracket (char character)
 Checks if the given character is an opening bracket. More...
 
static int IsEndBracket (char character)
 Checks if the given character is an closing bracket. More...
 
static bool AnyBracket (char character)
 Checks if the given character is either an opening or closing bracket. More...
 
- Public Attributes inherited from Nitro.BracketFragment
char Bracket =StringReader.NULL
 The opening bracket character. E.g. (,{,[. More...
 
char CloseBracket =StringReader.NULL
 The closing bracket character. E.g. ),},]. More...
 
- Static Public Attributes inherited from Nitro.BracketFragment
static char[] Brackets =new char[]{'(','[','{'}
 The set of opening brackets. More...
 
static char[] EndBrackets =new char[]{')',']','}'}
 The set of closing brackets. More...
 
- Properties inherited from Nitro.CodeFragment
bool IsParent [get]
 Is this fragment a parent or not? More...
 

Constructor & Destructor Documentation

Nitro.BaseFragment.BaseFragment ( CodeLexer  sr)
inline