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

C++ createSymbol函数代码示例

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

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



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

示例1: addFilter

IHqlExpression * addFilter(IHqlExpression * dataset, IHqlExpression * limitField)
{
    IHqlExpression * lower = createConstant(limitField->queryType()->castFrom(true, (__int64)0));
    lower = createValue(no_colon, lower, createValue(no_stored, createConstant(LOWER_LIMIT_ID)));
    lower = createSymbol(createIdentifierAtom(LOWER_LIMIT_ID), lower, ob_private);
    dataset = createDataset(no_filter, LINK(dataset), createBoolExpr(no_ge, LINK(limitField), lower));

    IHqlExpression * upper = createConstant((int)DISKREAD_PAGE_SIZE);
    upper = createValue(no_colon, upper, createValue(no_stored, createConstant(RECORD_LIMIT_ID)));
    upper = createSymbol(createIdentifierAtom(RECORD_LIMIT_ID), upper, ob_private);
    dataset = createDataset(no_choosen, dataset, upper);
    dataset = createSymbol(createIdentifierAtom("_Filtered_"), dataset, ob_private);
    return dataset;
}
开发者ID:aa0,项目名称:HPCC-Platform,代码行数:14,代码来源:fvwugen.cpp


示例2: add_builtins

void add_builtins () {
  pushLevel();
  add_builtin_types();
  add_builtin_functions();
  /**
   * What to do with these? Consts
   * true
   * false
   * maxint
   * minint
   * pi
   */
   
  symbol *booleanTypeDescription = getType ("boolean");
  
  symbol *oddFunctionSymbol = calloc (1, sizeof (symbol));
  GPtrArray *oddParam = g_ptr_array_new ();
  struct function_desc *funcDescription = createFunctionDesc (oddParam, 
    booleanTypeDescription, 1);
  symbol *oddSymbol = createSymbol ("odd", booleanTypeDescription, OC_FUNC, funcDescription);
  addSymbol ("odd", oddSymbol);


  printf ("Type class of odd: %d\n", getTypeClass (oddSymbol));
  printf ("Done adding builtins\n");
  showAllSymbols();
  printf ("done showing all symbols\n");
  //exit (EXIT_SUCCESS);
}
开发者ID:mnbujold,项目名称:c415-compiler,代码行数:29,代码来源:builtin.c


示例3: Property

RFedd2P::RFedd2P()
{
  Description = QObject::tr("equation defined 2-port RF device");

  Model = "RFEDD2P";
  Name  = "RF";

  // first properties !!!
  Props.append(new Property("Type", "Y", false,
		QObject::tr("type of parameters")+" [Y, Z, S, H, G, A, T]"));
  Props.append(new Property("duringDC", "open", false,
		QObject::tr("representation during DC analysis")+
			    " [open, short, unspecified, zerofrequency]"));

  // last properties
  Props.append(new Property("P11", "0", false,
		QObject::tr("parameter equation") + " 11"));
  Props.append(new Property("P12", "0", false,
		QObject::tr("parameter equation") + " 12"));
  Props.append(new Property("P21", "0", false,
		QObject::tr("parameter equation") + " 21"));
  Props.append(new Property("P22", "0", false,
		QObject::tr("parameter equation") + " 22"));

  createSymbol();
}
开发者ID:bastien-roucaries,项目名称:qucsrework,代码行数:26,代码来源:rfedd2p.cpp


示例4: Property

Resistor::Resistor(bool european)
{
  Description = QObject::tr("resistor");

  Props.append(new Property("R", "50 Ohm", true,
    QObject::tr("ohmic resistance in Ohms")));
  Props.append(new Property("Temp", "26.85", false,
    QObject::tr("simulation temperature in degree Celsius")));
  Props.append(new Property("Tc1", "0.0", false,
    QObject::tr("first order temperature coefficient")));
  Props.append(new Property("Tc2", "0.0", false,
    QObject::tr("second order temperature coefficient")));
  Props.append(new Property("Tnom", "26.85", false,
    QObject::tr("temperature at which parameters were extracted")));

  // this must be the last property in the list !!!
  Props.append(new Property("Symbol", "european", false,
        QObject::tr("schematic symbol")+" [european, US]"));
  if(!european)  Props.getLast()->Value = "US";

  createSymbol();
  tx = x1+4;
  ty = y2+4;
  Model = "R";
  SpiceModel = "R";
  Name  = "R";
}
开发者ID:nvdl,项目名称:qucs,代码行数:27,代码来源:resistor.cpp


