2 ** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2001.
3 ** See ../LICENSE for license information.
9 extern /*@owned@*/ fileloc g_currentloc;
12 ** All the streams are unchecked for now.
15 /* stream for warning messages */
16 /*@unchecked@*/ extern /*@relnull@*/ /*@dependent@*/ /*:open:*/ FILE *g_warningstream;
18 /* stream for status messages */
19 /*@unchecked@*/ extern /*@relnull@*/ /*@dependent@*/ /*:open:*/ FILE *g_messagestream;
21 /* stream for error messages */
22 /*@unchecked@*/ extern /*@relnull@*/ /*@dependent@*/ /*:open:*/ FILE *g_errorstream;
25 /* This macro is defined by flex. */
26 /*@constant external int ECHO@*/
32 /*@-declundef@*/ /* Might not process grammar files */
33 extern /*@dependent@*/ /*@open@*/ FILE *yyin;
34 extern /*@dependent@*/ /*@open@*/ /*@unused@*/ FILE *yyout;
35 extern /*@unused@*/ int yyleng;
43 extern /*@observer@*/ cstring g_codeFile;
44 extern int g_codeLine;
46 extern /*@observer@*/ cstring g_prevCodeFile;
47 extern int g_prevCodeLine;
49 extern /*@observer@*/ char *g_localSpecPath;
51 extern /*@only@*/ cstring g_currentSpec;
52 extern /*@null@*/ /*@only@*/ char *g_currentSpecName;
54 extern void setCodePoint (void);
55 # define setCodePoint() \
56 (g_prevCodeFile = g_codeFile, g_prevCodeLine = g_codeLine, \
57 g_codeFile = cstring_makeLiteralTemp (__FILE__), g_codeLine = __LINE__)
59 extern void printCodePoint (void);
61 extern fileId currentFile (void) /*@globals g_currentloc; @*/ ;
62 # define currentFile() (fileloc_fileId (g_currentloc))
64 extern int currentColumn (void) /*@globals g_currentloc; @*/ ;
65 # define currentColumn() (fileloc_column(g_currentloc))
67 extern void incColumn (void)
68 /*@globals g_currentloc; @*/
69 /*@modifies g_currentloc@*/ ;
70 # define incColumn() (fileloc_incColumn(g_currentloc))
72 extern void decColumn (void)
73 /*@globals g_currentloc; @*/
74 /*@modifies g_currentloc@*/ ;
75 # define decColumn() (fileloc_addColumn(g_currentloc, -1))
77 extern void incLine (void)
78 /*@globals g_currentloc; @*/
79 /*@modifies g_currentloc; @*/ ;
80 # define incLine() (fileloc_nextLine(g_currentloc))
82 extern void decLine (void)
83 /*@globals g_currentloc; @*/
84 /*@modifies g_currentloc; @*/ ;
85 # define decLine() (fileloc_addLine (g_currentloc, -1))
87 extern void beginLine (void)
88 /*@globals g_currentloc; @*/
89 /*@modifies g_currentloc; @*/ ;
90 # define beginLine() (fileloc_setColumn(g_currentloc, 1))
92 extern void addColumn (int p_n)
93 /*@globals g_currentloc; @*/
94 /*@modifies g_currentloc; @*/ ;
95 # define addColumn(n) (fileloc_addColumn(g_currentloc, n))
97 extern void setLine (int p_n)
98 /*@globals fileloc g_currentloc; @*/
99 /*@modifies g_currentloc; @*/ ;
100 # define setLine(n) (fileloc_setLineno(g_currentloc, n))
102 extern void setColumn (int p_n)
103 /*@globals fileloc g_currentloc; @*/
104 /*@modifies g_currentloc; @*/ ;
105 # define setColumn(n) (fileloc_setColumn(g_currentloc, n))
107 extern void setSpecFileId (fileId p_s)
108 /*@globals fileloc g_currentloc; @*/
109 /*@modifies g_currentloc; @*/ ;
110 # define setSpecFileId(s) \
111 (fileloc_reallyFree (g_currentloc), g_currentloc = fileloc_createSpec (s, 1, 1))
113 extern void setFileLine (fileId p_s, int p_line)
114 /*@globals fileloc g_currentloc; @*/
115 /*@modifies g_currentloc; @*/ ;
116 # define setFileLine(s, line) \
117 (context_setFilename(s, line))
120 # error "Multiple include"