本文整理汇总了C++中Tuple::Length方法的典型用法代码示例。如果您正苦于以下问题:C++ Tuple::Length方法的具体用法?C++ Tuple::Length怎么用?C++ Tuple::Length使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tuple
的用法示例。
在下文中一共展示了Tuple::Length方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PartialOrder
void TypeCycleChecker::PartialOrder(Tuple<Semantic*>& semantic, int start)
{
type_list.Reset();
//
// assert that the "index" of all types that should be checked is initially
// set to OMEGA
//
for (unsigned i = start; i < semantic.Length(); i++)
{
Semantic* sem = semantic[i];
for (unsigned k = 0;
k < sem -> compilation_unit -> NumTypeDeclarations(); k++)
{
AstDeclaredType* declared =
sem -> compilation_unit -> TypeDeclaration(k);
if (declared -> EmptyDeclarationCast())
continue;
SemanticEnvironment* env =
declared -> class_body -> semantic_environment;
if (env) // type was successfully compiled thus far?
{
TypeSymbol* type = env -> Type();
if (type -> index == OMEGA)
ProcessSubtypes(type);
}
}
}
ReverseTypeList();
}
示例2: OutputMake
void TypeDependenceChecker::OutputMake(FILE* outfile, char* output_name,
Tuple<FileSymbol*>& file_list)
{
assert(outfile);
for (unsigned i = 0; i < file_list.Length(); i++)
{
FileSymbol* file_symbol = file_list[i];
char* name = file_symbol -> FileName();
int length = file_symbol -> FileNameLength() -
(file_symbol -> IsJava() ? FileSymbol::java_suffix_length
: FileSymbol::class_suffix_length);
char* class_name = new char[length + FileSymbol::class_suffix_length +
1];
char* java_name =
new char[length + FileSymbol::java_suffix_length + 1];
strncpy(class_name, name, length);
strcpy(&class_name[length], FileSymbol::class_suffix);
strncpy(java_name, name, length);
strcpy(&java_name[length], FileSymbol::java_suffix);
fprintf(outfile, "%s : %s\n", output_name, java_name);
if (i > 0) // Not the first file in the list
{
fprintf(outfile, "%s : %s\n", output_name, class_name);
}
delete [] class_name;
delete [] java_name;
}
}
示例3: OpLine
void Operators::OpLine(Tuple<cp_info *> &constant_pool, const char *hdr,
int pc, Opcode opc, const char *name, char *args,
const char *desc, int info_kind, int info_index)
{
// generate line of opcode dump, info is extra info
Coutput << *hdr;
Coutput.width(4);
Coutput << pc;
Coutput << "\t" << name;
int len = strlen(name);
if (strlen(args))
{
Coutput << " " << args;
len += (strlen(args) + 1);
}
if (len < 8)
Coutput << "\t\t\t";
else if (len < 16)
Coutput << "\t\t";
else Coutput << "\t";
switch (info_kind)
{
case INFO_CONST:
Coutput << " ";
if (info_index <= 0 || info_index > constant_pool.Length())
Coutput << "OUT-OF_BOUNDS CONSTANT_POOL-INDEX " << info_index;
else {
// constant_pool[info_index] -> describe(constant_pool);
}
break;
case INFO_LOCAL:
Coutput << " local#" << info_index;
break;
}
//
// DS (17 jun) - skip desc for now: it's too long and should only
// be written at user request.
// Coutput << " " << desc;
//
Coutput << endl;
}
示例4: OpDmp
void Operators::OpDmp(Tuple<cp_info *> &constant_pool, Tuple<u1> &code)
{
int pc = 0;
while (pc < code.Length())
{
int info_kind = INFO_NONE; // assume no extra info
int info_index = 0;
int pc_start = pc;
Opcode opc = (Opcode) GetU1(code, pc);
const char *name, *desc; // set to name (mnemonic) and description of opcode.
OpDesc((Opcode) code[pc_start], &name, &desc);
pc++;
char argdesc[100];
argdesc[0] = U_NULL; // assume no argument description needed
unsigned au1;
int ai1,
ai2,
ai4;
switch (opc)
{
case OP_BIPUSH:
ai1 = GetI1(code, pc); pc++;
sprintf(argdesc, "%d", ai1);
break;
case OP_SIPUSH:
ai2 = GetI2(code, pc); pc +=2;
sprintf(argdesc, "%d", ai2);
break;
case OP_LDC:
info_index = GetU1(code, pc); pc++;
sprintf(argdesc,"%d", info_index);
info_kind = INFO_CONST;
break;
case OP_LDC_W:
case OP_LDC2_W:
info_index = GetU2(code, pc);pc +=2;
sprintf(argdesc, "%u", info_index);
info_kind = INFO_CONST;
break;
case OP_ILOAD:
case OP_LLOAD:
case OP_FLOAD:
case OP_DLOAD:
case OP_ALOAD:
case OP_ISTORE:
case OP_LSTORE:
case OP_FSTORE:
case OP_DSTORE:
case OP_ASTORE:
info_index = GetU1(code, pc);pc++;
sprintf(argdesc, "%u", info_index);
info_kind = INFO_LOCAL;
break;
case OP_ILOAD_0:
case OP_LLOAD_0:
case OP_FLOAD_0:
case OP_DLOAD_0:
case OP_ALOAD_0:
case OP_ISTORE_0:
case OP_LSTORE_0:
case OP_FSTORE_0:
case OP_DSTORE_0:
case OP_ASTORE_0:
info_kind = INFO_LOCAL;
info_index = 0;
break;
case OP_ILOAD_1:
case OP_LLOAD_1:
case OP_FLOAD_1:
case OP_DLOAD_1:
case OP_ALOAD_1:
case OP_ISTORE_1:
case OP_LSTORE_1:
case OP_FSTORE_1:
case OP_DSTORE_1:
case OP_ASTORE_1:
info_kind = INFO_LOCAL;
info_index = 1;
break;
case OP_ILOAD_2:
case OP_LLOAD_2:
case OP_FLOAD_2:
case OP_DLOAD_2:
case OP_ALOAD_2:
case OP_ISTORE_2:
case OP_LSTORE_2:
case OP_DSTORE_2:
case OP_FSTORE_2:
case OP_ASTORE_2:
info_kind = INFO_LOCAL;
info_index = 2;
break;
case OP_ILOAD_3:
case OP_LLOAD_3:
case OP_FLOAD_3:
case OP_DLOAD_3:
case OP_ALOAD_3:
case OP_ISTORE_3:
//.........这里部分代码省略.........