home *** CD-ROM | disk | FTP | other *** search
/ ftp.ee.pdx.edu / 2014.02.ftp.ee.pdx.edu.tar / ftp.ee.pdx.edu / pub / users / Harry / compilers / p3 / LogicError.java < prev    next >
Text File  |  2005-10-19  |  933b  |  25 lines

  1. // ----------------------  LogicError  -----------------------
  2. //
  3. // Each instance of this exception class contains a message describing
  4. // a program logic problem;  A bug-free program should not throw this
  5. // exception but it can be useful in testing.  For example:
  6. //         if (nextToken != Token.WHILE) {
  7. //             throw new LogicError ("NextToken is messed up");
  8. //         }
  9. // When thrown, this expection will result in a stack trace, which can
  10. // may be useful in debugging. For example:
  11. //         LogicError: NextToken is messed up
  12. //                 at Parser.parseStmts(Parser.java:678)
  13. //                 at Parser.parseBody(Parser.java:345)
  14. //                 at Parser.parseProgram(Parser.java:122)
  15. //                 at Main.main(Main.java:32)
  16. //
  17. // Harry Porter -- 01/15/03
  18. //              -- 02/04/04
  19. //
  20. class LogicError extends FatalError {
  21.     LogicError (String message) {
  22.         super (message);
  23.     }
  24. }
  25.