kDB: Knowledge DataBase
Loading...
Searching...
No Matches
Lexer_p.h
1/*
2 * Copyright (c) 2008,2010,2015 Cyrille Berger <cberger@cberger.net>
3 *
4 */
5
6#ifndef _SPARQL_LEXER_BASE_H_
7#define _SPARQL_LEXER_BASE_H_
8
9class QIODevice;
10
11#include <QVariantHash>
12
13#include <knowCore/LexerTextStream.h>
14#include <knowCore/ValueHash.h>
15
16#include "Token_p.h"
17
18namespace kDB
19{
20 namespace SPARQL
21 {
28 class Lexer
29 {
30 public:
31 Lexer(QIODevice* sstream, const knowCore::ValueHash& _bindings);
32 Lexer(const QString& string, const knowCore::ValueHash& _bindings);
33 ~Lexer();
34 public:
35 Token nextToken();
36 void setCurieLexingEnabled(bool _v);
37 bool isCurieLexingEnabled() const;
38 void setPrefixLexingEnabled(bool _v);
39 void setUriLexingEnabled(bool _v);
40 bool isUriLexingEnabled() const;
41 void setPLLexingEnabled(bool _v);
42 bool isPLLexingEnabled() const;
43 protected:
48 {
49 PN_LOCAL,
50 VARNAME,
51 IDENTIFIER
52 };
53 QString getName(knowCore::LexerTextStream::Element lastChar, NameMode nameMode);
55 Token getString(const QString& terminator, Token::Type _type);
56 private:
57 struct Private;
58 Private* const d;
59 };
60 } // namespace SPARQL
61} // namespace kDB
62
63#endif
Definition Lexer_p.h:29
NameMode
Definition Lexer_p.h:48
Definition ValueHash.h:13
Definition Token_p.h:19
Type
Definition Token_p.h:24
Definition LexerTextStream.h:36