]>
Commit | Line | Data |
---|---|---|
885824d3 | 1 | /* |
c0de361f | 2 | ** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2003. |
885824d3 | 3 | ** See ../LICENSE for license information. |
4 | ** | |
5 | */ | |
6 | # ifndef GLOBALS_H | |
7 | # define GLOBALS_H | |
8 | ||
9 | extern /*@owned@*/ fileloc g_currentloc; | |
10 | ||
80489f0a | 11 | /* |
12 | ** All the streams are unchecked for now. | |
13 | */ | |
14 | ||
15 | /* stream for warning messages */ | |
16 | /*@unchecked@*/ extern /*@relnull@*/ /*@dependent@*/ /*:open:*/ FILE *g_warningstream; | |
17 | ||
18 | /* stream for status messages */ | |
19 | /*@unchecked@*/ extern /*@relnull@*/ /*@dependent@*/ /*:open:*/ FILE *g_messagestream; | |
20 | ||
885824d3 | 21 | /* stream for error messages */ |
80489f0a | 22 | /*@unchecked@*/ extern /*@relnull@*/ /*@dependent@*/ /*:open:*/ FILE *g_errorstream; |
885824d3 | 23 | |
53306cab | 24 | /* stream for error messages */ |
25 | /*@unchecked@*/ extern /*@null@*/ /*@dependent@*/ /*:open:*/ FILE *g_csvstream; | |
26 | ||
885824d3 | 27 | /*@-ansireserved@*/ |
28 | /* This macro is defined by flex. */ | |
29 | /*@constant external int ECHO@*/ | |
30 | /*@=ansireserved@*/ | |
31 | ||
32 | /*@-redecl@*/ | |
33 | /*@-incondefs@*/ | |
34 | /*@-namechecks@*/ | |
a956d444 | 35 | /*@-declundef@*/ /* Might not process grammar files */ |
36 | extern /*@dependent@*/ /*@open@*/ FILE *yyin; | |
37 | extern /*@dependent@*/ /*@open@*/ /*@unused@*/ FILE *yyout; | |
38 | extern /*@unused@*/ int yyleng; | |
885824d3 | 39 | /*@=incondefs@*/ |
40 | ||
885824d3 | 41 | extern int yydebug; |
42 | /*@=redecl@*/ | |
a956d444 | 43 | /*@=declundef@*/ |
885824d3 | 44 | /*@=namechecks@*/ |
45 | ||
46 | extern /*@observer@*/ cstring g_codeFile; | |
47 | extern int g_codeLine; | |
48 | ||
49 | extern /*@observer@*/ cstring g_prevCodeFile; | |
50 | extern int g_prevCodeLine; | |
51 | ||
52 | extern /*@observer@*/ char *g_localSpecPath; | |
53 | ||
885824d3 | 54 | extern /*@only@*/ cstring g_currentSpec; |
55 | extern /*@null@*/ /*@only@*/ char *g_currentSpecName; | |
885824d3 | 56 | |
57 | extern void setCodePoint (void); | |
58 | # define setCodePoint() \ | |
59 | (g_prevCodeFile = g_codeFile, g_prevCodeLine = g_codeLine, \ | |
60 | g_codeFile = cstring_makeLiteralTemp (__FILE__), g_codeLine = __LINE__) | |
61 | ||
62 | extern void printCodePoint (void); | |
63 | ||
64 | extern fileId currentFile (void) /*@globals g_currentloc; @*/ ; | |
65 | # define currentFile() (fileloc_fileId (g_currentloc)) | |
66 | ||
67 | extern int currentColumn (void) /*@globals g_currentloc; @*/ ; | |
68 | # define currentColumn() (fileloc_column(g_currentloc)) | |
69 | ||
70 | extern void incColumn (void) | |
28bf4b0b | 71 | /*@globals g_currentloc; @*/ |
885824d3 | 72 | /*@modifies g_currentloc@*/ ; |
73 | # define incColumn() (fileloc_incColumn(g_currentloc)) | |
74 | ||
75 | extern void decColumn (void) | |
28bf4b0b | 76 | /*@globals g_currentloc; @*/ |
885824d3 | 77 | /*@modifies g_currentloc@*/ ; |
78 | # define decColumn() (fileloc_addColumn(g_currentloc, -1)) | |
79 | ||
80 | extern void incLine (void) | |
28bf4b0b | 81 | /*@globals g_currentloc; @*/ |
885824d3 | 82 | /*@modifies g_currentloc; @*/ ; |
83 | # define incLine() (fileloc_nextLine(g_currentloc)) | |
84 | ||
85 | extern void decLine (void) | |
28bf4b0b | 86 | /*@globals g_currentloc; @*/ |
885824d3 | 87 | /*@modifies g_currentloc; @*/ ; |
88 | # define decLine() (fileloc_addLine (g_currentloc, -1)) | |
89 | ||
90 | extern void beginLine (void) | |
28bf4b0b | 91 | /*@globals g_currentloc; @*/ |
885824d3 | 92 | /*@modifies g_currentloc; @*/ ; |
93 | # define beginLine() (fileloc_setColumn(g_currentloc, 1)) | |
94 | ||
95 | extern void addColumn (int p_n) | |
28bf4b0b | 96 | /*@globals g_currentloc; @*/ |
885824d3 | 97 | /*@modifies g_currentloc; @*/ ; |
98 | # define addColumn(n) (fileloc_addColumn(g_currentloc, n)) | |
99 | ||
100 | extern void setLine (int p_n) | |
101 | /*@globals fileloc g_currentloc; @*/ | |
102 | /*@modifies g_currentloc; @*/ ; | |
103 | # define setLine(n) (fileloc_setLineno(g_currentloc, n)) | |
104 | ||
105 | extern void setColumn (int p_n) | |
106 | /*@globals fileloc g_currentloc; @*/ | |
107 | /*@modifies g_currentloc; @*/ ; | |
108 | # define setColumn(n) (fileloc_setColumn(g_currentloc, n)) | |
109 | ||
885824d3 | 110 | extern void setSpecFileId (fileId p_s) |
111 | /*@globals fileloc g_currentloc; @*/ | |
112 | /*@modifies g_currentloc; @*/ ; | |
113 | # define setSpecFileId(s) \ | |
114 | (fileloc_reallyFree (g_currentloc), g_currentloc = fileloc_createSpec (s, 1, 1)) | |
885824d3 | 115 | |
116 | extern void setFileLine (fileId p_s, int p_line) | |
117 | /*@globals fileloc g_currentloc; @*/ | |
118 | /*@modifies g_currentloc; @*/ ; | |
119 | # define setFileLine(s, line) \ | |
120 | (context_setFilename(s, line)) | |
121 | ||
122 | # else | |
123 | # error "Multiple include" | |
124 | # endif | |
125 | ||
126 | ||
127 | ||
128 | ||
129 | ||
130 |