1 |
m4_divert(-1) |
m4_divert(-1) |
|
|
|
2 |
# C++ skeleton for Bison |
# C++ skeleton for Bison |
3 |
# Copyright (C) 2002 Free Software Foundation, Inc. |
# Copyright (C) 2002 Free Software Foundation, Inc. |
4 |
|
|
17 |
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
18 |
# 02111-1307 USA |
# 02111-1307 USA |
19 |
|
|
20 |
|
m4_include([c.m4]) |
|
# b4_sint_type(MAX) |
|
|
# ----------------- |
|
|
# Return the smallest signed int type able to handle the number MAX. |
|
|
m4_define([b4_sint_type], |
|
|
[m4_if(m4_eval([$1 <= 127]), [1], [signed char], |
|
|
m4_eval([$1 <= 32767]), [1], [signed short], |
|
|
[signed int])]) |
|
|
|
|
|
|
|
|
# b4_uint_type(MAX) |
|
|
# ----------------- |
|
|
# Return the smallest unsigned int type able to handle the number MAX. |
|
|
m4_define([b4_uint_type], |
|
|
[m4_if(m4_eval([$1 <= 255]), [1], [unsigned char], |
|
|
m4_eval([$1 <= 65535]), [1], [unsigned short], |
|
|
[unsigned int])]) |
|
|
|
|
21 |
|
|
22 |
# b4_lhs_value([TYPE]) |
# b4_lhs_value([TYPE]) |
23 |
# -------------------- |
# -------------------- |
49 |
[location_stack_@<:@m4_eval([$1 - $2])@:>@]) |
[location_stack_@<:@m4_eval([$1 - $2])@:>@]) |
50 |
|
|
51 |
|
|
|
# b4_token_define(TOKEN-NAME, TOKEN-NUMBER) |
|
|
# ----------------------------------------- |
|
|
# Output the definition of this token as #define. |
|
|
m4_define([b4_token_define], |
|
|
[#define $1 $2 |
|
|
]) |
|
|
|
|
|
|
|
|
# b4_token_defines(LIST-OF-PAIRS-TOKEN-NAME-TOKEN-NUMBER) |
|
|
# ------------------------------------------------------- |
|
|
# Output the definition of the tokens as #define. |
|
|
m4_define([b4_token_defines], |
|
|
[m4_map([b4_token_define], [$@])]) |
|
|
|
|
52 |
m4_define_default([b4_input_suffix], [.y]) |
m4_define_default([b4_input_suffix], [.y]) |
53 |
|
|
54 |
m4_define_default([b4_output_parser_suffix], |
m4_define_default([b4_output_parser_suffix], |
86 |
], |
], |
87 |
[])]) |
[])]) |
88 |
|
|
|
m4_define([b4_copyright], |
|
|
[/* -*- C++ -*- */ |
|
|
/* A Bison parser, made from b4_filename, |
|
|
by GNU bison b4_version. */ |
|
|
|
|
|
/* Skeleton output parser for bison, |
|
|
Copyright 2002 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 |
|
|
the Free Software Foundation; either version 2, or (at your option) |
|
|
any later version. |
|
|
|
|
|
This program is distributed in the hope that it will be useful, |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
|
GNU General Public License for more details. |
|
|
|
|
|
You should have received a copy of the GNU General Public License |
|
|
along with this program; if not, write to the Free Software |
|
|
Foundation, Inc., 59 Temple Place - Suite 330, |
|
|
Boston, MA 02111-1307, USA. */ |
|
|
|
|
|
/* As a special exception, when this file is copied by Bison into a |
|
|
Bison output file, you may use that output file without restriction. |
|
|
This special exception was added by the Free Software Foundation |
|
|
in version 1.24 of Bison. */]) |
|
89 |
|
|
90 |
m4_divert(0)dnl |
m4_divert(0)dnl |
91 |
#output "b4_output_header_name" |
#output "b4_output_header_name" |
92 |
b4_copyright |
b4_copyright([C++ Skeleton parser for LALR(1) parsing with Bison], |
93 |
|
[2002]) |
94 |
#ifndef b4_header_guard |
#ifndef b4_header_guard |
95 |
# define b4_header_guard |
# define b4_header_guard |
96 |
|
|
295 |
#endif /* not b4_header_guard */ |
#endif /* not b4_header_guard */ |
296 |
|
|
297 |
#output "b4_output_prefix[]b4_output_infix[].cc" |
#output "b4_output_prefix[]b4_output_infix[].cc" |
298 |
b4_copyright |
b4_copyright([C++ Skeleton parser for LALR(1) parsing with Bison], |
299 |
|
[2002]) |
300 |
|
|
301 |
#include "b4_output_header_name" |
#include "b4_output_header_name" |
302 |
|
|
774 |
b4_epilogue |
b4_epilogue |
775 |
|
|
776 |
#output "stack.hh" |
#output "stack.hh" |
777 |
b4_copyright |
b4_copyright([2002]) |
778 |
|
|
779 |
#ifndef BISON_STACK_HH |
#ifndef BISON_STACK_HH |
780 |
# define BISON_STACK_HH |
# define BISON_STACK_HH |
871 |
#endif // not BISON_STACK_HH |
#endif // not BISON_STACK_HH |
872 |
|
|
873 |
#output "location.hh" |
#output "location.hh" |
874 |
b4_copyright |
b4_copyright([2002]) |
875 |
|
|
876 |
#ifndef BISON_LOCATION_HH |
#ifndef BISON_LOCATION_HH |
877 |
# define BISON_LOCATION_HH |
# define BISON_LOCATION_HH |