ANTLR Support Libraries 2.7.1+
Loading...
Searching...
No Matches
TokenStreamSelector.hpp
Go to the documentation of this file.
1#ifndef INC_TokenStreamSelector_hpp__
2#define INC_TokenStreamSelector_hpp__
3
4/* ANTLR Translator Generator
5 * Project led by Terence Parr at http://www.jGuru.com
6 * Software rights: http://www.antlr.org/license.html
7 *
8 * $Id: //depot/code/org.antlr/release/antlr-2.7.7/lib/cpp/antlr/TokenStreamSelector.hpp#2 $
9 */
10
11#include <antlr/config.hpp>
12#include <antlr/TokenStream.hpp>
13#include <map>
14#include <stack>
15
16#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
17namespace antlr {
18#endif
19
28protected:
30#ifdef OS_NO_ALLOCATOR
31 typedef ANTLR_USE_NAMESPACE(std)less<ANTLR_USE_NAMESPACE(std)string> lessp;
33#else
35#endif
37
40
42#ifdef OS_NO_ALLOCATOR
44#else
46#endif
48
49public:
52
53 void addInputStream(TokenStream* stream, const ANTLR_USE_NAMESPACE(std)string& key);
54
56 TokenStream* getCurrentStream() const;
57
58 TokenStream* getStream(const ANTLR_USE_NAMESPACE(std)string& sname) const;
59
60 RefToken nextToken();
61
62 TokenStream* pop();
63
64 void push(TokenStream* stream);
65
66 void push(const ANTLR_USE_NAMESPACE(std)string& sname);
67
75 void retry();
76
78 void select(TokenStream* stream);
79
80 void select(const ANTLR_USE_NAMESPACE(std)string& sname);
81};
82
83#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
84}
85#endif
86
87#endif //INC_TokenStreamSelector_hpp__
Definition RefCount.hpp:17
Definition TokenStreamSelector.hpp:27
streamStack_coll streamStack
Definition TokenStreamSelector.hpp:47
std ::map< std ::string, TokenStream * > inputStreamNames_coll
Definition TokenStreamSelector.hpp:34
std ::stack< TokenStream * > streamStack_coll
Definition TokenStreamSelector.hpp:45
inputStreamNames_coll inputStreamNames
Definition TokenStreamSelector.hpp:36
TokenStream * input
Definition TokenStreamSelector.hpp:39
Definition TokenStream.hpp:22
#define ANTLR_USE_NAMESPACE(_x_)
Definition config.hpp:18
#define ANTLR_API
Definition config.hpp:22
Definition ANTLRException.hpp:15