Documentation ¶
Index ¶
- Constants
- Variables
- func NewPlSqlLexerParser(text string) *plsql.PlSqlParser
- func NewPlSqlStringLexer(text string) *plsql.PlSqlLexer
- func ParseTillCloseParen(tokens []Token) ([]Token, Expressions, error)
- type BaseWalkListener
- type Chunk
- type ConvertMap
- type ErrorListener
- type Errors
- type Expression
- type Expressions
- type InsertInto
- type SelectStatement
- type TableWithAlias
- type Token
- type TokenType
- type Tree
Constants ¶
View Source
const ( OpenParenTok = TokenType(iota + 1) CloseParenTok CommaTok AtomTok StringTok NumberTok OpTok LineCommentTok BlockCommentTok EndTok )
Variables ¶
View Source
var ( // NewPlSqlLexer is a copy of plsql.NewPlSqlLexer NewPlSqlLexer = plsql.NewPlSqlLexer // NewPlSqlParser is a copy of plsql.NewPlSqlParser NewPlSqlParser = plsql.NewPlSqlParser )
Export functionality of plsql package.
View Source
var Warning = errors.New("WARNING")
Functions ¶
func NewPlSqlLexerParser ¶
func NewPlSqlLexerParser(text string) *plsql.PlSqlParser
NewPlSqlLexerParser returns a new *PlSqlParser, including a PlSqlLexer with the given text.
func NewPlSqlStringLexer ¶
func NewPlSqlStringLexer(text string) *plsql.PlSqlLexer
NewPlSqlStringLexer returns a new *PlSqlLexer with an input stream set to the given text.
func ParseTillCloseParen ¶
func ParseTillCloseParen(tokens []Token) ([]Token, Expressions, error)
Types ¶
type BaseWalkListener ¶
type BaseWalkListener struct { *plsql.BasePlSqlParserListener *antlr.DefaultErrorListener Ambiguity [][2]int Err *Errors }
BaseWalkListener is a minimal Walk Listener.
func NewPlSqlParserListener ¶
func NewPlSqlParserListener() *BaseWalkListener
NewPlSqlParserListener returns a *BaseWalkListener with the DefaultErrorListener set.
func (*BaseWalkListener) AddError ¶
func (wl *BaseWalkListener) AddError(err error)
func (*BaseWalkListener) Walk ¶
func (wl *BaseWalkListener) Walk(tree Tree, parser interface{ AddErrorListener(ErrorListener) }) error
Walk the given Tree, with the optional parser's ErrorListener set to wl.
type ConvertMap ¶
type ConvertMap struct { Table string Fields []Chunk Select *selectStmt Values []Chunk InsertInto Chunk }
func ParseToConvertMap ¶
func ParseToConvertMap(text string) (ConvertMap, error)
ParseToConvertMap parses the text into a ConvertMap (INSERT INTO with SELECT statements only).
func (ConvertMap) String ¶
func (M ConvertMap) String() string
type ErrorListener ¶
type ErrorListener = antlr.ErrorListener
type Errors ¶
type Errors struct {
// contains filtered or unexported fields
}
Errors implements the "error" interface, and holds several errors.
type Expression ¶
type Expression struct { Value string Expr Expressions }
type Expressions ¶
type Expressions []Expression
type InsertInto ¶
type InsertInto struct { Table string IsSelect bool Fields []string Values []Expression }
type SelectStatement ¶
type SelectStatement struct {
Fields []Expression
}
func ParseSelect ¶
func ParseSelect(tokens []Token) (SelectStatement, error)
type TableWithAlias ¶
type TableWithAlias struct {
Alias, Table string
}
Click to show internal directories.
Click to hide internal directories.