Commit 315c946f authored by Benoit Perrot's avatar Benoit Perrot
Browse files

2006-01-07 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.
parent f5410445
2006-01-07 Benot 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 Benot Perrot <benoit@lrde.epita.fr>
Add forward declarations files
......
#!/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 @@ from xml.sax import ContentHandler, make_parser
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 @@ license = """//
// 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):
......
......@@ -43,7 +43,7 @@ def class_generate(inst):
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 @@ for inst in instructions:
## 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 @@ os.remove("all.hh.tmp")
## 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 @@ os.remove("fwd.hh.tmp")
## 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
......
......@@ -22,7 +22,7 @@ import sys, os
import string, re
import nolimips
from nolimips import license, depth
from nolimips import depth
#### Nolimips' inst/Makefile.am generator ------------------
......
#!/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 sys, os
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 @@ instructions = parser.parse(sys.stdin)
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
......
......@@ -22,7 +22,7 @@ import sys, os
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 @@ instructions = parser.parse(sys.stdin)
## 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 @@ os.remove("program_solver.hh.tmp")
## 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\"
......
#!/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 sys, os
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 @@ sys.stdout = file("asm-parse.yy.tmp", "w")
## Prologue --------------------------
print "%{ // -*- C++ -*-"
print license
print nolimips.license
print nolimips.generated_by_hand
print """
#include <string>
......
#!/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 sys, os
import string, re
import nolimips
from nolimips import license, define_id
from nolimips import define_id
#### Nolimips' Flex scanner generator --------------------------
......@@ -38,7 +38,8 @@ sys.stdout = file("asm-scan.ll.tmp", "w")
## Prologue ----------------------------
print "%{ /* -*- C++ -*- */"
print license
print nolimips.license
print nolimips.generated_by_hand
print """
#include <string>
#include <sstream>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment