yosys-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
abc_output_filter Struct Reference

Public Member Functions

 abc_output_filter ()
 
void next_char (char ch)
 
void next_line (const std::string &line)
 

Data Fields

bool got_cr
 
int escape_seq_state
 
std::string linebuf
 

Detailed Description

Definition at line 496 of file abc.cc.

Constructor & Destructor Documentation

abc_output_filter::abc_output_filter ( )
inline

Definition at line 502 of file abc.cc.

503  {
504  got_cr = false;
505  escape_seq_state = 0;
506  }
int escape_seq_state
Definition: abc.cc:499

Member Function Documentation

void abc_output_filter::next_char ( char  ch)
inline

Definition at line 508 of file abc.cc.

509  {
510  if (escape_seq_state == 0 && ch == '\033') {
511  escape_seq_state = 1;
512  return;
513  }
514  if (escape_seq_state == 1) {
515  escape_seq_state = ch == '[' ? 2 : 0;
516  return;
517  }
518  if (escape_seq_state == 2) {
519  if ((ch < '0' || '9' < ch) && ch != ';')
520  escape_seq_state = 0;
521  return;
522  }
523  escape_seq_state = 0;
524  if (ch == '\r') {
525  got_cr = true;
526  return;
527  }
528  if (ch == '\n') {
529  log("ABC: %s\n", linebuf.c_str());
530  got_cr = false, linebuf.clear();
531  return;
532  }
533  if (got_cr)
534  got_cr = false, linebuf.clear();
535  linebuf += ch;
536  }
int escape_seq_state
Definition: abc.cc:499
void log(const char *format,...)
Definition: log.cc:180
std::string linebuf
Definition: abc.cc:500

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void abc_output_filter::next_line ( const std::string &  line)
inline

Definition at line 538 of file abc.cc.

539  {
540  for (char ch : line)
541  next_char(ch);
542  }
void next_char(char ch)
Definition: abc.cc:508

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

int abc_output_filter::escape_seq_state

Definition at line 499 of file abc.cc.

bool abc_output_filter::got_cr

Definition at line 498 of file abc.cc.

std::string abc_output_filter::linebuf

Definition at line 500 of file abc.cc.


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