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/ValueHash.h>
14#include <knowCore/LexerTextStream.h>
15
16#include "Token_p.h"
17
18namespace kDB
19{
20 namespace SPARQL
21 {
28 class Lexer {
29 public:
30 Lexer(QIODevice* sstream, const knowCore::ValueHash& _bindings);
31 Lexer(const QString& string, const knowCore::ValueHash& _bindings);
32 ~Lexer();
33 public:
34 Token nextToken();
35 void setCurieLexingEnabled(bool _v);
36 bool isCurieLexingEnabled() const;
37 void setPrefixLexingEnabled(bool _v);
38 void setUriLexingEnabled(bool _v);
39 bool isUriLexingEnabled() const;
40 void setPLLexingEnabled(bool _v);
41 bool isPLLexingEnabled() const;
42 protected:
47 {
48 PN_LOCAL, VARNAME, IDENTIFIER
49 };
50 QString getName(knowCore::LexerTextStream::Element lastChar, NameMode nameMode);
52 Token getString(const QString& terminator, Token::Type _type);
53 private:
54 struct Private;
55 Private* const d;
56 };
57 }
58}
59
60#endif
Definition Lexer_p.h:28
NameMode
Definition Lexer_p.h:47
Definition ValueHash.h:13
Definition Token_p.h:18
Type
Definition Token_p.h:22
Definition LexerTextStream.h:36