当前位置: 首页>>代码示例>>C++>>正文


C++ ExprNode::compile方法代码示例

本文整理汇总了C++中ExprNode::compile方法的典型用法代码示例。如果您正苦于以下问题:C++ ExprNode::compile方法的具体用法?C++ ExprNode::compile怎么用?C++ ExprNode::compile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ExprNode的用法示例。


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

示例1: compileSubObject

U32 ObjectDeclNode::compileSubObject(U32 *codeStream, U32 ip, bool root)
{
   U32 start = ip;
   codeStream[ip++] = OP_PUSH_FRAME;
   ip = classNameExpr->compile(codeStream, ip, TypeReqString);
   codeStream[ip++] = OP_PUSH;

   ip = objectNameExpr->compile(codeStream, ip, TypeReqString);
   codeStream[ip++] = OP_PUSH;
   for(ExprNode *exprWalk = argList; exprWalk; exprWalk = (ExprNode *) exprWalk->getNext())
   {
      ip = exprWalk->compile(codeStream, ip, TypeReqString);
      codeStream[ip++] = OP_PUSH;
   }
   codeStream[ip++] = OP_CREATE_OBJECT;
   codeStream[ip] = STEtoU32(parentObject, ip);
   ip++;
   codeStream[ip++] = isDatablock;
   codeStream[ip++] = isClassNameInternal;
   codeStream[ip++] = isSingleton;
   codeStream[ip++] = dbgLineNumber;
   codeStream[ip++] = start + failOffset;
   for(SlotAssignNode *slotWalk = slotDecls; slotWalk; slotWalk = (SlotAssignNode *) slotWalk->getNext())
      ip = slotWalk->compile(codeStream, ip, TypeReqNone);
   codeStream[ip++] = OP_ADD_OBJECT;
   codeStream[ip++] = root;
   for(ObjectDeclNode *objectWalk = subObjects; objectWalk; objectWalk = (ObjectDeclNode *) objectWalk->getNext())
      ip = objectWalk->compileSubObject(codeStream, ip, false);
   codeStream[ip++] = OP_END_OBJECT;
   codeStream[ip++] = root || isDatablock;
   // Added to fix the object creation issue [7/9/2007 Black]
   codeStream[ip++] = OP_FINISH_OBJECT;
   return ip;
}
开发者ID:campadrenalin,项目名称:terminal-overload,代码行数:34,代码来源:astNodes.cpp

示例2: compile

U32 FuncCallExprNode::compile(U32 *codeStream, U32 ip, TypeReq type)
{
   codeStream[ip++] = OP_PUSH_FRAME;
   for(ExprNode *walk = args; walk; walk = (ExprNode *) walk->getNext())
   {
      ip = walk->compile(codeStream, ip, TypeReqString);
      codeStream[ip++] = OP_PUSH;
   }
   if(callType == MethodCall || callType == ParentCall)
      codeStream[ip++] = OP_CALLFUNC;
   else
      codeStream[ip++] = OP_CALLFUNC_RESOLVE;

   codeStream[ip] = STEtoU32(funcName, ip);
   ip++;
   codeStream[ip] = STEtoU32(nameSpace, ip);
   ip++;
   codeStream[ip++] = callType;
   if(type != TypeReqString)
      codeStream[ip++] = conversionOp(TypeReqString, type);
   return ip;
}
开发者ID:campadrenalin,项目名称:terminal-overload,代码行数:22,代码来源:astNodes.cpp


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