• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ TypeSpec类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中TypeSpec的典型用法代码示例。如果您正苦于以下问题:C++ TypeSpec类的具体用法?C++ TypeSpec怎么用?C++ TypeSpec使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了TypeSpec类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: error

void
ASTvariable_declaration::typecheck_initlist (ref init, TypeSpec type,
                                             const char *name)
{
    // Loop over a list of initializers (it's just 1 if not an array)...
    for (int i = 0;  init;  init = init->next(), ++i) {
        // Check for too many initializers for an array
        if (type.is_array() && i > type.arraylength()) {
            error ("Too many initializers for a '%s'", type_c_str(type));
            break;
        }
        // Special case: ok to assign a literal 0 to a closure to
        // initialize it.
        if (type.is_closure() && ! init->typespec().is_closure() &&
              init->typespec().is_int_or_float() &&
              init->nodetype() == literal_node &&
            ((ASTliteral *)init.get())->floatval() == 0.0f) {
            continue;  // it's ok
        }
        if (! type.is_array() && i > 0)
            error ("Can't assign array initializers to non-array %s %s",
                   type_c_str(type), name);
        if (! assignable(type.elementtype(), init->typespec()))
            error ("Can't assign '%s' to %s %s", type_c_str(init->typespec()),
                   type_c_str(type), name);
    }
}
开发者ID:cmstein,项目名称:OpenShadingLanguage,代码行数:27,代码来源:typecheck.cpp


示例2: lvalue

/// Return the symbol pointer to the individual field that this
/// structselect represents; also set structid to the ID of the
/// structure type, and fieldid to the field index within the struct.
Symbol *
ASTstructselect::find_fieldsym (int &structid, int &fieldid)
{
    if (! lvalue()->typespec().is_structure() &&
        ! lvalue()->typespec().is_structure_array()) {
        return NULL;
    }

    ustring structsymname;
    TypeSpec structtype;
    find_structsym (lvalue().get(), structsymname, structtype);

    structid = structtype.structure();
    StructSpec *structspec (structtype.structspec());
    fieldid = -1;
    for (int i = 0;  i < (int)structspec->numfields();  ++i) {
        if (structspec->field(i).name == m_field) {
            fieldid = i;
            break;
        }
    }

    if (fieldid < 0) {
        error ("struct type '%s' does not have a member '%s'",
               structspec->name().c_str(), m_field.c_str());
        return NULL;
    }

    const StructSpec::FieldSpec &fieldrec (structspec->field(fieldid));
    ustring fieldsymname = ustring::format ("%s.%s", structsymname.c_str(),
                                            fieldrec.name.c_str());
    Symbol *sym = m_compiler->symtab().find (fieldsymname);
    return sym;
}
开发者ID:WooFL,项目名称:OpenShadingLanguage,代码行数:37,代码来源:ast.cpp


示例3: typecheck_children

TypeSpec
ASTunary_expression::typecheck (TypeSpec expected)
{
    // FIXME - closures
    typecheck_children (expected);
    TypeSpec t = expr()->typespec();
    if (t.is_structure()) {
        error ("Can't do '%s' to a %s.", opname(), type_c_str(t));
        return TypeSpec ();
    }
    switch (m_op) {
    case Sub :
    case Add :
        if (t.is_string()) {
            error ("Can't do '%s' to a %s.", opname(), type_c_str(t));
            return TypeSpec ();
        }
        m_typespec = t;
        break;
    case Not :
        m_typespec = TypeDesc::TypeInt;  // ! is always an int
        break;
    case Compl :
        if (! t.is_int()) {
            error ("Operator '~' can only be done to an int");
            return TypeSpec ();
        }
        m_typespec = t;
        break;
    default:
        error ("unknown unary operator");
    }
    return m_typespec;
}
开发者ID:cmstein,项目名称:OpenShadingLanguage,代码行数:34,代码来源:typecheck.cpp


示例4: typecheck_list

