KDESu

lexer.h
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 <[email protected]>
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 
16 class Lexer
17 {
18 public:
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 
53 private:
54  QByteArray m_Input;
55  QByteArray m_Output;
56 
57  int in;
58 };
59 
60 #endif
QByteArray & lval()
Return the token's value.
Definition: lexer.cpp:27
This is a lexer for the kdesud protocol.
Definition: lexer.h:16
int lex()
Read next token.
Definition: lexer.cpp:37
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Dec 5 2023 04:04:13 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.