Detailed Description

Represents a usage of an operator (e.g. '+').

Inheritance diagram for Nitro.OperatorFragment:
Nitro.CodeFragment

Public Member Functions

 OperatorFragment (string operatorText)
 Creates a new operator from the given raw text, e.g. "+". More...
 
 OperatorFragment (CodeLexer sr)
 Creates a new operator by reading one from given the lexer. More...
 
bool Set (string value)
 Sets the current operator of this fragment from the operator as a string (e.g. "+"). 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 int GetLineNumber ()
 Gets the line number if there is one. More...
 
virtual bool IsMemberAccessor ()
 A value which states if this fragment accesses members (methods/fields) of something. More...
 
virtual CompiledFragment Compile (CompiledMethod method)
 Attempts to compile this fragment into the given method. 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...
 
virtual bool Typeable ()
 Defines if a fragment can be given a :TYPE. E.g. Brackets (for casting, (A):TYPE) and variables can. More...
 
int ChildCount ()
 How many children does this fragment have? More...
 
virtual 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 ()
 Converts this fragment into a code string. More...
 

Static Public Member Functions

static bool WillHandle (char character)
 Checks if an operator can be read from the stream by checking if the given character is the start of an operator. More...
 
- Static Public Member Functions inherited from Nitro.CodeFragment
static int IsOfType (char[] arrayToSearch, char charToFind)
 Returns the index in the given array of the given character if it's found in it. More...
 

Public Attributes

Operator Value
 The operator being used. More...
 
- Public Attributes inherited from Nitro.CodeFragment
TypeFragment GivenType
 A type (:TYPE) which was explicitly given to this block. More...
 
CodeFragment NextChild
 The child after this one. More...
 
CodeFragment LastChild
 The last child of this fragment, stored as a linked list. More...
 
CodeFragment FirstChild
 The first child of this fragment, stored as a linked list. More...
 
CodeFragment PreviousChild
 The child before this one. More...
 
CodeFragment ParentFragment
 The parent fragment of this, if any. More...
 

Properties

bool IsSetOperator [get]
 Is this the set operator? More...
 
- Properties inherited from Nitro.CodeFragment
bool IsParent [get]
 Is this fragment a parent or not? More...
 

Constructor & Destructor Documentation

Nitro.OperatorFragment.OperatorFragment ( string  operatorText)
inline

Creates a new operator from the given raw text, e.g. "+".

Parameters
operatorTextThe raw text operator.
Nitro.OperatorFragment.OperatorFragment ( CodeLexer  sr)
inline

Creates a new operator by reading one from given the lexer.

Parameters
srThe lexer to read the operator from.

Member Function Documentation

bool Nitro.OperatorFragment.Set ( string  value)
inline

Sets the current operator of this fragment from the operator as a string (e.g. "+").

Parameters
valueThe operator as a string.
Returns
True if the string is an operator and it was set successfully; False otherwise.
override string Nitro.OperatorFragment.ToString ( )
inline
static bool Nitro.OperatorFragment.WillHandle ( char  character)
inlinestatic

Checks if an operator can be read from the stream by checking if the given character is the start of an operator.

Parameters
characterThe character to check.
Returns
True if the character is the start of an operator.

Member Data Documentation

Operator Nitro.OperatorFragment.Value

The operator being used.

Property Documentation

bool Nitro.OperatorFragment.IsSetOperator
get

Is this the set operator?