示例5: metrics

MStee::MStee()
{
  Description = QObject::tr("microstrip tee");

  x1 = -30; y1 = -11;
  x2 =  30; y2 =  30;

  QFontMetrics metrics(QucsSettings.font);   // get size of text
  tx = x1+4;
  ty = y1 - 5*metrics.lineSpacing() - 4;
  Model = "MTEE";
  Name  = "MS";

  Props.append(new Property("Subst", "Subst1", true,
		QObject::tr("substrate")));
  Props.append(new Property("W1", "1 mm", true,
		QObject::tr("width of line 1")));
  Props.append(new Property("W2", "1 mm", true,
		QObject::tr("width of line 2")));
  Props.append(new Property("W3", "2 mm", true,
		QObject::tr("width of line 3")));
  Props.append(new Property("MSModel", "Hammerstad", false,
	QObject::tr("quasi-static microstrip model")+
	" [Hammerstad, Wheeler, Schneider]"));
  Props.append(new Property("MSDispModel", "Kirschning", false,
	QObject::tr("microstrip dispersion model")+" [Kirschning, Kobayashi, "
	"Yamashita, Hammerstad, Getsinger, Schneider, Pramanick]"));
  Props.append(new Property("Temp", "26.85", false,
		QObject::tr("temperature in degree Celsius")));
  Props.append(new Property("Symbol", "showNumbers", false,
	QObject::tr("show port numbers in symbol or not")+
	" [showNumbers, noNumbers]"));

  createSymbol();
}
开发者ID:MikeBrinson,项目名称:qucs,代码行数:35,代码来源:mstee.cpp


示例6: Property

MScross::MScross()
{
  Description = QObject::tr("microstrip cross");

  Model = "MCROSS";
  Name  = "MS";

  Props.append(new Property("Subst", "Subst1", true,
		QObject::tr("substrate")));
  Props.append(new Property("W1", "1 mm", true,
		QObject::tr("width of line 1")));
  Props.append(new Property("W2", "2 mm", true,
		QObject::tr("width of line 2")));
  Props.append(new Property("W3", "1 mm", true,
		QObject::tr("width of line 3")));
  Props.append(new Property("W4", "2 mm", true,
		QObject::tr("width of line 4")));
  Props.append(new Property("MSModel", "Hammerstad", false,
	QObject::tr("quasi-static microstrip model")+
	" [Hammerstad, Wheeler, Schneider]"));
  Props.append(new Property("MSDispModel", "Kirschning", false,
	QObject::tr("microstrip dispersion model")+" [Kirschning, Kobayashi, "
	"Yamashita, Hammerstad, Getsinger, Schneider, Pramanick]"));
  Props.append(new Property("Symbol", "showNumbers", false,
	QObject::tr("show port numbers in symbol or not")+
	" [showNumbers, noNumbers]"));

  createSymbol();
}
开发者ID:AMDmi3,项目名称:qucs,代码行数:29,代码来源:mscross.cpp


示例7: patternSymbolIndex

