本文整理汇总了C#中PascalABCCompiler.TreeRealization.common_type_node.get_internal_interface方法的典型用法代码示例。如果您正苦于以下问题:C# common_type_node.get_internal_interface方法的具体用法?C# common_type_node.get_internal_interface怎么用?C# common_type_node.get_internal_interface使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PascalABCCompiler.TreeRealization.common_type_node
的用法示例。
在下文中一共展示了common_type_node.get_internal_interface方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VisitTypeDefinition
private void VisitTypeDefinition(common_type_node type)
{
int offset = 0;
if (is_interface == true) offset = SavePositionAndConstPool(type);
else offset = SavePositionAndImplementationPool(type);
bw.Write((byte)type.semantic_node_type);
bw.Write(is_interface);
bw.Write(type_entity_index++);
if (is_interface == true)
bw.Write(GetNameIndex(type));
else
bw.Write(type.name);
/*if (type.base_type != null)
WriteTypeReference(type.base_type);
else*/
//Пишем, является ли данный класс интерфейсом
if (type.IsInterface)
{
bw.Write((byte)1);
}
else
{
bw.Write((byte)0);
}
//Пишем, является ли данный класс делегатом
if (type.IsDelegate)
{
bw.Write((byte)1);
}
else
{
bw.Write((byte)0);
}
//Является ли тип описанием дженерика
if (type.is_generic_type_definition)
{
bw.Write((byte)1);
//Число типов-параметров
bw.Write(type.generic_params.Count);
//Имена параметров
foreach (common_type_node par in type.generic_params)
{
bw.Write(par.name);
}
}
else
{
bw.Write((byte)0);
}
int base_class_off = (int)bw.BaseStream.Position;
bw.Seek(GetSizeOfReference(type.base_type), SeekOrigin.Current);
//(ssyy) На кой чёрт это надо?
//WriteTypeReference(SystemLibrary.SystemLibrary.object_type);
//WriteTypeReference(type.base_type);
bw.Write(type.internal_is_value);
//Пишем поддерживаемые интерфейсы
//eto nepravilno!!! a vdrug bazovye interfejsy eshe ne projdeny.
//WriteImplementingInterfaces(type);
int interface_impl_off = (int)bw.BaseStream.Position;
int seek_off = sizeof(int);
for (int k=0; k<type.ImplementingInterfaces.Count; k++)
seek_off += GetSizeOfReference(type.ImplementingInterfaces[k] as TreeRealization.type_node);
bw.Seek(seek_off, SeekOrigin.Current);
bw.Write((byte)type.type_access_level);
bw.Write((byte)type.type_special_kind);
bw.Write(type.IsSealed);
bw.Write(type.IsAbstract);
bw.Write(type.IsPartial);
if (type.type_special_kind == SemanticTree.type_special_kind.diap_type)
{
ordinal_type_interface oti = type.get_internal_interface(internal_interface_kind.ordinal_interface) as ordinal_type_interface;
VisitExpression(oti.lower_value);
VisitExpression(oti.upper_value);
}
if (type.is_generic_type_definition)
{
//Ограничители параметров
WriteTypeParamsEliminations(type.generic_params);
}
if(CanWriteObject(type.element_type))
WriteTypeReference(type.element_type);
bw.Write(GetUnitReference(type.comprehensive_namespace));
SaveOffsetForAttribute(type);
bw.Write(0);//attributes;
if (type.default_property != null)
bw.Write((byte)1);
else
bw.Write((byte)0);
int def_prop_off = (int)bw.BaseStream.Position;
if (type.default_property != null)
bw.Write(0);//default_property
//.........这里部分代码省略.........
示例2: get_array_name
private string get_array_name(common_type_node ctn)
{
StringBuilder sb = new StringBuilder();
sb.Append("@array");
bounded_array_interface bai = ctn.get_internal_interface(internal_interface_kind.bounded_array_interface) as bounded_array_interface;
sb.Append('[');
sb.Append(get_constant(bai.ordinal_type_interface.lower_value));
sb.Append("..");
sb.Append(get_constant(bai.ordinal_type_interface.upper_value));
sb.Append(']');
sb.Append("["+get_name(ctn.element_type)+"]");
return sb.ToString();
}