KNOWN_PROBLEMS.txt 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. =======================================================
  2. Known Problems In PCCTS - Last revised 14 November 1998
  3. =======================================================
  4. #17. The dlg fix for handling characters up to 255 is incorrect.
  5. See item #207.
  6. Reported by Frank Hartmann.
  7. #16. A note about "&&" predicates (Mike Dimmick)
  8. Mike Dimmick has pointed out a potential pitfall in the use of the
  9. "&&" style predicate. Consider:
  10. r0: (g)? => <<P>>? r1
  11. | ...
  12. ;
  13. r1: A | B;
  14. If the context guard g is not a subset of the lookahead context for r1
  15. (in other words g is neither A nor B) then the code may execute r1
  16. even when the lookahead context is not satisfied. This is an error
  17. by the person coding the grammar, and the error should be reported to
  18. the user, but it isn't. expect. Some examples I've run seem to
  19. indicate that such an error actually results in the rule becoming
  20. unreachable.
  21. When g is properly coded the code is correct, the problem is when g
  22. is not properly coded.
  23. A second problem reported by Mike Dimmick is that the test for a
  24. failed validation predicate is equivalent to a test on the predicate
  25. along. In other words, if the "&&" has not been hoisted then it may
  26. falsely report a validation error.
  27. #15. (Changed in MR23) Warning for LT(i), LATEXT(i) in token match actions
  28. An bug (or at least an oddity) is that a reference to LT(1), LA(1),
  29. or LATEXT(1) in an action which immediately follows a token match
  30. in a rule refers to the token matched, not the token which is in
  31. the lookahead buffer. Consider:
  32. r : abc <<action alpha>> D <<action beta>> E;
  33. In this case LT(1) in action alpha will refer to the next token in
  34. the lookahead buffer ("D"), but LT(1) in action beta will refer to
  35. the token matched by D - the preceding token.
  36. A warning has been added which warns users about this when an action
  37. following a token match contains a reference to LT(1), LA(1), or LATEXT(1).
  38. This behavior should be changed, but it appears in too many programs
  39. now. Another problem, perhaps more significant, is that the obvious
  40. fix (moving the consume() call to before the action) could change the
  41. order in which input is requested and output appears in existing programs.
  42. This problem was reported, along with a fix by Benjamin Mandel
  43. (beny@sd.co.il). However, I felt that changing the behavior was too
  44. dangerous for existing code.
  45. #14. Parsing bug in dlg
  46. THM: I have been unable to reproduce this problem.
  47. Reported by Rick Howard Mijenix Corporation (rickh@mijenix.com).
  48. The regular expression parser (in rexpr.c) fails while
  49. trying to parse the following regular expression:
  50. {[a-zA-Z]:}(\\\\[a-zA-Z0-9]*)+
  51. See my comment in the following excerpt from rexpr.c:
  52. /*
  53. * <regExpr> ::= <andExpr> ( '|' {<andExpr>} )*
  54. *
  55. * Return -1 if syntax error
  56. * Return 0 if none found
  57. * Return 1 if a regExrp was found
  58. */
  59. static
  60. regExpr(g)
  61. GraphPtr g;
  62. {
  63. Graph g1, g2;
  64. if ( andExpr(&g1) == -1 )
  65. {
  66. return -1;
  67. }
  68. while ( token == '|' )
  69. {
  70. int a;
  71. next();
  72. a = andExpr(&g2);
  73. if ( a == -1 ) return -1; /* syntax error below */
  74. else if ( !a ) return 1; /* empty alternative */
  75. g1 = BuildNFA_AorB(g1, g2);
  76. }
  77. if ( token!='\0' ) return -1;
  78. *****
  79. ***** It appears to fail here becuause token is 125 - the closing '}'
  80. ***** If I change it to:
  81. ***** if ( token!='\0' && token!='}' && token!= ')' ) return -1;
  82. *****
  83. ***** It succeeds, but I'm not sure this is the corrrect approach.
  84. *****
  85. *g = g1;
  86. return 1;
  87. }
  88. #13. dlg reports an invalid range for: [\0x00-\0xff]
  89. Diagnosed by Piotr Eljasiak (eljasiak@no-spam.zt.gdansk.tpsa.pl):
  90. Fixed in MR16.
  91. #12. Strings containing comment actions
  92. Sequences that looked like C style comments appearing in string
  93. literals are improperly parsed by antlr/dlg.
  94. << fprintf(out," /* obsolete */ ");
  95. For this case use:
  96. << fprintf(out," \/\* obsolete \*\/ ");
  97. Reported by K.J. Cummings (cummings@peritus.com).
  98. #11. User hook for deallocation of variables on guess fail
  99. The mechanism outlined in Item #108 works only for
  100. heap allocated variables.
  101. #10. Label re-initialization in ( X {y:Y} )*
  102. If a label assignment is optional and appears in a
  103. (...)* or (...)+ block it will not be reset to NULL
  104. when it is skipped by a subsequent iteration.
  105. Consider the example:
  106. ( X { y:Y })* Z
  107. with input:
  108. X Y X Z
  109. The first time through the block Y will be matched and
  110. y will be set to point to the token. On the second
  111. iteration of the (...)* block there is no match for Y.
  112. But y will not be reset to NULL, as the user might
  113. expect, it will contain a reference to the Y that was
  114. matched in the first iteration.
  115. The work-around is to manually reset y:
  116. ( X << y = NULL; >> { y:Y } )* Z
  117. or
  118. ( X ( y:Y | << y = NULL; >> /* epsilon */ ) )* Z
  119. Reported by Jeff Vincent (JVincent@novell.com).
  120. #9. PCCTAST.h PCCTSAST::setType() is a noop
  121. #8. #tokdefs with ~Token and .
  122. THM: I have been unable to reproduce this problem.
  123. When antlr uses #tokdefs to define tokens the fields of
  124. #errclass and #tokclass do not get properly defined.
  125. When it subsequently attempts to take the complement of
  126. the set of tokens (using ~Token or .) it can refer to
  127. tokens which don't have names, generating a fatal error.
  128. #7. DLG crashes on some invalid inputs
  129. THM: In MR20 have fixed the most common cases.
  130. The following token definition will cause DLG to crash.
  131. #token "()"
  132. Reported by Mengue Olivier (dolmen@bigfoot.com).
  133. #6. On MS systems \n\r is treated as two new lines
  134. Fixed.
  135. #5. Token expressions in #tokclass
  136. #errclass does not support TOK1..TOK2 or ~TOK syntax.
  137. #tokclass does not support ~TOKEN syntax
  138. A workaround for #errclass TOK1..TOK2 is to use a
  139. #tokclass.
  140. Reported by Dave Watola (dwatola@amtsun.jpl.nasa.gov)
  141. #4. A #tokdef must appear "early" in the grammar file.
  142. The "early" section of the grammar file is the only
  143. place where the following directives may appear:
  144. #header
  145. #first
  146. #tokdefs
  147. #parser
  148. Any other kind of statement signifiies the end of the
  149. "early" section.
  150. #3. Use of PURIFY macro for C++ mode
  151. Item #93 of the CHANGES_FROM_1.33 describes the use of
  152. the PURIFY macro to zero arguments to be passed by
  153. upward inheritance.
  154. #define PURIFY(r, s) memset((char *) &(r), '\0', (s));
  155. This may not be the right thing to do for C++ objects that
  156. have constructors. Reported by Bonny Rais (bonny@werple.net.au).
  157. For those cases one should #define PURIFY to be an empty macro
  158. in the #header or #first actions.
  159. #2. Fixed in 1.33MR10 - See CHANGES_FROM_1.33 Item #80.
  160. #1. The quality of support for systems with 8.3 file names leaves
  161. much to be desired. Since the kit is distributed using the
  162. long file names and the make file uses long file names it requires
  163. some effort to generate. This will probably not be changed due
  164. to the large number of systems already written using the long
  165. file names.