Commit 37b77fea authored by Benoit Perrot's avatar Benoit Perrot
Browse files

Index: ChangeLog

2004-03-18  Benoît Perrot  <benoit@lrde.epita.fr>

        Inline definition of a virtual method is nonsense.

        * src/inst/exp.cc,
        * src/inst/data_section.cc,
        * src/inst/text_section.cc:
        New.
        * dev/inst-makefile-gen.py,
        * src/task/task.hh, src/task/task.cc
        * src/inst/exp.hh,
        * src/inst/data_section.hh,
        * src/inst/text_section.hh:
        Move definitions of virtual methods in corresponding implementation
        file.
parent 99749531
2004-03-18 Benot Perrot <benoit@lrde.epita.fr>
Inline definition of a virtual method is nonsense.
* src/inst/exp.cc,
* src/inst/data_section.cc,
* src/inst/text_section.cc:
New.
* dev/inst-makefile-gen.py,
* src/task/task.hh, src/task/task.cc
* src/inst/exp.hh,
* src/inst/data_section.hh,
* src/inst/text_section.hh:
Move definitions of virtual methods in corresponding implementation
file.
2004-02-29 Benot Perrot <benoit@lrde.epita.fr>
Track memory leaks.
......
......@@ -65,14 +65,14 @@ noinst_LIBRARIES = libinst.a
libinst_a_SOURCES = \\
$(FROM_INST_NODES_GEN_PY) inst-nodes-gen.log \\
register.hh \\
exp.hh \\
exp.hh exp.cc \\
exp-visitor.hh \\
inst.hh \\
program.hh \\
label.hh label.cc \\
section.hh \\
text_section.hh \\
data_section.hh \\
text_section.hh text_section.cc \\
data_section.hh data_section.cc \\
program.hh \\
program_builder.hh program_builder.cc inst-builder-gen.log \\
program_solver.hh \\
......
......@@ -2,58 +2,55 @@
(Created-By-Prcs-Version 1 3 2)
(Project-Description "")
(Project-Version mipsy 0 74)
(Parent-Version mipsy 0 73)
(Project-Version mipsy 0 75)
(Parent-Version mipsy 0 74)
(Version-Log
"Index: ChangeLog
from Benot Perrot <benoit@lrde.epita.fr>
2004-03-18 Benot Perrot <benoit@lrde.epita.fr>
Track memory leaks.
Inline definition of a virtual method is nonsense.
* dev/inst-builder-gen.py,
* dev/inst-nodes-gen.py,
* dev/mipsy.xml,
* dev/parse-asm-parse-gen.py,
* src/inst/data_section.hh,
* src/inst/exp.cc,
* src/inst/data_section.cc,
* src/inst/text_section.cc:
New.
* dev/inst-makefile-gen.py,
* src/task/task.hh, src/task/task.cc
* src/inst/exp.hh,
* src/inst/program_builder.cc,
* src/inst/section.hh,
* src/inst/text_section.hh,
* src/vm/cpu.hh, src/vm/cpu.cc
* src/vm/segment.hh,
* src/vm/vm-tasks.cc:
Use pointers instead of references for each allocated attribute,
and delete them.
* src/inst/data_section.hh,
* src/inst/text_section.hh:
Move definitions of virtual methods in corresponding implementation
file.
")
(New-Version-Log
"")
(Checkin-Time "Sun, 29 Feb 2004 20:00:21 +0100")
(Checkin-Login benoit)
(Checkin-Time "Thu, 18 Mar 2004 22:33:04 +0100")
(Checkin-Login noe)
(Files
;; ./
(AUTHORS (mipsy/0_AUTHORS 1.1 644))
(COPYING (mipsy/1_COPYING 1.1 644))
(ChangeLog (mipsy/2_ChangeLog 1.68 604))
(AUTHORS (mipsy/0_AUTHORS 1.1 604))
(COPYING (mipsy/1_COPYING 1.1 604))
(ChangeLog (mipsy/2_ChangeLog 1.69 604))
(Makefile.am (mipsy/3_Makefile.a 1.8 604))
(NEWS (mipsy/b/25_NEWS 1.6 604))
(README (mipsy/4_README 1.2 644))
(TODO (mipsy/5_TODO 1.2 644))
(README (mipsy/4_README 1.2 604))
(TODO (mipsy/5_TODO 1.2 604))
(bootstrap (mipsy/b/14_bootstrap 1.3 705))
(configure.ac (mipsy/6_configure. 1.7 604))
(prj (mipsy.prj) :symlink)
;; ./config/
(config/Makefile.am (mipsy/7_Makefile.a 1.1 644))
(config/Makefile.am (mipsy/7_Makefile.a 1.1 604))
;; ./dev/
(dev/doc-inst-set-gen.py (mipsy/c/21_doc-inst-s 1.3 705))
(dev/inst-builder-gen.py (mipsy/15_mipsy-buil 1.11 705))
(dev/inst-makefile-gen.py (mipsy/b/15_mipsy-mk-i 1.7 705))
(dev/inst-makefile-gen.py (mipsy/b/15_mipsy-mk-i 1.8 705))
(dev/inst-nodes-gen.py (mipsy/12_mipsy-inst 1.9 705))
(dev/mipsy.py (mipsy/16_mipsy.py 1.8 705))
(dev/mipsy.xml (mipsy/17_mipsy.xml 1.16 604))
......@@ -71,51 +68,54 @@ from Beno
(doc/mipsy.texi (mipsy/b/10_mipsy.texi 1.4 604))
;; ./src/
(src/Makefile.am (mipsy/18_Makefile.a 1.2 644))
(src/common.hh (mipsy/19_common.hh 1.4 644))
(src/mipsy-tasks.cc (mipsy/20_mipsy-task 1.3 644))
(src/mipsy-tasks.hh (mipsy/21_mipsy-task 1.3 644))
(src/Makefile.am (mipsy/18_Makefile.a 1.2 604))
(src/common.hh (mipsy/19_common.hh 1.4 604))
(src/mipsy-tasks.cc (mipsy/20_mipsy-task 1.3 604))
(src/mipsy-tasks.hh (mipsy/21_mipsy-task 1.3 604))
(src/mipsy.cc (mipsy/22_mipsy.cc 1.4 604))
(src/modules.hh (mipsy/23_modules.hh 1.3 644))
(src/modules.hh (mipsy/23_modules.hh 1.3 604))
;; ./src/inst/
(src/inst/data_section.hh (mipsy/24_data_secti 1.6 604))
(src/inst/data_section.hh (mipsy/24_data_secti 1.7 604))
(src/inst/data_section.cc (mipsy/c/31_data_secti 1.1 604))
(src/inst/exp-visitor.hh (mipsy/25_exp-visito 1.4 604))
(src/inst/exp.hh (mipsy/26_exp.hh 1.5 604))
(src/inst/inst-tasks.cc (mipsy/b/23_inst-tasks 1.2 644))
(src/inst/inst-tasks.hh (mipsy/b/22_inst-tasks 1.2 644))
(src/inst/inst.hh (mipsy/27_inst.hh 1.3 644))
(src/inst/exp.hh (mipsy/26_exp.hh 1.6 604))
(src/inst/exp.cc (mipsy/c/32_exp.cc 1.1 604))
(src/inst/inst-tasks.cc (mipsy/b/23_inst-tasks 1.2 604))
(src/inst/inst-tasks.hh (mipsy/b/22_inst-tasks 1.2 604))
(src/inst/inst.hh (mipsy/27_inst.hh 1.3 604))
(src/inst/label.cc (mipsy/b/21_label.cc 1.3 604))
(src/inst/label.hh (mipsy/b/20_label.hh 1.3 604))
(src/inst/program.hh (mipsy/28_program.hh 1.3 644))
(src/inst/program.hh (mipsy/28_program.hh 1.3 604))
(src/inst/program_builder.cc (mipsy/29_program_bu 1.13 604))
(src/inst/program_solver.hh (mipsy/30_program_so 1.7 644))
(src/inst/register.hh (mipsy/31_register.h 1.5 644))
(src/inst/program_solver.hh (mipsy/30_program_so 1.7 604))
(src/inst/register.hh (mipsy/31_register.h 1.5 604))
(src/inst/section.hh (mipsy/b/24_section.hh 1.7 604))
(src/inst/text_section.hh (mipsy/32_text_secti 1.6 604))
(src/inst/text_section.hh (mipsy/32_text_secti 1.7 604))
(src/inst/text_section.cc (mipsy/c/33_text_secti 1.1 604))
;; ./src/misc/
(src/misc/Makefile.am (mipsy/33_Makefile.a 1.2 644))
(src/misc/contract.hh (mipsy/34_contract.h 1.1 644))
(src/misc/deref.hh (mipsy/35_deref.hh 1.1 644))
(src/misc/escape.hh (mipsy/36_escape.hh 1.1 644))
(src/misc/has.hh (mipsy/37_has.hh 1.1 644))
(src/misc/Makefile.am (mipsy/33_Makefile.a 1.2 604))
(src/misc/contract.hh (mipsy/34_contract.h 1.1 604))
(src/misc/deref.hh (mipsy/35_deref.hh 1.1 604))
(src/misc/escape.hh (mipsy/36_escape.hh 1.1 604))
(src/misc/has.hh (mipsy/37_has.hh 1.1 604))
(src/misc/select_const.hh (mipsy/38_select_con 1.2 604))
;; ./src/parse/
(src/parse/Makefile.am (mipsy/39_Makefile.a 1.4 604))
(src/parse/asm-scan.hh (mipsy/40_asm-scan.h 1.3 644))
(src/parse/libparse.cc (mipsy/41_libparse.c 1.5 644))
(src/parse/libparse.hh (mipsy/42_libparse.h 1.5 644))
(src/parse/parse-tasks.cc (mipsy/43_parse-task 1.7 644))
(src/parse/parse-tasks.hh (mipsy/44_parse-task 1.5 644))
(src/parse/asm-scan.hh (mipsy/40_asm-scan.h 1.3 604))
(src/parse/libparse.cc (mipsy/41_libparse.c 1.5 604))
(src/parse/libparse.hh (mipsy/42_libparse.h 1.5 604))
(src/parse/parse-tasks.cc (mipsy/43_parse-task 1.7 604))
(src/parse/parse-tasks.hh (mipsy/44_parse-task 1.5 604))
;; ./src/task/
(src/task/Makefile.am (mipsy/45_Makefile.a 1.2 644))
(src/task/task-tasks.cc (mipsy/46_task-tasks 1.3 644))
(src/task/task-tasks.hh (mipsy/47_task-tasks 1.3 644))
(src/task/task.cc (mipsy/48_task.cc 1.3 644))
(src/task/task.hh (mipsy/49_task.hh 1.5 604))
(src/task/Makefile.am (mipsy/45_Makefile.a 1.2 604))
(src/task/task-tasks.cc (mipsy/46_task-tasks 1.3 604))
(src/task/task-tasks.hh (mipsy/47_task-tasks 1.3 604))
(src/task/task.cc (mipsy/48_task.cc 1.4 604))
(src/task/task.hh (mipsy/49_task.hh 1.6 604))
(src/task/task_register.cc (mipsy/50_task_regis 1.7 604))
(src/task/task_register.hh (mipsy/51_task_regis 1.4 604))
......@@ -125,66 +125,66 @@ from Beno
(src/vm/cpu.cc (mipsy/b/5_virtual_ma 1.22 604))
(src/vm/memory.hh (mipsy/b/2_memory.hh 1.9 604))
(src/vm/mmu.hh (mipsy/c/15_mmu.hh 1.3 604))
(src/vm/segment.hh (mipsy/b/3_segment.hh 1.4 644))
(src/vm/segment.hh (mipsy/b/3_segment.hh 1.4 604))
(src/vm/table.hh (mipsy/b/4_table.hh 1.4 604))
(src/vm/virtual_machine.hh (mipsy/b/6_virtual_ma 1.15 604))
(src/vm/vm-tasks.cc (mipsy/b/7_vm-tasks.c 1.7 604))
(src/vm/vm-tasks.hh (mipsy/b/8_vm-tasks.h 1.4 604))
;; ./tests/
(tests/Makefile.am (mipsy/b/26_Makefile.a 1.1 644))
(tests/common.mk (mipsy/b/27_common.mk 1.1 644))
(tests/generate-ref.mk (mipsy/b/28_generate-r 1.1 644))
(tests/mipsy-check (mipsy/b/29_mipsy-chec 1.1 745))
(tests/Makefile.am (mipsy/b/26_Makefile.a 1.1 604))
(tests/common.mk (mipsy/b/27_common.mk 1.1 604))
(tests/generate-ref.mk (mipsy/b/28_generate-r 1.1 604))
(tests/mipsy-check (mipsy/b/29_mipsy-chec 1.1 705))
;; ./tests/good/
(tests/good/Makefile.am (mipsy/b/30_Makefile.a 1.2 604))
(tests/good/add-sub.s (mipsy/b/31_add-sub.s 1.2 644))
(tests/good/and-or-nor-xor.s (mipsy/b/32_and-or-nor 1.2 644))
(tests/good/add-sub.s (mipsy/b/31_add-sub.s 1.2 604))
(tests/good/and-or-nor-xor.s (mipsy/b/32_and-or-nor 1.2 604))
(tests/good/check-good (mipsy/c/9_check-good 1.2 705))
(tests/good/exit.s (mipsy/b/33_exit.s 1.2 644))
(tests/good/extended-euclide.s (mipsy/b/34_extended-e 1.2 644))
(tests/good/gtcd.s (mipsy/b/35_gtcd.s 1.2 644))
(tests/good/modular-exponent.s (mipsy/b/36_modular-ex 1.2 644))
(tests/good/neg.s (mipsy/b/37_neg.s 1.2 644))
(tests/good/not.s (mipsy/b/38_not.s 1.2 644))
(tests/good/print.s (mipsy/b/39_print.s 1.2 644))
(tests/good/print_int.s (mipsy/b/40_print_int. 1.2 644))
(tests/good/read_int.in (mipsy/b/41_read_int.i 1.1 644))
(tests/good/read_int.s (mipsy/b/42_read_int.s 1.2 644))
(tests/good/seq-sne.s (mipsy/b/43_seq-sne.s 1.2 644))
(tests/good/shift.s (mipsy/b/44_shift.s 1.2 644))
(tests/good/exit.s (mipsy/b/33_exit.s 1.2 604))
(tests/good/extended-euclide.s (mipsy/b/34_extended-e 1.2 604))
(tests/good/gtcd.s (mipsy/b/35_gtcd.s 1.2 604))
(tests/good/modular-exponent.s (mipsy/b/36_modular-ex 1.2 604))
(tests/good/neg.s (mipsy/b/37_neg.s 1.2 604))
(tests/good/not.s (mipsy/b/38_not.s 1.2 604))
(tests/good/print.s (mipsy/b/39_print.s 1.2 604))
(tests/good/print_int.s (mipsy/b/40_print_int. 1.2 604))
(tests/good/read_int.in (mipsy/b/41_read_int.i 1.1 604))
(tests/good/read_int.s (mipsy/b/42_read_int.s 1.2 604))
(tests/good/seq-sne.s (mipsy/b/43_seq-sne.s 1.2 604))
(tests/good/shift.s (mipsy/b/44_shift.s 1.2 604))
;; ./tests/lexical/
(tests/lexical/Makefile.am (mipsy/b/45_Makefile.a 1.1 644))
(tests/lexical/check-lexical (mipsy/c/10_check-lexi 1.1 745))
(tests/lexical/invalid-string-hexa.s (mipsy/b/46_invalid-st 1.1 644))
(tests/lexical/invalid-string-octal.s (mipsy/b/47_invalid-st 1.1 644))
(tests/lexical/unlimited-regs.s (mipsy/b/48_unlimited- 1.1 644))
(tests/lexical/unrecognized-escape.s (mipsy/b/49_unrecogniz 1.1 644))
(tests/lexical/unterminated-string.s (mipsy/b/50_unterminat 1.1 644))
(tests/lexical/Makefile.am (mipsy/b/45_Makefile.a 1.1 604))
(tests/lexical/check-lexical (mipsy/c/10_check-lexi 1.1 705))
(tests/lexical/invalid-string-hexa.s (mipsy/b/46_invalid-st 1.1 604))
(tests/lexical/invalid-string-octal.s (mipsy/b/47_invalid-st 1.1 604))
(tests/lexical/unlimited-regs.s (mipsy/b/48_unlimited- 1.1 604))
(tests/lexical/unrecognized-escape.s (mipsy/b/49_unrecogniz 1.1 604))
(tests/lexical/unterminated-string.s (mipsy/b/50_unterminat 1.1 604))
;; ./tests/runtime/
(tests/runtime/Makefile.am (mipsy/b/51_Makefile.a 1.1 644))
(tests/runtime/Makefile.am (mipsy/b/51_Makefile.a 1.1 604))
(tests/runtime/check-runtime (mipsy/c/11_check-runt 1.2 705))
(tests/runtime/neg.s (mipsy/c/0_neg.s 1.2 644))
(tests/runtime/no-main.s (mipsy/c/1_no-main.s 1.2 644))
(tests/runtime/neg.s (mipsy/c/0_neg.s 1.2 604))
(tests/runtime/no-main.s (mipsy/c/1_no-main.s 1.2 604))
;; ./tests/solve/
(tests/solve/Makefile.am (mipsy/c/2_Makefile.a 1.1 644))
(tests/solve/check-solve (mipsy/c/12_check-solv 1.1 745))
(tests/solve/undefined-labels.s (mipsy/c/3_undefined- 1.2 644))
(tests/solve/Makefile.am (mipsy/c/2_Makefile.a 1.1 604))
(tests/solve/check-solve (mipsy/c/12_check-solv 1.1 705))
(tests/solve/undefined-labels.s (mipsy/c/3_undefined- 1.2 604))
;; ./tests/syntax/
(tests/syntax/Makefile.am (mipsy/c/4_Makefile.a 1.1 644))
(tests/syntax/Makefile.am (mipsy/c/4_Makefile.a 1.1 604))
(tests/syntax/asciiz-wrong-param.s (mipsy/c/5_asciiz-wro 1.2 604))
(tests/syntax/check-syntax (mipsy/c/13_check-synt 1.1 745))
(tests/syntax/too-many-operands.s (mipsy/c/6_too-many-o 1.2 644))
(tests/syntax/check-syntax (mipsy/c/13_check-synt 1.1 705))
(tests/syntax/too-many-operands.s (mipsy/c/6_too-many-o 1.2 604))
;; ./tests/unlimited/
(tests/unlimited/Makefile.am (mipsy/c/7_Makefile.a 1.2 604))
(tests/unlimited/check-unlimited (mipsy/c/14_check-unli 1.2 705))
(tests/unlimited/simple-exp.s (mipsy/c/8_simple-exp 1.2 644))
(tests/unlimited/simple-exp.s (mipsy/c/8_simple-exp 1.2 604))
)
(Populate-Ignore
......
//
// This file is part of Mipsy, a tiny MIPS simulator
// Copyright (C) 2003, 2004 Benoit Perrot <benoit@lrde.epita.fr>
//
// Mipsy 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 2 of the License, or
// (at your option) any later version.
//
// Mipsy 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, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
#include "inst/data_section.hh"
namespace inst
{
// --------------------------------------------------------------------------
// Constructor and destructor
// --------------------------------------------------------------------------
DataSection::~DataSection()
{
}
// --------------------------------------------------------------------------
// Print operator
// --------------------------------------------------------------------------
void
DataSection::print(std::ostream& ostr) const
{
if (_size == 0)
return;
ostr << "\t.data" << std::endl;
int i = 0;
while (i < _size)
{
std::map<int, label_list_type>::const_iterator it =
labels.find(i);
if (it != labels.end())
for (label_list_type::const_iterator l = (*it).second.begin();
l != (*it).second.end(); ++l)
ostr << *(*l) << ':' << std::endl;
ostr << "\t.byte\t0x"
<< std::hex << static_cast<unsigned>(bytes[i++])
<< std::endl;
}
ostr << std::dec;
}
} // namespace inst
......@@ -42,6 +42,7 @@ namespace inst
{
std::memset(bytes, 0, INST_DATA_DATASIZE);
}
virtual ~DataSection();
public:
int size () const
......@@ -95,29 +96,7 @@ namespace inst
public:
virtual void print(std::ostream& ostr) const
{
if (_size == 0)
return;
ostr << "\t.data" << std::endl;
int i = 0;
while (i < _size)
{
std::map<int, label_list_type>::const_iterator it =
labels.find(i);
if (it != labels.end())
for (label_list_type::const_iterator l = (*it).second.begin();
l != (*it).second.end(); ++l)
ostr << *(*l) << ':' << std::endl;
ostr << "\t.byte\t0x"
<< std::hex << static_cast<unsigned>(bytes[i++])
<< std::endl;
}
ostr << std::dec;
}
virtual void print(std::ostream& ostr) const;
protected:
int _size;
......
//
// This file is part of Mipsy, a tiny MIPS simulator
// Copyright (C) 2003, 2004 Benoit Perrot <benoit@lrde.epita.fr>
//
// Mipsy 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 2 of the License, or
// (at your option) any later version.
//
// Mipsy 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, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
#include "inst/exp.hh"
namespace inst
{
// --------------------------------------------------------------------------
// Exp: Constructor & Destructor
// --------------------------------------------------------------------------
Exp::~Exp()
{
}
// --------------------------------------------------------------------------
// Exp: Print operator
// --------------------------------------------------------------------------
void
Exp::print(std::ostream& ostr) const
{
ostr << immediate;
}
// --------------------------------------------------------------------------
// IntExp: Constructor & Destructor
// --------------------------------------------------------------------------
IntExp::~IntExp()
{
}
// --------------------------------------------------------------------------
// IntExp: Visitor entry points
// --------------------------------------------------------------------------
void
IntExp::accept (ConstExpVisitor& v) const
{
v.visit(*this);
}
void
IntExp::accept (ExpVisitor& v)
{
v.visit(*this);
}
// --------------------------------------------------------------------------
// IntExp: Print operator
// --------------------------------------------------------------------------
void
IntExp::print(std::ostream& ostr) const
{
ostr << integer;
}
// --------------------------------------------------------------------------
// LabelExp: Constructor & Destructor
// --------------------------------------------------------------------------
LabelExp::~LabelExp()
{
// FIXME: delete label;
}
// --------------------------------------------------------------------------
// LabelExp: Visitor entry points
// --------------------------------------------------------------------------
void
LabelExp::accept (ConstExpVisitor& v) const
{
v.visit(*this);
}
void
LabelExp::accept (ExpVisitor& v)
{
v.visit(*this);
}
// --------------------------------------------------------------------------
// LabelExp: Print operator
// --------------------------------------------------------------------------
void
LabelExp::print(std::ostream& ostr) const
{
ostr << label;
}
// --------------------------------------------------------------------------
// OpExp: Constructor & Destructor
// --------------------------------------------------------------------------
OpExp::~OpExp()
{
// FIXME: delete left;
// FIXME: delete right;
}
// --------------------------------------------------------------------------
// OpExp: Visitor entry points
// --------------------------------------------------------------------------
void
OpExp::accept (ConstExpVisitor& v) const
{
v.visit(*this);
}
void
OpExp::accept (ExpVisitor& v)
{
v.visit(*this);
}
// --------------------------------------------------------------------------
// OpExp: Print operator
// --------------------------------------------------------------------------
void
OpExp::print(std::ostream& ostr) const
{
ostr << *left;
switch (kind)
{
case add: ostr << " + "; break;
case sub: ostr << " - "; break;
case mul: ostr << " * "; break;
case div: ostr << " / "; break;
}
ostr << *right;
}
} // namespace inst
......@@ -36,15 +36,10 @@ namespace inst
immediate(-2097) // Caracteristic initial value
{
}
virtual ~Exp()
{
}
virtual ~Exp();
public:
virtual void print(std::ostream& ostr) const
{
ostr << immediate;
}
virtual void print(std::ostream& ostr) const;
virtual void accept (ConstExpVisitor& v) const = 0;
virtual void accept (ExpVisitor& v) = 0;
......@@ -80,19 +75,11 @@ namespace inst
integer(integer)
{
}
virtual ~IntExp()
{
}
virtual ~IntExp();
public:
virtual void accept (ConstExpVisitor& v) const
{
v.visit(*this);
}
virtual void accept (ExpVisitor& v)
{
v.visit(*this);
}
virtual void accept (ConstExpVisitor& v) const;
virtual void accept (ExpVisitor& v);
public:
int get_integer() const
......@@ -101,10 +88,8 @@ namespace inst
}
public:
virtual void print(std::ostream& ostr) const
{
ostr << integer;
}
virtual void print(std::ostream& ostr) const;
protected:
int integer;
};
......@@ -117,20 +102,11 @@ namespace inst
label(label)
{
}
virtual ~LabelExp()
{
// FIXME: delete label;
}
virtual ~LabelExp();
public:
virtual void accept (ConstExpVisitor& v) const
{
v.visit(*this);
}
virtual void accept (ExpVisitor& v)
{
v.visit(*this);
}
virtual void accept (ConstExpVisitor& v) const;
virtual void accept (ExpVisitor& v);
public:
const Label& get_label() const
......@@ -143,10 +119,8 @@ namespace inst
}
public:
virtual void print(std::ostream& ostr) const