# class toSQLParse

A bunch of functions to parse and indent SQL text. More...

Definition | `#include <tosqlparse.h>`
List of all Methods

Annotated List
Files
Globals
Hierarchy
Index

#### Public Types

- struct settings
- class statement
- class tokenizer
- class stringTokenizer
- class editorTokenizer

#### Public Static Methods

- static std::list<statement> parse (tokenizer &tokens)
- static std::list<statement> parse (const QString &str)
- static std::list<statement> parse (const QString &str,toConnection &conn)
- static statement parseStatement (tokenizer &tokens)
- static statement parseStatement (const QString &str)
- static statement parseStatement (tokenizer &tokens,toConnection &conn)
- static statement parseStatement (const QString &str,toConnection &conn)
- static QString indent (const QString &str)
- static QString indentStatement (statement &stat,toConnection &conn,int level=0)
- static QString indentStatement (statement &stat,int level=0)
- static QString indent (const QString &str,toConnection &conn)
- static QString indentString (int level)
- static QString indent (std::list<statement> &stat,toConnection &conn)
- static QString indent (std::list<statement> &stat)
- static int countIndent (const QString &str,int &chars)
- static QString indent (const QString &str,toSyntaxAnalyzer &syntax)
- static QString indent (std::list<statement> &stat,toSyntaxAnalyzer &syntax)
- static settings getSetting (void)
- static void setSetting (const settings &setting)

## Detailed Description

A bunch of functions to parse and indent SQL text.

settings (struct)

### settings

statement (class)

### statement

Structure the statement is parsed into.

tokenizer (class)

### tokenizer

Abstract class to define a source of tokens for the parser.

stringTokenizer (class)

### stringTokenizer

Tokenizer class which gets tokens from a string.

editorTokenizer (class)

### editorTokenizer

Tokenizer class which gets tokens from an editor.

std::list<statement> parse (tokenizer &tokens)

### parse

[static]

Parse a string.

Parameters:

tokens | Tokenizer provider to generate parsed tree from.

Returns: Parsed statement tree.

std::list<statement> parse (const QString &str)

### parse

[static]

Parse a string.

Parameters:

str | String to parse.

Returns: Parsed statement tree.

std::list<statement> parse (const QString &str,toConnection &conn)

### parse

[static]

Parse a string.

Parameters:

str | String to parse.
conn | Connection to determine SQL dialect. (For future use)

Returns: Parsed statement tree.

statement parseStatement (tokenizer &tokens)

### parseStatement

[static]

Get one statement (or block) from the root of an editor or string.

Parameters:

tokens | Tokenizer to get tokens from.
conn | Connection to determine SQL dialog. (For future use)

statement parseStatement (const QString &str)

### parseStatement

[static]

Get one statement (or block) from the root of an editor or string.

Parameters:

str | Tokenizer to get tokens from.
conn | Connection to determine SQL dialog. (For future use)

statement parseStatement (tokenizer &tokens,toConnection &conn)

### parseStatement

[static]

Get one statement (or block) from the root of an editor or string.

Parameters:

tokens | Tokenizer to get tokens from.
conn | Connection to determine SQL dialog. (For future use)

statement parseStatement (const QString &str,toConnection &conn)

### parseStatement

[static]

Get one statement (or block) from the root of an editor or string.

Parameters:

str | Tokenizer to get tokens from.
conn | Connection to determine SQL dialog. (For future use)

QString indent (const QString &str)

### indent

[static]

Indent a string.

Parameters:

str | String to indent.

Returns: An indented string.

QString indentStatement (statement &stat,toConnection &conn,int level=0)

### indentStatement

[static]

Indent a parse statement structure into a string.

Parameters:

stat | Statement to indent.
level | Initial indentation level to use.
syntax | The syntax analyzer to use.

Returns: A string with the indented statement.

QString indentStatement (statement &stat,int level=0)

### indentStatement

[static]

Indent a parse statement structure into a string.

Parameters:

stat | Statement to indent.
level | Initial indentation level to use.

Returns: A string with the indented statement.

QString indent (const QString &str,toConnection &conn)

### indent

[static]

Indent a string.

Parameters:

str | String to indent.
conn | Connection to determine SQL dialect. (For future use)

Returns: An indented string.

QString indentString (int level)

### indentString

[static]

Create an indentation string.

Parameters:

level | Number of characters to indent.

QString indent (std::list<statement> &stat,toConnection &conn)

### indent

[static]

Indent a string.

Parameters:

str | List of statements
conn | Connection to determine SQL dialect. (For future use)

Returns: An indented string.

QString indent (std::list<statement> &stat)

### indent

[static]

Indent a string.

Parameters:

stat | List of statements

Returns: An indented string.

int countIndent (const QString &str,int &chars)

### countIndent

[static]

Count indentation level of a string.

Parameters:

str | String to check.
chars | Position in string.

QString indent (const QString &str,toSyntaxAnalyzer &syntax)

### indent

[static]

Indent a string.

Parameters:

str | String to indent.
syntax | Syntax analyzer to determine SQL dialect. (For future use)

Returns: An indented string.

QString indent (std::list<statement> &stat,toSyntaxAnalyzer &syntax)

### indent

[static]

Indent a string.

Parameters:

stat | List of statements
syntax | Syntax analyzer to determine SQL dialect. (For future use)

Returns: An indented string.

settings getSetting (void)

### getSetting

[static]

Get current settings.

void setSetting (const settings &setting)

### setSetting

[static]

Get current settings.

Generated by: nneul on skyhawk on Wed Feb 23 19:49:58 2005, using kdoc 2.0a54.