kDB: Knowledge DataBase
Loading...
Searching...
No Matches
kdb
kDB
SPARQL
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
9
class
QIODevice;
10
11
#include <QVariantHash>
12
13
#include <knowCore/LexerTextStream.h>
14
#include <knowCore/ValueHash.h>
15
16
#include "Token_p.h"
17
18
namespace
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
:
47
enum
NameMode
48
{
49
PN_LOCAL,
50
VARNAME,
51
IDENTIFIER
52
};
53
QString getName(
knowCore::LexerTextStream::Element
lastChar,
NameMode
nameMode);
54
Token
getDigit(
knowCore::LexerTextStream::Element
lastChar);
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
kDB::SPARQL::Lexer
Definition
Lexer_p.h:29
kDB::SPARQL::Lexer::NameMode
NameMode
Definition
Lexer_p.h:48
knowCore::ValueHash
Definition
ValueHash.h:13
kDB::SPARQL::Token
Definition
Token_p.h:19
kDB::SPARQL::Token::Type
Type
Definition
Token_p.h:24
knowCore::LexerTextStream::Element
Definition
LexerTextStream.h:36
Generated by
1.12.0