-#include <limits>
#include <stdlib.h> // exit
#include "src/codegen/skeleton/skeleton.h"
delete [] nodes;
}
-template <> uint32_t Skeleton::none<uint32_t> () { return std::numeric_limits<uint32_t>::max(); }
-template <> uint16_t Skeleton::none<uint16_t> () { return std::numeric_limits<uint16_t>::max(); }
-template <> uint8_t Skeleton::none<uint8_t> () { return std::numeric_limits<uint8_t >::max(); }
-
-template <> uint32_t Skeleton::def<uint32_t> () { return std::numeric_limits<uint32_t>::max() - 1; }
-template <> uint16_t Skeleton::def<uint16_t> () { return std::numeric_limits<uint16_t>::max() - 1; }
-template <> uint8_t Skeleton::def<uint8_t> () { return std::numeric_limits<uint8_t >::max() - 1; }
-
uint32_t Skeleton::rule2key (rule_rank_t r) const
{
switch (sizeof_key)
#ifndef _RE2C_CODEGEN_SKELETON_SKELETON_
#define _RE2C_CODEGEN_SKELETON_SKELETON_
+#include <limits>
#include <map>
#include "src/codegen/skeleton/path.h"
static void emit_epilog (OutputFile & o, const std::set<std::string> & names);
void emit_action (OutputFile & o, uint32_t ind, rule_rank_t rank) const;
- template <typename key_t> static key_t none ();
- template <typename key_t> static key_t def ();
template <typename key_t> static key_t rule2key (rule_rank_t r);
uint32_t rule2key (rule_rank_t r) const;
template<typename key_t> key_t Skeleton::rule2key (rule_rank_t r)
{
if (r.is_none()) {
- return none<key_t>();
+ return std::numeric_limits<key_t>::max();
} else if (r.is_def()) {
- return def<key_t>();
+ key_t k = std::numeric_limits<key_t>::max();
+ return --k;
} else {
return static_cast<key_t>(r.uint32());
}