TypeSpec
ASTternary_expression::typecheck (TypeSpec expected)
{
    // FIXME - closures
    TypeSpec c = typecheck_list (cond(), TypeDesc::TypeInt);
    TypeSpec t = typecheck_list (trueexpr(), expected);
    TypeSpec f = typecheck_list (falseexpr(), expected);

    if (c.is_closure())
        error ("Cannot use a closure as a condition");
    if (c.is_structure())
        error ("Cannot use a struct as a condition");
    if (c.is_array())
        error ("Cannot use an array as a condition");

    // No arrays
    if (t.is_array() || t.is_array()) {
        error ("Not allowed: '%s ? %s : %s'",
               type_c_str(c), type_c_str(t), type_c_str(f));
        return TypeSpec ();
    }

    // The true and false clauses need to be equivalent types, or one
    // needs to be assignable to the other (so one can be upcast).
    if (assignable (t, f) || assignable (f, t))
        m_typespec = higherprecision (t.simpletype(), f.simpletype());
    else
        error ("Not allowed: '%s ? %s : %s'",
               type_c_str(c), type_c_str(t), type_c_str(f));

    return m_typespec;
}
开发者ID:cmstein,项目名称:OpenShadingLanguage,代码行数:32,代码来源:typecheck.cpp


示例5: switch

TypeSpec
OSLCompilerImpl::type_from_code (const char *code, int *advance)
{
    TypeSpec t;
    int i = 0;
    switch (code[i]) {
    case 'i' : t = TypeDesc::TypeInt;          break;
    case 'f' : t = TypeDesc::TypeFloat;        break;
    case 'c' : t = TypeDesc::TypeColor;        break;
    case 'p' : t = TypeDesc::TypePoint;        break;
    case 'v' : t = TypeDesc::TypeVector;       break;
    case 'n' : t = TypeDesc::TypeNormal;       break;
    case 'm' : t = TypeDesc::TypeMatrix;       break;
    case 's' : t = TypeDesc::TypeString;       break;
    case 'x' : t = TypeDesc (TypeDesc::NONE);  break;
    case 'X' : t = TypeDesc (TypeDesc::PTR);   break;
    case 'L' : t = TypeDesc (TypeDesc::LONGLONG); break;
    case 'C' : // color closure
        t = TypeSpec (TypeDesc::TypeColor, true);
        break;
    case 'S' : // structure
        // Following the 'S' is the numeric structure ID
        t = TypeSpec ("struct", atoi (code+i+1));
        // Skip to the last digit
        while (isdigit(code[i+1]))
            ++i;
        break;
    case '?' : break; // anything will match, so keep 'UNKNOWN'
    case '*' : break; // anything will match, so keep 'UNKNOWN'
    case '.' : break; // anything will match, so keep 'UNKNOWN'
    default:
        std::cerr << "Don't know how to decode type code '" 
                  << code << "' " << (int)code[0] << "\n";
        ASSERT (0);   // FIXME
        if (advance)
            *advance = 1;
        return TypeSpec();
    }
    ++i;

    if (code[i] == '[') {
        ++i;
        t.make_array (-1);   // signal arrayness, unknown length
        if (isdigit(code[i]) || code[i] == ']') {
            if (isdigit(code[i]))
                t.make_array (atoi (code+i));
            while (isdigit(code[i]))
                ++i;
            if (code[i] == ']')
                ++i;
        }
    }

    if (advance)
        *advance = i;
    return t;
}
开发者ID:cmstein,项目名称:OpenShadingLanguage,代码行数:57,代码来源:typecheck.cpp


示例6: sizeof

