]> granicus.if.org Git - re2c/commitdiff
Fixed Clang warning -Wshadow.
authorUlya Trofimovich <skvadrik@gmail.com>
Sat, 13 Jul 2019 10:03:13 +0000 (11:03 +0100)
committerUlya Trofimovich <skvadrik@gmail.com>
Sat, 13 Jul 2019 10:03:13 +0000 (11:03 +0100)
bootstrap/src/parse/lex.cc
bootstrap/src/parse/lex.h
src/codegen/go.h
src/codegen/go_construct.cc
src/codegen/output.cc
src/codegen/output.h
src/debug/dump_dfa.cc
src/parse/lex.re
src/parse/scanner.h

index f65433a31f742a41766e7b9f08ddba35571120ac..e28d220089df56039dbcd34e2c2a19908c18de12 100644 (file)
@@ -1,4 +1,4 @@
-/* Generated by re2c 1.1.1 on Sat Jul 13 10:46:39 2019 */
+/* Generated by re2c 1.1.1 on Sat Jul 13 11:00:45 2019 */
 #line 1 "../src/parse/lex.re"
 #include <ctype.h>
 #include "src/util/c99_stdint.h"
@@ -50,7 +50,7 @@ Scanner::ParseMode Scanner::echo(Output &out)
 next:
     tok = cur;
 loop:
-    loc = cur_loc();
+    location = cur_loc();
     ptr = cur;
 
 #line 57 "src/parse/lex.cc"
@@ -1172,7 +1172,7 @@ int Scanner::scan()
     const char *p;
 scan:
     tok = cur;
