本文整理汇总了C#中PascalABCCompiler.TreeRealization.function_node类的典型用法代码示例。如果您正苦于以下问题:C# function_node类的具体用法?C# function_node怎么用?C# function_node使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
function_node类属于PascalABCCompiler.TreeRealization命名空间,在下文中一共展示了function_node类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: is_exist_eq_method_in_list
public function_node is_exist_eq_method_in_list(function_node fn,function_node_list funcs)
{
return find_eq_method_in_list(fn,funcs);
/*if (fn==null)
{
return false;
}
return true;*/
}
示例2: WriteGenericMethodReference
private void WriteGenericMethodReference(function_node meth)
{
common_method_node cnode = meth.original_function as common_method_node;
if (cnode != null)
{
bw.Write((byte)PCUConsts.common_method_generic);
WriteMethodReference(cnode);
}
else
{
compiled_function_node comp = meth.original_function as compiled_function_node;
bw.Write((byte)PCUConsts.compiled_method_generic);
WriteCompiledMethod(comp);
}
WriteTypeList(meth.get_generic_params_list());
}
示例3: SaveCodeReference
//связываем сущность со смещением, по которому находится тело методов
private void SaveCodeReference(function_node fn)
{
func_codes[fn] = (int)bw.BaseStream.Position;
}
示例4: initialize_types
/*public static void Reset()
{
(string_type as compiled_type_node).reinit_scope();
}*/
//TODO: Замечание к TODO перед этим классом. Просто сохранить ссылки на все объекты, которые мы здесь получаем.
private static void initialize_types()
{
//TODO: (??? подумать над именами!!)
/* bit
Shortint signed 8
Byte unsigned 8
Smallint signed 16
Word unsigned 16
Integer signed 32
Cardinal unsigned 32
Longint signed 64
ULongint unsigned 64
Decimal signed 128
*/
_byte_type = compiled_type_node.get_type_node(typeof(byte), symtab);
_byte_type.SetName(compiler_string_consts.byte_type_name);
_sbyte_type = compiled_type_node.get_type_node(typeof(sbyte), symtab);
_sbyte_type.SetName(compiler_string_consts.sbyte_type_name);
_short_type = compiled_type_node.get_type_node(typeof(short), symtab);
_short_type.SetName(compiler_string_consts.short_type_name);
_ushort_type = compiled_type_node.get_type_node(typeof(ushort), symtab);
_ushort_type.SetName(compiler_string_consts.ushort_type_name);
_integer_type = compiled_type_node.get_type_node(typeof(int), symtab);
_integer_type.SetName(compiler_string_consts.integer_type_name);
_uint_type = compiled_type_node.get_type_node(typeof(uint), symtab);
_uint_type.SetName(compiler_string_consts.uint_type_name);
_int64_type = compiled_type_node.get_type_node(typeof(long), symtab);
_int64_type.SetName(compiler_string_consts.long_type_name);
_uint64_type = compiled_type_node.get_type_node(typeof(ulong), symtab);
_uint64_type.SetName(compiler_string_consts.ulong_type_name);
_icloneable_interface = compiled_type_node.get_type_node(typeof(ICloneable), symtab);
_ilist_interface = compiled_type_node.get_type_node(typeof(IList), symtab);
_icollection_interface = compiled_type_node.get_type_node(typeof(ICollection));
_ienumerable_interface = compiled_type_node.get_type_node(typeof(IEnumerable));
_ilist1_interface = compiled_type_node.get_type_node(typeof(IList<>));
_icollection1_interface = compiled_type_node.get_type_node(typeof(ICollection<>));
_ienumerable1_interface = compiled_type_node.get_type_node(typeof(IEnumerable<>));
_assert_method = compiled_function_node.get_compiled_method(typeof(System.Diagnostics.Debug).GetMethod("Assert",new Type[1]{typeof(bool)}));
_decimal_type = compiled_type_node.get_type_node(typeof(decimal), symtab);
//_decimal_type.SetName(compiler_string_consts.decimal_type_name);
make_assign_operator(_decimal_type, SemanticTree.basic_function_type.objassign);
_bool_type = compiled_type_node.get_type_node(typeof(bool), symtab);
_bool_type.SetName(compiler_string_consts.bool_type_name);
_double_type = compiled_type_node.get_type_node(typeof(double), symtab);
_double_type.SetName(compiler_string_consts.real_type_name);
_float_type = compiled_type_node.get_type_node(typeof(float), symtab);
_float_type.SetName(compiler_string_consts.float_type_name);
_char_type = compiled_type_node.get_type_node(typeof(char), symtab);
_char_type.SetName(compiler_string_consts.char_type_name);
_string_type = compiled_type_node.get_type_node(typeof(string), symtab);
_string_type.SetName(compiler_string_consts.string_type_name);
_pointer_type = compiled_type_node.get_type_node(NetHelper.NetHelper.void_ptr_type, symtab);
_pointer_type.SetName(compiler_string_consts.pointer_type_name);
_object_type = compiled_type_node.get_type_node(typeof(object), symtab);
_object_type.SetName(compiler_string_consts.object_type_name);
_enum_base_type = compiled_type_node.get_type_node(typeof(System.Enum), symtab);
_delegate_base_type = compiled_type_node.get_type_node(typeof(System.MulticastDelegate), symtab);
_delegate_base_type.SetName(compiler_string_consts.base_delegate_type_name);
_system_delegate_type = compiled_type_node.get_type_node(typeof(System.Delegate), symtab);
_array_base_type = compiled_type_node.get_type_node(typeof(System.Array), symtab);
_array_base_type.SetName(compiler_string_consts.base_array_type_name);
_void_type = compiled_type_node.get_type_node(typeof(void), symtab);
_value_type = compiled_type_node.get_type_node(typeof(ValueType),symtab);
Type delegate_type = typeof(System.Delegate);
Type[] arr_params=new Type[2];
arr_params[0]=delegate_type;
arr_params[1]=delegate_type;
_delegate_combine_method =
compiled_function_node.get_compiled_method(delegate_type.GetMethod(compiler_string_consts.combine_method_name, arr_params));
//.........这里部分代码省略.........
示例5: add_generated_funtion_to_type
public static void add_generated_funtion_to_type(string oper_name, type_node to, function_node fn)
{
to.add_generated_name(oper_name, new SymbolInfo(fn));
}
示例6: function_intersection_node
public function_intersection_node(function_node left, function_node right)
{
_left = left;
_right = right;
}
示例7: get_intersecion
private function_intersection_node get_intersecion(function_node _func)
{
function_intersection_node _fint = null;
bool ret = _func_intersections.TryGetValue(_func, out _fint);
if (!ret)
{
return null;
}
return _fint;
}
示例8: create_possible_delegates_list
private base_function_call_list create_possible_delegates_list(expression_node obj, function_node func, location loc, bool is_static)
{
function_node_list fnl = new function_node_list();
fnl.AddElement(func);
return convert_functions_to_calls(obj, fnl, loc, is_static);
}
示例9: make_delegate_wrapper
internal typed_expression make_delegate_wrapper(expression_node obj, function_node func, location loc, bool is_static)
{
base_function_call_list fnl = create_possible_delegates_list(obj, func, loc, is_static);
if (fnl.Count == 0)
{
if (is_static)
{
AddError(loc, "EXPECTED_STATIC_METHOD");
}
else
{
AddError(loc, "EXPECTED_NON_STATIC_METHOD");
}
}
delegated_methods dm = new delegated_methods();
dm.proper_methods.AddRange(fnl);
typed_expression te = new typed_expression(dm, loc);
return te;
}
示例10: FunctionExsistsInSymbolInfo
private bool FunctionExsistsInSymbolInfo(function_node fn, SymbolInfo si)
{
while (si != null)
{
if (si.sym_info is function_node)
if (convertion_data_and_alghoritms.function_eq_params(fn, si.sym_info as function_node))
return true;
si = si.Next;
}
return false;
}
示例11: CreateDelegate
internal common_type_node CreateDelegate(function_node fn)
{
common_type_node del =
convertion_data_and_alghoritms.type_constructor.create_delegate(context.get_delegate_type_name(), fn.return_value_type, fn.parameters, context.converted_namespace, null);
context.converted_namespace.types.AddElement(del);
return del;
}
示例12: check_operator
/// <summary>
/// Проверяет, что оператор статический метод класса.
/// </summary>
/// <param name="fn">Функция-оператор.</param>
public void check_operator(function_node fn)
{
switch (fn.semantic_node_type)
{
case semantic_node_type.common_in_function_function_node:
{
throw new CompilerInternalError("Operator can not be nested in function function.");
}
case semantic_node_type.common_method_node:
{
common_method_node cmn=(common_method_node)fn;
if (cmn.polymorphic_state!=SemanticTree.polymorphic_state.ps_static)
{
throw new CompilerInternalError("Operator can not be non static method");
}
break;
}
case semantic_node_type.compiled_function_node:
{
compiled_function_node cfn=(compiled_function_node)fn;
if (cfn.polymorphic_state!=SemanticTree.polymorphic_state.ps_static)
{
throw new CompilerInternalError("Operator can not be non static method. Included library is can be corrupted or library data extraction error.");
}
break;
}
}
}
示例13: create_simple_function_call
//Метод только для внутнреннего использования.
//НЕ ПРЕОБРАЗУЕТ ТИПЫ. Только создает узел вызова метода.
//Этот метод и используется для создания узлов преобразования типов.
//TODO: Переименовать.
public expression_node create_simple_function_call(function_node fn, location loc, params expression_node[] exprs)
{
if (fn.compile_time_executor != null)
{
expression_node ex = fn.compile_time_executor(loc, exprs);
if (ex != null)
{
return ex;
}
}
switch (fn.semantic_node_type)
{
/*
case semantic_node_type.empty_function_node:
{
#if (DEBUG)
if (exprs.Length!=1)
{
throw new CompilerInternalError("Epty functions with only single parameter allowed.");
}
#endif
return exprs[0];
}
*/
case semantic_node_type.basic_function_node:
{
return create_basic_function_call((basic_function_node)fn, loc, exprs);
}
case semantic_node_type.common_namespace_function_node:
{
return create_common_namespace_function_call((common_namespace_function_node)fn, loc, exprs);
}
case semantic_node_type.common_method_node:
{
common_method_node cmn = (common_method_node)fn;
if (cmn.polymorphic_state != SemanticTree.polymorphic_state.ps_static)
{
break;
}
return create_common_static_method_call(cmn, loc, exprs);
}
/*
case semantic_node_type.pseudo_function:
{
pseudo_function pf=(pseudo_function)fn;
return pf.execute_pseudo_function_algorithm(loc,exprs);
}
*/
case semantic_node_type.common_in_function_function_node: break;
case semantic_node_type.compiled_function_node:
{
compiled_function_node cfn = (compiled_function_node)fn;
if (cfn.polymorphic_state != SemanticTree.polymorphic_state.ps_static)
{
break;
}
return create_compiled_static_method_call(cfn, loc, exprs);
}
case semantic_node_type.compiled_constructor_node:
{
compiled_constructor_call ccc = new compiled_constructor_call((compiled_constructor_node)fn,loc);
ccc.parameters.AddRange(exprs);
return ccc;
}
case semantic_node_type.indefinite_definition_node:
{
indefinite_function_call ifc = new indefinite_function_call(fn, loc);
ifc.parameters.AddRange(exprs);
return ifc;
}
default: throw new CompilerInternalError("Unknown function type");
}
throw new CanNotReferenceToNonStaticMethodWithType(fn.name, loc);
}
示例14: is_exist_eq_return_value_method
private function_node is_exist_eq_return_value_method(function_node fn, function_node_list funcs)
{
fn = find_eq_return_value_method_in_list(fn, funcs);
return fn;
/*if (fn == null)
{
return false;
}
return true;*/
}
示例15: get_function_intersection
public static function_intersection_node get_function_intersection(function_node left, function_node right)
{
return left.get_intersecion(right);
}