internal ScriptError(BaseScripter scripter, string message)
 {
     this.message = message;
     this.pcode_line = scripter.code.n;
     if (this.pcode_line == 0)
     {
         this.pcode_line = scripter.code.Card;
     }
     Module module = scripter.code.GetModule(this.pcode_line);
     if (module == null)
     {
         this.module_name = "";
         this.line_number = 0;
         this.line = "";
     }
     else
     {
         this.module_name = module.Name;
         this.line_number = scripter.code.GetErrorLineNumber(this.pcode_line);
         this.line = module.GetLine(this.line_number);
         while (this.IsEmptyLine(this.line))
         {
             this.pcode_line++;
             this.line_number++;
             this.line = module.GetLine(this.line_number);
             if (this.pcode_line >= scripter.code.Card)
             {
                 break;
             }
         }
     }
     this.E = null;
 }
Exemple #2
0
 internal Breakpoint(BaseScripter scripter, string module_name, int line_number)
 {
     this.scripter = scripter;
     this.n = -1;
     this.module_name = module_name;
     this.line_number = line_number;
 }
Exemple #3
0
 internal Module(BaseScripter scripter, string name, string language)
 {
     this.name = name;
     this.language = language;
     this.scripter = scripter;
     this.name_index = scripter.names.Add(name);
 }
 internal EventDispatcher(BaseScripter scripter, string type_name)
 {
     this.scripter = scripter;
     this.type_name = type_name;
     this.registered_event_handlers = new ArrayList();
     this.event_rec_list = new ArrayList();
     this.RegisterStandardHandlers();
 }
 internal EventObject(BaseScripter scripter, int event_id, int owner_id)
     : base(scripter, event_id, owner_id)
 {
     this.Event_Info = null;
     this.OwnerType = null;
     this.AddId = 0;
     this.RemoveId = 0;
     this.EventFieldId = 0;
 }
Exemple #6
0
 internal SymbolRec(BaseScripter scripter, int id)
 {
     this.scripter = scripter;
     this.id = id;
     this.value = new ArrayList();
     this.value.Add(null);
     this.value_level = 0;
     this.level = 0;
     this.block = 0;
 }
 internal ObjectObject(BaseScripter scripter, ClassObject class_object)
     : base(scripter)
 {
     this.class_object = class_object;
     this.Properties = new InstancePropertyList(scripter);
     this.Instance = null;
     this.invocation_listX = new ArrayList();
     this.invocation_listF = new ArrayList();
     this.invocation_index = -1;
 }
 public SymbolTable(BaseScripter scripter)
 {
     this.scripter = scripter;
     this.state_stack = new IntegerStack();
     this.a = new ArrayList();
     for (int i = 0; i < 0x3e8; i++)
     {
         this.a.Add(new SymbolRec(scripter, i));
     }
 }
 internal MemberObject(BaseScripter scripter, int id, int owner_id)
     : base(scripter)
 {
     this.ImplementsId = 0;
     this.PCodeLine = 0;
     this.Modifiers = new ModifierList();
     this.Members = new MemberList(scripter);
     this.Id = id;
     this.OwnerId = owner_id;
     this.Kind = scripter.symbol_table[this.Id].Kind;
     this.NameIndex = scripter.symbol_table[this.Id].NameIndex;
     this.Imported = false;
 }
 internal SymbolRecConstInt(BaseScripter scripter, int id)
     : base(scripter, id)
 {
     if (scripter.symbol_table[id].Value != null)
     {
         this.v = scripter.symbol_table[id].ValueAsInt;
     }
     base.Level = scripter.symbol_table[id].Level;
     base.TypeId = scripter.symbol_table[id].TypeId;
     base.Kind = scripter.symbol_table[id].Kind;
     base.NameIndex = scripter.symbol_table[id].NameIndex;
     base.is_static = scripter.symbol_table[id].is_static;
 }
 public CSLite_Scripter()
 {
     this.ch = null;
     this.rh = null;
     this.CSLiteException = null;
     this.RunCount = 0;
     this.scripter = new BaseScripter(this);
     this.scripter.RegisterParser(new CSharp_Parser());
     //this.scripter.RegisterParser(new VB_Parser());
     //this.scripter.RegisterParser(new Pascal_Parser());
     this.state = ScripterState.None;
     this.SetState(ScripterState.Init);
 }
 internal SymbolRecVarDecimal(BaseScripter scripter, int id)
     : base(scripter, id)
 {
     this.v = new decimal[20];
     if (scripter.symbol_table[id].Value != null)
     {
         this.v[base.value_level] = scripter.symbol_table[id].ValueAsDecimal;
     }
     base.Level = scripter.symbol_table[id].Level;
     base.TypeId = scripter.symbol_table[id].TypeId;
     base.Kind = scripter.symbol_table[id].Kind;
     base.NameIndex = scripter.symbol_table[id].NameIndex;
     base.is_static = scripter.symbol_table[id].is_static;
 }
