OpenASIP  2.0
DisassemblyInstruction.hh
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2009 Tampere University.
3 
4  This file is part of TTA-Based Codesign Environment (TCE).
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23  */
24 /**
25  * @file DisassemblyInstruction.hh
26  *
27  * Declaration of DisassemblyInstruction class.
28  *
29  * @author Veli-Pekka Jääskeläinen 2005 (vjaaskel-no.spam-cs.tut.fi)
30  * @note rating: red
31  */
32 
33 #ifndef TTA_DISASSEMBLY_INSTRUCTION_HH
34 #define TTA_DISASSEMBLY_INSTRUCTION_HH
35 
36 #include <string>
37 #include <vector>
40 #include "BaseType.hh"
41 #include "Exception.hh"
42 
43 /**
44  * Represents an instruction in the disassembler.
45  */
47 public:
50 
51  Word moveCount() const;
53  DisassemblyInstructionSlot& move(Word index) const;
54 
55  Word longImmediateCount() const;
58 
59  std::string toString() const;
60 
61  DisassemblyAnnotation& annotation(int index) const;
63  int annotationCount() const;
64 
65 private:
66  /// Vector of DisassemblyMoves.
67  typedef std::vector<DisassemblyInstructionSlot*> MoveTable;
68 
69  /// Vector of DisassemblyMoves.
70  typedef std::vector<DisassemblyImmediateAssignment*> LongImmediateTable;
71 
72  /// Copying not allowed.
74  /// Assignment not allowed.
76 
77  /// List of instruction moves.
79 
80  /// List of instruction long immediates
82 
83  /// Annotationes of instruction itself
84  std::vector<DisassemblyAnnotation*> annotations_;
85 
86 };
87 #endif
BaseType.hh
DisassemblyInstruction::longImmediateCount
Word longImmediateCount() const
Definition: DisassemblyInstruction.cc:109
DisassemblyInstruction::addAnnotation
void addAnnotation(DisassemblyAnnotation *annotation)
Definition: DisassemblyInstruction.cc:175
Exception.hh
DisassemblyInstruction::annotation
DisassemblyAnnotation & annotation(int index) const
Definition: DisassemblyInstruction.cc:165
DisassemblyInstruction::toString
std::string toString() const
Definition: DisassemblyInstruction.cc:135
DisassemblyInstructionSlot
Definition: DisassemblyInstructionSlot.hh:43
DisassemblyInstruction::annotations_
std::vector< DisassemblyAnnotation * > annotations_
Annotationes of instruction itself.
Definition: DisassemblyInstruction.hh:84
DisassemblyInstruction::moves_
MoveTable moves_
List of instruction moves.
Definition: DisassemblyInstruction.hh:78
DisassemblyInstruction::operator=
DisassemblyInstruction operator=(const DisassemblyInstruction &)
Assignment not allowed.
DisassemblyImmediateAssignment
Definition: DisassemblyImmediateAssignment.hh:46
DisassemblyInstruction::annotationCount
int annotationCount() const
Definition: DisassemblyInstruction.cc:185
DisassemblyAnnotation
Definition: DisassemblyAnnotation.hh:44
DisassemblyInstruction::LongImmediateTable
std::vector< DisassemblyImmediateAssignment * > LongImmediateTable
Vector of DisassemblyMoves.
Definition: DisassemblyInstruction.hh:70
DisassemblyInstructionSlot.hh
DisassemblyImmediateAssignment.hh
DisassemblyInstruction::addMove
void addMove(DisassemblyInstructionSlot *move)
Definition: DisassemblyInstruction.cc:58
DisassemblyInstruction::DisassemblyInstruction
DisassemblyInstruction()
Definition: DisassemblyInstruction.cc:39
DisassemblyInstruction::move
DisassemblyInstructionSlot & move(Word index) const
Definition: DisassemblyInstruction.cc:82
DisassemblyInstruction::MoveTable
std::vector< DisassemblyInstructionSlot * > MoveTable
Vector of DisassemblyMoves.
Definition: DisassemblyInstruction.hh:67
DisassemblyInstruction::addLongImmediate
void addLongImmediate(DisassemblyImmediateAssignment *longImm)
Definition: DisassemblyInstruction.cc:96
DisassemblyInstruction::moveCount
Word moveCount() const
Definition: DisassemblyInstruction.cc:69
DisassemblyInstruction::longImmediate
DisassemblyImmediateAssignment & longImmediate(Word index) const
Definition: DisassemblyInstruction.cc:122
DisassemblyInstruction::longImmediates_
LongImmediateTable longImmediates_
List of instruction long immediates.
Definition: DisassemblyInstruction.hh:81
DisassemblyInstruction::~DisassemblyInstruction
~DisassemblyInstruction()
Definition: DisassemblyInstruction.cc:46
DisassemblyInstruction
Definition: DisassemblyInstruction.hh:46