[nolimips] 208: Print a generated-file warning

Index: ChangeLog from Benoît Perrot <benoit@lrde.epita.fr> Print a generated-file warning at the beginning of generated files. Suggested by Roland Levillain. * dev/nolimips.py (generated_by_hand): Add warning string. * src/parse/asm-parse.yy.gen.py, * src/parse/asm-scan.ll.gen.py, * src/inst/program_solver.gen.py, * src/inst/nodes.gen.py, * src/inst/program_builder.hh.gen.py, Print warning right after license. * src/inst/nodes.mk.gen.py: Remove a useless import. 2006-01-07 Benoît Perrot <benoit@lrde.epita.fr> Index: src/parse/asm-parse.yy.gen.py --- src/parse/asm-parse.yy.gen.py (revision 207) +++ src/parse/asm-parse.yy.gen.py (working copy) @@ -1,7 +1,7 @@ #!/usr/bin/env python ## ## This file is part of Nolimips, a MIPS simulator with unlimited registers -## Copyright (C) 2003, 2004 Benoit Perrot <benoit@lrde.epita.fr> +## Copyright (C) 2003, 2004, 2006 Benoit Perrot <benoit@lrde.epita.fr> ## ## Nolimips is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -22,7 +22,7 @@ import string, re import nolimips -from nolimips import license, depth, define_id +from nolimips import depth, define_id #### Nolimips' Bison assembly parser generator ------------- @@ -38,7 +38,8 @@ ## Prologue -------------------------- print "%{ // -*- C++ -*-" -print license +print nolimips.license +print nolimips.generated_by_hand print """ #include <string> Index: src/parse/asm-scan.ll.gen.py --- src/parse/asm-scan.ll.gen.py (revision 207) +++ src/parse/asm-scan.ll.gen.py (working copy) @@ -1,7 +1,7 @@ #!/usr/bin/env python ## ## This file is part of Nolimips, a MIPS simulator with unlimited registers -## Copyright (C) 2003, 2004 Benoit Perrot <benoit@lrde.epita.fr> +## Copyright (C) 2003, 2004, 2006 Benoit Perrot <benoit@lrde.epita.fr> ## ## Nolimips is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -22,7 +22,7 @@ import string, re import nolimips -from nolimips import license, define_id +from nolimips import define_id #### Nolimips' Flex scanner generator -------------------------- @@ -38,7 +38,8 @@ ## Prologue ---------------------------- print "%{ /* -*- C++ -*- */" -print license +print nolimips.license +print nolimips.generated_by_hand print """ #include <string> #include <sstream> Index: src/inst/program_solver.gen.py --- src/inst/program_solver.gen.py (revision 207) +++ src/inst/program_solver.gen.py (working copy) @@ -22,7 +22,7 @@ import string, re import nolimips -from nolimips import license, depth, class_id +from nolimips import depth, class_id #### Nolimips' program solver generator -------------------- @@ -38,7 +38,8 @@ ## Generate interface sys.stdout = file("program_solver.hh.tmp", "w") -print license +print nolimips.license +print nolimips.generated_by_hand print """#ifndef INST_PROGRAM_SOLVER_HH # define INST_PROGRAM_SOLVER_HH @@ -145,7 +146,8 @@ ## Generate implementation sys.stdout = file("program_solver.cc.tmp", "w") -print license +print nolimips.license +print nolimips.generated_by_hand print """#include \"inst/program_solver.hh\" #include \"inst/int_exp.hh\" #include \"inst/label_exp.hh\" Index: src/inst/nodes.gen.py --- src/inst/nodes.gen.py (revision 207) +++ src/inst/nodes.gen.py (working copy) @@ -43,7 +43,7 @@ class_id = nolimips.class_id(inst.opcode) define_id = nolimips.define_id(inst.opcode) file_id = nolimips.file_id(inst.opcode) - banner = nolimips.license + "\n// Generated, do not edit by hand." + banner = nolimips.license + "\n" + nolimips.generated_by_hand format = inst.format ## Open header, inline and implementation files @@ -262,6 +262,7 @@ ## Generate all-includer sys.stdout = file("all.hh.tmp", "w") print nolimips.license +print nolimips.generated_by_hand print "#ifndef INST_ALL_HH" print "# define INST_ALL_HH" for inst in instructions: @@ -276,6 +277,7 @@ ## Generate all-declarator sys.stdout = file("fwd.hh.tmp", "w") print nolimips.license +print nolimips.generated_by_hand print """ #ifndef INST_FWD_HH # define INST_FWD_HH @@ -326,6 +328,7 @@ ## Generate visitor sys.stdout = file("visitor.hh.tmp", "w") print nolimips.license +print nolimips.generated_by_hand print """#ifndef INST_VISITOR_HH # define INST_VISITOR_HH Index: src/inst/program_builder.hh.gen.py --- src/inst/program_builder.hh.gen.py (revision 207) +++ src/inst/program_builder.hh.gen.py (working copy) @@ -1,7 +1,7 @@ #!/usr/bin/env python ## ## This file is part of Nolimips, a MIPS simulator with unlimited registers -## Copyright (C) 2003, 2004 Benoit Perrot <benoit@lrde.epita.fr> +## Copyright (C) 2003, 2004, 2006 Benoit Perrot <benoit@lrde.epita.fr> ## ## Nolimips is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -22,7 +22,7 @@ import string, re import nolimips -from nolimips import license, depth, class_id +from nolimips import depth, class_id #### Nolimips' program builder generator ------------------- @@ -36,7 +36,8 @@ sys.stdout = file("program_builder.hh.tmp", "w") -print license +print nolimips.license +print nolimips.generated_by_hand print """#ifndef INST_PROGRAM_BUILDER_HH # define INST_PROGRAM_BUILDER_HH Index: src/inst/nodes.mk.gen.py --- src/inst/nodes.mk.gen.py (revision 207) +++ src/inst/nodes.mk.gen.py (working copy) @@ -22,7 +22,7 @@ import string, re import nolimips -from nolimips import license, depth +from nolimips import depth #### Nolimips' inst/Makefile.am generator ------------------ Index: dev/nolimips.py --- dev/nolimips.py (revision 207) +++ dev/nolimips.py (working copy) @@ -1,7 +1,7 @@ #!/usr/bin/env python ## ## This file is part of Nolimips, a MIPS simulator with unlimited registers -## Copyright (C) 2003, 2004, 2005 Benoit Perrot <benoit@lrde.epita.fr> +## Copyright (C) 2003, 2004, 2005, 2006 Benoit Perrot <benoit@lrde.epita.fr> ## ## Nolimips is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -26,7 +26,7 @@ license = """// // This file is part of Nolimips, a MIPS simulator with unlimited registers -// Copyright (C) 2004, 2005 Benoit Perrot <benoit@lrde.epita.fr> +// Copyright (C) 2004, 2005, 2006 Benoit Perrot <benoit@lrde.epita.fr> // // Nolimips is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -41,7 +41,13 @@ // 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 -//""" +// +""" + +generated_by_hand = """// +// WARNING: Generated file, do not edit by hand! +// +""" ## --------------------------------------------------------------------------- def depth(root):
participants (1)
-
Noe