1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_CONNECTIVITY_SQLSCAN_HXX
20 #define INCLUDED_CONNECTIVITY_SQLSCAN_HXX
22 #include <connectivity/IParseContext.hxx>
23 #include <connectivity/dbtoolsdllapi.hxx>
25 namespace connectivity
32 class OOO_DLLPUBLIC_DBTOOLS OSQLScanner
34 const IParseContext
* m_pContext
; // context for parse, knows all international stuff
35 OString m_sStatement
; // statement to parse
36 OUString m_sErrorMessage
;
38 sal_Int32 m_nCurrentPos
; // next position to read from the statement
39 bool m_bInternational
; // do we have a statement which may uses
40 sal_Int32 m_nRule
; // rule to be set
44 virtual ~OSQLScanner();
46 sal_Int32
SQLyygetc();
47 void SQLyyerror(char const *fmt
);
48 IParseContext::InternationalKeyCode
getInternationalTokenID(const char* sToken
) const;
50 // setting the new information before scanning
51 void prepareScan(const OUString
& rNewStatement
, const IParseContext
* pContext
, bool bInternational
);
52 const OUString
& getErrorMessage() const {return m_sErrorMessage
;}
53 const OString
& getStatement() const { return m_sStatement
; }
55 static sal_Int32
SQLlex();
56 // set this as scanner for flex
57 void setScanner(bool _bNull
=false);
59 void SetRule(sal_Int32 nRule
) {m_nRule
= nRule
;}
60 static sal_Int32
GetGERRule();
61 static sal_Int32
GetENGRule();
62 static sal_Int32
GetSQLRule();
63 static sal_Int32
GetDATERule();
64 static sal_Int32
GetSTRINGRule();
65 sal_Int32
GetCurrentPos() const { return m_nCurrentPos
; }
71 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */