-m4_divert(-1) -*- C -*-
+ -*- C -*-
# GLR skeleton for Bison
# Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
m4_include(b4_pkgdatadir/[c.m4])
-b4_check_percent_code_qualifiers([[requires]], [[provides]], [[top]])
b4_push_if([
-m4_fatal([Non-deterministic push parsers are not yet supported])])
+b4_complain([[non-deterministic push parsers are not yet supported]])])
## ---------------- ##
## Default values. ##
# We do want M4 expansion after # for CPP macros.
m4_changecom()
-m4_divert(0)dnl
-@output b4_parser_file_name
+m4_divert_push(0)dnl
+@output(b4_parser_file_name@)
b4_copyright([Skeleton implementation for Bison GLR parsers in C],
[2002, 2003, 2004, 2005, 2006])
[
]b4_identification
-m4_ifdef([b4_percent_code_top],
-[[/* Copy the %code "top" blocks. */
-]b4_user_code([b4_percent_code_top])])[]dnl
+b4_percent_code_get([[top]])[]dnl
m4_if(b4_prefix, [yy], [],
[/* Substitute the variable and function names. */
#define yyparse b4_prefix[]parse
dnl # Declaration that might either go into the header (if --defines)
dnl # or open coded in the parser body.
m4_define([b4_shared_declarations],
-[m4_ifdef([b4_percent_code_requires],
-[[/* Copy the %code "requires" blocks. */
-]b4_user_code([b4_percent_code_requires])])[]dnl
+[b4_percent_code_get([[requires]])[]dnl
b4_token_enums(b4_tokens)
[#ifndef YYSTYPE
]m4_ifdef([b4_stype],
[[typedef union ]b4_union_name[
+{
]b4_user_stype[
- YYSTYPE;
+} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1]],
[m4_if(b4_tag_seen_flag, 0,
[[typedef int YYSTYPE;
# define YYLTYPE_IS_TRIVIAL 1
#endif
-]m4_ifdef([b4_percent_code_provides],
-[[/* Copy the %code "provides" blocks. */
-]b4_user_code([b4_percent_code_provides])])[]dnl
+]b4_percent_code_get([[provides]])[]dnl
])
b4_defines_if([[#include "@basename(]b4_spec_defines_file[@)"]],
/* Copy the second part of user declarations. */
]b4_user_post_prologue
-m4_ifdef([b4_percent_code],
-[[/* Copy the unqualified %code blocks. */
-]b4_user_code([b4_percent_code])
-])[]dnl
+b4_percent_code_get[]dnl
[#include <stdio.h>
#include <stdlib.h>
dnl
m4_if(b4_skeleton, ["glr.c"],
[b4_defines_if(
-[@output b4_spec_defines_file
+[@output(b4_spec_defines_file@)
b4_copyright([Skeleton interface for Bison GLR parsers in C],
[2002, 2003, 2004, 2005, 2006])
[extern YYLTYPE b4_prefix[]lloc;])
])
])])
+m4_divert_pop(0)