本文整理汇总了C++中HB_COMP_EXPR_NEW函数的典型用法代码示例。如果您正苦于以下问题:C++ HB_COMP_EXPR_NEW函数的具体用法?C++ HB_COMP_EXPR_NEW怎么用?C++ HB_COMP_EXPR_NEW使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了HB_COMP_EXPR_NEW函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: hb_compExprNewHash
/* Creates a new literal hash { key1=>val1, key2=>val2, ... keyN=>valN }
* 'pHashList' is a list of hash items
*/
PHB_EXPR hb_compExprNewHash( PHB_EXPR pHashList, HB_COMP_DECL )
{
PHB_EXPR pExpr;
HB_TRACE( HB_TR_DEBUG, ( "hb_compExprNewHash()" ) );
if( pHashList )
pHashList->ExprType = HB_ET_HASH; /* change type from ET_LIST */
else
{
pHashList = HB_COMP_EXPR_NEW( HB_ET_HASH );
pHashList->value.asList.pExprList = NULL;
}
pHashList->ValType = HB_EV_HASH;
pHashList->nLength = 0;
pHashList->value.asList.reference = HB_FALSE;
pHashList->value.asList.pIndex = NULL;
/*
* replace all EO_NONE expressions with ET_NIL expressions and
* calculate the list length
*/
pExpr = pHashList->value.asList.pExprList;
while( pExpr )
{
if( pExpr->ExprType == HB_ET_NONE )
pExpr->ExprType = HB_ET_NIL;
pExpr = pExpr->pNext;
++pHashList->nLength;
}
return pHashList;
}
开发者ID:jlsiug,项目名称:harbour-core,代码行数:36,代码来源:expropt1.c
示例2: hb_compExprNewMacroSend
/* Creates new macro send expression
* : &<msg> -> ( expression )
*/
PHB_EXPR hb_compExprNewMacroSend( PHB_EXPR pMessage, HB_COMP_DECL )
{
PHB_EXPR pExpr;
HB_TRACE( HB_TR_DEBUG, ( "hb_compExprNewMacroSend(%p,%p)", pMessage, HB_COMP_PARAM ) );
pExpr = HB_COMP_EXPR_NEW( HB_ET_SEND );
pExpr->value.asMessage.pObject = NULL;
pExpr->value.asMessage.pParms = NULL;
pExpr->value.asMessage.szMessage = NULL;
pExpr->value.asMessage.pMessage = pMessage;
pExpr->nLength = 0;
if( pMessage->ExprType == HB_ET_MACRO )
{
/* Signal that macro compiler have to generate a pcode that will
* return function name as symbol instead of usual value
*/
pMessage->value.asMacro.SubType = HB_ET_MACRO_SYMBOL;
}
return pExpr;
}
开发者ID:jlsiug,项目名称:harbour-core,代码行数:28,代码来源:expropt1.c
示例3: hb_compExprNewEqual
PHB_EXPR hb_compExprNewEqual( PHB_EXPR pLeftExpr, HB_COMP_DECL )
{
PHB_EXPR pExpr = HB_COMP_EXPR_NEW( HB_EO_EQUAL );
pExpr->value.asOperator.pLeft = pLeftExpr;
pExpr->value.asOperator.pRight = NULL;
return pExpr;
}
开发者ID:jlsiug,项目名称:harbour-core,代码行数:8,代码来源:expropt1.c
示例4: hb_compExprNewPreDec
PHB_EXPR hb_compExprNewPreDec( PHB_EXPR pLeftExpr, HB_COMP_DECL )
{
PHB_EXPR pExpr = HB_COMP_EXPR_NEW( HB_EO_PREDEC );
pExpr->value.asOperator.pLeft = pLeftExpr;
pExpr->value.asOperator.pRight = NULL;
return pExpr;
}
开发者ID:jlsiug,项目名称:harbour-core,代码行数:8,代码来源:expropt1.c
示例5: hb_compExprNewMultEq
PHB_EXPR hb_compExprNewMultEq( PHB_EXPR pLeftExpr, HB_COMP_DECL )
{
PHB_EXPR pExpr = HB_COMP_EXPR_NEW( HB_EO_MULTEQ );
pExpr->value.asOperator.pLeft = pLeftExpr;
pExpr->value.asOperator.pRight = NULL;
return pExpr;
}
开发者ID:jlsiug,项目名称:harbour-core,代码行数:8,代码来源:expropt1.c
示例6: hb_compExprNewAlias
/* Create a new symbol used in an alias expressions
*/
PHB_EXPR hb_compExprNewAlias( const char * szName, HB_COMP_DECL )
{
PHB_EXPR pExpr;
HB_TRACE( HB_TR_DEBUG, ( "hb_compExprNewAlias(%s,%p)", szName, HB_COMP_PARAM ) );
pExpr = HB_COMP_EXPR_NEW( HB_ET_ALIAS );
pExpr->value.asSymbol.name = szName;
return pExpr;
}
开发者ID:jlsiug,项目名称:harbour-core,代码行数:12,代码来源:expropt1.c
示例7: hb_compExprNewVar
PHB_EXPR hb_compExprNewVar( const char * szName, HB_COMP_DECL )
{
PHB_EXPR pExpr;
HB_TRACE( HB_TR_DEBUG, ( "hb_compExprNewVar(%s,%p)", szName, ( void * ) HB_COMP_PARAM ) );
pExpr = HB_COMP_EXPR_NEW( HB_ET_VARIABLE );
pExpr->value.asSymbol.name = szName;
return pExpr;
}
开发者ID:alcz,项目名称:harbour,代码行数:10,代码来源:expropt1.c
示例8: hb_compExprNewSelf
PHB_EXPR hb_compExprNewSelf( HB_COMP_DECL )
{
PHB_EXPR pExpr;
HB_TRACE( HB_TR_DEBUG, ( "hb_compExprNewSelf(%p)", HB_COMP_PARAM ) );
pExpr = HB_COMP_EXPR_NEW( HB_ET_SELF );
pExpr->ValType = HB_EV_OBJECT;
return pExpr;
}
开发者ID:jlsiug,项目名称:harbour-core,代码行数:11,代码来源:expropt1.c
示例9: hb_compExprNewArgList
/* Creates a list of function call arguments
*/
PHB_EXPR hb_compExprNewArgList( PHB_EXPR pFirstItem, HB_COMP_DECL )
{
PHB_EXPR pExpr;
HB_TRACE( HB_TR_DEBUG, ( "hb_compExprNewArgList()" ) );
pExpr = HB_COMP_EXPR_NEW( HB_ET_ARGLIST );
pExpr->value.asList.pExprList = pFirstItem;
pExpr->value.asList.reference = HB_FALSE;
return pExpr;
}
开发者ID:jlsiug,项目名称:harbour-core,代码行数:13,代码来源:expropt1.c
示例10: hb_compExprNewArgRef
/* Creates a reference to variable arguments
*/
PHB_EXPR hb_compExprNewArgRef( HB_COMP_DECL )
{
PHB_EXPR pExpr;
HB_TRACE( HB_TR_DEBUG, ( "hb_compExprNewArgRef()" ) );
pExpr = HB_COMP_EXPR_NEW( HB_ET_ARGLIST );
pExpr->value.asList.pExprList = NULL;
pExpr->value.asList.reference = HB_TRUE;
return pExpr;
}
开发者ID:jlsiug,项目名称:harbour-core,代码行数:13,代码来源:expropt1.c
示例11: hb_compExprNewNil
PHB_EXPR hb_compExprNewNil( HB_COMP_DECL )
{
PHB_EXPR pExpr;
HB_TRACE( HB_TR_DEBUG, ( "hb_compExprNewNil(%p)", HB_COMP_PARAM ) );
pExpr = HB_COMP_EXPR_NEW( HB_ET_NIL );
pExpr->ValType = HB_EV_NIL;
return pExpr;
}
开发者ID:jlsiug,项目名称:harbour-core,代码行数:11,代码来源:expropt1.c
示例12: hb_compExprNewRef
PHB_EXPR hb_compExprNewRef( PHB_EXPR pRefer, HB_COMP_DECL )
{
PHB_EXPR pExpr;
HB_TRACE( HB_TR_DEBUG, ( "hb_compExprNewRef(%p,%p)", pRefer, HB_COMP_PARAM ) );
pExpr = HB_COMP_EXPR_NEW( HB_ET_REFERENCE );
pExpr->value.asReference = pRefer;
pExpr->ValType = HB_EV_VARREF;
return pExpr;
}
开发者ID:jlsiug,项目名称:harbour-core,代码行数:12,代码来源:expropt1.c
示例13: hb_compExprNewVarRef
PHB_EXPR hb_compExprNewVarRef( const char * szVarName, HB_COMP_DECL )
{
PHB_EXPR pExpr;
HB_TRACE( HB_TR_DEBUG, ( "hb_compExprNewVarRef(%s,%p)", szVarName, HB_COMP_PARAM ) );
pExpr = HB_COMP_EXPR_NEW( HB_ET_VARREF );
pExpr->value.asSymbol.name = szVarName;
pExpr->ValType = HB_EV_VARREF;
return pExpr;
}
开发者ID:jlsiug,项目名称:harbour-core,代码行数:12,代码来源:expropt1.c
示例14: hb_compExprNewFunName
/* Create a new symbol used in function calls
*/
PHB_EXPR hb_compExprNewFunName( const char * szName, HB_COMP_DECL )
{
PHB_EXPR pExpr;
HB_TRACE( HB_TR_DEBUG, ( "hb_compExprNewFunName(%s,%p)", szName, HB_COMP_PARAM ) );
pExpr = HB_COMP_EXPR_NEW( HB_ET_FUNNAME );
pExpr->value.asSymbol.name = hb_compGetFuncID( szName,
&pExpr->value.asSymbol.funcid,
&pExpr->value.asSymbol.flags );
return pExpr;
}
开发者ID:jlsiug,项目名称:harbour-core,代码行数:14,代码来源:expropt1.c
示例15: hb_compExprAssign
/* Handles (expression := expression) syntax
*/
PHB_EXPR hb_compExprAssign( PHB_EXPR pLeftExpr, PHB_EXPR pRightExpr,
HB_COMP_DECL )
{
PHB_EXPR pExpr;
HB_TRACE( HB_TR_DEBUG, ( "hb_compExprAssign()" ) );
pExpr = HB_COMP_EXPR_NEW( HB_EO_ASSIGN );
pExpr->value.asOperator.pLeft = pLeftExpr;
pExpr->value.asOperator.pRight = pRightExpr;
return pExpr;
}
开发者ID:jlsiug,项目名称:harbour-core,代码行数:14,代码来源:expropt1.c
示例16: hb_compExprNewLogical
PHB_EXPR hb_compExprNewLogical( int iValue, HB_COMP_DECL )
{
PHB_EXPR pExpr;
HB_TRACE( HB_TR_DEBUG, ( "hb_compExprNewLogical(%i,%p)", iValue, HB_COMP_PARAM ) );
pExpr = HB_COMP_EXPR_NEW( HB_ET_LOGICAL );
pExpr->value.asLogical = iValue;
pExpr->ValType = HB_EV_LOGICAL;
return pExpr;
}
开发者ID:jlsiug,项目名称:harbour-core,代码行数:13,代码来源:expropt1.c
示例17: hb_compExprSetGetBlock
/* Creates a set/get codeblock for passed expression used in __GET
*
* {| ~1 | iif( ~1 == NIL, <pExpr>, <pExpr> := ~1 ) }
*
* NOTE: "~1" is not a valid variable name so there will be no collisions
*/
PHB_EXPR hb_compExprSetGetBlock( PHB_EXPR pExpr, HB_COMP_DECL )
{
PHB_EXPR pSet;
/* create setget expression: IIF( var==NIL, <pExpr>, <pExpr>:=var ) */
pSet = HB_COMP_EXPR_NEW( HB_ET_SETGET );
pSet->value.asSetGet.pVar = hb_compExprNewVar( "~1", HB_COMP_PARAM );
pSet->value.asSetGet.pExpr = pExpr;
/* create a codeblock */
return hb_compExprAddCodeblockExpr( hb_compExprCBVarAdd(
hb_compExprNewCodeBlock( NULL, 0, 0, HB_COMP_PARAM ),
"~1", ' ', HB_COMP_PARAM ), pSet );
}
开发者ID:jlsiug,项目名称:harbour-core,代码行数:19,代码来源:expropt1.c
示例18: hb_compExprNewTimeStamp
PHB_EXPR hb_compExprNewTimeStamp( long lDate, long lTime, HB_COMP_DECL )
{
PHB_EXPR pExpr;
HB_TRACE( HB_TR_DEBUG, ( "hb_compExprNewTimeStamp(%ld, %ld, %p)", lDate, lTime, HB_COMP_PARAM ) );
pExpr = HB_COMP_EXPR_NEW( HB_ET_TIMESTAMP );
pExpr->value.asDate.lDate = lDate;
pExpr->value.asDate.lTime = lTime;
pExpr->ValType = HB_EV_TIMESTAMP;
return pExpr;
}
开发者ID:jlsiug,项目名称:harbour-core,代码行数:14,代码来源:expropt1.c
示例19: hb_compExprNewFunRef
PHB_EXPR hb_compExprNewFunRef( const char * szFunName, HB_COMP_DECL )
{
PHB_EXPR pExpr;
HB_TRACE( HB_TR_DEBUG, ( "hb_compExprNewFunRef(%s,%p)", szFunName, ( void * ) HB_COMP_PARAM ) );
pExpr = HB_COMP_EXPR_NEW( HB_ET_FUNREF );
pExpr->value.asSymbol.name = hb_compGetFuncID( szFunName,
&pExpr->value.asSymbol.funcid,
&pExpr->value.asSymbol.flags );
pExpr->ValType = HB_EV_FUNREF;
return pExpr;
}
开发者ID:alcz,项目名称:harbour,代码行数:14,代码来源:expropt1.c
示例20: hb_compExprAssignStatic
/* It initializes static variable.
* It is called in the following context:
* STATIC sVar := expression
*
* pLeftExpr - is a variable name
* pRightExpr - can be an expression of any type
*/
PHB_EXPR hb_compExprAssignStatic( PHB_EXPR pLeftExpr, PHB_EXPR pRightExpr, HB_COMP_DECL )
{
PHB_EXPR pExpr;
HB_TRACE( HB_TR_DEBUG, ( "hb_compExprAssignStatic()" ) );
pExpr = HB_COMP_EXPR_NEW( HB_EO_ASSIGN );
pExpr->value.asOperator.pLeft = pLeftExpr;
/* Try to reduce the assigned value */
pRightExpr = HB_EXPR_USE( pRightExpr, HB_EA_REDUCE );
/* When -kc switch is used expression list is not stripped
* in reduce operation
*/
if( ! HB_SUPPORT_HARBOUR )
pRightExpr = hb_compExprListStrip( pRightExpr, HB_COMP_PARAM );
pExpr->value.asOperator.pRight = pRightExpr;
if( pRightExpr->ExprType == HB_ET_ARGLIST )
{
/* HB_ET_ARGLIST is used in case of STATIC var[dim1, dim2, dimN]
* was used - we have to check if all array dimensions are
* constant values
*/
hb_compExprCheckStaticListInitializers( pLeftExpr, pRightExpr, HB_COMP_PARAM );
}
else if( pRightExpr->ExprType == HB_ET_ARRAY )
{
/* { elem1, elem2, elemN } was used as initializer
* Scan an array for illegal initializers.
* An array item have to be a const value too.
*/
hb_compExprCheckStaticListInitializers( pLeftExpr, pRightExpr, HB_COMP_PARAM );
}
else if( pRightExpr->ExprType == HB_ET_HASH )
{
/* { idx1=>var1, idx2=>var2, idxN=>varN } was used as initializer
* Scan a hash array for illegal initializers.
* A hash item have to be a const value too.
*/
hb_compExprCheckStaticListInitializers( pLeftExpr, pRightExpr, HB_COMP_PARAM );
}
else
{
hb_compExprCheckStaticInitializer( pLeftExpr, pRightExpr, HB_COMP_PARAM );
}
return pExpr;
}
开发者ID:jlsiug,项目名称:harbour-core,代码行数:57,代码来源:hbexpra.c
注:本文中的HB_COMP_EXPR_NEW函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论