Kea 1.5.0
master_lexer_state.h
Go to the documentation of this file.
1// Copyright (C) 2012-2015 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7#ifndef MASTER_LEXER_STATE_H
8#define MASTER_LEXER_STATE_H 1
9
10#include <dns/master_lexer.h>
11
12#include <boost/function.hpp>
13
14namespace isc {
15namespace dns {
16
17namespace master_lexer_internal {
18
50class State {
51public:
56 virtual ~State() {}
57
71 static const State* start(MasterLexer& lexer,
72 MasterLexer::Options options);
73
86 virtual void handle(MasterLexer& lexer) const = 0;
87
93 enum ID {
97 Number
98 };
99
105 static const State& getInstance(ID state_id);
106
113 bool wasLastEOL(const MasterLexer& lexer) const;
114 const MasterToken& getToken(const MasterLexer& lexer) const;
115 size_t getParenCount(const MasterLexer& lexer) const;
117
118protected:
128 MasterLexer::MasterLexerImpl* getLexerImpl(MasterLexer& lexer) const {
129 return (lexer.impl_);
130 }
131};
132
133} // namespace master_lexer_internal
134} // namespace dns
135} // namespace isc
136#endif // MASTER_LEXER_STATE_H
137
138// Local Variables:
139// mode: c++
140// End:
Tokenizer for parsing DNS master files.
Definition: master_lexer.h:301
Options
Options for getNextToken.
Definition: master_lexer.h:343
Tokens for MasterLexer.
Definition: master_lexer.h:39
Tokenization state for MasterLexer.
virtual void handle(MasterLexer &lexer) const =0
Handle the process of one specific state.
size_t getParenCount(const MasterLexer &lexer) const
MasterLexer::MasterLexerImpl * getLexerImpl(MasterLexer &lexer) const
An accessor to the internal implementation class of MasterLexer.
static const State * start(MasterLexer &lexer, MasterLexer::Options options)
Begin state transitions to get the next token.
virtual ~State()
Virtual destructor.
static const State & getInstance(ID state_id)
Returns a State instance of the given state.
const MasterToken & getToken(const MasterLexer &lexer) const
bool wasLastEOL(const MasterLexer &lexer) const
@ CRLF
Just seen a carriage-return character.
@ QString
Handling a quoted string token.
Defines the logger used by the top-level component of kea-dhcp-ddns.