From 5a6a65ef2cc49e29e217650cbcbc6f44912fd65b Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Mon, 24 Aug 2009 12:50:42 +0000 Subject: [PATCH] 2009-08-24 14:50 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/include/hbmacro.h * harbour/source/macro/macro.yyc * harbour/source/macro/macro.y * hb_macroIdentNew() made public * harbour/include/hbexprb.c ! use hb_macroIdentNew() instead of hb_compIdentifierNew() in code compiled for macrocompiler --- harbour/ChangeLog | 10 + harbour/include/hbexprb.c | 7 + harbour/include/hbmacro.h | 1 + harbour/source/macro/macro.y | 6 +- harbour/source/macro/macro.yyc | 334 ++++++++++++++++----------------- 5 files changed, 188 insertions(+), 170 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index c64555e08d..8becab63ee 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,16 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-08-24 14:50 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/include/hbmacro.h + * harbour/source/macro/macro.yyc + * harbour/source/macro/macro.y + * hb_macroIdentNew() made public + + * harbour/include/hbexprb.c + ! use hb_macroIdentNew() instead of hb_compIdentifierNew() + in code compiled for macrocompiler + 2009-08-24 14:46 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) - config/os2echo.exe * config/globsh.mk diff --git a/harbour/include/hbexprb.c b/harbour/include/hbexprb.c index 3c95c32549..bf0f182821 100644 --- a/harbour/include/hbexprb.c +++ b/harbour/include/hbexprb.c @@ -5324,10 +5324,17 @@ static HB_EXPR_PTR hb_compExprReduceAliasString( HB_EXPR_PTR pExpr, HB_EXPR_PTR } if( ulLen == 0 ) { +#if defined( HB_MACRO_SUPPORT ) + if( fLower ) + szAlias = hb_macroIdentNew( HB_COMP_PARAM, hb_strupr( hb_strdup( szAlias ) ) ); + else if( pAlias->value.asString.dealloc ) + szAlias = hb_macroIdentNew( HB_COMP_PARAM, hb_strdup( szAlias ) ); +#else if( fLower ) szAlias = hb_compIdentifierNew( HB_COMP_PARAM, hb_strupr( hb_strdup( szAlias ) ), HB_IDENT_FREE ); else if( pAlias->value.asString.dealloc ) szAlias = hb_compIdentifierNew( HB_COMP_PARAM, szAlias, HB_IDENT_COPY ); +#endif HB_COMP_EXPR_DELETE( pExpr ); pExpr = hb_compExprNewAlias( szAlias, HB_COMP_PARAM ); } diff --git a/harbour/include/hbmacro.h b/harbour/include/hbmacro.h index 2b99c4ed02..3b1e637bb6 100644 --- a/harbour/include/hbmacro.h +++ b/harbour/include/hbmacro.h @@ -102,6 +102,7 @@ extern ULONG hb_macroSetMacro( BOOL bSet, ULONG ulFlag ); extern ULONG hb_macroAutoSetMacro( ULONG ulFlag ); extern BOOL hb_macroLexNew( HB_MACRO_PTR pMacro ); extern void hb_macroLexDelete( HB_MACRO_PTR pMacro ); +extern char * hb_macroIdentNew( HB_COMP_DECL, char * ); extern HB_EXPR_PTR hb_macroExprGenPush( HB_EXPR_PTR, HB_COMP_DECL ); extern HB_EXPR_PTR hb_macroExprGenPop( HB_EXPR_PTR, HB_COMP_DECL ); diff --git a/harbour/source/macro/macro.y b/harbour/source/macro/macro.y index 4513f6e2da..a9448f91ac 100644 --- a/harbour/source/macro/macro.y +++ b/harbour/source/macro/macro.y @@ -173,8 +173,6 @@ extern int yylex( YYSTYPE *, HB_MACRO_PTR ); /* main lex token function, call extern int yyparse( HB_MACRO_PTR ); /* main yacc parsing function */ extern void yyerror( HB_MACRO_PTR, const char * ); /* parsing error management function */ -static void hb_macroIdentNew( HB_COMP_DECL, char * ); - %} %token IDENTIFIER NIL NUM_DOUBLE INASSIGN NUM_LONG NUM_DATE TIMESTAMP @@ -757,12 +755,14 @@ static HB_EXPR_PTR hb_macroExprAlloc( HB_COMP_DECL ) return &pMExpr->Expressions[ pMExpr->count++ ]; } -static void hb_macroIdentNew( HB_COMP_DECL, char * szIdent ) +char * hb_macroIdentNew( HB_COMP_DECL, char * szIdent ) { HB_MIDENT_PTR pMIdent = ( HB_MIDENT_PTR ) hb_xgrab( sizeof( HB_MIDENT ) ); pMIdent->Identifier = szIdent; pMIdent->pPrev = ( HB_MIDENT_PTR ) HB_MACRO_DATA->pIdentLst; HB_MACRO_DATA->pIdentLst = ( void * ) pMIdent; + + return szIdent; } static HB_EXPR_PTR hb_macroExprNew( HB_COMP_DECL, HB_EXPRTYPE iType ) diff --git a/harbour/source/macro/macro.yyc b/harbour/source/macro/macro.yyc index c4426b5062..b6729e66bb 100644 --- a/harbour/source/macro/macro.yyc +++ b/harbour/source/macro/macro.yyc @@ -360,12 +360,10 @@ extern int yylex( YYSTYPE *, HB_MACRO_PTR ); /* main lex token function, call extern int yyparse( HB_MACRO_PTR ); /* main yacc parsing function */ extern void yyerror( HB_MACRO_PTR, const char * ); /* parsing error management function */ -static void hb_macroIdentNew( HB_COMP_DECL, char * ); - /* Line 216 of yacc.c. */ -#line 369 "macroy.c" +#line 367 "macroy.c" #ifdef short # undef short @@ -728,27 +726,27 @@ static const yytype_int16 yyrhs[] = /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 253, 253, 263, 271, 280, 281, 284, 287, 290, - 295, 300, 305, 306, 311, 316, 321, 326, 327, 330, - 331, 337, 340, 345, 348, 367, 372, 375, 382, 383, - 388, 389, 390, 391, 392, 395, 396, 399, 400, 401, - 402, 403, 404, 405, 414, 415, 416, 417, 418, 423, - 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 446, 449, - 454, 464, 465, 468, 469, 472, 473, 474, 475, 476, - 479, 480, 485, 486, 487, 492, 496, 497, 498, 499, - 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, - 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, - 520, 521, 522, 523, 524, 525, 528, 529, 532, 533, - 536, 536, 550, 551, 555, 556, 559, 560, 561, 562, - 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 577, 578, 579, 580, 586, 587, - 593, 596, 597, 600, 601, 602, 605, 608, 611, 614, - 617, 620, 623, 626, 627, 628, 629, 630, 631, 634, - 635, 636, 637, 638, 639, 642, 643, 646, 647, 648, - 649, 650, 651, 652, 653, 654, 657, 663, 664, 665, - 668, 669, 673, 672, 680, 681, 686, 687, 688, 689, - 692, 693, 696, 697, 700, 703, 707 + 0, 251, 251, 261, 269, 278, 279, 282, 285, 288, + 293, 298, 303, 304, 309, 314, 319, 324, 325, 328, + 329, 335, 338, 343, 346, 365, 370, 373, 380, 381, + 386, 387, 388, 389, 390, 393, 394, 397, 398, 399, + 400, 401, 402, 403, 412, 413, 414, 415, 416, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, + 432, 433, 434, 435, 436, 437, 438, 439, 444, 447, + 452, 462, 463, 466, 467, 470, 471, 472, 473, 474, + 477, 478, 483, 484, 485, 490, 494, 495, 496, 497, + 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, + 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 520, 521, 522, 523, 526, 527, 530, 531, + 534, 534, 548, 549, 553, 554, 557, 558, 559, 560, + 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, + 571, 572, 573, 574, 575, 576, 577, 578, 584, 585, + 591, 594, 595, 598, 599, 600, 603, 606, 609, 612, + 615, 618, 621, 624, 625, 626, 627, 628, 629, 632, + 633, 634, 635, 636, 637, 640, 641, 644, 645, 646, + 647, 648, 649, 650, 651, 652, 655, 661, 662, 663, + 666, 667, 671, 670, 678, 679, 684, 685, 686, 687, + 690, 691, 694, 695, 698, 701, 705 }; #endif @@ -2065,7 +2063,7 @@ yyreduce: switch (yyn) { case 2: -#line 253 "macro.y" +#line 251 "macro.y" { HB_MACRO_DATA->exprType = hb_compExprType( (yyvsp[(1) - (1)].asExpr) ); if( HB_MACRO_DATA->Flags & HB_MACRO_GEN_REFER ) @@ -2079,7 +2077,7 @@ yyreduce: break; case 3: -#line 263 "macro.y" +#line 261 "macro.y" { HB_MACRO_DATA->exprType = hb_compExprType( (yyvsp[(1) - (1)].asExpr) ); if( HB_MACRO_DATA->Flags & HB_MACRO_GEN_PUSH ) @@ -2091,7 +2089,7 @@ yyreduce: break; case 4: -#line 271 "macro.y" +#line 269 "macro.y" { HB_TRACE(HB_TR_DEBUG, ("macro -> invalid syntax: %s", HB_MACRO_DATA->string)); hb_macroError( EG_SYNTAX, HB_COMP_PARAM ); @@ -2100,104 +2098,104 @@ yyreduce: break; case 5: -#line 280 "macro.y" +#line 278 "macro.y" { (yyval.asExpr) = hb_compExprNewDouble( (yyvsp[(1) - (1)].valDouble).dNumber, (yyvsp[(1) - (1)].valDouble).bWidth, (yyvsp[(1) - (1)].valDouble).bDec, HB_COMP_PARAM ); ;} break; case 6: -#line 281 "macro.y" +#line 279 "macro.y" { (yyval.asExpr) = hb_compExprNewLong( (yyvsp[(1) - (1)].valLong).lNumber, HB_COMP_PARAM ); ;} break; case 7: -#line 284 "macro.y" +#line 282 "macro.y" { (yyval.asExpr) = hb_compExprNewDate( (yyvsp[(1) - (1)].valLong).lNumber, HB_COMP_PARAM ); ;} break; case 8: -#line 287 "macro.y" +#line 285 "macro.y" { (yyval.asExpr) = hb_compExprNewTimeStamp( (yyvsp[(1) - (1)].valTimeStamp).date, (yyvsp[(1) - (1)].valTimeStamp).time, HB_COMP_PARAM ); ;} break; case 9: -#line 290 "macro.y" +#line 288 "macro.y" { (yyval.asExpr) = hb_compExprNewLong( (yyvsp[(1) - (2)].valLong).lNumber, HB_COMP_PARAM ); ;} break; case 10: -#line 295 "macro.y" +#line 293 "macro.y" { (yyval.asExpr) = hb_compExprNewNil( HB_COMP_PARAM ); ;} break; case 11: -#line 300 "macro.y" +#line 298 "macro.y" { (yyval.asExpr) = hb_compExprNewString( (yyvsp[(1) - (1)].valChar).string, (yyvsp[(1) - (1)].valChar).length, FALSE, HB_COMP_PARAM ); ;} break; case 12: -#line 305 "macro.y" +#line 303 "macro.y" { (yyval.asExpr) = hb_compExprNewLogical( TRUE, HB_COMP_PARAM ); ;} break; case 13: -#line 306 "macro.y" +#line 304 "macro.y" { (yyval.asExpr) = hb_compExprNewLogical( FALSE, HB_COMP_PARAM ); ;} break; case 14: -#line 311 "macro.y" +#line 309 "macro.y" { (yyval.asExpr) = hb_compExprNewSelf( HB_COMP_PARAM ); ;} break; case 15: -#line 316 "macro.y" +#line 314 "macro.y" { (yyval.asExpr) = hb_compExprNewArray( (yyvsp[(2) - (3)].asExpr), HB_COMP_PARAM ); ;} break; case 16: -#line 321 "macro.y" +#line 319 "macro.y" { (yyval.asExpr) = (yyvsp[(2) - (2)].asExpr); ;} break; case 17: -#line 326 "macro.y" +#line 324 "macro.y" { (yyval.asExpr) = hb_compExprNewHash( NULL, HB_COMP_PARAM ); ;} break; case 18: -#line 327 "macro.y" +#line 325 "macro.y" { (yyval.asExpr) = hb_compExprNewHash( (yyvsp[(2) - (3)].asExpr), HB_COMP_PARAM ); ;} break; case 19: -#line 330 "macro.y" +#line 328 "macro.y" { (yyval.asExpr) = hb_compExprAddListExpr( hb_compExprNewList( (yyvsp[(1) - (3)].asExpr), HB_COMP_PARAM ), (yyvsp[(3) - (3)].asExpr) ); ;} break; case 20: -#line 331 "macro.y" +#line 329 "macro.y" { (yyval.asExpr) = hb_compExprAddListExpr( hb_compExprAddListExpr( (yyvsp[(1) - (5)].asExpr), (yyvsp[(3) - (5)].asExpr) ), (yyvsp[(5) - (5)].asExpr) ); ;} break; case 21: -#line 337 "macro.y" +#line 335 "macro.y" { (yyval.asExpr) = hb_compExprNewVar( (yyvsp[(1) - (1)].string), HB_COMP_PARAM ); ;} break; case 22: -#line 340 "macro.y" +#line 338 "macro.y" { (yyval.asExpr) = hb_compExprNewAlias( (yyvsp[(1) - (2)].string), HB_COMP_PARAM ); ;} break; case 23: -#line 345 "macro.y" +#line 343 "macro.y" { (yyval.asExpr) = hb_compExprNewMacro( NULL, '&', (yyvsp[(1) - (1)].string), HB_COMP_PARAM ); HB_MACRO_CHECK( (yyval.asExpr) ); ;} break; case 24: -#line 348 "macro.y" +#line 346 "macro.y" { BOOL fNewString; char * szVarName = hb_macroTextSymbol( (yyvsp[(1) - (1)].string), strlen( (yyvsp[(1) - (1)].string) ), &fNewString ); if( szVarName ) @@ -2218,226 +2216,226 @@ yyreduce: break; case 25: -#line 367 "macro.y" +#line 365 "macro.y" { hb_compExprMacroAsAlias( (yyvsp[(1) - (2)].asExpr) ); ;} break; case 26: -#line 372 "macro.y" +#line 370 "macro.y" { (yyval.asExpr) = hb_compExprNewMacro( (yyvsp[(2) - (2)].asExpr), 0, NULL, HB_COMP_PARAM ); ;} break; case 28: -#line 382 "macro.y" +#line 380 "macro.y" { (yyval.asExpr) = hb_compExprNewAlias( "FIELD", HB_COMP_PARAM ); ;} break; case 29: -#line 383 "macro.y" +#line 381 "macro.y" { (yyval.asExpr) = (yyvsp[(3) - (3)].asExpr); ;} break; case 30: -#line 388 "macro.y" +#line 386 "macro.y" { (yyval.asExpr) = (yyvsp[(2) - (2)].asExpr); ;} break; case 31: -#line 389 "macro.y" +#line 387 "macro.y" { (yyval.asExpr) = (yyvsp[(2) - (2)].asExpr); ;} break; case 32: -#line 390 "macro.y" +#line 388 "macro.y" { (yyval.asExpr) = (yyvsp[(2) - (2)].asExpr); ;} break; case 33: -#line 391 "macro.y" +#line 389 "macro.y" { (yyval.asExpr) = (yyvsp[(2) - (2)].asExpr); ;} break; case 34: -#line 392 "macro.y" +#line 390 "macro.y" { (yyval.asExpr) = (yyvsp[(2) - (2)].asExpr); ;} break; case 35: -#line 395 "macro.y" +#line 393 "macro.y" { (yyval.asExpr) = hb_compExprNewVar( (yyvsp[(1) - (1)].string), HB_COMP_PARAM ); ;} break; case 37: -#line 399 "macro.y" +#line 397 "macro.y" { (yyval.asExpr) = hb_compExprNewAliasVar( (yyvsp[(1) - (2)].asExpr), (yyvsp[(2) - (2)].asExpr), HB_COMP_PARAM ); ;} break; case 38: -#line 400 "macro.y" +#line 398 "macro.y" { (yyval.asExpr) = hb_compExprNewAliasVar( (yyvsp[(1) - (2)].asExpr), (yyvsp[(2) - (2)].asExpr), HB_COMP_PARAM ); ;} break; case 39: -#line 401 "macro.y" +#line 399 "macro.y" { (yyval.asExpr) = hb_compExprNewAliasVar( (yyvsp[(1) - (2)].asExpr), (yyvsp[(2) - (2)].asExpr), HB_COMP_PARAM ); ;} break; case 40: -#line 402 "macro.y" +#line 400 "macro.y" { (yyval.asExpr) = hb_compExprNewAliasVar( (yyvsp[(1) - (2)].asExpr), (yyvsp[(2) - (2)].asExpr), HB_COMP_PARAM ); ;} break; case 41: -#line 403 "macro.y" +#line 401 "macro.y" { (yyval.asExpr) = hb_compExprNewAliasVar( (yyvsp[(1) - (2)].asExpr), (yyvsp[(2) - (2)].asExpr), HB_COMP_PARAM ); ;} break; case 42: -#line 404 "macro.y" +#line 402 "macro.y" { (yyval.asExpr) = hb_compExprNewAliasVar( (yyvsp[(1) - (2)].asExpr), (yyvsp[(2) - (2)].asExpr), HB_COMP_PARAM ); ;} break; case 43: -#line 405 "macro.y" +#line 403 "macro.y" { (yyval.asExpr) = hb_compExprNewAliasVar( (yyvsp[(1) - (2)].asExpr), (yyvsp[(2) - (2)].asExpr), HB_COMP_PARAM ); ;} break; case 44: -#line 414 "macro.y" +#line 412 "macro.y" { (yyval.asExpr) = hb_compExprNewAliasExpr( (yyvsp[(1) - (2)].asExpr), (yyvsp[(2) - (2)].asExpr), HB_COMP_PARAM ); ;} break; case 45: -#line 415 "macro.y" +#line 413 "macro.y" { (yyval.asExpr) = hb_compExprNewAliasExpr( (yyvsp[(1) - (2)].asExpr), (yyvsp[(2) - (2)].asExpr), HB_COMP_PARAM ); ;} break; case 46: -#line 416 "macro.y" +#line 414 "macro.y" { (yyval.asExpr) = hb_compExprNewAliasExpr( (yyvsp[(1) - (2)].asExpr), (yyvsp[(2) - (2)].asExpr), HB_COMP_PARAM ); ;} break; case 47: -#line 417 "macro.y" +#line 415 "macro.y" { (yyval.asExpr) = hb_compExprNewAliasExpr( (yyvsp[(1) - (2)].asExpr), (yyvsp[(2) - (2)].asExpr), HB_COMP_PARAM ); ;} break; case 48: -#line 418 "macro.y" +#line 416 "macro.y" { (yyval.asExpr) = hb_compExprNewAliasExpr( (yyvsp[(1) - (2)].asExpr), (yyvsp[(2) - (2)].asExpr), HB_COMP_PARAM ); ;} break; case 49: -#line 423 "macro.y" +#line 421 "macro.y" { (yyval.asExpr) = (yyvsp[(2) - (2)].asExpr); ;} break; case 50: -#line 424 "macro.y" +#line 422 "macro.y" { (yyval.asExpr) = (yyvsp[(2) - (2)].asExpr); ;} break; case 51: -#line 425 "macro.y" +#line 423 "macro.y" { (yyval.asExpr) = (yyvsp[(2) - (2)].asExpr); ;} break; case 52: -#line 426 "macro.y" +#line 424 "macro.y" { (yyval.asExpr) = (yyvsp[(2) - (2)].asExpr); ;} break; case 53: -#line 427 "macro.y" +#line 425 "macro.y" { (yyval.asExpr) = (yyvsp[(2) - (2)].asExpr); ;} break; case 54: -#line 428 "macro.y" +#line 426 "macro.y" { (yyval.asExpr) = (yyvsp[(2) - (2)].asExpr); ;} break; case 55: -#line 429 "macro.y" +#line 427 "macro.y" { (yyval.asExpr) = (yyvsp[(2) - (2)].asExpr); ;} break; case 56: -#line 430 "macro.y" +#line 428 "macro.y" { (yyval.asExpr) = (yyvsp[(2) - (2)].asExpr); ;} break; case 57: -#line 431 "macro.y" +#line 429 "macro.y" { (yyval.asExpr) = (yyvsp[(2) - (2)].asExpr); ;} break; case 58: -#line 432 "macro.y" +#line 430 "macro.y" { (yyval.asExpr) = (yyvsp[(2) - (2)].asExpr); ;} break; case 59: -#line 433 "macro.y" +#line 431 "macro.y" { (yyval.asExpr) = (yyvsp[(2) - (2)].asExpr); ;} break; case 60: -#line 434 "macro.y" +#line 432 "macro.y" { (yyval.asExpr) = (yyvsp[(2) - (2)].asExpr); ;} break; case 61: -#line 435 "macro.y" +#line 433 "macro.y" { (yyval.asExpr) = (yyvsp[(2) - (2)].asExpr); ;} break; case 62: -#line 436 "macro.y" +#line 434 "macro.y" { (yyval.asExpr) = (yyvsp[(2) - (2)].asExpr); ;} break; case 63: -#line 437 "macro.y" +#line 435 "macro.y" { (yyval.asExpr) = (yyvsp[(2) - (2)].asExpr); ;} break; case 64: -#line 438 "macro.y" +#line 436 "macro.y" { (yyval.asExpr) = (yyvsp[(2) - (2)].asExpr); ;} break; case 65: -#line 439 "macro.y" +#line 437 "macro.y" { (yyval.asExpr) = (yyvsp[(2) - (2)].asExpr); ;} break; case 66: -#line 440 "macro.y" +#line 438 "macro.y" { (yyval.asExpr) = (yyvsp[(2) - (2)].asExpr); ;} break; case 67: -#line 441 "macro.y" +#line 439 "macro.y" { (yyval.asExpr) = (yyvsp[(2) - (2)].asExpr); ;} break; case 68: -#line 446 "macro.y" +#line 444 "macro.y" { (yyval.asExpr) = hb_macroExprNewFunCall( hb_compExprNewFunName( (yyvsp[(1) - (4)].string), HB_COMP_PARAM ), (yyvsp[(3) - (4)].asExpr), HB_COMP_PARAM ); HB_MACRO_CHECK( (yyval.asExpr) ); ;} break; case 69: -#line 449 "macro.y" +#line 447 "macro.y" { (yyval.asExpr) = hb_macroExprNewFunCall( (yyvsp[(1) - (4)].asExpr), (yyvsp[(3) - (4)].asExpr), HB_COMP_PARAM ); HB_MACRO_CHECK( (yyval.asExpr) ); ;} break; case 70: -#line 454 "macro.y" +#line 452 "macro.y" { if( hb_compExprParamListLen( (yyvsp[(4) - (5)].asExpr) ) != 0 ) { hb_macroError( EG_SYNTAX, HB_COMP_PARAM ); @@ -2449,97 +2447,97 @@ yyreduce: break; case 71: -#line 464 "macro.y" +#line 462 "macro.y" { (yyval.asExpr) = hb_compExprNewArgList( (yyvsp[(1) - (1)].asExpr), HB_COMP_PARAM ); ;} break; case 72: -#line 465 "macro.y" +#line 463 "macro.y" { (yyval.asExpr) = hb_compExprAddListExpr( (yyvsp[(1) - (3)].asExpr), (yyvsp[(3) - (3)].asExpr) ); ;} break; case 75: -#line 472 "macro.y" +#line 470 "macro.y" { (yyval.asExpr) = hb_compExprNewVarRef( (yyvsp[(2) - (2)].string), HB_COMP_PARAM ); ;} break; case 76: -#line 473 "macro.y" +#line 471 "macro.y" { (yyval.asExpr) = hb_compExprNewRef( (yyvsp[(2) - (2)].asExpr), HB_COMP_PARAM ); ;} break; case 77: -#line 474 "macro.y" +#line 472 "macro.y" { (yyval.asExpr) = hb_compExprNewRef( (yyvsp[(2) - (2)].asExpr), HB_COMP_PARAM ); ;} break; case 78: -#line 475 "macro.y" +#line 473 "macro.y" { (yyval.asExpr) = hb_compExprNewRef( (yyvsp[(2) - (2)].asExpr), HB_COMP_PARAM ); ;} break; case 79: -#line 476 "macro.y" +#line 474 "macro.y" { (yyval.asExpr) = (yyvsp[(2) - (2)].asExpr); (yyval.asExpr)->value.asList.reference = TRUE; ;} break; case 80: -#line 479 "macro.y" +#line 477 "macro.y" { (yyval.asExpr) = hb_compExprNewArgRef( HB_COMP_PARAM ); ;} break; case 82: -#line 485 "macro.y" +#line 483 "macro.y" { (yyval.asExpr) = hb_macroExprNewSend( (yyvsp[(1) - (3)].asExpr), (yyvsp[(3) - (3)].string), NULL, HB_COMP_PARAM ); ;} break; case 83: -#line 486 "macro.y" +#line 484 "macro.y" { (yyval.asExpr) = hb_macroExprNewSend( (yyvsp[(1) - (3)].asExpr), NULL, (yyvsp[(3) - (3)].asExpr), HB_COMP_PARAM ); ;} break; case 84: -#line 487 "macro.y" +#line 485 "macro.y" { (yyval.asExpr) = hb_macroExprNewSend( (yyvsp[(1) - (3)].asExpr), NULL, (yyvsp[(3) - (3)].asExpr), HB_COMP_PARAM ); ;} break; case 85: -#line 492 "macro.y" +#line 490 "macro.y" { (yyval.asExpr) = hb_compExprNewMethodCall( (yyvsp[(1) - (4)].asExpr), (yyvsp[(3) - (4)].asExpr) ); ;} break; case 108: -#line 518 "macro.y" +#line 516 "macro.y" { HB_MACRO_IFENABLED( (yyval.asExpr), (yyvsp[(1) - (1)].asExpr), HB_SM_HARBOUR ); ;} break; case 109: -#line 519 "macro.y" +#line 517 "macro.y" { HB_MACRO_IFENABLED( (yyval.asExpr), (yyvsp[(1) - (1)].asExpr), HB_SM_HARBOUR ); ;} break; case 110: -#line 520 "macro.y" +#line 518 "macro.y" { HB_MACRO_IFENABLED( (yyval.asExpr), (yyvsp[(1) - (1)].asExpr), HB_SM_HARBOUR ); ;} break; case 116: -#line 528 "macro.y" +#line 526 "macro.y" { (yyval.asExpr) = (yyvsp[(1) - (1)].asExpr); HB_MACRO_CHECK( (yyval.asExpr) ); ;} break; case 117: -#line 529 "macro.y" +#line 527 "macro.y" { (yyval.asExpr) = (yyvsp[(1) - (1)].asExpr); HB_MACRO_CHECK( (yyval.asExpr) ); ;} break; case 118: -#line 532 "macro.y" +#line 530 "macro.y" { (yyval.asExpr) = hb_compExprNewArgRef( HB_COMP_PARAM ); ;} break; case 120: -#line 536 "macro.y" +#line 534 "macro.y" { if( !(HB_MACRO_DATA->Flags & HB_MACRO_GEN_LIST) ) { @@ -2551,7 +2549,7 @@ yyreduce: break; case 121: -#line 544 "macro.y" +#line 542 "macro.y" { HB_MACRO_DATA->uiListElements = 1; (yyval.asExpr) = hb_compExprAddListExpr( ( HB_MACRO_DATA->Flags & HB_MACRO_GEN_PARE ) ? hb_compExprNewList( (yyvsp[(1) - (4)].asExpr), HB_COMP_PARAM ) : hb_compExprNewArgList( (yyvsp[(1) - (4)].asExpr), HB_COMP_PARAM ), (yyvsp[(4) - (4)].asExpr) ); @@ -2559,274 +2557,274 @@ yyreduce: break; case 123: -#line 551 "macro.y" +#line 549 "macro.y" { HB_MACRO_DATA->uiListElements++; (yyval.asExpr) = hb_compExprAddListExpr( (yyvsp[(1) - (3)].asExpr), (yyvsp[(3) - (3)].asExpr) ); ;} break; case 124: -#line 555 "macro.y" +#line 553 "macro.y" { (yyval.asExpr) = hb_compExprNewEmpty( HB_COMP_PARAM ); ;} break; case 146: -#line 579 "macro.y" +#line 577 "macro.y" { HB_MACRO_IFENABLED( (yyval.asExpr), (yyvsp[(1) - (1)].asExpr), HB_SM_HARBOUR ); ;} break; case 148: -#line 586 "macro.y" +#line 584 "macro.y" { (yyval.asExpr) = hb_compExprNewPostInc( (yyvsp[(0) - (1)].asExpr), HB_COMP_PARAM ); ;} break; case 149: -#line 587 "macro.y" +#line 585 "macro.y" { (yyval.asExpr) = hb_compExprNewPostDec( (yyvsp[(0) - (1)].asExpr), HB_COMP_PARAM ); ;} break; case 150: -#line 593 "macro.y" +#line 591 "macro.y" { (yyval.asExpr) = (yyvsp[(2) - (2)].asExpr); ;} break; case 151: -#line 596 "macro.y" +#line 594 "macro.y" { (yyval.asExpr) = hb_compExprNewPreInc( (yyvsp[(2) - (2)].asExpr), HB_COMP_PARAM ); ;} break; case 152: -#line 597 "macro.y" +#line 595 "macro.y" { (yyval.asExpr) = hb_compExprNewPreDec( (yyvsp[(2) - (2)].asExpr), HB_COMP_PARAM ); ;} break; case 153: -#line 600 "macro.y" +#line 598 "macro.y" { (yyval.asExpr) = hb_compExprNewNot( (yyvsp[(2) - (2)].asExpr), HB_COMP_PARAM ); ;} break; case 154: -#line 601 "macro.y" +#line 599 "macro.y" { (yyval.asExpr) = hb_compExprNewNegate( (yyvsp[(2) - (2)].asExpr), HB_COMP_PARAM ); ;} break; case 155: -#line 602 "macro.y" +#line 600 "macro.y" { (yyval.asExpr) = (yyvsp[(2) - (2)].asExpr); ;} break; case 156: -#line 605 "macro.y" +#line 603 "macro.y" { (yyval.asExpr) = hb_compExprAssign( (yyvsp[(1) - (3)].asExpr), (yyvsp[(3) - (3)].asExpr), HB_COMP_PARAM ); ;} break; case 157: -#line 608 "macro.y" +#line 606 "macro.y" { (yyval.asExpr) = hb_compExprSetOperand( hb_compExprNewPlusEq( (yyvsp[(1) - (3)].asExpr), HB_COMP_PARAM ), (yyvsp[(3) - (3)].asExpr), HB_COMP_PARAM ); ;} break; case 158: -#line 611 "macro.y" +#line 609 "macro.y" { (yyval.asExpr) = hb_compExprSetOperand( hb_compExprNewMinusEq( (yyvsp[(1) - (3)].asExpr), HB_COMP_PARAM ), (yyvsp[(3) - (3)].asExpr), HB_COMP_PARAM ); ;} break; case 159: -#line 614 "macro.y" +#line 612 "macro.y" { (yyval.asExpr) = hb_compExprSetOperand( hb_compExprNewMultEq( (yyvsp[(1) - (3)].asExpr), HB_COMP_PARAM ), (yyvsp[(3) - (3)].asExpr), HB_COMP_PARAM ); ;} break; case 160: -#line 617 "macro.y" +#line 615 "macro.y" { (yyval.asExpr) = hb_compExprSetOperand( hb_compExprNewDivEq( (yyvsp[(1) - (3)].asExpr), HB_COMP_PARAM ), (yyvsp[(3) - (3)].asExpr), HB_COMP_PARAM ); ;} break; case 161: -#line 620 "macro.y" +#line 618 "macro.y" { (yyval.asExpr) = hb_compExprSetOperand( hb_compExprNewModEq( (yyvsp[(1) - (3)].asExpr), HB_COMP_PARAM ), (yyvsp[(3) - (3)].asExpr), HB_COMP_PARAM ); ;} break; case 162: -#line 623 "macro.y" +#line 621 "macro.y" { (yyval.asExpr) = hb_compExprSetOperand( hb_compExprNewExpEq( (yyvsp[(1) - (3)].asExpr), HB_COMP_PARAM ), (yyvsp[(3) - (3)].asExpr), HB_COMP_PARAM ); ;} break; case 169: -#line 634 "macro.y" +#line 632 "macro.y" { (yyval.asExpr) = hb_compExprSetOperand( hb_compExprNewPlus( (yyvsp[(1) - (3)].asExpr), HB_COMP_PARAM ), (yyvsp[(3) - (3)].asExpr), HB_COMP_PARAM ); ;} break; case 170: -#line 635 "macro.y" +#line 633 "macro.y" { (yyval.asExpr) = hb_compExprSetOperand( hb_compExprNewMinus( (yyvsp[(1) - (3)].asExpr), HB_COMP_PARAM ), (yyvsp[(3) - (3)].asExpr), HB_COMP_PARAM ); ;} break; case 171: -#line 636 "macro.y" +#line 634 "macro.y" { (yyval.asExpr) = hb_compExprSetOperand( hb_compExprNewMult( (yyvsp[(1) - (3)].asExpr), HB_COMP_PARAM ), (yyvsp[(3) - (3)].asExpr), HB_COMP_PARAM ); ;} break; case 172: -#line 637 "macro.y" +#line 635 "macro.y" { (yyval.asExpr) = hb_compExprSetOperand( hb_compExprNewDiv( (yyvsp[(1) - (3)].asExpr), HB_COMP_PARAM ), (yyvsp[(3) - (3)].asExpr), HB_COMP_PARAM ); ;} break; case 173: -#line 638 "macro.y" +#line 636 "macro.y" { (yyval.asExpr) = hb_compExprSetOperand( hb_compExprNewMod( (yyvsp[(1) - (3)].asExpr), HB_COMP_PARAM ), (yyvsp[(3) - (3)].asExpr), HB_COMP_PARAM ); ;} break; case 174: -#line 639 "macro.y" +#line 637 "macro.y" { (yyval.asExpr) = hb_compExprSetOperand( hb_compExprNewPower( (yyvsp[(1) - (3)].asExpr), HB_COMP_PARAM ), (yyvsp[(3) - (3)].asExpr), HB_COMP_PARAM ); ;} break; case 175: -#line 642 "macro.y" +#line 640 "macro.y" { (yyval.asExpr) = hb_compExprSetOperand( hb_compExprNewAnd( (yyvsp[(1) - (3)].asExpr), HB_COMP_PARAM ), (yyvsp[(3) - (3)].asExpr), HB_COMP_PARAM ); ;} break; case 176: -#line 643 "macro.y" +#line 641 "macro.y" { (yyval.asExpr) = hb_compExprSetOperand( hb_compExprNewOr( (yyvsp[(1) - (3)].asExpr), HB_COMP_PARAM ), (yyvsp[(3) - (3)].asExpr), HB_COMP_PARAM ); ;} break; case 177: -#line 646 "macro.y" +#line 644 "macro.y" { (yyval.asExpr) = hb_compExprSetOperand( hb_compExprNewEQ( (yyvsp[(1) - (3)].asExpr), HB_COMP_PARAM ), (yyvsp[(3) - (3)].asExpr), HB_COMP_PARAM ); ;} break; case 178: -#line 647 "macro.y" +#line 645 "macro.y" { (yyval.asExpr) = hb_compExprSetOperand( hb_compExprNewLT( (yyvsp[(1) - (3)].asExpr), HB_COMP_PARAM ), (yyvsp[(3) - (3)].asExpr), HB_COMP_PARAM ); ;} break; case 179: -#line 648 "macro.y" +#line 646 "macro.y" { (yyval.asExpr) = hb_compExprSetOperand( hb_compExprNewGT( (yyvsp[(1) - (3)].asExpr), HB_COMP_PARAM ), (yyvsp[(3) - (3)].asExpr), HB_COMP_PARAM ); ;} break; case 180: -#line 649 "macro.y" +#line 647 "macro.y" { (yyval.asExpr) = hb_compExprSetOperand( hb_compExprNewLE( (yyvsp[(1) - (3)].asExpr), HB_COMP_PARAM ), (yyvsp[(3) - (3)].asExpr), HB_COMP_PARAM ); ;} break; case 181: -#line 650 "macro.y" +#line 648 "macro.y" { (yyval.asExpr) = hb_compExprSetOperand( hb_compExprNewGE( (yyvsp[(1) - (3)].asExpr), HB_COMP_PARAM ), (yyvsp[(3) - (3)].asExpr), HB_COMP_PARAM ); ;} break; case 182: -#line 651 "macro.y" +#line 649 "macro.y" { (yyval.asExpr) = hb_compExprSetOperand( hb_compExprNewNE( (yyvsp[(1) - (3)].asExpr), HB_COMP_PARAM ), (yyvsp[(3) - (3)].asExpr), HB_COMP_PARAM ); ;} break; case 183: -#line 652 "macro.y" +#line 650 "macro.y" { (yyval.asExpr) = hb_compExprSetOperand( hb_compExprNewNE( (yyvsp[(1) - (3)].asExpr), HB_COMP_PARAM ), (yyvsp[(3) - (3)].asExpr), HB_COMP_PARAM ); ;} break; case 184: -#line 653 "macro.y" +#line 651 "macro.y" { (yyval.asExpr) = hb_compExprSetOperand( hb_compExprNewIN( (yyvsp[(1) - (3)].asExpr), HB_COMP_PARAM ), (yyvsp[(3) - (3)].asExpr), HB_COMP_PARAM ); ;} break; case 185: -#line 654 "macro.y" +#line 652 "macro.y" { (yyval.asExpr) = hb_compExprSetOperand( hb_compExprNewEqual( (yyvsp[(1) - (3)].asExpr), HB_COMP_PARAM ), (yyvsp[(3) - (3)].asExpr), HB_COMP_PARAM ); ;} break; case 187: -#line 663 "macro.y" +#line 661 "macro.y" { (yyval.asExpr) = hb_macroExprNewArrayAt( (yyvsp[(0) - (2)].asExpr), (yyvsp[(2) - (2)].asExpr), HB_COMP_PARAM ); ;} break; case 188: -#line 664 "macro.y" +#line 662 "macro.y" { (yyval.asExpr) = hb_macroExprNewArrayAt( (yyvsp[(1) - (3)].asExpr), (yyvsp[(3) - (3)].asExpr), HB_COMP_PARAM ); ;} break; case 189: -#line 665 "macro.y" +#line 663 "macro.y" { (yyval.asExpr) = hb_macroExprNewArrayAt( (yyvsp[(1) - (4)].asExpr), (yyvsp[(4) - (4)].asExpr), HB_COMP_PARAM ); ;} break; case 190: -#line 668 "macro.y" +#line 666 "macro.y" { (yyval.asExpr) = hb_compExprNewList( (yyvsp[(1) - (1)].asExpr), HB_COMP_PARAM ); ;} break; case 191: -#line 669 "macro.y" +#line 667 "macro.y" { (yyval.asExpr) = hb_compExprAddListExpr( (yyvsp[(1) - (3)].asExpr), (yyvsp[(3) - (3)].asExpr) ); ;} break; case 192: -#line 673 "macro.y" +#line 671 "macro.y" { (yyval.asExpr) = hb_compExprNewCodeBlock( NULL, 0, 0, HB_COMP_PARAM ); ;} break; case 193: -#line 675 "macro.y" +#line 673 "macro.y" { (yyval.asExpr) = (yyvsp[(3) - (7)].asExpr); ;} break; case 194: -#line 680 "macro.y" +#line 678 "macro.y" { (yyval.asExpr) = hb_compExprAddCodeblockExpr( (yyvsp[(-2) - (1)].asExpr), (yyvsp[(1) - (1)].asExpr) ); ;} break; case 195: -#line 681 "macro.y" +#line 679 "macro.y" { (yyval.asExpr) = hb_compExprAddCodeblockExpr( (yyvsp[(-2) - (3)].asExpr), (yyvsp[(3) - (3)].asExpr) ); ;} break; case 196: -#line 686 "macro.y" +#line 684 "macro.y" { (yyval.asExpr) = NULL; ;} break; case 197: -#line 687 "macro.y" +#line 685 "macro.y" { (yyval.asExpr) = NULL; (yyvsp[(0) - (1)].asExpr)->value.asCodeblock.flags |= HB_BLOCK_VPARAMS; ;} break; case 198: -#line 688 "macro.y" +#line 686 "macro.y" { (yyval.asExpr) = (yyvsp[(1) - (1)].asExpr); ;} break; case 199: -#line 689 "macro.y" +#line 687 "macro.y" { (yyval.asExpr) = (yyvsp[(1) - (3)].asExpr); (yyvsp[(0) - (3)].asExpr)->value.asCodeblock.flags |= HB_BLOCK_VPARAMS; ;} break; case 200: -#line 692 "macro.y" +#line 690 "macro.y" { (yyval.asExpr) = hb_compExprCBVarAdd( (yyvsp[(0) - (1)].asExpr), (yyvsp[(1) - (1)].string), ' ', HB_COMP_PARAM ); ;} break; case 201: -#line 693 "macro.y" +#line 691 "macro.y" { (yyval.asExpr) = hb_compExprCBVarAdd( (yyvsp[(0) - (3)].asExpr), (yyvsp[(3) - (3)].string), ' ', HB_COMP_PARAM ); HB_MACRO_CHECK( (yyval.asExpr) ); ;} break; case 202: -#line 696 "macro.y" +#line 694 "macro.y" { (yyval.asExpr) = hb_compExprNewList( (yyvsp[(2) - (2)].asExpr), HB_COMP_PARAM ); ;} break; case 203: -#line 697 "macro.y" +#line 695 "macro.y" { (yyval.asExpr) = hb_compExprAddListExpr( (yyvsp[(1) - (3)].asExpr), (yyvsp[(3) - (3)].asExpr) ); ;} break; case 206: -#line 708 "macro.y" +#line 706 "macro.y" { (yyval.asExpr) = hb_compExprNewIIF( hb_compExprAddListExpr( hb_compExprAddListExpr( hb_compExprNewList( (yyvsp[(3) - (8)].asExpr), HB_COMP_PARAM ), (yyvsp[(5) - (8)].asExpr) ), (yyvsp[(7) - (8)].asExpr) ) ); ;} break; /* Line 1268 of yacc.c. */ -#line 2830 "macroy.c" +#line 2828 "macroy.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -3045,7 +3043,7 @@ yyreturn: } -#line 711 "macro.y" +#line 709 "macro.y" @@ -3095,12 +3093,14 @@ static HB_EXPR_PTR hb_macroExprAlloc( HB_COMP_DECL ) return &pMExpr->Expressions[ pMExpr->count++ ]; } -static void hb_macroIdentNew( HB_COMP_DECL, char * szIdent ) +char * hb_macroIdentNew( HB_COMP_DECL, char * szIdent ) { HB_MIDENT_PTR pMIdent = ( HB_MIDENT_PTR ) hb_xgrab( sizeof( HB_MIDENT ) ); pMIdent->Identifier = szIdent; pMIdent->pPrev = ( HB_MIDENT_PTR ) HB_MACRO_DATA->pIdentLst; HB_MACRO_DATA->pIdentLst = ( void * ) pMIdent; + + return szIdent; } static HB_EXPR_PTR hb_macroExprNew( HB_COMP_DECL, HB_EXPRTYPE iType )