Documentation ¶
Index ¶
- Variables
- type Index
- type Listener
- func (l *Listener) EnterCypherConsoleCommand(ctx *parser.CypherConsoleCommandContext)
- func (l *Listener) EnterCypherPart(ctx *parser.CypherPartContext)
- func (l *Listener) EnterCypherQuery(ctx *parser.CypherQueryContext)
- func (l *Listener) EnterRaw(ctx antlr.ParserRuleContext)
- func (l *Listener) ExitCypherConsoleCommand(ctx *parser.CypherConsoleCommandContext)
- func (l *Listener) ExitCypherPart(ctx *parser.CypherPartContext)
- func (l *Listener) ExitLabelName(ctx *parser.LabelNameContext)
- func (l *Listener) ExitParameterName(ctx *parser.ParameterNameContext)
- func (l *Listener) ExitPropertyKeyName(ctx *parser.PropertyKeyNameContext)
- func (l *Listener) ExitRaw(ctx antlr.ParserRuleContext)
- func (l *Listener) ExitRelTypeName(ctx *parser.RelTypeNameContext)
- func (l *Listener) ExitVariable(ctx *parser.VariableContext)
- type Provider
Constants ¶
This section is empty.
Variables ¶
var Present = struct{}{}
Present indicates presence in a map.
Functions ¶
This section is empty.
Types ¶
type Index ¶
type Index struct { Names []string NamesByQuery [][]string ReferencesByName map[string][]antlr.ParserRuleContext ReferencesByQueryAndName []map[string][]antlr.ParserRuleContext }
func (*Index) AddVariable ¶
func (i *Index) AddVariable(ctx *parser.VariableContext)
AddVariable registers a new variable context. Variables have specific rules, because they participate in autocompletion. We should not add to the names list variables that are in expression.
type Listener ¶
type Listener struct { Queries []parser.CypherQueryContext QueriesAndCommands []antlr.ParserRuleContext Statements []parser.CypherPartContext Raw []antlr.ParserRuleContext Indexes map[string]*Index InConsoleCommand bool parser.BaseCypherListener }
Listener implements callback methods, which are invoked upon AST traversal. It collects certain nodes and indexes them for later retrieval.
func NewListener ¶
func NewListener() *Listener
NewListener creates a Listener with an empty Index for each symbolic context.
func (*Listener) EnterCypherConsoleCommand ¶
func (l *Listener) EnterCypherConsoleCommand(ctx *parser.CypherConsoleCommandContext)
EnterCypherConsoleCommand is called when production cypherConsoleCommand is entered.
func (*Listener) EnterCypherPart ¶
func (l *Listener) EnterCypherPart(ctx *parser.CypherPartContext)
EnterCypherPart is called when production cypherPart is entered.
func (*Listener) EnterCypherQuery ¶
func (l *Listener) EnterCypherQuery(ctx *parser.CypherQueryContext)
EnterCypherQuery is called when production cypherQuery is entered.
func (*Listener) EnterRaw ¶
func (l *Listener) EnterRaw(ctx antlr.ParserRuleContext)
EnterRaw is called when production parserRule is entered.
func (*Listener) ExitCypherConsoleCommand ¶
func (l *Listener) ExitCypherConsoleCommand(ctx *parser.CypherConsoleCommandContext)
ExitCypherConsoleCommand is called when production cypherConsoleCommand is exited.
func (*Listener) ExitCypherPart ¶
func (l *Listener) ExitCypherPart(ctx *parser.CypherPartContext)
ExitCypherPart is called when production cypherPart is exited.
func (*Listener) ExitLabelName ¶
func (l *Listener) ExitLabelName(ctx *parser.LabelNameContext)
ExitLabelName is called when production labelName is exited.
func (*Listener) ExitParameterName ¶
func (l *Listener) ExitParameterName(ctx *parser.ParameterNameContext)
ExitParameterName is called when production parameterName is exited.
func (*Listener) ExitPropertyKeyName ¶
func (l *Listener) ExitPropertyKeyName(ctx *parser.PropertyKeyNameContext)
ExitPropertyKeyName is called when production propertyKeyName is exited.
func (*Listener) ExitRaw ¶
func (l *Listener) ExitRaw(ctx antlr.ParserRuleContext)
ExitRaw is called when production parserRule is exited.
func (*Listener) ExitRelTypeName ¶
func (l *Listener) ExitRelTypeName(ctx *parser.RelTypeNameContext)
ExitRelTypeName is called when production relTypeName is exited.
func (*Listener) ExitVariable ¶
func (l *Listener) ExitVariable(ctx *parser.VariableContext)
ExitVariable is called when production variable is exited.
type Provider ¶
type Provider struct { Queries []parser.CypherQueryContext Names []string NamesByQuery [][]string ReferencesByName map[string][]antlr.ParserRuleContext ReferencesByQueryAndName []map[string][]antlr.ParserRuleContext }
Provider is like a flattened representation of the ParseTree.
func NewProvider ¶
func NewProvider(queries []parser.CypherQueryContext, index *Index) *Provider
func (Provider) GetReferences ¶
func (p Provider) GetReferences(name string, query *parser.CypherQueryContext) []antlr.ParserRuleContext