Exemple #13
0
 internal IndexObject(BaseScripter scripter, ObjectObject o)
     : base(scripter)
 {
     this.MinValue = 0;
     this.indexes = new ArrayList();
     if (o.Instance.GetType() == typeof(string))
     {
         this.string_instance = (string) o.Instance;
         this.what = 1;
     }
     else
     {
         this.array_instance = (Array) o.Instance;
         this.what = 2;
     }
 }
Exemple #14
0
 internal ClassObject(BaseScripter scripter, int class_id, int owner_id, ClassKind ck)
     : base(scripter, class_id, owner_id)
 {
     this.PatternMethod = null;
     this.UnderlyingType = null;
     this.RType = null;
     this._namespaceNameIndex = -1;
     this.MinValueId = 0;
     this.MaxValueId = 0;
     this.RangeTypeId = 0;
     this.IndexTypeId = 0;
     this.ht = new Hashtable();
     this.AncestorIds = new IntegerList(false);
     this.ImportedType = null;
     this.Class_Kind = ck;
     this.PatternMethod = null;
 }
Exemple #15
0
 public MemberList(BaseScripter scripter)
 {
     this.scripter = scripter;
     this.items = new ArrayList();
 }
        public bool ExistsImplicitNumericConstConversion(BaseScripter scripter, int id1, int id2)
        {
            if (scripter.symbol_table[id1].Kind == MemberKind.Const)
            {
                int typeId = scripter.symbol_table[id1].TypeId;
                int num2 = scripter.symbol_table[id2].TypeId;
                if (typeId == 8)
                {
                    switch (num2)
                    {
                        case 8:
                            return true;

                        case 13:
                            return true;

                        case 9:
                            return true;

                        case 14:
                            return true;

                        case 3:
                        {
                            int valueAsInt = scripter.symbol_table[id1].ValueAsInt;
                            if ((valueAsInt >= 0) && (valueAsInt <= 0xff))
                            {
                                return true;
                            }
                            break;
                        }
                        case 10:
                        {
                            int num4 = scripter.symbol_table[id1].ValueAsInt;
                            if ((num4 >= -128) && (num4 <= 0x7f))
                            {
                                return true;
                            }
                            break;
                        }
                        case 11:
                        {
                            int num5 = scripter.symbol_table[id1].ValueAsInt;
                            if ((num5 >= -32768) && (num5 <= 0x7fff))
                            {
                                return true;
                            }
                            break;
                        }
                        case 15:
                        {
                            int num6 = scripter.symbol_table[id1].ValueAsInt;
                            if ((num6 >= 0) && (num6 <= 0xffff))
                            {
                                return true;
                            }
                            break;
                        }
                    }
                }
            }
            return false;
        }
Exemple #17
0
 internal override void Init(BaseScripter scripter, Module m)
 {
     base.Init(scripter, m);
     this.variable_initializers.Clear();
     this.static_variable_initializers.Clear();
     this.param_ids.Clear();
     this.param_type_ids.Clear();
     this.param_mods.Clear();
     this.local_variables.Clear();
     this.has_constructor = false;
     this.valid_this_context = false;
     this.explicit_intf_id = 0;
     this.curr_prop_id = 0;
     this.new_type_id = 0;
     this.SKIP_STATEMENT_TERMINATOR = false;
     this.OPTION_STRICT = true;
     this.typeof_expression = false;
     this.for_loop_stack.Clear();
     this.exit_kind_stack.Clear();
     this.with_stack.Clear();
 }
