public expression_node convert_delegate_to_return_value_type_with_convertion(location call_location, params expression_node[] parameters) { expression_node del = parameters[0]; expression_node par = convert_delegate_to_return_value_type(call_location, del); return(type_table_function_call_maker(convert_function, call_location, par)); }
public common_constructor_call(common_method_node constructor_node, location loc) : base(constructor_node, loc) { }
public compiled_static_method_call(compiled_function_node static_method, location loc) : base(static_method, loc) { _compiled_type = static_method.cont_type; }
/// <summary> /// Конструктор узла. /// </summary> /// <param name="basic_func">Ссылка на функцию, которую мы вызываем.</param> public common_namespace_function_call(common_namespace_function_node namespace_func, location loc) : base(namespace_func, loc) { if (namespace_func is generic_namespace_function_instance_node) { common_namespace_function_node cnfn = (namespace_func as generic_namespace_function_instance_node).original_function as common_namespace_function_node; if (cnfn.function_code is wrapped_statement) { wrapped_statement ws = cnfn.function_code as wrapped_statement; cnfn.function_code = new empty_statement(null); cnfn.function_code = ws.restore(); } } else if (namespace_func.function_code is wrapped_statement) { wrapped_statement ws = namespace_func.function_code as wrapped_statement; namespace_func.function_code = new empty_statement(null); namespace_func.function_code = ws.restore(); } }
public common_method_call(common_method_node method, expression_node obj, location loc) : base(method, loc) { _obj = obj; _virtual_call = true; }
/// <summary> /// Конструктор узла. /// </summary> /// <param name="_function">Вызывамый метод.</param> public base_function_call_with_method(FunctionNodeType _function, location loc) : base(_function.return_value_type, loc) { _function_node = _function; }
/// <summary> /// Конструктор узла. /// </summary> /// <param name="basic_func">Ссылка на функцию, которую мы вызываем.</param> public basic_function_call(basic_function_node basic_func, location loc) : base(basic_func, loc) { }
/* * public static_class_field_reference(class_field static_field,common_type_node type,location loc) : * base(static_field.type,loc) * { * _field=static_field; * _type=type; * } */ public static_class_field_reference(class_field static_field, location loc) : base(static_field.type, loc) { _field = static_field; _type = static_field.cont_type; }
public compiled_variable_reference(compiled_variable_definition var, expression_node obj, location loc) : base(var.type, loc) { _var = var; _obj = obj; }
public namespace_variable_reference(namespace_variable var, location loc) : base(var.type, loc) { _var = var; }
public class_field_reference(class_field field, expression_node obj, location loc) : base(field.type, loc) { _field = field; _obj = obj; }
public local_variable_reference(local_variable var, int static_depth, location loc) : base(var.type, loc) { _var = var; this.static_depth = static_depth; }
public variable_reference(type_node tn, location loc) : base(tn, loc) { }
public expression_node convert_delegates_to_delegates(location call_location, expression_node[] parameters) { if (parameters.Length != 1) { throw new PascalSharp.Internal.TreeConverter.CompilerInternalError("Invalid delegates convertion"); } delegate_internal_interface dii_to = (delegate_internal_interface)_to.get_internal_interface(internal_interface_kind.delegate_interface); delegate_internal_interface dii = (delegate_internal_interface)parameters[0].type.get_internal_interface(internal_interface_kind.delegate_interface); expression_node pr = parameters[0]; base_function_call ifnotnull = null; if (_to.semantic_node_type == semantic_node_type.compiled_type_node) { ifnotnull = new compiled_constructor_call((compiled_constructor_node)dii_to.constructor, call_location); } else { ifnotnull = new common_constructor_call((common_method_node)dii_to.constructor, call_location); } //ccc = new common_constructor_call(dii_to.constructor, call_location); expression_node par = null; if (parameters[0].type.semantic_node_type == semantic_node_type.compiled_type_node) { par = new compiled_function_call((compiled_function_node)dii.invoke_method, parameters[0], call_location); } else { par = new common_method_call((common_method_node)dii.invoke_method, parameters[0], call_location); } ifnotnull.parameters.AddElement(par); null_const_node ncn = new null_const_node(_to, call_location); null_const_node ncn2 = new null_const_node(_to, call_location); SymbolInfo si = pr.type.find_first_in_type(compiler_string_consts.eq_name); basic_function_node fn = si.sym_info as basic_function_node; expression_node condition = null; if (fn != null) { basic_function_call condition_bfc = new basic_function_call(fn, call_location); condition_bfc.parameters.AddElement(pr); condition_bfc.parameters.AddElement(ncn); condition = condition_bfc; } else if (si.sym_info is compiled_function_node) { compiled_static_method_call condition_cfc = new compiled_static_method_call(si.sym_info as compiled_function_node, call_location); condition_cfc.parameters.AddElement(pr); condition_cfc.parameters.AddElement(ncn); condition = condition_cfc; } question_colon_expression qce = new question_colon_expression(condition, ncn2, ifnotnull, call_location); return(qce); }
public goto_statement(label_node v_label, location v_location) : base(v_location) { _label = v_label; }
public static_compiled_variable_reference(compiled_variable_definition var, location loc) : base(var.type, loc) { _var = var; _type = _var.cont_type; }
//запрещены ли переходы на метку //private bool _goto_blocked = false; //public bool goto_blocked //{ // get { return _goto_blocked; } // set { _goto_blocked = value; } //} public label_node(string v_name, location v_location) { _name = v_name; _loc = v_location; }
public common_parameter_reference(common_parameter par, int static_depth, location loc) : base(par.type, loc) { _par = par; this.static_depth = static_depth; }
public base_function_call(type_node tn, location loc) : base(tn, loc) { }
public local_block_variable_reference(local_block_variable var, location loc) : base(var.type, loc) { _var = var; }
public basic_function_call(basic_function_node basic_func, location loc, params expression_node[] prms) : base(basic_func, loc) { this.parameters.AddRange(prms); }
public throw_statement_node(expression_node exception, location loc) : base(loc) { _excpetion = exception; }
/// <summary> /// Конструктор узла. /// </summary> /// <param name="common_func">Вызываемый метод.</param> /// <param name="static_depth">Разность между статической глубиной вызываемого метода и статической глубиной вызывающего метода.</param> public common_in_function_function_call(common_in_function_function_node common_func, int static_depth, location loc) : base(common_func, loc) { _static_depth = static_depth; }
public rethrow_statement_node(location loc) : base(loc) { }
public common_static_method_call(common_method_node static_method, location loc) : base(static_method, loc) { //_method = static_method; _common_type = static_method.cont_type; }
/// <summary> /// Конструктор узла. /// </summary> /// <param name="comprehensive_namespace">Пространство имен, в которое вложено это пространство имен.</param> /// <param name="cont_unit">Модуль, в котором содержится это пространство имен.</param> /// <param name="name">Имя пространства имен.</param> /// <param name="scope">Область видимости пространства имен.</param> /// <param name="loc">Расположения заголовка пространства имен.</param> public common_namespace_node(namespace_node comprehensive_namespace, unit_node cont_unit, string name, PascalSharp.Internal.TreeConverter.SymbolTable.Scope scope, location loc) { _comprehensive_namespace = comprehensive_namespace; _cont_unit = cont_unit; _name = name; _scope = scope; _loc = loc; }
public compiled_function_call(compiled_function_node compiled_method, expression_node obj, location loc) : base(compiled_method, loc) { _obj = obj; }
public labeled_statement(label_node v_label, statement_node v_statement, location v_location) : base(v_location) { _label = v_label; _statement = v_statement; }
public compiled_constructor_call(compiled_constructor_node _constructor, location loc) : base(_constructor, loc) { }
//Добавляет интерфейс и всех его предков в список реализуемых данным классом. public static void AddInterface(common_type_node cnode, type_node _interface, location loc) { if (original_types_equals(_interface, cnode)) { throw new PascalSharp.Internal.TreeConverter.UndefinedNameReference(_interface.name, loc); } if (!_interface.IsInterface) { throw new PascalSharp.Internal.TreeConverter.SimpleSemanticError(loc, "{0}_IS_NOT_INTERFACE", _interface.name); } if (_interface.ForwardDeclarationOnly) { throw new PascalSharp.Internal.TreeConverter.SimpleSemanticError(loc, "FORWARD_DECLARATION_{0}_AS_IMPLEMENTING_INTERFACE", _interface.name); } if (!cnode.ImplementingInterfaces.Contains(_interface)) { cnode.ImplementingInterfaces.Add(_interface); foreach (type_node tn in _interface.ImplementingInterfaces) { if (!cnode.ImplementingInterfaces.Contains(tn)) { cnode.ImplementingInterfaces.Add(tn); } } } }