home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / pccts1.zip / BUGS106 < prev    next >
Text File  |  1993-03-30  |  6KB  |  188 lines

  1.  
  2.  
  3.  
  4.           C u r r e n t  B U G  L i s t   1 . 0 6
  5.  
  6.                        March 12, 1993
  7.  
  8.  
  9. (1)  The install.unbag.reqd file did not ensure that the makefiles  in
  10.      antlr  an dlg directories would compile antlr and dlg directly by
  11.      compiling all C files.  Without the fix, the makefiles  tried  to
  12.      regenerate  antlr.c  from antlr.g and dlg_p.c from dlg_p.g.  This
  13.      is impossible as they are written in  themselves  and  would  not
  14.      exist yet.  The fix, as per the latest README is:
  15.  
  16. For non-UNIX folks:
  17.      You must create the parser.dlg and "touch" scan.c  in  antlr  and
  18.      dlg  directories  or  the makefiles will try to execute antlr and
  19.      dlg, which don't exist yet.  The first time,  you  want  only  to
  20.      compile  the  C  files in order to obtain an executable for antlr
  21.      and dlg.  From this point, a change in antlr.g  or  dlg_p.g  will
  22.      force antlr/dlg to regenerate themselves.
  23.  
  24. (2)  ANTLR incorrectly handled return values and parameters because it
  25.      did  not  reset  a  few  pointers.  Here is a sample problem that
  26.      barfs:
  27.  
  28. e>[int type] : ;
  29.  
  30. p[int type]  : <<int ft = $type;>> ;
  31.  
  32. It generates, for the action, "int ft = _retv" instead of the  correct
  33. "int  ft  = type".  The fix is simple.  Change line 374 of rule 'rule'
  34. in antlr.g FROM:
  35.  
  36.     char *pdecl=NULL, *ret=NULL, *a;>>
  37.  
  38. TO:
  39.  
  40.     char *pdecl=NULL, *ret=NULL, *a; CurRetDef = CurParmDef = NULL;>>
  41.  
  42. Or, change the corresponding C code in antlr.c--it's better to  update
  43. the  antlr.g  file, but REQUIRES THAT YOU HAVE AN ANTLR/DLG EXECUTABLE
  44. ALREADY.
  45.  
  46. (3)  With respect to the beginning tutorial (from Gareth L de C Morgan
  47.      Esq, G.L.Morgan@durham.ac.uk) :  Section 4.1 (page 17) the rule:
  48.  
  49. a   :   "hi" "[0-9]+" <<printf("$1, $2 are %d, %d0, $1, $2);>>
  50.     ;
  51.  
  52. should read
  53.  
  54. a   :   "hi" "[0-9]+" <<printf(",  are %d, %d0, $1, $2);>>
  55.     ;
  56.  
  57. As the $i variables are translated to macros without the escape.
  58.  
  59.  
  60.  
  61.                                                                 Page 1
  62.  
  63.                                                                  PCCTS
  64.  
  65.  
  66. Also in Section 4.1, page 15:  For the input
  67.  
  68. begin hi 2 99 ptr
  69.  
  70. the token stream should be:
  71.  
  72.         (begin, begin)
  73.         (WORD, hi)
  74.         (INT, 2)
  75.         (INT, 99)
  76.         (WORD, ptr)
  77.  
  78. (4)  Neal Holtz (nholtz@civeng.carleton.ca) found a problem with  DLG:
  79.      it  incorrectly  generated  a  table called 'accepts' which, upon
  80.      erroneous input, forced a call to  an  undefined  address.   This
  81.      problem  was  only  found  with the Borland C compiler on the PC.
  82.      Hopefully, others will not have found the problem.  Fix for  file
  83.      output.c:
  84.  
  85. 166,167c166
  86. < /* make sure element for one past (zzerraction) -WEC 12/16/92 */
  87. <       fprintf(OUT,"0faState accepts[%d] = { ",dfa_allocated+1);
  88. ---
  89. >       fprintf(OUT,"0faState accepts[%d] = { ",dfa_allocated);
  90. 194,195d192
  91. < /* make sure element for one past (zzerraction) -WEC 12/16/92 */
  92. <       fprintf(OUT, ", 0");
  93.  
  94.  
  95. (5)  Joe Hummel (jhummel@esp.ICS.UCI.EDU) found a problem in  rexpr.c.
  96.      In  his  words:   "The  last  thing the routine rexpr does before
  97.      returning is free the nodes/arcs on the freelist.  It  does  this
  98.      by  traversing  block  by  block  down  the list, via the "track"
  99.      field.  However, note the list is actually full  of  2  types  of
  100.      blocks,  Node and Arc.  But the track field has different offsets
  101.      in each type, thus it turns out only the Node's are freed and the
  102.      Arcs are incorrectly accessed."
  103.  
  104. The solution is simple - move the track pointer field of the  Arc  and
  105. Node structures to the first field position:
  106.  
  107. typedef struct _a {
  108.                     struct _a *track;   /* track mem allocation */
  109.                     int label;
  110.                     struct _a *next;
  111.                     struct _n *target;
  112.                 } Arc, *ArcPtr;
  113.  
  114. typedef struct _n {
  115.                     struct _n *track;
  116.                     ArcPtr arcs, arctail;
  117.                 } Node, *NodePtr;
  118.  
  119.  
  120.  
  121.  
  122.  
  123.                                                                 Page 2
  124.  
  125.                                                                  PCCTS
  126.  
  127.  
  128. (6)  WARNING: Users with 16-bit integers.
  129.  
  130.      PCCTS Version 1.06 will complain if you try to compile it "out of
  131.      the  box"  with 16 bit integers even with the appropriate prepro-
  132.      cessor flag PC #define'd.  This is due to the fact that  1.06  is
  133.      written  in  1.00.   Portions of the source distributed for ANTLR
  134.      and DLG are generated on a  32-bit  machine  (by  ANTLR  itself).
  135.      Therefore,  the  set  routines  assumed  32-bits when they dumped
  136.      prediction and error sets to err.c.
  137.  
  138.      FIX OPTIONS:
  139.  
  140.      (1)  You can correct this, on your machine, by running ANTLR 1.00
  141.           on  antlr.g, in the antlr directory, and dlg_p.g, in the dlg
  142.           directory.  This will generate the parsers for ANTLR and DLG
  143.           using the "unsigned" size correct for you machine.
  144.  
  145.      (2)  Grab  the  binaries  in  the  DOS_OS2.binaries  subdirectory
  146.           (under  pccts/1.06).   We  used option (1) under OS/2 to get
  147.           the correct parser C code.
  148.  
  149.  
  150.      (3)  Anywhere you see an "unsigned" definition in err.c for  both
  151.           antlr  and  dlg  directories  (everywhere  if you want to be
  152.           safe) convert it to "unsigned long".
  153.  
  154.  
  155.      NOTE PC must still be defined so that  the  set.c  routines  will
  156.           assume 16-bit integers.
  157.  
  158.  
  159. (7)  The -gp prefix option is broken.  The  rule/function  definitions
  160.      are  prefixed, but some references to them are not.  To fix this,
  161.      change line 443 of gen.c from:
  162.  
  163.      _gen2("%s(%s);", p->text, (p->parms!=NULL)?p->parms:"");
  164.  
  165. to
  166.  
  167.      _gen3("%s%s(%s);", RulePrefix, p->text, (p->parms!=NULL)?p->parms:"");
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.                                                                 Page 3
  186.  
  187.  
  188.