X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/4f6e011e2eececfe5fb2c467da542615f26439bc..193d7c7054ba7197b0789e14965b739162319b5e:/data/location.cc diff --git a/data/location.cc b/data/location.cc index bb701b3e..6581b384 100644 --- a/data/location.cc +++ b/data/location.cc @@ -2,7 +2,7 @@ m4_divert(-1) # C++ skeleton for Bison -# Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,17 +19,29 @@ m4_divert(-1) # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA -m4_include(b4_pkgdatadir/[c++.m4]) - # We do want M4 expansion after # for CPP macros. m4_changecom() m4_divert(0)dnl @output b4_dir_prefix[]position.hh -b4_copyright([Position class for Bison C++ parsers], [2002, 2003, 2004, 2005])[ +b4_copyright([Positions for Bison parsers in C++], + [2002, 2003, 2004, 2005, 2006]) +[ +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ /** ** \file position.hh - ** Define the position class. + ** Define the ]b4_namespace[::position class. */ #ifndef BISON_POSITION_HH @@ -38,23 +50,27 @@ b4_copyright([Position class for Bison C++ parsers], [2002, 2003, 2004, 2005])[ # include # include -namespace yy +namespace ]b4_namespace[ { /// Abstract a position. class position { - /** \name Ctor & dtor. - ** \{ */ public: +]m4_ifdef([b4_location_constructors], [ /// Construct a position. - position () : - filename (0), - line (1), - column (0) + position () + : filename (0), line (1), column (0) { } - /** \} */ +])[ + /// Initialization. + inline void initialize (]b4_filename_type[* fn) + { + filename = fn; + line = 1; + column = 0; + } /** \name Line and Column related manipulators ** \{ */ @@ -132,11 +148,25 @@ namespace yy } #endif // not BISON_POSITION_HH] @output b4_dir_prefix[]location.hh -b4_copyright([Location class for Bison C++ parsers], [2002, 2003, 2004, 2005])[ +b4_copyright([Locations for Bison parsers in C++], + [2002, 2003, 2004, 2005, 2006]) +[ +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ /** ** \file location.hh - ** Define the location class. + ** Define the ]b4_namespace[::location class. */ #ifndef BISON_LOCATION_HH @@ -146,23 +176,27 @@ b4_copyright([Location class for Bison C++ parsers], [2002, 2003, 2004, 2005])[ # include # include "position.hh" -namespace yy +namespace ]b4_namespace[ { /// Abstract a location. class location { - /** \name Ctor & dtor. - ** \{ */ public: +]m4_ifdef([b4_location_constructors], [ /// Construct a location. - location () : - begin (), - end () + location () + : begin (), end () { } - /** \} */ +])[ + /// Initialization. + inline void initialize (]b4_filename_type[* fn) + { + begin.initialize (fn); + end = begin; + } /** \name Line and Column related manipulators ** \{ */