1/* vi: ts=8 sts=4 sw=4
2
3 This file is part of the KDE project, module kdesu.
4 SPDX-FileCopyrightText: 1999, 2000 Geert Jansen <jansen@kde.org>
5*/
6
7#ifndef __Lexer_h_included__
8#define __Lexer_h_included__
9
10#include <QByteArray>
11
12/**
13 * This is a lexer for the kdesud protocol.
14 */
15
16class Lexer
17{
18public:
19 Lexer(const QByteArray &input);
20 ~Lexer();
21
22 Lexer(const Lexer &) = delete;
23 Lexer &operator=(const Lexer &) = delete;
24
25 /** Read next token. */
26 int lex();
27
28 /** Return the token's value. */
29 QByteArray &lval();
30
31 enum Tokens {
32 Tok_none,
33 Tok_exec = 256,
34 Tok_pass,
35 Tok_delCmd,
36 Tok_ping,
37 Tok_str,
38 Tok_num,
39 Tok_stop,
40 Tok_set,
41 Tok_get,
42 Tok_delVar,
43 Tok_delGroup,
44 Tok_host,
45 Tok_prio,
46 Tok_sched,
47 Tok_getKeys,
48 Tok_chkGroup,
49 Tok_delSpecialKey,
50 Tok_exit,
51 };
52
53private:
54 QByteArray m_Input;
55 QByteArray m_Output;
56
57 int in;
58};
59
60#endif
61

source code of kdesu/src/kdesud/lexer.h