Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
Irony.Interpreter.LanguageRuntime Class Reference

Public Member Functions

 LanguageRuntime (LanguageData language)
 
bool IsAssigned (object value)
 
virtual bool IsTrue (object value)
 
OperatorImplementationTable CreateOperatorImplementationsTable ()
 
virtual OperatorImplementation AddOperatorImplementation (OperatorImplementationTable implementations, OperatorDispatchKey forKey)
 
virtual Type GetUpType (Type type)
 Returns the "up-type" to use in operation instead of the type that caused overflow. More...
 
virtual bool HandleException (Exception ex, DynamicCallDispatcher dispatcher, OperatorImplementation failedTarget, EvaluationContext context)
 
virtual void Init ()
 
virtual void InitBaseTypeList ()
 
virtual void InitTypeConverters ()
 
virtual void InitOperatorImplementations ()
 

Static Public Member Functions

static void Check (bool condition, string message, params object[] args)
 
static object ConvertAnyToString (object value)
 
static object ConvertBigIntToComplex (object value)
 
static object ConvertAnyToComplex (object value)
 
static object ConvertAnyIntToBigInteger (object value)
 

Public Attributes

readonly LanguageData Language
 
readonly TypeList BaseTypeSequence = new TypeList()
 
readonly TypeConverterTable TypeConverters = new TypeConverterTable()
 
TypeConverter BoolResultConverter = null
 
Unassigned Unassigned = new Unassigned()
 

Protected Member Functions

virtual Type GetBaseTypeForExpression (string op, Type type1, Type type2)
 Returns the type to which arguments should be converted to perform the operation for a given operator and arguments type. More...
 
virtual TypeConverter GetConverter (Type fromType, Type toType)
 
void OnConsoleWrite (EvaluationContext context, string text)
 
void AddImplementation (string op, Type baseType, BinaryOperatorMethod baseMethod)
 
void AddImplementation (string op, Type baseType, BinaryOperatorMethod baseMethod, TypeConverter resultConverter)
 

Properties

virtual object NullObject [get]
 

Events

EventHandler
< ConsoleWriteEventArgs
ConsoleWrite
 

Detailed Description

Definition at line 51 of file LanguageRuntime.cs.

Constructor & Destructor Documentation

Irony.Interpreter.LanguageRuntime.LanguageRuntime ( LanguageData  language)

Definition at line 53 of file LanguageRuntime.cs.

References Irony.Parsing.Init.

Member Function Documentation

void Irony.Interpreter.LanguageRuntime.AddImplementation ( string  op,
Type  baseType,
BinaryOperatorMethod  baseMethod 
)
protected

Definition at line 337 of file LanguageRuntime_Init.cs.

void Irony.Interpreter.LanguageRuntime.AddImplementation ( string  op,
Type  baseType,
BinaryOperatorMethod  baseMethod,
TypeConverter  resultConverter 
)
protected

Definition at line 340 of file LanguageRuntime_Init.cs.

static void Irony.Interpreter.LanguageRuntime.Check ( bool  condition,
string  message,
params object[]  args 
)
static

Definition at line 244 of file LanguageRuntime.cs.

static object Irony.Interpreter.LanguageRuntime.ConvertAnyIntToBigInteger ( object  value)
static

Definition at line 149 of file LanguageRuntime_Init.cs.

static object Irony.Interpreter.LanguageRuntime.ConvertAnyToComplex ( object  value)
static

Definition at line 145 of file LanguageRuntime_Init.cs.

static object Irony.Interpreter.LanguageRuntime.ConvertAnyToString ( object  value)
static

Definition at line 136 of file LanguageRuntime_Init.cs.

static object Irony.Interpreter.LanguageRuntime.ConvertBigIntToComplex ( object  value)
static

Definition at line 140 of file LanguageRuntime_Init.cs.

OperatorImplementationTable Irony.Interpreter.LanguageRuntime.CreateOperatorImplementationsTable ( )

Definition at line 91 of file LanguageRuntime.cs.

virtual Type Irony.Interpreter.LanguageRuntime.GetBaseTypeForExpression ( string  op,
Type  type1,
Type  type2 
)
protectedvirtual

Returns the type to which arguments should be converted to perform the operation for a given operator and arguments type.

Parameters
opOperator
type1The type of the first argument.
type2The type of the second argument
Returns

Definition at line 138 of file LanguageRuntime.cs.

virtual TypeConverter Irony.Interpreter.LanguageRuntime.GetConverter ( Type  fromType,
Type  toType 
)
protectedvirtual

Definition at line 224 of file LanguageRuntime.cs.

References Irony.Resources.ErrCannotConvertValue.

virtual Type Irony.Interpreter.LanguageRuntime.GetUpType ( Type  type)
virtual

Returns the "up-type" to use in operation instead of the type that caused overflow.

Parameters
typeThe base type for operation that caused overflow.
Returns
The type to use for operation.

Can be overwritten in language implementation to implement different type-conversion policy.

Definition at line 201 of file LanguageRuntime.cs.

virtual bool Irony.Interpreter.LanguageRuntime.HandleException ( Exception  ex,
DynamicCallDispatcher  dispatcher,
OperatorImplementation  failedTarget,
EvaluationContext  context 
)
virtual

Definition at line 218 of file LanguageRuntime.cs.

virtual void Irony.Interpreter.LanguageRuntime.Init ( )
virtual

Definition at line 26 of file LanguageRuntime_Init.cs.

virtual void Irony.Interpreter.LanguageRuntime.InitBaseTypeList ( )
virtual

Definition at line 32 of file LanguageRuntime_Init.cs.

virtual void Irony.Interpreter.LanguageRuntime.InitOperatorImplementations ( )
virtual

Definition at line 154 of file LanguageRuntime_Init.cs.

References DirectX.y.

virtual void Irony.Interpreter.LanguageRuntime.InitTypeConverters ( )
virtual

Definition at line 41 of file LanguageRuntime_Init.cs.

bool Irony.Interpreter.LanguageRuntime.IsAssigned ( object  value)

Definition at line 80 of file LanguageRuntime.cs.

virtual bool Irony.Interpreter.LanguageRuntime.IsTrue ( object  value)
virtual

Definition at line 84 of file LanguageRuntime.cs.

void Irony.Interpreter.LanguageRuntime.OnConsoleWrite ( EvaluationContext  context,
string  text 
)
protected

Definition at line 235 of file LanguageRuntime.cs.

Member Data Documentation

readonly TypeList Irony.Interpreter.LanguageRuntime.BaseTypeSequence = new TypeList()

Definition at line 59 of file LanguageRuntime.cs.

TypeConverter Irony.Interpreter.LanguageRuntime.BoolResultConverter = null

Definition at line 76 of file LanguageRuntime.cs.

readonly LanguageData Irony.Interpreter.LanguageRuntime.Language

Definition at line 58 of file LanguageRuntime.cs.

readonly TypeConverterTable Irony.Interpreter.LanguageRuntime.TypeConverters = new TypeConverterTable()

Definition at line 60 of file LanguageRuntime.cs.

Unassigned Irony.Interpreter.LanguageRuntime.Unassigned = new Unassigned()

Definition at line 78 of file LanguageRuntime.cs.

Property Documentation

virtual object Irony.Interpreter.LanguageRuntime.NullObject
get

Definition at line 88 of file LanguageRuntime.cs.

Event Documentation

EventHandler<ConsoleWriteEventArgs> Irony.Interpreter.LanguageRuntime.ConsoleWrite

Definition at line 234 of file LanguageRuntime.cs.


The documentation for this class was generated from the following files: