summaryrefslogtreecommitdiff
path: root/parse/lex.hpp
diff options
context:
space:
mode:
authorJohn Hodge (bugs) <tpg@mutabah.net>2014-12-07 10:53:56 +0800
committerJohn Hodge (bugs) <tpg@mutabah.net>2014-12-07 10:53:56 +0800
commit6178198e6a5f0ff2384660253347b6e9b5d686e2 (patch)
tree5289ad5107154f3dcebf4efaa98bb34558c3e027 /parse/lex.hpp
parentc325b671c1a44c90c8ce570b901219bcc2ae0a38 (diff)
downloadmrust-6178198e6a5f0ff2384660253347b6e9b5d686e2.tar.gz
TTStream implementation, doesn't compile yet (need to fix TT storage)
Diffstat (limited to 'parse/lex.hpp')
-rw-r--r--parse/lex.hpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/parse/lex.hpp b/parse/lex.hpp
index 88aef072..e01a1cbf 100644
--- a/parse/lex.hpp
+++ b/parse/lex.hpp
@@ -200,16 +200,20 @@ private:
class TokenTree
{
public:
+ TokenTree();
TokenTree(Token tok);
TokenTree(::std::vector<TokenTree> subtrees);
+
+ const unsigned int size() const;
+ const TokenTree& operator[](unsigned int) const;
+ const Token& tok() const;
};
class TTStream:
public TokenStream
{
const TokenTree& m_input_tt;
- const TokenTree* m_cur_layer;
- ::std::vector<unsigned int> m_index_stack;
+ ::std::vector< ::std::pair<unsigned int, const TokenTree*> > m_stack;
public:
TTStream(const TokenTree& input_tt);
~TTStream();