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

#include <go.h>

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

Public Member Functions

void emit (OutputFile &o, uint32_t ind)
 
 Case ()
 
 FORBID_COPY (Case)
 

Public Attributes

std::vector< std::pair< uint32_t, uint32_t > > ranges
 
const Stateto
 

Detailed Description

Definition at line 27 of file go.h.

Constructor & Destructor Documentation

re2c::Case::Case ( )
inline

Definition at line 33 of file go.h.

34  : ranges ()
35  , to (NULL)
36  {}
const State * to
Definition: go.h:30
std::vector< std::pair< uint32_t, uint32_t > > ranges
Definition: go.h:29

Member Function Documentation

void re2c::Case::emit ( OutputFile o,
uint32_t  ind 
)

Definition at line 71 of file go_emit.cc.

72 {
73  for (uint32_t i = 0; i < ranges.size (); ++i)
74  {
75  for (uint32_t b = ranges[i].first; b < ranges[i].second; ++b)
76  {
77  o.wind(ind).ws("case ").wc_hex (b).ws(":");
78  if (opts->dFlag && opts->encoding.type () == Enc::EBCDIC)
79  {
80  const uint32_t c = opts->encoding.decodeUnsafe (b);
81  if (is_print (c))
82  o.ws(" /* ").wc(static_cast<char> (c)).ws(" */");
83  }
84  bool last_case = i == ranges.size () - 1 && b == ranges[i].second - 1;
85  if (!last_case)
86  {
87  o.ws("\n");
88  }
89  }
90  }
91 }
type_t type() const
Definition: enc.h:185
bool dFlag
Definition: opt.h:118
bool is_print(uint32_t c)
Definition: print.cc:11
Enc encoding
Definition: opt.h:118
Opt opts
Definition: opt.cc:7
uint32_t decodeUnsafe(uint32_t c) const
Definition: enc.cc:103
std::vector< std::pair< uint32_t, uint32_t > > ranges
Definition: go.h:29

Here is the call graph for this function:

Here is the caller graph for this function:

re2c::Case::FORBID_COPY ( Case  )

Member Data Documentation

std::vector<std::pair<uint32_t, uint32_t> > re2c::Case::ranges

Definition at line 29 of file go.h.

const State* re2c::Case::to

Definition at line 30 of file go.h.


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