OpenASIP 2.2
Loading...
Searching...
No Matches
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.
 
LiteralOrExpression litOrExpr
 Initialisation value.
 

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 << ":";
353 retVal << std::dec << (litOrExpr.expression.label);
354 } else {
355 retVal << std::dec << (int)(litOrExpr.value);
356 }
357 return retVal.str();
358 }
std::string label
Name of the label.
LiteralOrExpression litOrExpr
Initialisation value.
UValue width
Number of MAUs that are initialized by the init field.
bool isExpression
Does object contain expression or literal.
UValue value
If literal, the literal. Otherwise not used.
Expression expression
If expression the expression, Otherwise not used.

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

Referenced by CodeSectionCreator::addAnnotationes().

Member Data Documentation

◆ litOrExpr

LiteralOrExpression InitDataField::litOrExpr

◆ 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(), AssemblerParser::definition< ScannerT >::definition(), toString(), and DataSectionCreator::writeDataLineToTPEF().


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