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

#include <ParserStructs.hh>

Collaboration diagram for DataLine:
Collaboration graph

Public Member Functions

std::string toString () const
 

Public Attributes

UValue width
 Number of MAUs initialized by this data line. More...
 
std::string dataSpace
 Address space whose MAUs are initialized. More...
 
std::vector< InitDataFieldinitData
 Init data fields of data line. Uninitilized data line, if empty. More...
 
std::vector< std::string > labels
 Labels of this data line. More...
 
UValue asmLineNumber
 Line number where in source code this DA line is found. More...
 

Detailed Description

Parsed data area definition.

Definition at line 477 of file ParserStructs.hh.

Member Function Documentation

◆ toString()

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

String representation of term for error message generation.

Definition at line 495 of file ParserStructs.hh.

495  {
496 
497  std::stringstream retVal;
498 
499  retVal << "DataLine:\n"
500  << "address space:\t" << dataSpace << std::endl
501  << "data maus: \t" << width << std::endl;
502 
503  retVal << "Labels:" << std::endl;
504  for (unsigned int i = 0; i < labels.size(); i++) {
505  retVal << "\t" << labels[i] << std::endl;
506  }
507 
508  retVal << "Init data:" << std::endl;
509  for (unsigned int i = 0; i < initData.size(); i++) {
510  retVal << (int)initData[i].width << ":";
511 
512  if (initData[i].litOrExpr.isExpression) {
513  retVal << initData[i].litOrExpr.expression.label;
514  } else {
515  retVal << (int)initData[i].litOrExpr.value;
516  }
517 
518  retVal << "\t";
519 
520  if ((i+1)%16 == 0) retVal << std::endl;
521  }
522 
523  retVal << "\n";
524 
525  return retVal.str();
526  }

References dataSpace, initData, labels, and width.

Member Data Documentation

◆ asmLineNumber

UValue DataLine::asmLineNumber

Line number where in source code this DA line is found.

Definition at line 490 of file ParserStructs.hh.

Referenced by DataSectionCreator::addDataLine(), DataSectionCreator::resolveDataAreaSizesAndLabelAddresses(), and DataSectionCreator::writeDataLineToTPEF().

◆ dataSpace

std::string DataLine::dataSpace

Address space whose MAUs are initialized.

Definition at line 482 of file ParserStructs.hh.

Referenced by DataSectionCreator::addDataLine(), and toString().

◆ initData

std::vector<InitDataField> DataLine::initData

Init data fields of data line. Uninitilized data line, if empty.

Definition at line 485 of file ParserStructs.hh.

Referenced by DataSectionCreator::addDataLine(), toString(), and DataSectionCreator::writeDataLineToTPEF().

◆ labels

std::vector<std::string> DataLine::labels

Labels of this data line.

Definition at line 487 of file ParserStructs.hh.

Referenced by DataSectionCreator::addDataLine(), DataSectionCreator::resolveDataAreaSizesAndLabelAddresses(), and toString().

◆ width

UValue DataLine::width

The documentation for this class was generated from the following file:
DataLine::dataSpace
std::string dataSpace
Address space whose MAUs are initialized.
Definition: ParserStructs.hh:482
DataLine::initData
std::vector< InitDataField > initData
Init data fields of data line. Uninitilized data line, if empty.
Definition: ParserStructs.hh:485
DataLine::labels
std::vector< std::string > labels
Labels of this data line.
Definition: ParserStructs.hh:487
DataLine::width
UValue width
Number of MAUs initialized by this data line.
Definition: ParserStructs.hh:480