$(srcdir)/src/codegen/output.h \
$(srcdir)/src/codegen/print.h \
$(srcdir)/src/codegen/scc.h \
+ $(srcdir)/src/codegen/skeleton/path.h \
$(srcdir)/src/codegen/skeleton/skeleton.h \
$(srcdir)/src/dfa/action.h \
$(srcdir)/src/dfa/encoding/enc.h \
$(srcdir)/src/codegen/output.cc \
$(srcdir)/src/codegen/print.cc \
$(srcdir)/src/codegen/scc.cc \
+ $(srcdir)/src/codegen/skeleton/path.cc \
$(srcdir)/src/codegen/skeleton/skeleton.cc \
$(srcdir)/src/dfa/actions.cc \
$(srcdir)/src/dfa/encoding/enc.cc \
--- /dev/null
+#include "src/codegen/skeleton/path.h"
+
+namespace re2c
+{
+
+namespace skeleton
+{
+
+Path::Path (const chars_t & cs, uint32_t l, uint32_t r)
+ : chars (cs)
+ , length (l)
+ , rule (r)
+{}
+
+void Path::update (uint32_t r)
+{
+ if (r != NO_RULE)
+ {
+ length = chars.size ();
+ rule = r;
+ }
+}
+
+void Path::extend (uint32_t r, uint32_t c)
+{
+ update (r);
+ chars.push_back (c);
+}
+
+void Path::append (const Path * p)
+{
+ if (p->rule != NO_RULE)
+ {
+ length = chars.size () + p->length;
+ rule = p->rule;
+ }
+ for (uint32_t i = 0; i < p->chars.size (); ++i)
+ {
+ chars.push_back (p->chars[i]);
+ }
+}
+
+} // namespace skeleton
+
+} // namespace re2c
--- /dev/null
+#ifndef __PATH__
+#define __PATH__
+
+#include <vector>
+
+#include "src/util/c99_stdint.h"
+
+namespace re2c
+{
+
+namespace skeleton
+{
+
+const uint32_t NO_RULE = 0xFFFFffff;
+
+struct Path
+{
+ typedef std::vector<uint32_t> chars_t;
+
+ chars_t chars;
+ uint32_t length;
+ uint32_t rule;
+
+ Path (const chars_t & cs, uint32_t l, uint32_t r);
+ void update (uint32_t r);
+ void extend (uint32_t r, uint32_t c);
+ void append (const Path * p);
+};
+
+} // namespace skeleton
+
+} // namespace re2c
+
+#endif // __PATH__
namespace skeleton
{
-Path::Path (const chars_t & cs, uint32_t l, uint32_t r)
- : chars (cs)
- , length (l)
- , rule (r)
-{}
-
-void Path::update (uint32_t r)
-{
- if (r != NO_RULE)
- {
- length = chars.size ();
- rule = r;
- }
-}
-
-void Path::extend (uint32_t r, uint32_t c)
-{
- update (r);
- chars.push_back (c);
-}
-
-void Path::append (const Path * p)
-{
- if (p->rule != NO_RULE)
- {
- length = chars.size () + p->length;
- rule = p->rule;
- }
- for (uint32_t i = 0; i < p->chars.size (); ++i)
- {
- chars.push_back (p->chars[i]);
- }
-}
-
const uint32_t Node::UNKNOWN_LEN = 0xFFFFffff;
Node::Node (const State * s, const s2n_map & s2n)
-#ifndef _skeleton_h
-#define _skeleton_h
+#ifndef __SKELETON__
+#define __SKELETON__
#include <map>
-#include <vector>
+#include "src/codegen/skeleton/path.h"
#include "src/dfa/dfa.h"
#include "src/util/c99_stdint.h"
#include "src/util/forbid_copy.h"
namespace skeleton
{
-const uint32_t NO_RULE = 0xFFFFffff;
-
-struct Path
-{
- typedef std::vector<uint32_t> chars_t;
-
- chars_t chars;
- uint32_t length;
- uint32_t rule;
-
- Path (const chars_t & cs, uint32_t l, uint32_t r);
- void update (uint32_t r);
- void extend (uint32_t r, uint32_t c);
- void append (const Path * p);
-};
-
struct Node
{
typedef std::map<const State *, Node *> s2n_map;
} // namespace re2c
-#endif // _skeleton_h
+#endif // __SKELETON__