-    loc = cur_loc();
+    location = cur_loc();
 
 #line 1178 "src/parse/lex.cc"
 {
index 8ba656b3aac65cf67af72aaedd17f29bbcd47d08..e2aa68e7a9cd5b1ff7134c50af5599975ed8b95c 100644 (file)
@@ -1,4 +1,4 @@
-/* Generated by re2c 1.1.1 on Sat Jul 13 10:46:39 2019 */
+/* Generated by re2c 1.1.1 on Sat Jul 13 11:00:45 2019 */
 
 #ifndef _RE2C_PARSE_LEX_
 #define _RE2C_PARSE_LEX_
index 82c98e83ada8f9c990b5979c01fd516773de4470..a819c6e52dd1d06e9cbafbf6a2d5c81a0e66259d 100644 (file)
@@ -180,9 +180,8 @@ struct Cpgoto
 
 struct Dot
 {
-    const State * from;
     Cases * cases;
-    Dot(const Span *sp, uint32_t nsp, const State *s, uint32_t eof);
+    Dot(const Span *sp, uint32_t nsp, uint32_t eof);
     ~Dot ();
     void emit (Output & o, const DFA &dfa, const State *from) const;
 
index 559a4638cf3bb21adc46df81003348d010f6c453..6f3a9c420f47b6ae096ac40fd61742cfad35fdd5 100644 (file)
@@ -216,9 +216,8 @@ Cpgoto::Cpgoto (const Span * span, uint32_t nSpans, const Span * hspan
     , table (new CpgotoTable (span, nSpans))
 {}
 
-Dot::Dot (const Span * sp, uint32_t nsp, const State * s, uint32_t eof)
-    : from (s)
-    , cases (new Cases (sp, nsp, false, eof))
+Dot::Dot (const Span * sp, uint32_t nsp, uint32_t eof)
+    : cases (new Cases (sp, nsp, false, eof))
 {}
 
 Go::Go ()
@@ -280,7 +279,7 @@ void Go::init(const State *from, const opt_t *opts, bitmaps_t &bitmaps)
     const bool part_skip = opts->eager_skip && !skip;
     if (opts->target == TARGET_DOT) {
         type = DOT;
-        info.dot = new Dot (span, nSpans, from, eof);
+        info.dot = new Dot (span, nSpans, eof);
     }
     else if (opts->gFlag && !part_skip && (dSpans >= opts->cGotoThreshold) && !low_spans_have_tags) {
         type = CPGOTO;
index bbd9764728d3231ffd581f5f5714fff0041a3946..0d469a95c27023446c235e04a7d7bc73b1cb35a7 100644 (file)
@@ -84,7 +84,7 @@ OutputBlock::~OutputBlock ()
 Output::Output(Msg &msg)
     : cblocks()
     , hblocks()
-    , blocks(&cblocks)
+    , pblocks(&cblocks)
     , label_counter()
     , fill_index(0)
     , state_goto(false)
@@ -105,12 +105,12 @@ Output::~Output ()
 
 void Output::header_mode(bool on)
 {
-    blocks = on ? &hblocks : &cblocks;
+    pblocks = on ? &hblocks : &cblocks;
 }
 
 OutputBlock& Output::block()
 {
-    return *blocks->back();
+    return *pblocks->back();
 }
 
 std::ostream & Output::stream ()
@@ -247,7 +247,7 @@ Output &Output::wdelay_tags(const ConfTags *cf, bool mtags)
         OutputFragment *frag = new OutputFragment(
             mtags ? OutputFragment::MTAGS : OutputFragment::STAGS, 0);
         frag->tags = cf;
-        blocks->back()->fragments.push_back(frag);
+        pblocks->back()->fragments.push_back(frag);
     }
     return *this;
 }
@@ -256,7 +256,7 @@ Output & Output::wdelay_line_info_input (const loc_t &loc)
 {
     OutputFragment *frag = new OutputFragment(OutputFragment::LINE_INFO_INPUT, 0);
     frag->loc = new loc_t(loc);
-    blocks->back()->fragments.push_back(frag);
+    pblocks->back()->fragments.push_back(frag);
     return *this;
 }
 
@@ -356,7 +356,7 @@ void Output::new_block(Opt &opts, const loc_t &loc)
 {
     OutputBlock *b = new OutputBlock(loc);
     b->opts = opts.snapshot();
-    blocks->push_back(b);
+    pblocks->push_back(b);
 
     // start label hapens to be the only option
     // that must be reset for each new block
index b3c24ee2c6faaa0a55d8e5bd1dca090ed23d16d8..726dd88c37fd935efa210b3acb11488a19ab25f0 100644 (file)
@@ -103,7 +103,7 @@ class Output
 {
     blocks_t cblocks; /* .c file */
     blocks_t hblocks; /* .h file */
-    blocks_t *blocks; /* selector */
+    blocks_t *pblocks; /* selector */
 
 public:
     counter_t<label_t> label_counter;
index a36ef00c5d6b85bdb2687ce8172b5a587dd3b60e..ecef2ae70c612b86573148fec9bc752992fdefa3 100644 (file)
@@ -105,9 +105,9 @@ void dump_dfa_t::state(const ctx_t &ctx, bool isnew)
     if (origin == dfa_t::NIL) {
         fprintf(stderr, "  void [shape=point]\n");
 
-        uint32_t i = 0;
-        for (c = b; c != e; ++c, ++i) {
-            fprintf(stderr, "  void -> 0:%u:w [style=dotted label=\"", i);
+        uint32_t j = 0;
+        for (c = b; c != e; ++c, ++j) {
+            fprintf(stderr, "  void -> 0:%u:w [style=dotted label=\"", j);
             dump_tags<ctx_t>(tvtbl, thist, c->ttran, c->tvers);
             fprintf(stderr, "\"]\n");
         }
@@ -125,11 +125,11 @@ void dump_dfa_t::state(const ctx_t &ctx, bool isnew)
             fprintf(stderr, "\"]\n");
         }
 
-        uint32_t i = 0;
-        for (c = b; c != e; ++c, ++i) {
+        uint32_t j = 0;
+        for (c = b; c != e; ++c, ++j) {
             fprintf(stderr,
                 "  %u:%u:e -> %s%u:%u:w [label=\"%u",
-                origin, c->origin, prefix, state, i, symbol);
+                origin, c->origin, prefix, state, j, symbol);
             dump_tags<ctx_t>(tvtbl, thist, c->ttran, c->tvers);
             fprintf(stderr, "\"]\n");
         }
@@ -146,9 +146,9 @@ void dump_dfa_t::state(const ctx_t &ctx, bool isnew)
         DASSERT(c != e);
 
         fprintf(stderr, "  r%u [shape=none label=\"(", state);
-        for (size_t t = r.ltag; t < r.htag; ++t) {
-            if (t > r.ltag) fprintf(stderr, " ");
-            fprintf(stderr, "%s%d", tagname(dfa.tags[t]), abs(dfa.finvers[t]));
+        for (size_t j = r.ltag; j < r.htag; ++j) {
+            if (j > r.ltag) fprintf(stderr, " ");
+            fprintf(stderr, "%s%d", tagname(dfa.tags[j]), abs(dfa.finvers[j]));
         }
         fprintf(stderr, ")\"]\n");
 
index 2b66c716f1a536d15fb20635318bcbfb29a92373..2ce3b55464e9278069b16d50b57b40f1afedf562 100644 (file)
@@ -127,7 +127,7 @@ Scanner::ParseMode Scanner::echo(Output &out)
 next:
     tok = cur;
 loop:
-    loc = cur_loc();
+    location = cur_loc();
     ptr = cur;
 /*!re2c
     "%{" | "/*!re2c" {
@@ -296,7 +296,7 @@ int Scanner::scan()
     const char *p;
 scan:
     tok = cur;
-    loc = cur_loc();
+    location = cur_loc();
 /*!re2c
     "{"  { lex_code_in_braces(); return TOKEN_CODE; }
     ":=" { lex_code_indented(); return TOKEN_CODE; }
index 87bec434fee2882264336391633fffeda4712b5d..2fd26a826e7bbc7d615ab127a0b07692db00dde9 100644 (file)
@@ -34,7 +34,7 @@ public:
 private:
     std::vector<Input*> files;
     const conopt_t *globopts;
-    loc_t loc;
+    loc_t location;
 
 public:
     Scanner(const conopt_t *o, Msg &m);
@@ -93,7 +93,7 @@ inline Scanner::Scanner(const conopt_t *o, Msg &m)
     , msg(m)
     , files()
     , globopts(o)
-    , loc(ATSTART)
+    , location(ATSTART)
 {}
 
 inline loc_t Scanner::cur_loc() const
@@ -110,7 +110,7 @@ inline loc_t Scanner::cur_loc() const
 
 inline const loc_t &Scanner::tok_loc() const
 {
-    return loc;
+    return location;
 }
 
 inline void Scanner::set_line(uint32_t l)