Documentation
¶
Index ¶
- Constants
- func AnalyzeSyntaxError(src *file.Source, err *diagnostics.Diagnostic, offending *TokenNode) bool
- func NewEmptyQueryError(src *file.Source) *diagnostics.Diagnostic
- func NewError(src *file.Source, kind diagnostics.Kind, message string) *diagnostics.Diagnostic
- func NewErrorListener(src *file.Source, handler *ErrorHandler, history *TokenHistory) antlr.ErrorListener
- func NewTrackingTokenStream(stream antlr.TokenStream, history *TokenHistory) antlr.TokenStream
- func NewUnexpectedError(src *file.Source, message string) *diagnostics.Diagnostic
- func NewUnexpectedErrorWith(src *file.Source, message string, cause error) *diagnostics.Diagnostic
- func SpanFromRuleContext(ctx antlr.ParserRuleContext) file.Span
- func SpanFromToken(tok antlr.Token) file.Span
- type ErrorHandler
- func (h *ErrorHandler) Add(err *diagnostics.Diagnostic)
- func (h *ErrorHandler) Create(kind diagnostics.Kind, ctx antlr.ParserRuleContext, msg string) *diagnostics.Diagnostic
- func (h *ErrorHandler) DuplicateMatchBinding(ctx antlr.ParserRuleContext, name string)
- func (h *ErrorHandler) Errors() *diagnostics.Diagnostics[*diagnostics.Diagnostic]
- func (h *ErrorHandler) HasErrorOnLine(line int) bool
- func (h *ErrorHandler) HasErrors() bool
- func (h *ErrorHandler) InvalidRegexExpression(ctx antlr.ParserRuleContext, expression string)
- func (h *ErrorHandler) InvalidToken(token antlr.Token)
- func (h *ErrorHandler) MissingReturnValue(ctx antlr.ParserRuleContext)
- func (h *ErrorHandler) Unwrap() error
- func (h *ErrorHandler) VariableNotFound(token antlr.Token, name string)
- func (h *ErrorHandler) VariableNotUnique(ctx antlr.ParserRuleContext, name string)
- type ErrorListener
- func (d *ErrorListener) ReportAmbiguity(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex int, exact bool, ...)
- func (d *ErrorListener) ReportAttemptingFullContext(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex int, ...)
- func (d *ErrorListener) ReportContextSensitivity(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex, prediction int, ...)
- func (d *ErrorListener) SyntaxError(_ antlr.Recognizer, offendingSymbol interface{}, line, column int, msg string, ...)
- type SyntaxErrorMatcher
- type TokenHistory
- type TokenNode
- type TrackingTokenStream
Constants ¶
View Source
const ( SyntaxError diagnostics.Kind = "SyntaxError" NameError diagnostics.Kind = "NameError" SemanticError diagnostics.Kind = "SemanticError" )
Variables ¶
This section is empty.
Functions ¶
func AnalyzeSyntaxError ¶
func AnalyzeSyntaxError(src *file.Source, err *diagnostics.Diagnostic, offending *TokenNode) bool
func NewEmptyQueryError ¶
func NewEmptyQueryError(src *file.Source) *diagnostics.Diagnostic
func NewError ¶
func NewError(src *file.Source, kind diagnostics.Kind, message string) *diagnostics.Diagnostic
func NewErrorListener ¶
func NewErrorListener(src *file.Source, handler *ErrorHandler, history *TokenHistory) antlr.ErrorListener
func NewTrackingTokenStream ¶
func NewTrackingTokenStream(stream antlr.TokenStream, history *TokenHistory) antlr.TokenStream
func NewUnexpectedError ¶
func NewUnexpectedError(src *file.Source, message string) *diagnostics.Diagnostic
func NewUnexpectedErrorWith ¶
func NewUnexpectedErrorWith(src *file.Source, message string, cause error) *diagnostics.Diagnostic
func SpanFromRuleContext ¶
func SpanFromRuleContext(ctx antlr.ParserRuleContext) file.Span
Types ¶
type ErrorHandler ¶
type ErrorHandler struct {
// contains filtered or unexported fields
}
func NewErrorHandler ¶
func NewErrorHandler(src *file.Source, threshold int) *ErrorHandler
func (*ErrorHandler) Add ¶
func (h *ErrorHandler) Add(err *diagnostics.Diagnostic)
func (*ErrorHandler) Create ¶
func (h *ErrorHandler) Create(kind diagnostics.Kind, ctx antlr.ParserRuleContext, msg string) *diagnostics.Diagnostic
func (*ErrorHandler) DuplicateMatchBinding ¶
func (h *ErrorHandler) DuplicateMatchBinding(ctx antlr.ParserRuleContext, name string)
func (*ErrorHandler) Errors ¶
func (h *ErrorHandler) Errors() *diagnostics.Diagnostics[*diagnostics.Diagnostic]
func (*ErrorHandler) HasErrorOnLine ¶
func (h *ErrorHandler) HasErrorOnLine(line int) bool
func (*ErrorHandler) HasErrors ¶
func (h *ErrorHandler) HasErrors() bool
func (*ErrorHandler) InvalidRegexExpression ¶
func (h *ErrorHandler) InvalidRegexExpression(ctx antlr.ParserRuleContext, expression string)
func (*ErrorHandler) InvalidToken ¶
func (h *ErrorHandler) InvalidToken(token antlr.Token)
func (*ErrorHandler) MissingReturnValue ¶
func (h *ErrorHandler) MissingReturnValue(ctx antlr.ParserRuleContext)
func (*ErrorHandler) Unwrap ¶
func (h *ErrorHandler) Unwrap() error
func (*ErrorHandler) VariableNotFound ¶
func (h *ErrorHandler) VariableNotFound(token antlr.Token, name string)
func (*ErrorHandler) VariableNotUnique ¶
func (h *ErrorHandler) VariableNotUnique(ctx antlr.ParserRuleContext, name string)
type ErrorListener ¶
type ErrorListener struct {
*antlr.DiagnosticErrorListener
// contains filtered or unexported fields
}
func (*ErrorListener) ReportAmbiguity ¶
func (*ErrorListener) ReportAttemptingFullContext ¶
func (d *ErrorListener) ReportAttemptingFullContext(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex int, conflictingAlts *antlr.BitSet, configs *antlr.ATNConfigSet)
func (*ErrorListener) ReportContextSensitivity ¶
func (d *ErrorListener) ReportContextSensitivity(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex, prediction int, configs *antlr.ATNConfigSet)
func (*ErrorListener) SyntaxError ¶
func (d *ErrorListener) SyntaxError(_ antlr.Recognizer, offendingSymbol interface{}, line, column int, msg string, e antlr.RecognitionException)
type SyntaxErrorMatcher ¶
type SyntaxErrorMatcher func(src *file.Source, err *diagnostics.Diagnostic, offending *TokenNode) bool
type TokenHistory ¶
type TokenHistory struct {
// contains filtered or unexported fields
}
func NewTokenHistory ¶
func NewTokenHistory(cap int) *TokenHistory
func (*TokenHistory) Add ¶
func (h *TokenHistory) Add(token antlr.Token)
func (*TokenHistory) Last ¶
func (h *TokenHistory) Last() *TokenNode
func (*TokenHistory) Size ¶
func (h *TokenHistory) Size() int
type TrackingTokenStream ¶
type TrackingTokenStream struct {
antlr.TokenStream
// contains filtered or unexported fields
}
func (*TrackingTokenStream) Consume ¶
func (s *TrackingTokenStream) Consume()
Source Files
¶
- error_analyzer.go
- error_listener.go
- errors.go
- handler.go
- helpers.go
- match_error_array_ops.go
- match_error_assignment.go
- match_error_common.go
- match_error_for_loop.go
- match_error_literals.go
- match_error_query.go
- match_error_return.go
- match_error_waitfor.go
- match_error_while_loop.go
- token_history.go
- token_navigation.go
- token_node.go
- tracking_token_stream.go
Click to show internal directories.
Click to hide internal directories.