bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

examples: add license headers


From: Akim Demaille
Subject: examples: add license headers
Date: Wed, 8 Jul 2020 06:09:43 +0200

commit f22d58435ac16c4a6554edc343d45d8c7d235121
Author: Akim Demaille <akim.demaille@gmail.com>
Date:   Tue Jul 7 08:14:07 2020 +0200

    examples: add license headers
    
    Prompted by Rici Lake.
    https://stackoverflow.com/questions/62658368/#comment110853985_62661621
    Discussed with Paul Eggert.
    
    * doc/bison.texi, examples/c/bistromathic/parse.y,
    * examples/c/lexcalc/parse.y, examples/c/lexcalc/scan.l,
    * examples/c/pushcalc/calc.y, examples/c/reccalc/parse.y,
    * examples/c/reccalc/scan.l, examples/d/calc.y,
    * examples/java/calc/Calc.y, examples/java/simple/Calc.y:
    Install the GPL3+ header.

diff --git a/doc/bison.texi b/doc/bison.texi
index 84a609cf..56367a3d 100644
--- a/doc/bison.texi
+++ b/doc/bison.texi
@@ -1677,6 +1677,31 @@ Here are the C and Bison declarations for the Reverse 
Polish Notation
 calculator.  As in C, comments are placed between @samp{/*@dots{}*/} or
 after @samp{//}.
 
+@ignore
+@comment file: rpcalc.y
+@example
+/* Parser for rpcalc.   -*- C -*-
+
+   Copyright (C) 1988-1993, 1995, 1998-2015, 2018-2020 Free Software
+   Foundation, Inc.
+
+   This file is part of Bison, the GNU Compiler Compiler.
+
+   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 3 of the License, 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, see <http://www.gnu.org/licenses/>.  */
+@end example
+@end ignore
+
 @comment file: rpcalc.y
 @example
 /* Reverse Polish Notation calculator. */
@@ -2538,6 +2563,31 @@ Note that multiple assignment and nested function calls 
are permitted.
 
 Here are the C and Bison declarations for the multi-function calculator.
 
+@ignore
+@comment file: mfcalc.y
+@example
+/* Parser for mfcalc.   -*- C -*-
+
+   Copyright (C) 1988-1993, 1995, 1998-2015, 2018-2020 Free Software
+   Foundation, Inc.
+
+   This file is part of Bison, the GNU Compiler Compiler.
+
+   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 3 of the License, 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, see <http://www.gnu.org/licenses/>.  */
+@end example
+@end ignore
+
 @comment file: mfcalc.y: 1
 @example
 @group
@@ -2642,6 +2692,31 @@ The symbol table itself consists of a linked list of 
records.  Its
 definition, which is kept in the header @file{calc.h}, is as follows.  It
 provides for either functions or variables to be placed in the table.
 
+@ignore
+@comment file: calc.h
+@example
+/* Functions for mfcalc.   -*- C -*-
+
+   Copyright (C) 1988-1993, 1995, 1998-2015, 2018-2020 Free Software
+   Foundation, Inc.
+
+   This file is part of Bison, the GNU Compiler Compiler.
+
+   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 3 of the License, 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, see <http://www.gnu.org/licenses/>.  */
+@end example
+@end ignore
+
 @comment file: calc.h
 @example
 @group
@@ -11745,6 +11820,30 @@ A Bison file has three parts.  In the first part, the 
prologue, we start by
 making sure we run a version of Bison which is recent enough, and that we
 generate C++.
 
+@ignore
+@comment file: c++/simple.yy: 1
+@example
+/* Simple variant-based parser.   -*- C++ -*-
+
+   Copyright (C) 2018-2020 Free Software Foundation, Inc.
+
+   This file is part of Bison, the GNU Compiler Compiler.
+
+   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 3 of the License, 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, see <http://www.gnu.org/licenses/>.  */
+@end example
+@end ignore
+
 @comment file: c++/simple.yy: 1
 @example
 %require "3.2"
@@ -12817,6 +12916,30 @@ The declaration of this driver class, in 
@file{driver.hh}, is as follows.
 The first part includes the CPP guard and imports the required standard
 library components, and the declaration of the parser class.
 
+@ignore
+@comment file: calc++/driver.hh
+@example
+/* Driver for calc++.   -*- C++ -*-
+
+   Copyright (C) 2005--2015, 2018--2020 Free Software Foundation, Inc.
+
+   This file is part of Bison, the GNU Compiler Compiler.
+
+   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 3 of the License, 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, see <http://www.gnu.org/licenses/>.  */
+@end example
+@end ignore
+
 @comment file: calc++/driver.hh
 @example
 #ifndef DRIVER_HH
@@ -12889,6 +13012,30 @@ member functions to open and close the scanning phase.
 
 The implementation of the driver (@file{driver.cc}) is straightforward.
 
+@ignore
+@comment file: calc++/driver.cc
+@example
+/* Driver for calc++.   -*- C++ -*-
+
+   Copyright (C) 2005--2015, 2018--2020 Free Software Foundation, Inc.
+
+   This file is part of Bison, the GNU Compiler Compiler.
+
+   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 3 of the License, 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, see <http://www.gnu.org/licenses/>.  */
+@end example
+@end ignore
+
 @comment file: calc++/driver.cc
 @example
 #include "driver.hh"
@@ -12932,6 +13079,30 @@ parser skeleton, the creation of the parser header 
file.  Because the C++
 skeleton changed several times, it is safer to require the version you
 designed the grammar for.
 
+@ignore
+@comment file: calc++/parser.yy
+@example
+/* Parser for calc++.   -*- C++ -*-
+
+   Copyright (C) 2005--2015, 2018--2020 Free Software Foundation, Inc.
+
+   This file is part of Bison, the GNU Compiler Compiler.
+
+   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 3 of the License, 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, see <http://www.gnu.org/licenses/>.  */
+@end example
+@end ignore
+
 @comment file: calc++/parser.yy
 @example
 %skeleton "lalr1.cc" // -*- C++ -*-
@@ -13120,6 +13291,30 @@ yy::parser::error (const location_type& l, const 
std::string& m)
 In addition to standard headers, the Flex scanner includes the driver's,
 then the parser's to get the set of defined tokens.
 
+@ignore
+@comment file: calc++/scanner.ll
+@example
+/* Scanner for calc++.   -*- C++ -*-
+
+   Copyright (C) 2005--2015, 2018--2020 Free Software Foundation, Inc.
+
+   This file is part of Bison, the GNU Compiler Compiler.
+
+   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 3 of the License, 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, see <http://www.gnu.org/licenses/>.  */
+@end example
+@end ignore
+
 @comment file: calc++/scanner.ll
 @example
 %@{ /* -*- C++ -*- */
@@ -13293,7 +13488,7 @@ The rules are simple.  The driver is used to report 
errors.
 You should keep your rules simple, both in the parser and in the scanner.
 Throwing from the auxiliary functions is then very handy to report errors.
 
-@comment file: scanner.ll
+@comment file: calc++/scanner.ll
 @example
 @group
 yy::parser::symbol_type
@@ -13343,7 +13538,31 @@ driver::scan_end ()
 
 The top level file, @file{calc++.cc}, poses no problem.
 
-@comment file: calc++.cc
+@ignore
+@comment file: calc++/calc++.cc
+@example
+/* Main for calc++.   -*- C++ -*-
+
+   Copyright (C) 2005--2015, 2018--2020 Free Software Foundation, Inc.
+
+   This file is part of Bison, the GNU Compiler Compiler.
+
+   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 3 of the License, 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, see <http://www.gnu.org/licenses/>.  */
+@end example
+@end ignore
+
+@comment file: calc++/calc++.cc
 @example
 #include <iostream>
 #include "driver.hh"
diff --git a/examples/c/bistromathic/parse.y b/examples/c/bistromathic/parse.y
index bb93af0f..d4e77825 100644
--- a/examples/c/bistromathic/parse.y
+++ b/examples/c/bistromathic/parse.y
@@ -1,3 +1,22 @@
+/* Parser and scanner for bistromathic.   -*- C -*-
+
+   Copyright (C) 2019-2020 Free Software Foundation, Inc.
+
+   This file is part of Bison, the GNU Compiler Compiler.
+
+   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 3 of the License, 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, see <http://www.gnu.org/licenses/>.  */
+
 %require "3.7"
 
 // Emitted on top of the implementation file.
diff --git a/examples/c/lexcalc/parse.y b/examples/c/lexcalc/parse.y
index 6db00c9b..d06a2036 100644
--- a/examples/c/lexcalc/parse.y
+++ b/examples/c/lexcalc/parse.y
@@ -1,3 +1,22 @@
+/* Parser for lexcalc.   -*- C -*-
+
+   Copyright (C) 2018-2020 Free Software Foundation, Inc.
+
+   This file is part of Bison, the GNU Compiler Compiler.
+
+   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 3 of the License, 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, see <http://www.gnu.org/licenses/>.  */
+
 // Prologue (directives).
 %expect 0
 
diff --git a/examples/c/lexcalc/scan.l b/examples/c/lexcalc/scan.l
index 708fd28b..3d71a381 100644
--- a/examples/c/lexcalc/scan.l
+++ b/examples/c/lexcalc/scan.l
@@ -1,4 +1,23 @@
-/* Prologue (directives).   -*- C -*- */
+/* Scanner for lexcalc.   -*- C -*-
+
+   Copyright (C) 2018-2020 Free Software Foundation, Inc.
+
+   This file is part of Bison, the GNU Compiler Compiler.
+
+   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 3 of the License, 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, see <http://www.gnu.org/licenses/>.  */
+
+/* Prologue (directives). */
 
 /* Disable Flex features we don't need, to avoid warnings. */
 %option nodefault noinput nounput noyywrap
diff --git a/examples/c/pushcalc/calc.y b/examples/c/pushcalc/calc.y
index 6d49470c..03ae04c4 100644
--- a/examples/c/pushcalc/calc.y
+++ b/examples/c/pushcalc/calc.y
@@ -1,3 +1,22 @@
+/* Parser and scanner for pushcalc.   -*- C -*-
+
+   Copyright (C) 2020 Free Software Foundation, Inc.
+
+   This file is part of Bison, the GNU Compiler Compiler.
+
+   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 3 of the License, 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, see <http://www.gnu.org/licenses/>.  */
+
 %code top {
   #include <ctype.h>  /* isdigit. */
   #include <stdio.h>  /* printf. */
diff --git a/examples/c/reccalc/parse.y b/examples/c/reccalc/parse.y
index c11f9b66..3d3fbf4d 100644
--- a/examples/c/reccalc/parse.y
+++ b/examples/c/reccalc/parse.y
@@ -1,3 +1,22 @@
+/* Parser for reccalc.   -*- C -*-
+
+   Copyright (C) 2019-2020 Free Software Foundation, Inc.
+
+   This file is part of Bison, the GNU Compiler Compiler.
+
+   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 3 of the License, 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, see <http://www.gnu.org/licenses/>.  */
+
 // Prologue (directives).
 %expect 0
 
diff --git a/examples/c/reccalc/scan.l b/examples/c/reccalc/scan.l
index 45d70d3b..1bf9773e 100644
--- a/examples/c/reccalc/scan.l
+++ b/examples/c/reccalc/scan.l
@@ -1,3 +1,22 @@
+/* Scanner for reccalc.   -*- C -*-
+
+   Copyright (C) 2019-2020 Free Software Foundation, Inc.
+
+   This file is part of Bison, the GNU Compiler Compiler.
+
+   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 3 of the License, 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, see <http://www.gnu.org/licenses/>.  */
+
 /* Prologue (directives).   -*- C -*- */
 
 /* Disable Flex features we don't need, to avoid warnings. */
diff --git a/examples/d/calc.y b/examples/d/calc.y
index a2ae85df..b0dee929 100644
--- a/examples/d/calc.y
+++ b/examples/d/calc.y
@@ -1,3 +1,22 @@
+/* Parser and scanner for calc in D.   -*- D -*-
+
+   Copyright (C) 2018-2020 Free Software Foundation, Inc.
+
+   This file is part of Bison, the GNU Compiler Compiler.
+
+   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 3 of the License, 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, see <http://www.gnu.org/licenses/>.  */
+
 %language "D"
 
 %define api.parser.class {Calc}
diff --git a/examples/java/calc/Calc.y b/examples/java/calc/Calc.y
index e9f89572..1caa48b7 100644
--- a/examples/java/calc/Calc.y
+++ b/examples/java/calc/Calc.y
@@ -1,3 +1,22 @@
+/* Parser and scanner for calc in Java.   -*- Java -*-
+
+   Copyright (C) 2018-2020 Free Software Foundation, Inc.
+
+   This file is part of Bison, the GNU Compiler Compiler.
+
+   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 3 of the License, 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, see <http://www.gnu.org/licenses/>.  */
+
 %language "Java"
 
 %define api.parser.class {Calc}
diff --git a/examples/java/simple/Calc.y b/examples/java/simple/Calc.y
index 7f6dacd7..958bcd5e 100644
--- a/examples/java/simple/Calc.y
+++ b/examples/java/simple/Calc.y
@@ -1,3 +1,22 @@
+/* Simple parser and scanner in Java.   -*- Java -*-
+
+   Copyright (C) 2018-2020 Free Software Foundation, Inc.
+
+   This file is part of Bison, the GNU Compiler Compiler.
+
+   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 3 of the License, 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, see <http://www.gnu.org/licenses/>.  */
+
 %language "Java"
 
 %define api.parser.class {Calc}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]