File: SQLParser.h

package info (click to toggle)
poco 1.14.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 56,460 kB
  • sloc: cpp: 340,542; ansic: 245,601; makefile: 1,742; yacc: 1,005; sh: 698; sql: 312; lex: 282; xml: 128; perl: 29; python: 24
file content (34 lines) | stat: -rw-r--r-- 1,091 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef SQLPARSER_SQLPARSER_H
#define SQLPARSER_SQLPARSER_H

#include "SQLParserResult.h"

namespace hsql {

// Static methods used to parse SQL strings.
class SQLParser_API SQLParser {
 public:
  // Parses a given constant character SQL string into the result object.
  // Returns true if the lexer and parser could run without internal errors.
  // This does NOT mean that the SQL string was valid SQL. To check that
  // you need to check result->isValid();
  static bool parse(const std::string& sql, SQLParserResult* result);

  // Run tokenization on the given string and store the tokens in the output vector.
  static bool tokenize(const std::string& sql, std::vector<int16_t>* tokens);

  // Old method to parse SQL strings. Replaced by parse().
  POCO_DEPRECATED("Use parse()")
  static bool parseSQLString(const char* sql, SQLParserResult* result);

  // Old method to parse SQL strings. Replaced by parse().
  POCO_DEPRECATED("Use parse()")
  static bool parseSQLString(const std::string& sql, SQLParserResult* result);

 private:
  SQLParser();
};

}  // namespace hsql

#endif