src
Public Types | Public Member Functions | List of all members
re2c::path_t Class Reference

#include <path.h>

Public Types

typedef std::vector< uint32_t > arc_t
 

Public Member Functions

 path_t (rule_t r, bool c)
 
size_t len () const
 
size_t len_matching () const
 
rule_rank_t match () const
 
const arc_toperator[] (size_t i) const
 
void extend (rule_t r, bool c, const arc_t *a)
 
void append (const path_t *p)
 

Detailed Description

Definition at line 31 of file path.h.

Member Typedef Documentation

typedef std::vector<uint32_t> re2c::path_t::arc_t

Definition at line 34 of file path.h.

Constructor & Destructor Documentation

re2c::path_t::path_t ( rule_t  r,
bool  c 
)
inlineexplicit

Definition at line 46 of file path.h.

47  : arcs ()
48  , rule (r)
49  , rule_pos (0)
50  , ctx (c)
51  , ctx_pos (0)
52  {}

Member Function Documentation

void re2c::path_t::append ( const path_t p)
inline

Definition at line 85 of file path.h.

86  {
87  if (!p->rule.rank.is_none ())
88  {
89  rule = p->rule;
90  rule_pos = arcs.size () + p->rule_pos;
91  }
92  if (p->ctx)
93  {
94  ctx = true;
95  ctx_pos = arcs.size () + p->ctx_pos;
96  }
97  arcs.insert (arcs.end (), p->arcs.begin (), p->arcs.end ());
98  }

Here is the call graph for this function:

Here is the caller graph for this function:

void re2c::path_t::extend ( rule_t  r,
bool  c,
const arc_t a 
)
inline

Definition at line 71 of file path.h.

72  {
73  arcs.push_back (a);
74  if (!r.rank.is_none ())
75  {
76  rule = r;
77  rule_pos = arcs.size ();
78  }
79  if (c)
80  {
81  ctx = true;
82  ctx_pos = arcs.size ();
83  }
84  }

Here is the call graph for this function:

Here is the caller graph for this function:

size_t re2c::path_t::len ( ) const
inline

Definition at line 53 of file path.h.

54  {
55  return arcs.size ();
56  }

Here is the caller graph for this function:

size_t re2c::path_t::len_matching ( ) const
inline

Definition at line 57 of file path.h.

58  {
59  return rule.restorectx
60  ? ctx_pos
61  : rule_pos;
62  }
bool restorectx
Definition: path.h:15

Here is the caller graph for this function:

rule_rank_t re2c::path_t::match ( ) const
inline

Definition at line 63 of file path.h.

64  {
65  return rule.rank;
66  }
rule_rank_t rank
Definition: path.h:14

Here is the caller graph for this function:

const arc_t* re2c::path_t::operator[] ( size_t  i) const
inline

Definition at line 67 of file path.h.

68  {
69  return arcs[i];
70  }

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