Exemple #18
0
 internal FieldObject(BaseScripter scripter, int field_id, int owner_id)
     : base(scripter, field_id, owner_id)
 {
     this.Field_Info = null;
     this.OwnerType = null;
 }
 public bool ExistsImplicitReferenceConversion(BaseScripter scripter, int id1, int id2)
 {
     int typeId = scripter.symbol_table[id1].TypeId;
     int id = scripter.symbol_table[id2].TypeId;
     ClassObject classObject = scripter.GetClassObject(typeId);
     ClassObject obj3 = scripter.GetClassObject(id);
     return (this.ExistsImplicitReferenceConversion(classObject, obj3) || ((id1 == scripter.symbol_table.NULL_id) && obj3.IsReferenceType));
 }
 internal ScriptObject(BaseScripter scripter)
 {
     this.Scripter = scripter;
 }
Exemple #21
0
 internal void Init(BaseScripter scripter, string code)
 {
     this.scripter = scripter;
     this.buff = string.Concat(new object[] { code, '\x001a', '\x001a', '\x001a' });
     this.p = -1;
     this.line_number = 0;
     this.pos = 0;
     this.history.Clear();
     this.def_stack.Clear();
 }
 public InstancePropertyList(BaseScripter scripter)
 {
     this.scripter = scripter;
 }
Exemple #23
0
 internal ModuleList(BaseScripter scripter)
 {
     this.scripter = scripter;
     this.items = new StringList(false);
 }
Exemple #24
0
 internal virtual void Init(BaseScripter scripter, Module m)
 {
     this.scripter = scripter;
     this.code = scripter.code;
     this.symbol_table = scripter.symbol_table;
     this.scanner.Init(scripter, m.Text);
     this.temp_count = 0;
     this.curr_module = m.NameIndex;
     this.level_stack.Clear();
     this.level_stack.Push(0);
     this.level_stack.Push(this.RootNamespaceId);
     this.block_count = 0;
     this.block_stack.Clear();
     this.block_stack.Push(0);
     this.block_list.Clear();
     this.DECLARE_SWITCH = false;
     this.DECLARATION_CHECK_SWITCH = false;
 }
 public bool ExistsImplicitEnumerationConversion(BaseScripter scripter, int id1, int id2)
 {
     int typeId = scripter.symbol_table[id1].TypeId;
     ClassObject classObject = scripter.GetClassObject(typeId);
     string name = scripter.symbol_table[id2].Name;
     return (classObject.IsEnum && (name == "0"));
 }
