From: Ulya Trofimovich Date: Tue, 12 May 2015 10:32:11 +0000 (+0100) Subject: Renamed struct to avoid confusion. X-Git-Tag: 0.15~274 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b9e788aa5d8bf8b918a13bf64db0ca7ef0f9e735;p=re2c Renamed struct to avoid confusion. 're2c::BitMap' represents actual bitmaps used for code generation, while 're2c::GoBitmap' (former 're2c::Bitmap') is a node type in graph representation of the program right before code generation. Names used in 're2c::Go' subsystem are really ugly and will be renamed to something more sensible later on. --- diff --git a/re2c/src/codegen/go.h b/re2c/src/codegen/go.h index 95716390..aa99e138 100644 --- a/re2c/src/codegen/go.h +++ b/re2c/src/codegen/go.h @@ -103,14 +103,14 @@ struct SwitchIf void used_labels (); }; -struct Bitmap +struct GoBitmap { const BitMap * bitmap; const State * bitmap_state; SwitchIf * hgo; SwitchIf * lgo; - Bitmap (const Span * span, uint32_t nSpans, const Span * hspan, uint32_t hSpans, const BitMap * bm, const State * bm_state, const State * next); - ~Bitmap (); + GoBitmap (const Span * span, uint32_t nSpans, const Span * hspan, uint32_t hSpans, const BitMap * bm, const State * bm_state, const State * next); + ~GoBitmap (); void emit (OutputFile & o, uint32_t ind, bool & readCh); void used_labels (); }; @@ -159,7 +159,7 @@ struct Go union { SwitchIf * switchif; - Bitmap * bitmap; + GoBitmap * bitmap; Cpgoto * cpgoto; Dot * dot; } info; diff --git a/re2c/src/codegen/go_construct.cc b/re2c/src/codegen/go_construct.cc index 7027e533..91570275 100644 --- a/re2c/src/codegen/go_construct.cc +++ b/re2c/src/codegen/go_construct.cc @@ -125,7 +125,7 @@ SwitchIf::SwitchIf (const Span * sp, uint32_t nsp, const State * next) } } -Bitmap::Bitmap (const Span * span, uint32_t nSpans, const Span * hspan, uint32_t hSpans, const BitMap * bm, const State * bm_state, const State * next) +GoBitmap::GoBitmap (const Span * span, uint32_t nSpans, const Span * hspan, uint32_t hSpans, const BitMap * bm, const State * bm_state, const State * next) : bitmap (bm) , bitmap_state (bm_state) , hgo (hSpans == 0 ? NULL : new SwitchIf (hspan, hSpans, next)) @@ -226,7 +226,7 @@ void Go::init (const State * from) else if (bFlag && (nBitmaps > 0)) { type = BITMAP; - info.bitmap = new Bitmap (span, nSpans, hspan, hSpans, bitmap, bitmap_state, from->next); + info.bitmap = new GoBitmap (span, nSpans, hspan, hSpans, bitmap, bitmap_state, from->next); bUsedYYBitmap = true; } else diff --git a/re2c/src/codegen/go_destruct.cc b/re2c/src/codegen/go_destruct.cc index 7db6c695..e53cedfb 100644 --- a/re2c/src/codegen/go_destruct.cc +++ b/re2c/src/codegen/go_destruct.cc @@ -50,7 +50,7 @@ SwitchIf::~SwitchIf () } } -Bitmap::~Bitmap () +GoBitmap::~GoBitmap () { delete hgo; delete lgo; diff --git a/re2c/src/codegen/go_emit.cc b/re2c/src/codegen/go_emit.cc index 9e0c50a1..e32e88b8 100644 --- a/re2c/src/codegen/go_emit.cc +++ b/re2c/src/codegen/go_emit.cc @@ -169,7 +169,7 @@ void SwitchIf::emit (OutputFile & o, uint32_t ind, bool & readCh) } } -void Bitmap::emit (OutputFile & o, uint32_t ind, bool & readCh) +void GoBitmap::emit (OutputFile & o, uint32_t ind, bool & readCh) { std::string yych = output_hgo (o, ind, readCh, hgo); o << "if (" << mapCodeName["yybm"] << "[" << bitmap->i << "+" << yych << "] & "; diff --git a/re2c/src/codegen/go_used_labels.cc b/re2c/src/codegen/go_used_labels.cc index e7125c40..6ae2fe87 100644 --- a/re2c/src/codegen/go_used_labels.cc +++ b/re2c/src/codegen/go_used_labels.cc @@ -52,7 +52,7 @@ void SwitchIf::used_labels () } } -void Bitmap::used_labels () +void GoBitmap::used_labels () { if (hgo != NULL) {