# 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
# 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([Position class for Bison C++ parsers],
+ [2002, 2003, 2004, 2005, 2006])[
/**
** \file position.hh
- ** Define the position class.
+ ** Define the yy::position class.
*/
#ifndef BISON_POSITION_HH
/// 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
** \{ */
}
#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([Location class for Bison C++ parsers],
+ [2002, 2003, 2004, 2005, 2006])[
/**
** \file location.hh
- ** Define the location class.
+ ** Define the yy::location class.
*/
#ifndef BISON_LOCATION_HH
/// 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
** \{ */