]>
Commit | Line | Data |
---|---|---|
885824d3 | 1 | /* |
28bf4b0b | 2 | ** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2001. |
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 | ||
11 | /* stream for error messages */ | |
28bf4b0b | 12 | extern /*@open@*/ FILE *g_msgstream; |
885824d3 | 13 | |
14 | /*@-ansireserved@*/ | |
15 | /* This macro is defined by flex. */ | |
16 | /*@constant external int ECHO@*/ | |
17 | /*@=ansireserved@*/ | |
18 | ||
19 | /*@-redecl@*/ | |
20 | /*@-incondefs@*/ | |
21 | /*@-namechecks@*/ | |
28bf4b0b | 22 | extern /*@dependent@*/ /*@open@*/ FILE *yyin; |
23 | extern /*@dependent@*/ /*@open@*/ FILE *yyout; | |
885824d3 | 24 | extern int yyleng; |
25 | /*@=incondefs@*/ | |
26 | ||
27 | # ifdef WIN32 | |
28 | extern int yywrap (void) /*@*/ ; | |
29 | # endif | |
30 | ||
31 | extern int yydebug; | |
32 | /*@=redecl@*/ | |
33 | /*@=namechecks@*/ | |
34 | ||
35 | extern /*@observer@*/ cstring g_codeFile; | |
36 | extern int g_codeLine; | |
37 | ||
38 | extern /*@observer@*/ cstring g_prevCodeFile; | |
39 | extern int g_prevCodeLine; | |
40 | ||
41 | extern /*@observer@*/ char *g_localSpecPath; | |
42 | ||
43 | # ifndef NOLCL | |
44 | extern /*@only@*/ cstring g_currentSpec; | |
45 | extern /*@null@*/ /*@only@*/ char *g_currentSpecName; | |
46 | # endif | |
47 | ||
48 | extern void setCodePoint (void); | |
49 | # define setCodePoint() \ | |
50 | (g_prevCodeFile = g_codeFile, g_prevCodeLine = g_codeLine, \ | |
51 | g_codeFile = cstring_makeLiteralTemp (__FILE__), g_codeLine = __LINE__) | |
52 | ||
53 | extern void printCodePoint (void); | |
54 | ||
55 | extern fileId currentFile (void) /*@globals g_currentloc; @*/ ; | |
56 | # define currentFile() (fileloc_fileId (g_currentloc)) | |
57 | ||
58 | extern int currentColumn (void) /*@globals g_currentloc; @*/ ; | |
59 | # define currentColumn() (fileloc_column(g_currentloc)) | |
60 | ||
61 | extern void incColumn (void) | |
28bf4b0b | 62 | /*@globals g_currentloc; @*/ |
885824d3 | 63 | /*@modifies g_currentloc@*/ ; |
64 | # define incColumn() (fileloc_incColumn(g_currentloc)) | |
65 | ||
66 | extern void decColumn (void) | |
28bf4b0b | 67 | /*@globals g_currentloc; @*/ |
885824d3 | 68 | /*@modifies g_currentloc@*/ ; |
69 | # define decColumn() (fileloc_addColumn(g_currentloc, -1)) | |
70 | ||
71 | extern void incLine (void) | |
28bf4b0b | 72 | /*@globals g_currentloc; @*/ |
885824d3 | 73 | /*@modifies g_currentloc; @*/ ; |
74 | # define incLine() (fileloc_nextLine(g_currentloc)) | |
75 | ||
76 | extern void decLine (void) | |
28bf4b0b | 77 | /*@globals g_currentloc; @*/ |
885824d3 | 78 | /*@modifies g_currentloc; @*/ ; |
79 | # define decLine() (fileloc_addLine (g_currentloc, -1)) | |
80 | ||
81 | extern void beginLine (void) | |
28bf4b0b | 82 | /*@globals g_currentloc; @*/ |
885824d3 | 83 | /*@modifies g_currentloc; @*/ ; |
84 | # define beginLine() (fileloc_setColumn(g_currentloc, 1)) | |
85 | ||
86 | extern void addColumn (int p_n) | |
28bf4b0b | 87 | /*@globals g_currentloc; @*/ |
885824d3 | 88 | /*@modifies g_currentloc; @*/ ; |
89 | # define addColumn(n) (fileloc_addColumn(g_currentloc, n)) | |
90 | ||
91 | extern void setLine (int p_n) | |
92 | /*@globals fileloc g_currentloc; @*/ | |
93 | /*@modifies g_currentloc; @*/ ; | |
94 | # define setLine(n) (fileloc_setLineno(g_currentloc, n)) | |
95 | ||
96 | extern void setColumn (int p_n) | |
97 | /*@globals fileloc g_currentloc; @*/ | |
98 | /*@modifies g_currentloc; @*/ ; | |
99 | # define setColumn(n) (fileloc_setColumn(g_currentloc, n)) | |
100 | ||
101 | # ifndef NOLCL | |
102 | extern void setSpecFileId (fileId p_s) | |
103 | /*@globals fileloc g_currentloc; @*/ | |
104 | /*@modifies g_currentloc; @*/ ; | |
105 | # define setSpecFileId(s) \ | |
106 | (fileloc_reallyFree (g_currentloc), g_currentloc = fileloc_createSpec (s, 1, 1)) | |
107 | # endif | |
108 | ||
109 | extern void setFileLine (fileId p_s, int p_line) | |
110 | /*@globals fileloc g_currentloc; @*/ | |
111 | /*@modifies g_currentloc; @*/ ; | |
112 | # define setFileLine(s, line) \ | |
113 | (context_setFilename(s, line)) | |
114 | ||
28bf4b0b | 115 | /*@constant int PRINTBREADTH;@*/ /* For printing lists. Should be parameter... */ /*@i32@*/ |
116 | # define PRINTBREADTH 3 | |
117 | ||
885824d3 | 118 | # else |
119 | # error "Multiple include" | |
120 | # endif | |
121 | ||
122 | ||
123 | ||
124 | ||
125 | ||
126 |