X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/0c8e079fa62ba9bbae1b6766e1082b482d7dab07..eb1b07409f0ccad9970c8a60ded9f2a56d205b9c:/src/location.h diff --git a/src/location.h b/src/location.h index 150b842f..0b4f715a 100644 --- a/src/location.h +++ b/src/location.h @@ -1,5 +1,5 @@ /* Locations for Bison - Copyright (C) 2002, 2004, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of Bison, the GNU Compiler Compiler. @@ -21,7 +21,6 @@ #ifndef LOCATION_H_ # define LOCATION_H_ -# include # include "uniqstr.h" /* A boundary between two characters. */ @@ -45,9 +44,9 @@ typedef struct static inline void boundary_set (boundary *b, const char *f, int l, int c) { - b->file = f; - b->line = l; - b->column = c; + b->file = f; + b->line = l; + b->column = c; } /* Return nonzero if A and B are equal boundaries. */ @@ -72,6 +71,7 @@ typedef struct #define YYLTYPE location +#define EMPTY_LOCATION_INIT {{NULL, 0, 0}, {NULL, 0, 0}} extern location const empty_location; /* Set *LOC and adjust scanner cursor to account for token TOKEN of @@ -81,4 +81,7 @@ void location_compute (location *loc, void location_print (FILE *out, location loc); +/* LOC_STR must be formatted as `file:line.column', it will be modified. */ +void boundary_set_from_string (boundary *bound, char *loc_str); + #endif /* ! defined LOCATION_H_ */