OpenASIP  2.0
Public Member Functions | Public Attributes | List of all members
ParserSource Class Reference

#include <ParserStructs.hh>

Collaboration diagram for ParserSource:
Collaboration graph

Public Member Functions

std::string toString () const
 

Public Attributes

bool isRegister
 Is source register or immediate reference. More...
 
RegisterTerm regTerm
 If register, the register. Otherwise not used. More...
 
LiteralOrExpression immTerm
 If immediate value, the literal or expression. Otherwise not used. More...
 

Detailed Description

Source field of parsed move.

Source can be either RegisterTerm or Immediate.

Definition at line 279 of file ParserStructs.hh.

Member Function Documentation

◆ toString()

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

String representation of term for error message generation.

Definition at line 291 of file ParserStructs.hh.

291  {
292  std::stringstream retVal;
293  if (isRegister) {
294  retVal << regTerm.toString();
295  } else {
296  retVal << immTerm.toString();
297  }
298  return retVal.str();
299  }

References immTerm, isRegister, regTerm, RegisterTerm::toString(), and LiteralOrExpression::toString().

Referenced by ParserMove::toString().

Here is the call graph for this function:

Member Data Documentation

◆ immTerm

LiteralOrExpression ParserSource::immTerm

If immediate value, the literal or expression. Otherwise not used.

Definition at line 286 of file ParserStructs.hh.

Referenced by CodeSectionCreator::addMove(), and toString().

◆ isRegister

bool ParserSource::isRegister

Is source register or immediate reference.

Definition at line 282 of file ParserStructs.hh.

Referenced by CodeSectionCreator::addMove(), and toString().

◆ regTerm

RegisterTerm ParserSource::regTerm

If register, the register. Otherwise not used.

Definition at line 284 of file ParserStructs.hh.

Referenced by CodeSectionCreator::addMove(), and toString().


The documentation for this class was generated from the following file:
RegisterTerm::toString
std::string toString() const
Definition: ParserStructs.hh:161
LiteralOrExpression::toString
std::string toString() const
Definition: ParserStructs.hh:263
ParserSource::regTerm
RegisterTerm regTerm
If register, the register. Otherwise not used.
Definition: ParserStructs.hh:284
ParserSource::immTerm
LiteralOrExpression immTerm
If immediate value, the literal or expression. Otherwise not used.
Definition: ParserStructs.hh:286
ParserSource::isRegister
bool isRegister
Is source register or immediate reference.
Definition: ParserStructs.hh:282