]>
git.saurik.com Git - bison.git/blob - src/location.h
150b842f6db80e93c021d7f83d1f3cc5edf27e6d
2 Copyright (C) 2002, 2004, 2005, 2006 Free Software Foundation, Inc.
4 This file is part of Bison, the GNU Compiler Compiler.
6 Bison is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 Bison is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with Bison; see the file COPYING. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA. */
27 /* A boundary between two characters. */
30 /* The name of the file that contains the boundary. */
33 /* The (origin-1) line that contains the boundary.
34 If this is INT_MAX, the line number has overflowed. */
37 /* The (origin-1) column just after the boundary. This is neither a
38 byte count, nor a character count; it is a column count.
39 If this is INT_MAX, the column number has overflowed. */
44 /* Set the position of \a a. */
46 boundary_set (boundary
*b
, const char *f
, int l
, int c
)
53 /* Return nonzero if A and B are equal boundaries. */
55 equal_boundaries (boundary a
, boundary b
)
57 return (a
.column
== b
.column
59 && UNIQSTR_EQ (a
.file
, b
.file
));
62 /* A location, that is, a region of source code. */
65 /* Boundary just before the location starts. */
68 /* Boundary just after the location ends. */
73 #define YYLTYPE location
75 extern location
const empty_location
;
77 /* Set *LOC and adjust scanner cursor to account for token TOKEN of
79 void location_compute (location
*loc
,
80 boundary
*cur
, char const *token
, size_t size
);
82 void location_print (FILE *out
, location loc
);
84 #endif /* ! defined LOCATION_H_ */