]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/input.h
gcc_release (announce_snapshot): Use changedir instead of plain cd.
[thirdparty/gcc.git] / gcc / input.h
CommitLineData
d7f6896a
RK
1/* Declarations for variables relating to reading the source file.
2 Used by parsers, lexical analyzers, and error message routines.
d9221e01 3 Copyright (C) 1993, 1997, 1998, 2000, 2003, 2004 Free Software Foundation, Inc.
d7f6896a 4
1322177d 5This file is part of GCC.
d7f6896a 6
1322177d
LB
7GCC is free software; you can redistribute it and/or modify it under
8the terms of the GNU General Public License as published by the Free
9Software Foundation; either version 2, or (at your option) any later
10version.
d7f6896a 11
1322177d
LB
12GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13WARRANTY; without even the implied warranty of MERCHANTABILITY or
14FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15for more details.
d7f6896a
RK
16
17You should have received a copy of the GNU General Public License
1322177d
LB
18along with GCC; see the file COPYING. If not, write to the Free
19Software Foundation, 59 Temple Place - Suite 330, Boston, MA
2002111-1307, USA. */
d7f6896a 21
6060edcb
NS
22#ifndef GCC_INPUT_H
23#define GCC_INPUT_H
1fa2d22f 24
50f59cd7
PB
25extern struct line_maps line_table;
26
6060edcb 27/* The data structure used to record a location in a translation unit. */
59e4e217 28/* Long-term, we want to get rid of this and typedef fileline location_t. */
6060edcb
NS
29struct location_s GTY (())
30{
1d088dee 31 /* The name of the source file involved. */
6060edcb 32 const char *file;
1fa2d22f 33
6060edcb
NS
34 /* The line-location in the source file. */
35 int line;
36};
37typedef struct location_s location_t;
1fa2d22f
RS
38
39struct file_stack
6060edcb
NS
40{
41 struct file_stack *next;
42 location_t location;
43};
44
45/* Top-level source file. */
46extern const char *main_input_filename;
47
48extern location_t input_location;
49#define input_line (input_location.line)
50#define input_filename (input_location.file)
1fa2d22f
RS
51
52/* Stack of currently pending input files.
53 The line member is not accurate for the innermost file on the stack. */
54extern struct file_stack *input_file_stack;
55
72954a4f
JM
56/* Stack of EXPR_WITH_FILE_LOCATION nested expressions. */
57extern struct file_stack *expr_wfl_stack;
58
1fa2d22f
RS
59/* Incremented on each change to input_file_stack. */
60extern int input_file_stack_tick;
68723fae 61
1d088dee
AJ
62extern void push_srcloc (const char *name, int line);
63extern void pop_srcloc (void);
6060edcb
NS
64
65#endif