|
11 | 11 | * |
12 | 12 | * History |
13 | 13 | * |
| 14 | + * bengsig 25-may-2023 - Improve syntax understanding |
14 | 15 | * bengsig 15-may-2023 - statisticsonly |
15 | 16 | * bengsig 24-apr-2023 - Fix bug when every follows queue every |
16 | 17 | * bengsig 3-apr-2023 - Allow 0 cursorcache |
@@ -509,8 +510,38 @@ programelementlist: |
509 | 510 |
|
510 | 511 | programelement: |
511 | 512 | statement |
512 | | - // Here are declarations that are only available globally |
| 513 | + | globaldeclaration |
| 514 | + | threadexecution |
| 515 | + // printvar |
| 516 | + | RWL_T_PRINTVAR RWL_T_ALL |
| 517 | + terminator |
| 518 | + { rwlprintallvars(rwm); } |
| 519 | + | RWL_T_PRINTVAR printvarlist |
| 520 | + terminator |
| 521 | + |
| 522 | + ; |
| 523 | + /* end of programelement */ |
| 524 | + |
| 525 | +globaldeclaration: |
513 | 526 | // this is everything except integer, double, string, clob, sql |
| 527 | + databasedeclaration |
| 528 | + |
| 529 | + | subroutinedeclaration codeterminator |
| 530 | + { |
| 531 | + if (bit(rwm->m3flags, RWL_P3_BNOXPROC|RWL_P3_BNOXFUNC)) |
| 532 | + rwlcodetail(rwm); |
| 533 | + bic(rwm->m3flags, RWL_P3_BNOXPROC|RWL_P3_BNOXFUNC); |
| 534 | + /* Is is crucial to set codename to 0 here as this means we |
| 535 | + are no longer compiling code. rwm->codename is used in many |
| 536 | + places as argument to rwlfindvar2 to mean that we are compiling |
| 537 | + code and therefore need rwlfindvar2 to local for potential |
| 538 | + local variables |
| 539 | + */ |
| 540 | + |
| 541 | + rwm->codename = 0; // we are no longer compiling code |
| 542 | + rwm->codeguess = RWL_VAR_NOGUESS; |
| 543 | + } |
| 544 | + |
514 | 545 | | RWL_T_PRIVATE RWL_T_RANDOM RWL_T_STRING RWL_T_ARRAY RWL_T_IDENTIFIER |
515 | 546 | { |
516 | 547 | rwm->raname = rwm->inam; |
@@ -544,37 +575,7 @@ programelement: |
544 | 575 | rwlrastbeg(rwm, rwm->raname, RWL_TYPE_RAPROC); |
545 | 576 | } |
546 | 577 | ranidentifierspec |
547 | | - |
548 | | - // more complex declarations |
549 | | - | database |
550 | | - // |
551 | | - | subroutinedeclaration codeterminator |
552 | | - { |
553 | | - if (bit(rwm->m3flags, RWL_P3_BNOXPROC|RWL_P3_BNOXFUNC)) |
554 | | - rwlcodetail(rwm); |
555 | | - bic(rwm->m3flags, RWL_P3_BNOXPROC|RWL_P3_BNOXFUNC); |
556 | | - /* Is is crucial to set codename to 0 here as this means we |
557 | | - are no longer compiling code. rwm->codename is used in many |
558 | | - places as argument to rwlfindvar2 to mean that we are compiling |
559 | | - code and therefore need rwlfindvar2 to local for potential |
560 | | - local variables |
561 | | - */ |
562 | | - |
563 | | - rwm->codename = 0; // we are no longer compiling code |
564 | | - rwm->codeguess = RWL_VAR_NOGUESS; |
565 | | - } |
566 | | - |
567 | | - // printvar |
568 | | - | RWL_T_PRINTVAR RWL_T_ALL |
569 | | - terminator |
570 | | - { rwlprintallvars(rwm); } |
571 | | - | RWL_T_PRINTVAR printvarlist |
572 | | - terminator |
573 | | - |
574 | | - | threadexecution |
575 | | - |
576 | | - ; |
577 | | - /* end of programelement */ |
| 578 | + ; |
578 | 579 |
|
579 | 580 | ranstringspec: |
580 | 581 | '(' ranstringlist ')' |
@@ -625,7 +626,7 @@ ranidentifierentry: |
625 | 626 | {rwlrastadd(rwm, rwm->raentry, rwm->pval.dval); } |
626 | 627 | ; |
627 | 628 |
|
628 | | -database: |
| 629 | +databasedeclaration: |
629 | 630 | RWL_T_DATABASE RWL_T_IDENTIFIER |
630 | 631 | { |
631 | 632 | // add identifier |
|
0 commit comments