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

#include <ParserStructs.hh>

Collaboration diagram for InitDataField:
Collaboration graph

Public Member Functions

std::string toString () const
 

Public Attributes

UValue width
 Number of MAUs that are initialized by the init field. More...
 
LiteralOrExpression litOrExpr
 Initialisation value. More...
 

Detailed Description

One init data field of data line.

Form: [width:]literalOrExpression

e.g.these are valid 4:codeLabel, 0b1010010, 0x139da 4:0x1abcd -4

Definition at line 339 of file ParserStructs.hh.

Member Function Documentation

◆ toString()

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

String representation of term for error message generation.

Definition at line 349 of file ParserStructs.hh.

349  {
350  std::stringstream retVal;
351  retVal << std::dec << (int)width << ":";
352  if (litOrExpr.isExpression) {
353  retVal << std::dec << (litOrExpr.expression.label);
354  } else {
355  retVal << std::dec << (int)(litOrExpr.value);
356  }
357  return retVal.str();
358  }

References LiteralOrExpression::expression, LiteralOrExpression::isExpression, Expression::label, litOrExpr, LiteralOrExpression::value, and width.

Referenced by CodeSectionCreator::addAnnotationes().

Member Data Documentation

◆ litOrExpr

LiteralOrExpression InitDataField::litOrExpr

Initialisation value.

Definition at line 344 of file ParserStructs.hh.

Referenced by CodeSectionCreator::addAnnotationes(), toString(), and DataSectionCreator::writeDataLineToTPEF().

◆ width

UValue InitDataField::width

Number of MAUs that are initialized by the init field.

Definition at line 342 of file ParserStructs.hh.

Referenced by CodeSectionCreator::addAnnotationes(), toString(), and DataSectionCreator::writeDataLineToTPEF().


The documentation for this class was generated from the following file:
Expression::label
std::string label
Name of the label.
Definition: ParserStructs.hh:201
InitDataField::width
UValue width
Number of MAUs that are initialized by the init field.
Definition: ParserStructs.hh:342
LiteralOrExpression::isExpression
bool isExpression
Does object contain expression or literal.
Definition: ParserStructs.hh:251
InitDataField::litOrExpr
LiteralOrExpression litOrExpr
Initialisation value.
Definition: ParserStructs.hh:344
LiteralOrExpression::value
UValue value
If literal, the literal. Otherwise not used.
Definition: ParserStructs.hh:256
LiteralOrExpression::expression
Expression expression
If expression the expression, Otherwise not used.
Definition: ParserStructs.hh:253