bool symbolChooser::changeSymbol(const triC& color, int newIndex) {

  const QRgb rgbColor = color.qrgb();
  const QHash<QRgb, patternSymbolIndex>::const_iterator it =
    symbolMap_.find(rgbColor);
  if (it != symbolMap_.end()) {
    const int oldIndex = it.value().index();
    if (oldIndex == newIndex) {
      return true;
    }
    // make sure the new index is available
    if (!colorIndex_.indexIsAvailable(newIndex)) {
      return false;
    }
    // free the old index
    colorIndex_.free(oldIndex);
    symbolMap_.remove(rgbColor);
    colorIndex_.reserve(newIndex);
    symbolMap_.insert(rgbColor,
                      patternSymbolIndex(createSymbol(newIndex, rgbColor),
                                         newIndex, borderDimension_,
                                         symbolDimension_));
    return true;
  }
  else {
    qWarning() << "Unreserved color in symbolChooser::changeSymbol" <<
      ::ctos(color) << newIndex;
    return false;
  }
}
开发者ID:angelagabereau,项目名称:Cstitch,代码行数:30,代码来源:symbolChooser.cpp


示例8: main

/**
 * \brief Entry point.
 * \param argc The number of input parameters.
 * \param argv The input parameters.
 */
int main(int argc, char *argv[]) {

	/* the resource manager must be initialized before any
	 * further actions are implemented */
	rm_init(&resource_mgr);

	if (process_options(argc, argv) == 1) {
		rm_cleanup_resources(&resource_mgr);
		exit(EXIT_FAILURE);
	}

	if (cc_options.print_only_errors != 1) {
		printf("Input: %s\n", cc_options.input_file);
		printf("Output: %s\n", cc_options.output_file);
		printf("IR: %s\n", cc_options.ir_file);
	}

	yyin = fopen(cc_options.input_file, "r");
	if (!yyin) {
		fprintf(stderr,
				"Input file could not be opened for reading. Maybe, file does not exist?");
	} else {
		setSymbolTable(createSymbol());
		yyparse();
		fclose(yyin);
		irCode_t* ircode = NULL;

		if (cc_options.ir_file != NULL) {
			FILE *irFile;
			irFile = fopen(cc_options.ir_file, "w+");

			// Test symbolTable
			print_symTab(irFile);

			// get ir code and print it into irFile
			struct func_t *func, *tmp;
			HASH_ITER(hh, getSymbolTable()->symFunc, func, tmp) {
				if (func->symbol != NULL) {
					fprintf(irFile, "Function %s:\n", func->id);
					printIRCode(irFile, func->symbol->ircode);
				}
			}

			fclose(irFile);
		}

		yyout = fopen(cc_options.output_file, "w+");
		if (!yyout) {
			fprintf(stderr,
					"Output file could not be opened for writing. Maybe, file does not exist?");
		} else {
			int ret = mips32gen(yyout, ircode, getSymbolTable());
			if (ret != 0) {
				fprintf(stderr, "Error generating mips32 code with code: %d\n",
						ret);
			}
			fclose(yyout);
		}
	}
开发者ID:doniexun,项目名称:compiler-9,代码行数:64,代码来源:main.c


示例9: createSymbol

MOSFET_sub::MOSFET_sub()
{
  Description = QObject::tr("MOS field-effect transistor with substrate");
  createSymbol();
  tx = x2+4;
  ty = y1+4;
  Model = "MOSFET";
}
开发者ID:AMDmi3,项目名称:qucs,代码行数:8,代码来源:mosfet_sub.cpp


示例10: createSymbol

BJTsub::BJTsub()
{
  Description = QObject::tr("bipolar junction transistor with substrate");
  createSymbol();
  tx = x2+4;
  ty = y1+4;
  Model = "BJT";
}
开发者ID:MikeBrinson,项目名称:qucs,代码行数:8,代码来源:bjtsub.cpp


示例11: createSymbol

MOSFET::MOSFET()
{
  // properties obtained from "Basic_MOSFET" in mosfet_sub.cpp
  Description = QObject::tr("MOS field-effect transistor");
  createSymbol();
  tx = x2+4;
  ty = y1+4;
  Model = "_MOSFET";
}
开发者ID:FoxMarts,项目名称:qucs,代码行数:9,代码来源:mosfet.cpp


示例12: createSymbol

Logical_NAND::Logical_NAND()
{
  Description = QObject::tr("logical NAND");
  Model = "NAND";

  createSymbol();
  tx = x1+4;
  ty = y2+4;
}
开发者ID:AMDmi3,项目名称:qucs,代码行数:9,代码来源:logical_nand.cpp


示例13: buildWorkUnitViewerEcl

IHqlExpression * buildWorkUnitViewerEcl(IHqlExpression * record, const char * wuid, unsigned sequence, const char * name)
{
    OwnedHqlExpr newRecord = createSymbol(createIdentifierAtom("_SourceRecord_"), LINK(record), ob_private);
    IHqlExpression * arg = name ? createConstant(name) : createConstant((int)sequence);
    OwnedHqlExpr dataset = createDataset(no_workunit_dataset, newRecord.getLink(), createComma(createConstant(wuid), arg));
    OwnedHqlExpr projected = addSimplifyProject(dataset);
    OwnedHqlExpr output = addOutput(projected);
    return output.getClear();
}
开发者ID:aa0,项目名称:HPCC-Platform,代码行数:9,代码来源:fvwugen.cpp


示例14: addSimplifyProject

IHqlExpression * addSimplifyProject(IHqlExpression * dataset)
{
    IHqlExpression * record = dataset->queryRecord();
    IHqlExpression * projectRecord = getSimplifiedRecord(record, false);
    if (!projectRecord)
        return LINK(dataset);

    projectRecord = createSymbol(createIdentifierAtom("_TargetRecord_"), projectRecord, ob_private);
    return createDataset(no_newusertable, LINK(dataset), createComma(projectRecord, getSimplifiedTransform(projectRecord, record, dataset)));
}
开发者ID:aa0,项目名称:HPCC-Platform,代码行数:10,代码来源:fvwugen.cpp


示例15: lookup

Symbol *getTmpSym(Table *curTable, long yylineno)
{
	Symbol *retSym;
	char *newName = (char *)newTmp();
	int sRes = lookup(curTable, newName, &retSym);
	if ( sRes != NOTFOUND )
		return retSym;
	retSym = createSymbol(TMP, newName, yylineno);
	insToTable(curTable, retSym);
	return retSym;
}
开发者ID:ramrunner,项目名称:alpha-lang,代码行数:11,代码来源:symFunc.c


示例16: buildTable

void buildTable(char filename[]){
  if(filename==NULL){ //no filename, empty table.
return;
}
FILE *file=fopen(filename,"r");

if(file==NULL){
fprintf(stderr,"Error loading symbol table\n");
exit(EXIT_FAILURE);
}

int i=0;
if(!feof(file)){
  for(;i<MAX_SYMBOLS;i++){
    char *token_type=calloc(1,1024);
    char *token_name=calloc(1,1024);
    char *token_value=calloc(1,1024);

    if(fscanf(file, "%s %s %s", token_type, token_name, token_value)!=3){
      break;
    }


    if(strcmp(token_type,"int")==0){
      Symbol int_symbol=createSymbol(TYPE_INT, token_name, token_value);
      symbol[i]=int_symbol;
    }else if(strcmp(token_type,"double")==0){
      Symbol double_symbol=createSymbol(TYPE_DOUBLE, token_name, token_value);
      symbol[i]=double_symbol;
    }
  }
}


number_of_symbols=i;

fclose(file);

return;

}
开发者ID:Scruf,项目名称:CSCI243,代码行数:41,代码来源:symTbl.c


示例17: readClassDeclaration

/*
    readDeclaration reads a declaration of a class
*/
static void readClassDeclaration()
{   
    ObjectHandle classObj, metaObj, vars;
    std::string className, superName;
    int i, size, instanceTop;
    // todo: fixed length variables array!
    ObjectHandle instanceVariables[15];
    // todo: horrible fixed length arrays!
    char metaClassName[100];
    char metaSuperClassName[100];

    if (ll.nextToken() != nameconst)
        sysError("bad file format","no name in declaration");
    className = ll.strToken();
    if (ll.nextToken() == nameconst) 
    { /* read superclass name */
        superName = ll.strToken();
        ll.nextToken();
    }
    // todo: sprintf eradication!
    sprintf(metaClassName, "Meta%s", className.c_str());
    if(!superName.empty())
        sprintf(metaSuperClassName, "Meta%s", superName.c_str());
    else
        sprintf(metaSuperClassName, "Class");

    metaObj = createRawClass(metaClassName, "Class", metaSuperClassName);
    classObj = createRawClass(className.c_str(), metaClassName, superName.c_str());
    classObj->_class = metaObj;

    // Get the current class size, we'll build on this as 
    // we add instance variables.
    size = getInteger(classObj->basicAt(sizeInClass));

    if (ll.currentToken() == nameconst) 
    {     /* read instance var names */
        instanceTop = 0;
        while (ll.currentToken() == nameconst) 
        {
            instanceVariables[instanceTop++] = createSymbol(ll.strToken().c_str());
            size++;
            ll.nextToken();
        }
        vars = newArray(instanceTop);
        for (i = 0; i < instanceTop; i++) 
        {
            vars->basicAtPut(i+1, instanceVariables[i]);
        }
        classObj->basicAtPut(variablesInClass, vars);
    }
    classObj->basicAtPut(sizeInClass, newInteger(size));
    classObj->basicAtPut(methodsInClass, newDictionary(39));
}
开发者ID:pgregory,项目名称:tumbleweed,代码行数:56,代码来源:filein.cpp


示例18: getData

/*!
 * \brief vacomponent::vacomponent
 * \param filename File (JSON) containing the symbol paintins and properties.
 */
vacomponent::vacomponent(QString filename)
{
  QString data = getData(filename);

  /// \todo check if JSON is error free
  /// \todo Need to destroy engine?
  QScriptEngine engine;
  QScriptValue vadata = engine.evaluate("(" + data + ")");

  Description = getString(vadata, "description");

  QScriptValue entries = vadata.property("property");

  QScriptValueIterator it(entries);

  while (it.hasNext()) {
    it.next();

    QScriptValue entry = it.value();

    // skip length named iterate
    if (it.name().compare("length")) {
      QString name = getString(entry, "name");
      QString value = getString(entry, "value");
      QString display = getString(entry, "display");
      QString desc = getString(entry, "desc");
      // QString unit = getString(entry, "unit");

      /// \todo append units to description

      bool show;
      if (!display.compare("false"))
        show = false;
      else
        show = true;

      /// \todo what if there are no properties?

      Props.append (new Property (name, value, show, desc));
    }
  }

  createSymbol(filename);

  Model = getString(vadata, "Model");
  Name  = getString(vadata, "SymName");

  /// TODO adjust location of text
  tx = x1+100;
  ty = y1+20;
}
开发者ID:Kevinaw,项目名称:simGUI,代码行数:55,代码来源:vacomponent.cpp


示例19: Property

logic_1::logic_1()
{
  Type = isComponent; // Analogue and digital component.
  Description = QObject::tr ("logic 1 verilog device");

 Props.append (new Property ("LEVEL", "1", false,
    QObject::tr ("logic 1 voltage level")
    +" ("+QObject::tr ("V")+")"));
  createSymbol ();
  tx = x1 + 4;
  ty = y2 + 4;
  Model = "logic_1";
  Name  = "S";
}
开发者ID:FoxMarts,项目名称:qucs,代码行数:14,代码来源:logic_1.cpp


示例20: Property

pad3bit::pad3bit()
{
  Type = isComponent; // Analogue and digital component.
  Description = QObject::tr ("3bit pattern generator verilog device");

  Props.append (new Property ("Number", "0", false,
    QObject::tr ("pad output value")));
 
  createSymbol ();
  tx = x1 + 4;
  ty = y2 + 4;
  Model = "pad3bit";
  Name  = "Y";
}
开发者ID:MikeBrinson,项目名称:qucs,代码行数:14,代码来源:pad3bit.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ createSyntaxError函数代码示例发布时间:2022-05-30
下一篇:
C++ createSurface函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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