forked from Uninett/fwbuilder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIOSCfgParser.hpp
178 lines (159 loc) · 5.52 KB
/
IOSCfgParser.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
#ifndef INC_IOSCfgParser_hpp_
#define INC_IOSCfgParser_hpp_
#line 27 "iosacl.g"
// gets inserted before antlr generated includes in the header
// file
#include "IOSImporter.h"
#line 11 "IOSCfgParser.hpp"
#include <antlr/config.hpp>
/* $ANTLR 2.7.7 (20090306): "iosacl.g" -> "IOSCfgParser.hpp"$ */
#include <antlr/TokenStream.hpp>
#include <antlr/TokenBuffer.hpp>
#include "IOSCfgParserTokenTypes.hpp"
#include <antlr/LLkParser.hpp>
#line 33 "iosacl.g"
// gets inserted after antlr generated includes in the header file
// outside any generated namespace specifications
#include <sstream>
class IOSImporter;
#line 28 "IOSCfgParser.hpp"
#line 57 "iosacl.g"
// gets inserted after generated namespace specifications in the
// header file. But outside the generated class.
#line 34 "IOSCfgParser.hpp"
class CUSTOM_API IOSCfgParser : public ANTLR_USE_NAMESPACE(antlr)LLkParser, public IOSCfgParserTokenTypes
{
#line 74 "iosacl.g"
// additional methods and members
public:
std::ostream *dbg;
IOSImporter *importer;
/// Parser error-reporting function can be overridden in subclass
virtual void reportError(const ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex)
{
importer->addMessageToLog("Parser error: " + ex.toString());
}
/// Parser error-reporting function can be overridden in subclass
virtual void reportError(const ANTLR_USE_NAMESPACE(std)string& s)
{
importer->addMessageToLog("Parser error: " + s);
}
/// Parser warning-reporting function can be overridden in subclass
virtual void reportWarning(const ANTLR_USE_NAMESPACE(std)string& s)
{
importer->addMessageToLog("Parser warning: " + s);
}
#line 38 "IOSCfgParser.hpp"
public:
void initializeASTFactory( ANTLR_USE_NAMESPACE(antlr)ASTFactory& factory );
protected:
IOSCfgParser(ANTLR_USE_NAMESPACE(antlr)TokenBuffer& tokenBuf, int k);
public:
IOSCfgParser(ANTLR_USE_NAMESPACE(antlr)TokenBuffer& tokenBuf);
protected:
IOSCfgParser(ANTLR_USE_NAMESPACE(antlr)TokenStream& lexer, int k);
public:
IOSCfgParser(ANTLR_USE_NAMESPACE(antlr)TokenStream& lexer);
IOSCfgParser(const ANTLR_USE_NAMESPACE(antlr)ParserSharedInputState& state);
int getNumTokens() const
{
return IOSCfgParser::NUM_TOKENS;
}
const char* getTokenName( int type ) const
{
if( type > getNumTokens() ) return 0;
return IOSCfgParser::tokenNames[type];
}
const char* const* getTokenNames() const
{
return IOSCfgParser::tokenNames;
}
public: void cfgfile();
public: void comment();
public: void version();
public: void hostname();
public: void ip_commands();
public: void intrface();
public: void controller();
public: void vlan();
public: void access_list_commands();
public: void exit();
public: void description();
public: void shutdown();
public: void certificate();
public: void quit();
public: void unknown_command();
public: void ip_access_list_ext();
public: void interface_known_ip_commands();
public: void community_list_command();
public: void ip_unused_command();
public: void permit_std();
public: void deny_std();
public: void permit_ext();
public: void deny_ext();
public: void remark();
public: void rule_ext();
public: void rule_std();
public: void ip_protocols();
public: void hostaddr_ext();
public: void time_range();
public: void fragments();
public: void log();
public: void icmp_spec();
public: void xoperator();
public: void established();
public: void hostaddr_std();
public: void single_port_op();
public: void port_range();
public: void port_spec();
public: void access_group_by_name();
public: void access_group_by_number();
public: void intf_address();
public:
ANTLR_USE_NAMESPACE(antlr)RefAST getAST()
{
return returnAST;
}
protected:
ANTLR_USE_NAMESPACE(antlr)RefAST returnAST;
private:
static const char* tokenNames[];
#ifndef NO_STATIC_CONSTS
static const int NUM_TOKENS = 80;
#else
enum {
NUM_TOKENS = 80
};
#endif
static const unsigned long _tokenSet_0_data_[];
static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_0;
static const unsigned long _tokenSet_1_data_[];
static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_1;
static const unsigned long _tokenSet_2_data_[];
static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_2;
static const unsigned long _tokenSet_3_data_[];
static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_3;
static const unsigned long _tokenSet_4_data_[];
static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_4;
static const unsigned long _tokenSet_5_data_[];
static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_5;
static const unsigned long _tokenSet_6_data_[];
static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_6;
static const unsigned long _tokenSet_7_data_[];
static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_7;
static const unsigned long _tokenSet_8_data_[];
static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_8;
static const unsigned long _tokenSet_9_data_[];
static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_9;
static const unsigned long _tokenSet_10_data_[];
static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_10;
static const unsigned long _tokenSet_11_data_[];
static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_11;
static const unsigned long _tokenSet_12_data_[];
static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_12;
static const unsigned long _tokenSet_13_data_[];
static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_13;
static const unsigned long _tokenSet_14_data_[];
static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_14;
};
#endif /*INC_IOSCfgParser_hpp_*/