2 ** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2001.
3 ** See ../LICENSE for license information.
9 extern /*@owned@*/ fileloc g_currentloc;
11 /* stream for error messages */
12 extern /*:open:*/ FILE *g_msgstream;
15 /* This macro is defined by flex. */
16 /*@constant external int ECHO@*/
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;
33 extern /*@observer@*/ cstring g_codeFile;
34 extern int g_codeLine;
36 extern /*@observer@*/ cstring g_prevCodeFile;
37 extern int g_prevCodeLine;
39 extern /*@observer@*/ char *g_localSpecPath;
42 extern /*@only@*/ cstring g_currentSpec;
43 extern /*@null@*/ /*@only@*/ char *g_currentSpecName;
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__)
51 extern void printCodePoint (void);
53 extern fileId currentFile (void) /*@globals g_currentloc; @*/ ;
54 # define currentFile() (fileloc_fileId (g_currentloc))
56 extern int currentColumn (void) /*@globals g_currentloc; @*/ ;
57 # define currentColumn() (fileloc_column(g_currentloc))
59 extern void incColumn (void)
60 /*@globals g_currentloc; @*/
61 /*@modifies g_currentloc@*/ ;
62 # define incColumn() (fileloc_incColumn(g_currentloc))
64 extern void decColumn (void)
65 /*@globals g_currentloc; @*/
66 /*@modifies g_currentloc@*/ ;
67 # define decColumn() (fileloc_addColumn(g_currentloc, -1))
69 extern void incLine (void)
70 /*@globals g_currentloc; @*/
71 /*@modifies g_currentloc; @*/ ;
72 # define incLine() (fileloc_nextLine(g_currentloc))
74 extern void decLine (void)
75 /*@globals g_currentloc; @*/
76 /*@modifies g_currentloc; @*/ ;
77 # define decLine() (fileloc_addLine (g_currentloc, -1))
79 extern void beginLine (void)
80 /*@globals g_currentloc; @*/
81 /*@modifies g_currentloc; @*/ ;
82 # define beginLine() (fileloc_setColumn(g_currentloc, 1))
84 extern void addColumn (int p_n)
85 /*@globals g_currentloc; @*/
86 /*@modifies g_currentloc; @*/ ;
87 # define addColumn(n) (fileloc_addColumn(g_currentloc, n))
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))
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))
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))
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))
114 # error "Multiple include"