Implement support for relative and absolute skeleton file names.

Discussed starting at
<http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
* doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
(Bison Options): Document in --skeleton entry.
* src/output.c (output_skeleton): Use strncpy rather than strcpy since
full_skeleton can't necessarily hold all of pkgdatadir.
If the specified skeleton file name contains a `/', don't prepend
pkgdatadir.
* src/parse-gram.y (prologue_declaration): If the specified skeleton
file name contains a `/', prepend the grammar file directory.
* tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
* skeletons.at: New file.
(relative skeleton file names): New test case.
(installed skeleton file names): New test case.
* tests/testsuite.at: Include skeletons.at.

* bootstrap: Update copyright to 2007.
This commit is contained in:
Joel E. Denny
2007-01-18 02:18:17 +00:00
parent 830c9b1847
commit a7867f53b3
9 changed files with 309 additions and 81 deletions

View File

@@ -4698,11 +4698,18 @@ Require a Version of Bison}.
@end deffn
@deffn {Directive} %skeleton "@var{file}"
Specify the skeleton to use. You probably don't need this option unless
you are developing Bison; you should use @code{%language} if you want to
specify the skeleton for a different language, because it is clearer and
because it will always choose the correct skeleton for non-deterministic
or push parsers.
Specify the skeleton to use.
You probably don't need this option unless you are developing Bison.
You should use @code{%language} if you want to specify the skeleton for a
different language, because it is clearer and because it will always choose the
correct skeleton for non-deterministic or push parsers.
If @var{file} does not contain a @code{/}, @var{file} is the name of a skeleton
file in the Bison installation directory.
If it does, @var{file} is an absolute file name or a file name relative to the
directory of the grammar file.
This is similar to how most shells resolve commands.
@end deffn
@deffn {Directive} %token-table
@@ -7319,14 +7326,20 @@ Pretend that @code{%no-parser} was specified. @xref{Decl Summary}.
@item -S @var{file}
@itemx --skeleton=@var{file}
Specify the skeleton to use, as if @code{%skeleton} was specified
Specify the skeleton to use, similar to @code{%skeleton}
(@pxref{Decl Summary, , Bison Declaration Summary}).
You probably don't need this option unless you are developing Bison;
you should use @option{--language} if you want to specify the skeleton for a
You probably don't need this option unless you are developing Bison.
You should use @option{--language} if you want to specify the skeleton for a
different language, because it is clearer and because it will always
choose the correct skeleton for non-deterministic or push parsers.
If @var{file} does not contain a @code{/}, @var{file} is the name of a skeleton
file in the Bison installation directory.
If it does, @var{file} is an absolute file name or a file name relative to the
current working directory.
This is similar to how most shells resolve commands.
@item -k
@itemx --token-table
Pretend that @code{%token-table} was specified. @xref{Decl Summary}.