LibreOffice Module connectivity (master) 1
sqlscan.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19#pragma once
20
22
23namespace connectivity
24{
25
26 //= OSQLScanner
27
31 {
32 const IParseContext* m_pContext; // context for parse, knows all international stuff
33 OString m_sStatement; // statement to parse
35
36 sal_Int32 m_nCurrentPos; // next position to read from the statement
37 bool m_bInternational; // do we have a statement which may uses
38 sal_Int32 m_nRule; // rule to be set
39
40 public:
43
44 sal_Int32 SQLyygetc();
45 void SQLyyerror(char const *fmt);
47
48 // setting the new information before scanning
49 void prepareScan(const OUString & rNewStatement, const IParseContext* pContext, bool bInternational);
50 const OUString& getErrorMessage() const {return m_sErrorMessage;}
51 const OString& getStatement() const { return m_sStatement; }
52
53 static sal_Int32 SQLlex();
54 // set this as scanner for flex
55 void setScanner(bool _bNull=false);
56 // rules settings
57 void SetRule(sal_Int32 nRule) {m_nRule = nRule;}
58 static sal_Int32 GetGERRule();
59 static sal_Int32 GetENGRule();
60 static sal_Int32 GetSQLRule();
61 static sal_Int32 GetDATERule();
62 static sal_Int32 GetSTRINGRule();
63 sal_Int32 GetCurrentPos() const { return m_nCurrentPos; }
64 };
65}
66
67/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Scanner for SQL92.
Definition: sqlscan.hxx:31
static sal_Int32 GetENGRule()
Definition: sqlflex.l:795
sal_Int32 SQLyygetc()
Definition: sqlflex.l:781
static sal_Int32 GetGERRule()
Definition: sqlflex.l:794
static sal_Int32 GetSTRINGRule()
Definition: sqlflex.l:798
void prepareScan(const OUString &rNewStatement, const IParseContext *pContext, bool bInternational)
Definition: sqlflex.l:768
static sal_Int32 GetDATERule()
Definition: sqlflex.l:797
void setScanner(bool _bNull=false)
Definition: sqlflex.l:799
static sal_Int32 GetSQLRule()
Definition: sqlflex.l:796
const IParseContext * m_pContext
Definition: sqlscan.hxx:32
void SQLyyerror(char const *fmt)
Definition: sqlflex.l:726
IParseContext::InternationalKeyCode getInternationalTokenID(const char *sToken) const
Definition: sqlflex.l:789
void SetRule(sal_Int32 nRule)
Definition: sqlscan.hxx:57
const OString & getStatement() const
Definition: sqlscan.hxx:51
static sal_Int32 SQLlex()
Definition: sqlflex.l:803
const OUString & getErrorMessage() const
Definition: sqlscan.hxx:50
sal_Int32 GetCurrentPos() const
Definition: sqlscan.hxx:63