llvm::Type *
BackendLLVM::llvm_type_groupdata ()
{
    // If already computed, return it
    if (m_llvm_type_groupdata)
        return m_llvm_type_groupdata;

    std::vector<llvm::Type*> fields;

    // First, add the array that tells if each layer has run.  But only make
    // slots for the layers that may be called/used.
    int sz = (m_num_used_layers + 3) & (~3);  // Round up to 32 bit boundary
    fields.push_back (ll.type_array (ll.type_bool(), sz));
    size_t offset = sz * sizeof(bool);

    // For each layer in the group, add entries for all params that are
    // connected or interpolated, and output params.  Also mark those
    // symbols with their offset within the group struct.
    if (llvm_debug() >= 2)
        std::cout << "Group param struct:\n";
    m_param_order_map.clear ();
    int order = 1;
    for (int layer = 0;  layer < group().nlayers();  ++layer) {
        ShaderInstance *inst = group()[layer];
        if (inst->unused())
            continue;
        FOREACH_PARAM (Symbol &sym, inst) {
            TypeSpec ts = sym.typespec();
            if (ts.is_structure())  // skip the struct symbol itself
                continue;
            int arraylen = std::max (1, sym.typespec().arraylength());
            int deriv_mult = sym.has_derivs() ? 3 : 1;
            int n = arraylen * deriv_mult;
            ts.make_array (n);
            fields.push_back (llvm_type (ts));

            // Alignment
            size_t align = sym.typespec().is_closure_based() ? sizeof(void*) :
                    sym.typespec().simpletype().basesize();
            if (offset & (align-1))
                offset += align - (offset & (align-1));
            if (llvm_debug() >= 2)
                std::cout << "  " << inst->layername() 
                          << " (" << inst->id() << ") " << sym.mangled()
                          << " " << ts.c_str() << ", field " << order 
                          << ", offset " << offset << std::endl;
            sym.dataoffset ((int)offset);
            offset += int(sym.size()) * deriv_mult;

            m_param_order_map[&sym] = order;
            ++order;
        }
    }
开发者ID:wildparky,项目名称:OpenShadingLanguage,代码行数:53,代码来源:llvm_instance.cpp


示例7: name

void
OSOReaderToMaster::symbol (SymType symtype, TypeSpec typespec, const char *name_)
{
    ustring name(name_);
    Symbol sym (name, typespec, symtype);
    TypeDesc t = typespec.simpletype();
    int nvals = t.aggregate * (t.is_unsized_array() ? 1 : t.numelements());
    if (sym.symtype() == SymTypeParam || sym.symtype() == SymTypeOutputParam) {
        // Skip structs for now, they're just placeholders
        if (typespec.is_structure()) {
        }
        else if (typespec.simpletype().basetype == TypeDesc::FLOAT) {
            sym.dataoffset ((int) m_master->m_fdefaults.size());
            expand (m_master->m_fdefaults, nvals);
        } else if (typespec.simpletype().basetype == TypeDesc::INT) {
            sym.dataoffset ((int) m_master->m_idefaults.size());
            expand (m_master->m_idefaults, nvals);
        } else if (typespec.simpletype().basetype == TypeDesc::STRING) {
            sym.dataoffset ((int) m_master->m_sdefaults.size());
            expand (m_master->m_sdefaults, nvals);
        } else if (typespec.is_closure_based()) {
            // Closures are pointers, so we allocate a string default taking
            // adventage of their default being NULL as well.
            sym.dataoffset ((int) m_master->m_sdefaults.size());
            expand (m_master->m_sdefaults, nvals);
        } else {
            ASSERT (0 && "unexpected type");
        }
    }
    if (sym.symtype() == SymTypeConst) {
        if (typespec.simpletype().basetype == TypeDesc::FLOAT) {
            sym.dataoffset ((int) m_master->m_fconsts.size());
            expand (m_master->m_fconsts, nvals);
        } else if (typespec.simpletype().basetype == TypeDesc::INT) {
            sym.dataoffset ((int) m_master->m_iconsts.size());
            expand (m_master->m_iconsts, nvals);
        } else if (typespec.simpletype().basetype == TypeDesc::STRING) {
            sym.dataoffset ((int) m_master->m_sconsts.size());
            expand (m_master->m_sconsts, nvals);
        } else {
            ASSERT (0 && "unexpected type");
        }
    }
#if 0
    // FIXME -- global_heap_offset is quite broken.  But also not necessary.
    // We made need to fix this later.
    if (sym.symtype() == SymTypeGlobal) {
        sym.dataoffset (m_shadingsys.global_heap_offset (sym.name()));
    }
#endif
    sym.lockgeom (m_shadingsys.lockgeom_default());
    m_master->m_symbols.push_back (sym);
    m_symmap[name] = int(m_master->m_symbols.size()) - 1;
    // Start the index at which we add specified defaults
    m_sym_default_index = 0;
}
开发者ID:ElaraFX,项目名称:OpenShadingLanguage,代码行数:56,代码来源:loadshader.cpp


示例8: ASTNode

ASTvariable_declaration::ASTvariable_declaration (OSLCompilerImpl *comp,
                                                  const TypeSpec &type,
                                                  ustring name, ASTNode *init,
                                                  bool isparam, bool ismeta,
                                                  bool isoutput, bool initlist)
    : ASTNode (variable_declaration_node, comp, 0, init, NULL /* meta */),
      m_name(name), m_sym(NULL),
      m_isparam(isparam), m_isoutput(isoutput), m_ismetadata(ismeta),
      m_initlist(initlist)
{
    m_typespec = type;
    Symbol *f = comp->symtab().clash (name);
    if (f  &&  ! m_ismetadata) {
        std::string e = Strutil::format ("\"%s\" already declared in this scope", name.c_str());
        if (f->node()) {
            std::string filename = OIIO::Filesystem::filename(f->node()->sourcefile().string());
            e += Strutil::format ("\n\t\tprevious declaration was at %s:%d",
                                  filename, f->node()->sourceline());
        }
        if (f->scope() == 0 && f->symtype() == SymTypeFunction && isparam) {
            // special case: only a warning for param to mask global function
            warning ("%s", e.c_str());
        } else {
            error ("%s", e.c_str());
        }
    }
    if (name[0] == '_' && name[1] == '_' && name[2] == '_') {
        error ("\"%s\" : sorry, can't start with three underscores",
               name.c_str());
    }
    SymType symtype = isparam ? (isoutput ? SymTypeOutputParam : SymTypeParam)
                              : SymTypeLocal;
    // Sneaky debugging aid: a local that starts with "__debug_tmp__"
    // gets declared as a temp. Don't do this on purpose!!!
    if (symtype == SymTypeLocal && Strutil::starts_with (name, "__debug_tmp__"))
        symtype = SymTypeTemp;
    m_sym = new Symbol (name, type, symtype, this);
    if (! m_ismetadata)
        oslcompiler->symtab().insert (m_sym);

    // A struct really makes several subvariables
    if (type.is_structure() || type.is_structure_array()) {
        ASSERT (! m_ismetadata);
        // Add the fields as individual declarations
        m_compiler->add_struct_fields (type.structspec(), m_sym->name(), symtype,
                                       type.is_unsized_array() ? -1 : type.arraylength(),
                                       this, init);
    }
}
开发者ID:boberfly,项目名称:gafferDependencies,代码行数:49,代码来源:ast.cpp


示例9: PasteText

void scContUnit::PasteText( const scContUnit*	srcPara,
							long&				offset )
{
	try {
		if ( offset == 0 ) {
			TypeSpec ts = srcPara->GetDefaultSpec();
			if ( ts.ptr() )
				SetDefaultSpec( ts );
		}
			
			// paste the specs in
		fSpecRun.InsertRun( offset, srcPara->GetContentSize(), srcPara->GetSpecRun() );

			// paste the text in
		fCharArray.Paste( ((scContUnit*)srcPara)->GetCharArray(), offset );
		Mark( scREBREAK );

#ifdef _RUBI_SUPPORT
			// paste the rubis in
		if ( fRubiArray || srcPara->GetRubiArray() ) {
	
			if ( fRubiArray && !srcPara->GetRubiArray() )
				fRubiArray->BumpRubiData( offset, srcPara->GetContentSize() );
			else if ( !fRubiArray && srcPara->GetRubiArray() ) {
				AllocRubiArray( *srcPara->GetRubiArray() );
				fRubiArray->BumpRubiData( 0, offset );
			}
			else
				fRubiArray->Paste( *srcPara->GetRubiArray(), offset, srcPara->GetContentSize() );
		}
#endif

		scTextline* txl = FindLine( offset );
		if ( txl )
			txl->Mark( scREPAINT ); /* force repaint */

		long startOffset = offset;
		offset += srcPara->GetContentSize();

		fSpecRun.SetContentSize( GetContentSize() );
		
		fCharArray.RepairText( fSpecRun, startOffset, offset );
	} 
	catch( ... ) {
		SCDebugBreak(); // remove stuff from the paragraph
		throw;
	} 
}
开发者ID:jimmccurdy,项目名称:ArchiveGit,代码行数:48,代码来源:Scparagr.cpp


示例10: if

/// structnode is an AST node representing a struct.  It could be a
/// struct variable, or a field of a struct (which is itself a struct),
/// or an array element of a struct.  Whatever, here we figure out some
/// vital information about it: the name of the symbol representing the
/// struct, and its type.
void
ASTstructselect::find_structsym (ASTNode *structnode, ustring &structname,
                                 TypeSpec &structtype)
{
    // This node selects a field from a struct. The purpose of this
    // method is to "flatten" the possibly-nested (struct in struct, and
    // or array of structs) down to a symbol that represents the
    // particular field.  In the process, we set structname and its
    // type structtype.
    ASSERT (structnode->typespec().is_structure() ||
            structnode->typespec().is_structure_array());
    if (structnode->nodetype() == variable_ref_node) {
        // The structnode is a top-level struct variable
        ASTvariable_ref *var = (ASTvariable_ref *) structnode;
        structname = var->name();
        structtype = var->typespec();
    }
    else if (structnode->nodetype() == structselect_node) {
        // The structnode is itself a field of another struct.
        ASTstructselect *thestruct = (ASTstructselect *) structnode;
        int structid, fieldid;
        Symbol *sym = thestruct->find_fieldsym (structid, fieldid);
        structname = sym->name();
        structtype = sym->typespec();
    }
    else if (structnode->nodetype() == index_node) {
        // The structnode is an element of an array of structs:
        ASTindex *arrayref = (ASTindex *) structnode;
        find_structsym (arrayref->lvalue().get(), structname, structtype);
        structtype.make_array (0);  // clear its arrayness
    }
    else {
        ASSERT (0 && "Malformed ASTstructselect");
    }
}
开发者ID:WooFL,项目名称:OpenShadingLanguage,代码行数:40,代码来源:ast.cpp


示例11: ChInfo

void scContUnit::ChInfo( long			offset,
						 UCS2&			ch, 		/* character at offset */
						 ulong& 		flags,
						 MicroPoint&	escapement, /* escapement at offset */
						 MicroPoint&	wordspace,	/* ws escapement at offset */
						 TypeSpec&		ts, 		/* typespec at offset */
						 eUnitType& 	unitType )	/* relative or absolute */
{
	if ( offset == 0 ) {
		ch			= scParaStart;	
		flags		= 0;		
		escapement	= 0;
		ts			= fSpecRun.SpecAtOffset( offset );
		unitType	= eAbsUnit;
	}
	else if ( offset == GetContentSize() + 1 ) {
		ch			= scParaEnd;
		flags		= 0;
		escapement	= 0;
		ts			= fSpecRun.SpecAtOffset( GetContentSize() );
		unitType	= eAbsUnit;
	}
	else if ( offset > GetContentSize() ) {
		ch			= 0;
		flags		= 0;
		escapement	= 0;
		ts.clear();
		unitType	= eAbsUnit;
	}
	else
		fCharArray.CharInfo( fSpecRun, offset, ch, flags, escapement, ts, unitType );

	fCharArray.WordSpaceInfo( offset, wordspace );
}
开发者ID:jimmccurdy,项目名称:ArchiveGit,代码行数:34,代码来源:Scparagr.cpp


示例12: SetParaStyle

void scCachedStyle::SetParaStyle( const scContUnit* cu, TypeSpec& ts )
{
	if ( ts.ptr() == cachedParaStyle_.fSpec.ptr() )
		return;
	cachedPara_ = cu;
	cachedParaStyle_.Init( ts );
}
开发者ID:jimmccurdy,项目名称:ArchiveGit,代码行数:7,代码来源:Scstcach.cpp


示例13: Insert

void scTypeSpecList::Insert( TypeSpec& ts )
{	
	for ( int i = 0; i < NumItems(); i++ ) {
		if ( ts.ptr() == (*this)[i].ptr() )
			return;
	}
	Append( ts );
}
开发者ID:jimmccurdy,项目名称:ArchiveGit,代码行数:8,代码来源:sccspecl.cpp


示例14: SetDefaultSpec

void scContUnit::SetDefaultSpec( TypeSpec& ts )
{
	if ( ts.ptr() != defspec_.ptr() ) {
		defspec_ = ts;
		Mark( scREBREAK );
	}
	ForceRepaint( 0, LONG_MAX );
}
开发者ID:jimmccurdy,项目名称:ArchiveGit,代码行数:8,代码来源:Scparagr.cpp


示例15:

void
OSOReaderQuery::symbol (SymType symtype, TypeSpec typespec, const char *name)
{
    if (symtype == SymTypeParam || symtype == SymTypeOutputParam) {
        m_reading_param = true;
        OSLQuery::Parameter p;
        p.name = name;
        p.type = typespec.simpletype();   // FIXME -- struct & closure
        p.isoutput = (symtype == SymTypeOutputParam);
        p.varlenarray = (typespec.arraylength() < 0);
        p.isstruct = typespec.is_structure();
        p.isclosure = typespec.is_closure();
        m_query.m_params.push_back (p);
    } else {
        m_reading_param = false;
    }
}
开发者ID:danieldresser,项目名称:OpenShadingLanguage,代码行数:17,代码来源:oslquery.cpp


示例16: while

void
BackendLLVM::initialize_llvm_group ()
{
    ll.setup_optimization_passes (shadingsys().llvm_optimize());

    // Clear the shaderglobals and groupdata types -- they will be
    // created on demand.
    m_llvm_type_sg = NULL;
    m_llvm_type_groupdata = NULL;
    m_llvm_type_closure_component = NULL;
    m_llvm_type_closure_component_attr = NULL;

    for (int i = 0;  llvm_helper_function_table[i];  i += 2) {
        const char *funcname = llvm_helper_function_table[i];
        bool varargs = false;
        const char *types = llvm_helper_function_table[i+1];
        int advance;
        TypeSpec rettype = OSLCompilerImpl::type_from_code (types, &advance);
        types += advance;
        std::vector<llvm::Type*> params;
        while (*types) {
            TypeSpec t = OSLCompilerImpl::type_from_code (types, &advance);
            if (t.simpletype().basetype == TypeDesc::UNKNOWN) {
                if (*types == '*')
                    varargs = true;
                else
                    ASSERT (0);
            } else {
                params.push_back (llvm_pass_type (t));
            }
            types += advance;
        }
        ll.make_function (funcname, false, llvm_type(rettype), params, varargs);
    }

    // Needed for closure setup
    std::vector<llvm::Type*> params(3);
    params[0] = (llvm::Type *) ll.type_char_ptr();
    params[1] = ll.type_int();
    params[2] = (llvm::Type *) ll.type_char_ptr();
    m_llvm_type_prepare_closure_func = ll.type_function_ptr (ll.type_void(), params);
    m_llvm_type_setup_closure_func = m_llvm_type_prepare_closure_func;
}
开发者ID:crunchvfx,项目名称:OpenShadingLanguage,代码行数:43,代码来源:llvm_instance.cpp


示例17: ASSERT

void
OSLCompilerImpl::write_oso_metadata (const ASTNode *metanode) const
{
    ASSERT (metanode->nodetype() == ASTNode::variable_declaration_node);
    const ASTvariable_declaration *metavar = static_cast<const ASTvariable_declaration *>(metanode);
    Symbol *metasym = metavar->sym();
    ASSERT (metasym);
    TypeSpec ts = metasym->typespec();
    std::string pdl;
    bool ok = metavar->param_default_literals (metasym, pdl, ",");
    if (ok) {
        oso ("%%meta{%s,%s,%s} ", ts.string().c_str(), metasym->name(), pdl);
    } else {
        error (metanode->sourcefile(), metanode->sourceline(),
               "Don't know how to print metadata %s (%s) with node type %s",
               metasym->name().c_str(), ts.string().c_str(),
               metavar->init()->nodetypename());
    }
}
开发者ID:HazardousCode,项目名称:OpenShadingLanguage,代码行数:19,代码来源:oslcomp.cpp


示例18: Insert

void scContUnit::Insert( const CharRecord&	ch,
						 TypeSpec&			spec,
						 long				offset )
{
	CharRecordP chRec = (CharRecordP)&ch;
	fCharArray.Insert( chRec, offset, 1 );
	fSpecRun.BumpOffset( offset, fCharArray.GetNumItems() );

	if ( spec.ptr() )
		fSpecRun.ApplySpec( spec, offset, offset + 1 );

	Mark( scREBREAK );
}
开发者ID:jimmccurdy,项目名称:ArchiveGit,代码行数:13,代码来源:Scparagr.cpp


示例19: ContainTS

/* return true if a spec exists on a line */
BOOL scTextline::ContainTS( TypeSpec ts )
{
	scSpecRun&		run = fPara->GetSpecRun();

	int i = run.indexAtOffset( fStartOffset );

	do {
		if ( run[i].spec().ptr() == ts.ptr() )
			return true;			
	} while ( run[++i].offset() < fEndOffset );

	return false;
}
开发者ID:jimmccurdy,项目名称:ArchiveGit,代码行数:14,代码来源:Sctextli.cpp


示例20: GetSParamElement

	TiXmlElement* GetSParamElement(Parameter *param)
	{
		TiXmlElement *gParamEl = new TiXmlElement("SPar");

		TypeSpec *tSpec = dynamic_cast<TypeSpec*>(param->type);
		TypeRef *tRef = dynamic_cast<TypeRef*>(param->type);
		if (tRef)
			tSpec = static_cast<TypeSpec*>(tRef->type);

		gParamEl->SetAttribute("Qual", tSpec->GetParentModule()->Name.c_str());

		//if (tSpec->IsTagged)
		//	gParamEl->SetAttribute("Name", (tSpec->base ? tSpec->base->Name.c_str() : "NIL"));
		//else
		//	gParamEl->SetAttribute("Name", (tSpec->base ? tSpec->Name.c_str() : "NIL"));
		gParamEl->SetAttribute("Name", tSpec->GetCPPTypeName(false).c_str());

		if (tSpec->IsTagged)
			gParamEl->SetAttribute("Tag", tSpec->Name.c_str());

		return gParamEl;
	}
开发者ID:kpdev42,项目名称:Kaleidoscope,代码行数:22,代码来源:GenProcsManager.cpp



注:本文中的TypeSpec类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ TypeStruct类代码示例发布时间:2022-05-31
下一篇:
C++ TypeSourceInfo类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap