OpenASIP 2.2
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | List of all members
ParserMove Class Reference

#include <ParserStructs.hh>

Collaboration diagram for ParserMove:
Collaboration graph

Public Types

enum  MoveType { EMPTY , LONG_IMMEDIATE , TRANSPORT }
 Types of instruction slots. More...
 

Public Member Functions

 ParserMove ()
 
 ParserMove (MoveType aType, bool begin)
 
std::string toString () const
 

Public Attributes

MoveType type
 Type of move.
 
bool isBegin
 Tells whether the slot is the first of the instruction.
 
ParserGuard guard
 Guard field.
 
ParserSource source
 Source field.
 
RegisterTerm destination
 Destination field.
 
UValue asmLineNumber
 Line number of source code for errors.
 
std::vector< Annotationannotationes
 

Detailed Description

All info of one parsed instruction slot.

Instruction slot defines a move or long immediate. An instruction slot can also be empty (unused).

Definition at line 391 of file ParserStructs.hh.

Member Enumeration Documentation

◆ MoveType

Types of instruction slots.

Enumerator
EMPTY 

Empty move slot.

LONG_IMMEDIATE 

Encoding of one long immediate slot.

TRANSPORT 

Data transport (move).

Definition at line 394 of file ParserStructs.hh.

394 {
395 EMPTY, ///< Empty move slot.
396 LONG_IMMEDIATE, ///< Encoding of one long immediate slot.
397 TRANSPORT ///< Data transport (move).
398 };
@ TRANSPORT
Data transport (move).
@ EMPTY
Empty move slot.
@ LONG_IMMEDIATE
Encoding of one long immediate slot.

Constructor & Destructor Documentation

◆ ParserMove() [1/2]

ParserMove::ParserMove ( )
inline

Empty constructor.

All values are set by hand.

Definition at line 422 of file ParserStructs.hh.

422 {
423 }

◆ ParserMove() [2/2]

ParserMove::ParserMove ( MoveType  aType,
bool  begin 
)
inline

Constructor.

Parameters
aTypeType of created move.
beginIs first move of an instruction.

Definition at line 431 of file ParserStructs.hh.

431 :
432 type(aType), isBegin(begin) {
433 }
MoveType type
Type of move.
bool isBegin
Tells whether the slot is the first of the instruction.

Member Function Documentation

◆ toString()

std::string ParserMove::toString ( ) const
inline

String representation of term for error message generation.

Definition at line 438 of file ParserStructs.hh.

438 {
439 std::stringstream retVal;
440 switch (type) {
441 case EMPTY:
442 retVal << "...";
443 break;
444
445 case LONG_IMMEDIATE:
446 retVal << "[" << destination.toString()
447 << "=" << source.toString()
448 << "]";
449
450 for (unsigned int i = 0;i < annotationes.size();i++) {
451 retVal << annotationes[i].toString();
452 }
453
454 break;
455
456 case TRANSPORT:
457 retVal << guard.toString() << " "
458 << source.toString() << " -> "
460
461 for (unsigned int i = 0;i < annotationes.size();i++) {
462 retVal << annotationes[i].toString();
463 }
464
465 break;
466
467 default:
468 retVal << "Unknown move type!\n";
469 }
470 return retVal.str();
471 }
std::string toString() const
std::vector< Annotation > annotationes
ParserSource source
Source field.
ParserGuard guard
Guard field.
RegisterTerm destination
Destination field.
std::string toString() const
std::string toString() const

References annotationes, destination, EMPTY, guard, LONG_IMMEDIATE, source, RegisterTerm::toString(), ParserSource::toString(), ParserGuard::toString(), TRANSPORT, and type.

Here is the call graph for this function:

Member Data Documentation

◆ annotationes

std::vector<Annotation> ParserMove::annotationes

◆ asmLineNumber

UValue ParserMove::asmLineNumber

Line number of source code for errors.

Definition at line 413 of file ParserStructs.hh.

Referenced by CodeSectionCreator::addMove(), and AssemblerParser::definition< ScannerT >::definition().

◆ destination

RegisterTerm ParserMove::destination

Destination field.

Definition at line 411 of file ParserStructs.hh.

Referenced by CodeSectionCreator::addMove(), AssemblerParser::definition< ScannerT >::definition(), and toString().

◆ guard

ParserGuard ParserMove::guard

◆ isBegin

bool ParserMove::isBegin

Tells whether the slot is the first of the instruction.

Definition at line 404 of file ParserStructs.hh.

Referenced by CodeSectionCreator::addMove(), and AssemblerParser::definition< ScannerT >::definition().

◆ source

ParserSource ParserMove::source

◆ type

MoveType ParserMove::type

The documentation for this class was generated from the following file: