]> granicus.if.org Git - re2c/commitdiff
Renamed function.
authorUlya Trofimovich <skvadrik@gmail.com>
Tue, 8 Sep 2015 16:57:06 +0000 (17:57 +0100)
committerUlya Trofimovich <skvadrik@gmail.com>
Tue, 8 Sep 2015 16:57:06 +0000 (17:57 +0100)
re2c/src/codegen/skeleton/control_flow.cc
re2c/src/codegen/skeleton/skeleton.h

index b61428c48a20aeede4276f6cc4698441cf399041..1962fcd868dc7646e50884fc63ed287054feade4 100644 (file)
@@ -4,9 +4,9 @@ namespace re2c
 {
 
 // see note [estimating total size of paths in skeleton]
-// neither do we need all default paths, nor default path cover:
-// just one path per each default final state, the shorter the better
-arccount_t Node::generate_paths_default (const way_t & prefix, std::vector<way_t> & ways)
+// We don't need all patterns that cause undefined behaviour.
+// We only need some examples, the shorter the better.
+arccount_t Node::naked_ways (const way_t & prefix, std::vector<way_t> & ways)
 {
        if (!rule.is_none ())
        {
@@ -25,7 +25,7 @@ arccount_t Node::generate_paths_default (const way_t & prefix, std::vector<way_t
                {
                        way_t w = prefix;
                        w.push_back (&i->second);
-                       size = size + i->first->generate_paths_default (w, ways);
+                       size = size + i->first->naked_ways (w, ways);
                        if (size.overflow ())
                        {
                                return arccount_t::limit ();
@@ -43,7 +43,7 @@ void Skeleton::warn_undefined_control_flow (uint32_t line, const std::string & c
 {
        way_t prefix;
        std::vector<way_t> ways;
-       const bool overflow = nodes->generate_paths_default (prefix, ways).overflow ();
+       const bool overflow = nodes->naked_ways (prefix, ways).overflow ();
        if (!ways.empty ())
        {
                warn.undefined_control_flow (line, cond, ways, overflow);
index 9faff99636537632369b93d3e7341f117e2fdee1..a9ae9f7f7eab45dcb580909474ae0aadce0f693c 100644 (file)
@@ -44,7 +44,7 @@ struct Node
        arccount_t sizeof_permutate (arccount_t inarcs, arccount_t len);
        void permutate (const multipath_t & prefix, FILE * input, std::ofstream & keys);
        arccount_t cover (const multipath_t & prefix, FILE * input, std::ofstream & keys);
-       arccount_t generate_paths_default (const way_t & prefix, std::vector<way_t> & ways);
+       arccount_t naked_ways (const way_t & prefix, std::vector<way_t> & ways);
 
        FORBID_COPY (Node);
 };