src
Public Member Functions | Public Attributes | List of all members
re2c::Binary Struct Reference

#include <go.h>

Collaboration diagram for re2c::Binary:
Collaboration graph
[legend]

Public Member Functions

 Binary (const Span *s, uint32_t n, const State *next)
 
 ~Binary ()
 
void emit (OutputFile &o, uint32_t ind, bool &readCh)
 
void used_labels (std::set< label_t > &used)
 
 FORBID_COPY (Binary)
 

Public Attributes

Condcond
 
Ifthn
 
Ifels
 

Detailed Description

Definition at line 62 of file go.h.

Constructor & Destructor Documentation

re2c::Binary::Binary ( const Span s,
uint32_t  n,
const State next 
)

Definition at line 51 of file go_construct.cc.

52  : cond (NULL)
53  , thn (NULL)
54  , els (NULL)
55 {
56  const uint32_t l = n / 2;
57  const uint32_t h = n - l;
58  cond = new Cond ("<=", s[l - 1].ub - 1);
59  thn = new If (l > 4 ? If::BINARY : If::LINEAR, &s[0], l, next);
60  els = new If (h > 4 ? If::BINARY : If::LINEAR, &s[l], h, next);
61 }
If * thn
Definition: go.h:65
Cond * cond
Definition: go.h:64
If * els
Definition: go.h:66
re2c::Binary::~Binary ( )

Definition at line 15 of file go_destruct.cc.

16 {
17  delete cond;
18  delete thn;
19  delete els;
20 }
If * thn
Definition: go.h:65
Cond * cond
Definition: go.h:64
If * els
Definition: go.h:66

Member Function Documentation

void re2c::Binary::emit ( OutputFile o,
uint32_t  ind,
bool &  readCh 
)

Definition at line 109 of file go_emit.cc.

110 {
111  output_if (o, ind, readCh, cond->compare, cond->value);
112  o.ws("{\n");
113  thn->emit (o, ind + 1, readCh);
114  o.wind(ind).ws("} else {\n");
115  els->emit (o, ind + 1, readCh);
116  o.wind(ind).ws("}\n");
117 }
If * thn
Definition: go.h:65
void emit(OutputFile &o, uint32_t ind, bool &readCh)
Definition: go_emit.cc:135
std::string compare
Definition: go.h:57
uint32_t value
Definition: go.h:58
Cond * cond
Definition: go.h:64
If * els
Definition: go.h:66
static void output_if(OutputFile &o, uint32_t ind, bool &readCh, const std::string &compare, uint32_t value)
Definition: go_emit.cc:39

Here is the call graph for this function:

re2c::Binary::FORBID_COPY ( Binary  )
void re2c::Binary::used_labels ( std::set< label_t > &  used)

Definition at line 22 of file go_used_labels.cc.

23 {
24  thn->used_labels (used);
25  els->used_labels (used);
26 }
If * thn
Definition: go.h:65
void used_labels(std::set< label_t > &used)
If * els
Definition: go.h:66

Here is the call graph for this function:

Member Data Documentation

Cond* re2c::Binary::cond

Definition at line 64 of file go.h.

If* re2c::Binary::els

Definition at line 66 of file go.h.

If* re2c::Binary::thn

Definition at line 65 of file go.h.


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