Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /sml/branches/dbm-branch-2005_09_20/ckit/src/parser/util/error-sig.sml
ViewVC logotype

Annotation of /sml/branches/dbm-branch-2005_09_20/ckit/src/parser/util/error-sig.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 597 - (view) (download)
Original Path: sml/trunk/ckit/src/parser/util/error-sig.sml

1 : dbm 597 (*
2 :     * Copyright (c) 1996 by Satish Chandra, Brad Richards, Mark D. Hill,
3 :     * James R. Larus, and David A. Wood.
4 :     *
5 :     * Teapot is distributed under the following conditions:
6 :     *
7 :     * You may make copies of Teapot for your own use and modify those copies.
8 :     *
9 :     * All copies of Teapot must retain our names and copyright notice.
10 :     *
11 :     * You may not sell Teapot or distributed Teapot in conjunction with a
12 :     * commercial product or service without the expressed written consent of
13 :     * the copyright holders.
14 :     *
15 :     * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
16 :     * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
17 :     * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
18 :     *
19 :     *)
20 :    
21 :     (* error-sig.sml
22 :     *
23 :     * CS703 --- Project --- Spring '94
24 :     *
25 :     * COPYRIGHT (c) 1992 AT&T Bell Laboratories
26 :     *)
27 :    
28 :     signature ERROR =
29 :     sig
30 :    
31 :     type errorState
32 :     (* the information related to error reporting, including counters
33 :     * for errors and warnings and upper bounds thereon.*)
34 :    
35 :     (* global limit variables *)
36 :    
37 :     val errorsLimit : int ref
38 :     (* caps number of errors reported on an error state (see mkErrState) *)
39 :    
40 :     val warningsLimit : int ref
41 :     (* caps number of warnings reported on an error state (see mkErrState) *)
42 :    
43 :    
44 :     (* creating errorStates *)
45 :    
46 :     val mkErrState : TextIO.outstream -> errorState
47 :     (* mkErrorState(os): make an error state with destination outstream os.
48 :     * Uses the current values of errorsLimit and warningsLimit as upper bounds
49 :     * on numbers of errors and warnings reported via the resulting errorState.
50 :     *)
51 :    
52 :    
53 :     (* reporting internal bugs *)
54 :    
55 :     val bug : errorState -> string -> unit
56 :     (* for reporting internal bugs *)
57 :    
58 :    
59 :     (* generating warning messages *)
60 :    
61 :     val warning : (errorState * SourceMap.location * string) -> unit
62 :     (* warning(es,loc,message): the message and location loc will be printed
63 :     * to the destination outstream component of es *)
64 :    
65 :     val warningf : (errorState * SourceMap.location * string * Format.fmt_item list)
66 :     -> unit
67 :     (* warning(es,loc,message,items): the message and location loc and
68 :     * formated representation of items will be printed to the destination
69 :     * outstream component of es *)
70 :    
71 :     val noMoreWarnings : errorState -> unit
72 :     (* turns off printing of warning messages for the given errorState *)
73 :    
74 :    
75 :     (* generating error messages *)
76 :    
77 :     val hint: string -> unit
78 :     (* MAGIC (i.e. really gross hack) that allows you to insert hints
79 :     * that will be utilized by the next call to error. This was introduced
80 :     * to support better parser error messages. The next call to error will
81 :     * consume the hint, so it only applies to the next error. Typically
82 :     * it is a hint as to why the error occurred. *)
83 :    
84 :     val error : (errorState * SourceMap.location * string) -> unit
85 :     (* warning(es,loc,message): the message and location loc will be printed
86 :     * to the destination outstream component of es *)
87 :    
88 :     val errorf : (errorState * SourceMap.location * string * Format.fmt_item list)
89 :     (* warning(es,loc,message,items): the message and location loc and
90 :     * formated representation of items will be printed to the destination
91 :     * outstream component of es *)
92 :     -> unit
93 :     val noMoreErrors : errorState -> unit
94 :     (* turns off printing of warning messages for the given errorState *)
95 :    
96 :     val ppError :
97 :     (errorState * SourceMap.location * (OldPrettyPrint.ppstream -> unit))
98 :     -> unit
99 :     (* pretty-print an error message on the error stream *)
100 :    
101 :     val errStream : errorState -> TextIO.outstream
102 :     (* returns the destination outstream of the errorState *)
103 :    
104 :     val errorCount : errorState -> int
105 :     (* returns n, if there have been n>0 errors reported on the state since
106 :     * it was initialized or last reset *)
107 :    
108 :     val warningCount : errorState -> int
109 :     (* returns n, if there have been n>0 warnings reported on the state since
110 :     * it was initialized or last reset *)
111 :    
112 :     val reset : errorState -> unit
113 :     (* clears the error and warnings counts *)
114 :    
115 :     end (* signature ERROR *)

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0