]>
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 */ | |
15b3d2b2 | 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@*/ | |
a956d444 | 22 | /*@-declundef@*/ /* Might not process grammar files */ |
23 | extern /*@dependent@*/ /*@open@*/ FILE *yyin; | |
24 | extern /*@dependent@*/ /*@open@*/ /*@unused@*/ FILE *yyout; | |
25 | extern /*@unused@*/ int yyleng; | |
885824d3 | 26 | /*@=incondefs@*/ |
27 | ||
885824d3 | 28 | extern int yydebug; |
29 | /*@=redecl@*/ | |
a956d444 | 30 | /*@=declundef@*/ |
885824d3 | 31 | /*@=namechecks@*/ |
32 | ||
33 | extern /*@observer@*/ cstring g_codeFile; | |
34 | extern int g_codeLine; | |
35 | ||
36 | extern /*@observer@*/ cstring g_prevCodeFile; | |
37 | extern int g_prevCodeLine; | |
38 | ||
39 | extern /*@observer@*/ char *g_localSpecPath; | |
40 | ||
41 | # ifndef NOLCL | |
42 | extern /*@only@*/ cstring g_currentSpec; | |
43 | extern /*@null@*/ /*@only@*/ char *g_currentSpecName; | |
44 | # endif | |
45 | ||
46 | extern void setCodePoint (void); | |
47 | # define setCodePoint() \ | |
48 | (g_prevCodeFile = g_codeFile, g_prevCodeLine = g_codeLine, \ | |
49 | g_codeFile = cstring_makeLiteralTemp (__FILE__), g_codeLine = __LINE__) | |
50 | ||
51 | extern void printCodePoint (void); | |
52 | ||
53 | extern fileId currentFile (void) /*@globals g_currentloc; @*/ ; | |
54 | # define currentFile() (fileloc_fileId (g_currentloc)) | |
55 | ||
56 | extern int currentColumn (void) /*@globals g_currentloc; @*/ ; | |
57 | # define currentColumn() (fileloc_column(g_currentloc)) | |
58 | ||
59 | extern void incColumn (void) | |
28bf4b0b | 60 | /*@globals g_currentloc; @*/ |
885824d3 | 61 | /*@modifies g_currentloc@*/ ; |
62 | # define incColumn() (fileloc_incColumn(g_currentloc)) | |
63 | ||
64 | extern void decColumn (void) | |
28bf4b0b | 65 | /*@globals g_currentloc; @*/ |
885824d3 | 66 | /*@modifies g_currentloc@*/ ; |
67 | # define decColumn() (fileloc_addColumn(g_currentloc, -1)) | |
68 | ||
69 | extern void incLine (void) | |
28bf4b0b | 70 | /*@globals g_currentloc; @*/ |
885824d3 | 71 | /*@modifies g_currentloc; @*/ ; |
72 | # define incLine() (fileloc_nextLine(g_currentloc)) | |
73 | ||
74 | extern void decLine (void) | |
28bf4b0b | 75 | /*@globals g_currentloc; @*/ |
885824d3 | 76 | /*@modifies g_currentloc; @*/ ; |
77 | # define decLine() (fileloc_addLine (g_currentloc, -1)) | |
78 | ||
79 | extern void beginLine (void) | |
28bf4b0b | 80 | /*@globals g_currentloc; @*/ |
885824d3 | 81 | /*@modifies g_currentloc; @*/ ; |
82 | # define beginLine() (fileloc_setColumn(g_currentloc, 1)) | |
83 | ||
84 | extern void addColumn (int p_n) | |
28bf4b0b | 85 | /*@globals g_currentloc; @*/ |
885824d3 | 86 | /*@modifies g_currentloc; @*/ ; |
87 | # define addColumn(n) (fileloc_addColumn(g_currentloc, n)) | |
88 | ||
89 | extern void setLine (int p_n) | |
90 | /*@globals fileloc g_currentloc; @*/ | |
91 | /*@modifies g_currentloc; @*/ ; | |
92 | # define setLine(n) (fileloc_setLineno(g_currentloc, n)) | |
93 | ||
94 | extern void setColumn (int p_n) | |
95 | /*@globals fileloc g_currentloc; @*/ | |
96 | /*@modifies g_currentloc; @*/ ; | |
97 | # define setColumn(n) (fileloc_setColumn(g_currentloc, n)) | |
98 | ||
99 | # ifndef NOLCL | |
100 | extern void setSpecFileId (fileId p_s) | |
101 | /*@globals fileloc g_currentloc; @*/ | |
102 | /*@modifies g_currentloc; @*/ ; | |
103 | # define setSpecFileId(s) \ | |
104 | (fileloc_reallyFree (g_currentloc), g_currentloc = fileloc_createSpec (s, 1, 1)) | |
105 | # endif | |
106 | ||
107 | extern void setFileLine (fileId p_s, int p_line) | |
108 | /*@globals fileloc g_currentloc; @*/ | |
109 | /*@modifies g_currentloc; @*/ ; | |
110 | # define setFileLine(s, line) \ | |
111 | (context_setFilename(s, line)) | |
112 | ||
113 | # else | |
114 | # error "Multiple include" | |
115 | # endif | |
116 | ||
117 | ||
118 | ||
119 | ||
120 | ||
121 |