Exemple #26
0
 internal void InitExpression(BaseScripter scripter, Module m, int sub_id, string expr)
 {
     this.scripter = scripter;
     this.code = scripter.code;
     this.symbol_table = scripter.symbol_table;
     this.scanner.Init(scripter, expr);
     this.temp_count = 0;
     this.curr_module = m.NameIndex;
     this.level_stack.Clear();
     this.level_stack.Push(0);
     this.level_stack.Push(sub_id);
     this.block_count = 0;
     this.block_stack.Clear();
     this.block_stack.Push(0);
     this.block_list.Clear();
     this.DECLARE_SWITCH = false;
 }
 internal override void Init(BaseScripter scripter, Module m)
 {
     base.Init(scripter, m);
     this.variable_initializers.Clear();
     this.static_variable_initializers.Clear();
     this.param_ids.Clear();
     this.param_type_ids.Clear();
     this.param_mods.Clear();
     this.local_variables.Clear();
     this.has_constructor = false;
     this.valid_this_context = false;
 }
 internal CallStackRec(BaseScripter scripter, FunctionObject f, int n)
 {
     this.scripter = scripter;
     this.n = n;
     this.f = f;
 }
 internal override void Init(BaseScripter scripter, Module m)
 {
     base.Init(scripter, m);
     this.variable_initializers.Clear();
     this.static_variable_initializers.Clear();
     this.param_ids.Clear();
     this.param_type_ids.Clear();
     this.param_mods.Clear();
     this.local_variables.Clear();
     this.ACCESSOR_SWITCH = false;
     this.has_constructor = false;
     this.no_gen = false;
     this.valid_this_context = false;
     this.assign_operators.Clear();
     this.assign_operators.Add("=", base.code.OP_ASSIGN);
     this.assign_operators.Add("+=", base.code.OP_PLUS);
     this.assign_operators.Add("-=", base.code.OP_MINUS);
     this.assign_operators.Add("*=", base.code.OP_MULT);
     this.assign_operators.Add("/=", base.code.OP_DIV);
     this.assign_operators.Add("%=", base.code.OP_MOD);
     this.assign_operators.Add("&=", base.code.OP_BITWISE_AND);
     this.assign_operators.Add("|=", base.code.OP_BITWISE_OR);
     this.assign_operators.Add("^=", base.code.OP_BITWISE_XOR);
     this.assign_operators.Add("<<=", base.code.OP_LEFT_SHIFT);
     this.assign_operators.Add(">>=", base.code.OP_RIGHT_SHIFT);
     this.relational_operators.Clear();
     this.relational_operators.Add(">", base.code.OP_GT);
     this.relational_operators.Add("<", base.code.OP_LT);
     this.relational_operators.Add(">=", base.code.OP_GE);
     this.relational_operators.Add("<=", base.code.OP_LE);
     this.relational_operators.Add("is", base.code.OP_IS);
     this.relational_operators.Add("as", base.code.OP_AS);
     this.shift_operators.Clear();
     this.shift_operators.Add("<<", base.code.OP_LEFT_SHIFT);
     this.shift_operators.Add(">>", base.code.OP_RIGHT_SHIFT);
     this.additive_operators.Clear();
     this.additive_operators.Add("+", base.code.OP_PLUS);
     this.additive_operators.Add("-", base.code.OP_MINUS);
     this.multiplicative_operators.Clear();
     this.multiplicative_operators.Add("*", base.code.OP_MULT);
     this.multiplicative_operators.Add("/", base.code.OP_DIV);
     this.multiplicative_operators.Add("%", base.code.OP_MOD);
     this.overloadable_unary_operators.Clear();
     this.overloadable_unary_operators.AddObject("+", base.code.OP_UNARY_PLUS);
     this.overloadable_unary_operators.AddObject("-", base.code.OP_UNARY_MINUS);
     this.overloadable_unary_operators.AddObject("!", base.code.OP_NOT);
     this.overloadable_unary_operators.AddObject("~", base.code.OP_COMPLEMENT);
     this.overloadable_unary_operators.AddObject("++", base.code.OP_INC);
     this.overloadable_unary_operators.AddObject("--", base.code.OP_DEC);
     this.overloadable_unary_operators.AddObject("true", base.code.OP_TRUE);
     this.overloadable_unary_operators.AddObject("false", base.code.OP_TRUE);
     this.overloadable_binary_operators.Clear();
     this.overloadable_binary_operators.AddObject("+", base.code.OP_PLUS);
     this.overloadable_binary_operators.AddObject("-", base.code.OP_MINUS);
     this.overloadable_binary_operators.AddObject("*", base.code.OP_MULT);
     this.overloadable_binary_operators.AddObject("/", base.code.OP_DIV);
     this.overloadable_binary_operators.AddObject("%", base.code.OP_MOD);
     this.overloadable_binary_operators.AddObject("&", base.code.OP_BITWISE_AND);
     this.overloadable_binary_operators.AddObject("|", base.code.OP_BITWISE_OR);
     this.overloadable_binary_operators.AddObject("^", base.code.OP_BITWISE_XOR);
     this.overloadable_binary_operators.AddObject("<<", base.code.OP_LEFT_SHIFT);
     this.overloadable_binary_operators.AddObject(">>", base.code.OP_RIGHT_SHIFT);
     this.overloadable_binary_operators.AddObject("==", base.code.OP_EQ);
     this.overloadable_binary_operators.AddObject("!=", base.code.OP_NE);
     this.overloadable_binary_operators.AddObject(">", base.code.OP_GT);
     this.overloadable_binary_operators.AddObject("<", base.code.OP_LT);
     this.overloadable_binary_operators.AddObject(">=", base.code.OP_GE);
     this.overloadable_binary_operators.AddObject("<=", base.code.OP_LE);
 }
 public bool ExistsImplicitConversion(BaseScripter scripter, int id1, int id2)
 {
     int typeId = scripter.symbol_table[id1].TypeId;
     int num2 = scripter.symbol_table[id2].TypeId;
     if (typeId == num2)
     {
         return true;
     }
     if (this.ExistsImplicitNumericConstConversion(scripter, id1, id2))
     {
         return true;
     }
     if (this.ExistsImplicitReferenceConversion(scripter, id1, id2))
     {
         return true;
     }
     if (this.ExistsImplicitEnumerationConversion(scripter, id1, id2))
     {
         return true;
     }
     if (this.ExistsImplicitNumericConversion(typeId, num2))
     {
         return true;
     }
     ClassObject classObject = scripter.GetClassObject(typeId);
     ClassObject obj3 = scripter.GetClassObject(num2);
     return this.ExistsImplicitBoxingConversion(classObject, obj3);
 }