Documentation ¶
Index ¶
- Constants
- func Parse(lin, col int, data string, storage TokenStorage) (errors []error)
- type BooleanContext
- func (s *BooleanContext) EnterRule(listener antlr.ParseTreeListener)
- func (s *BooleanContext) ExitRule(listener antlr.ParseTreeListener)
- func (s *BooleanContext) GetParser() antlr.Parser
- func (s *BooleanContext) GetRuleContext() antlr.RuleContext
- func (*BooleanContext) IsBooleanContext()
- func (s *BooleanContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string
- type EocContext
- func (s *EocContext) AllNEWLINE() []antlr.TerminalNode
- func (s *EocContext) EnterRule(listener antlr.ParseTreeListener)
- func (s *EocContext) ExitRule(listener antlr.ParseTreeListener)
- func (s *EocContext) GetParser() antlr.Parser
- func (s *EocContext) GetRuleContext() antlr.RuleContext
- func (*EocContext) IsEocContext()
- func (s *EocContext) NEWLINE(i int) antlr.TerminalNode
- func (s *EocContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string
- type Error
- type ErrorHandler
- func (eh *ErrorHandler) ReportAmbiguity(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex int, exact bool, ...)
- func (eh *ErrorHandler) ReportAttemptingFullContext(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex int, ...)
- func (eh *ErrorHandler) ReportContextSensitivity(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex, prediction int, ...)
- func (eh *ErrorHandler) SyntaxError(recognizer antlr.Recognizer, offendingSymbol interface{}, line, column int, ...)
- type IBooleanContext
- type IEocContext
- type ILineContext
- type ISetContext
- type IValueContext
- type LineContext
- func (s *LineContext) EnterRule(listener antlr.ParseTreeListener)
- func (s *LineContext) ExitRule(listener antlr.ParseTreeListener)
- func (s *LineContext) GetParser() antlr.Parser
- func (s *LineContext) GetRuleContext() antlr.RuleContext
- func (s *LineContext) IDENTIFIER() antlr.TerminalNode
- func (*LineContext) IsLineContext()
- func (s *LineContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string
- func (s *LineContext) Value() IValueContext
- type Listener
- func (l *Listener) EnterBoolean(c *BooleanContext)
- func (l *Listener) EnterEoc(c *EocContext)
- func (l *Listener) EnterEveryRule(ctx antlr.ParserRuleContext)
- func (l *Listener) EnterLine(c *LineContext)
- func (l *Listener) EnterSet(c *SetContext)
- func (l *Listener) EnterValue(c *ValueContext)
- func (l *Listener) ExitBoolean(c *BooleanContext)
- func (l *Listener) ExitEoc(c *EocContext)
- func (l *Listener) ExitEveryRule(ctx antlr.ParserRuleContext)
- func (l *Listener) ExitLine(c *LineContext)
- func (l *Listener) ExitSet(c *SetContext)
- func (l *Listener) ExitValue(c *ValueContext)
- func (l *Listener) VisitErrorNode(node antlr.ErrorNode)
- func (l *Listener) VisitTerminal(node antlr.TerminalNode)
- type RawLexer
- type RawListener
- type RawParser
- type SetContext
- func (s *SetContext) AllEoc() []IEocContext
- func (s *SetContext) AllLine() []ILineContext
- func (s *SetContext) EOF() antlr.TerminalNode
- func (s *SetContext) EnterRule(listener antlr.ParseTreeListener)
- func (s *SetContext) Eoc(i int) IEocContext
- func (s *SetContext) ExitRule(listener antlr.ParseTreeListener)
- func (s *SetContext) GetParser() antlr.Parser
- func (s *SetContext) GetRuleContext() antlr.RuleContext
- func (*SetContext) IsSetContext()
- func (s *SetContext) Line(i int) ILineContext
- func (s *SetContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string
- type TokenStorage
- type ValueContext
- func (s *ValueContext) Boolean() IBooleanContext
- func (s *ValueContext) EnterRule(listener antlr.ParseTreeListener)
- func (s *ValueContext) ExitRule(listener antlr.ParseTreeListener)
- func (s *ValueContext) GetParser() antlr.Parser
- func (s *ValueContext) GetRuleContext() antlr.RuleContext
- func (s *ValueContext) IDENTIFIER() antlr.TerminalNode
- func (s *ValueContext) INLINE_STRING() antlr.TerminalNode
- func (*ValueContext) IsValueContext()
- func (s *ValueContext) NUMBER() antlr.TerminalNode
- func (s *ValueContext) STRING_LITERAL() antlr.TerminalNode
- func (s *ValueContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string
Constants ¶
const ( RawLexerT__0 = 1 RawLexerT__1 = 2 RawLexerT__2 = 3 RawLexerIDENTIFIER = 4 RawLexerSTRING_LITERAL = 5 RawLexerNUMBER = 6 RawLexerINT = 7 RawLexerINLINE_STRING = 8 RawLexerNEWLINE = 9 RawLexerWS = 10 )
RawLexer tokens.
const ( RawParserEOF = antlr.TokenEOF RawParserT__0 = 1 RawParserT__1 = 2 RawParserT__2 = 3 RawParserIDENTIFIER = 4 RawParserSTRING_LITERAL = 5 RawParserNUMBER = 6 RawParserINT = 7 RawParserINLINE_STRING = 8 RawParserNEWLINE = 9 RawParserWS = 10 )
RawParser tokens.
const ( RawParserRULE_set = 0 RawParserRULE_eoc = 1 RawParserRULE_line = 2 RawParserRULE_value = 3 RawParserRULE_boolean = 4 )
RawParser rules.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BooleanContext ¶
type BooleanContext struct { *antlr.BaseParserRuleContext // contains filtered or unexported fields }
func NewBooleanContext ¶
func NewBooleanContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *BooleanContext
func NewEmptyBooleanContext ¶
func NewEmptyBooleanContext() *BooleanContext
func (*BooleanContext) EnterRule ¶
func (s *BooleanContext) EnterRule(listener antlr.ParseTreeListener)
func (*BooleanContext) ExitRule ¶
func (s *BooleanContext) ExitRule(listener antlr.ParseTreeListener)
func (*BooleanContext) GetParser ¶
func (s *BooleanContext) GetParser() antlr.Parser
func (*BooleanContext) GetRuleContext ¶
func (s *BooleanContext) GetRuleContext() antlr.RuleContext
func (*BooleanContext) IsBooleanContext ¶
func (*BooleanContext) IsBooleanContext()
func (*BooleanContext) ToStringTree ¶
func (s *BooleanContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string
type EocContext ¶
type EocContext struct { *antlr.BaseParserRuleContext // contains filtered or unexported fields }
func NewEmptyEocContext ¶
func NewEmptyEocContext() *EocContext
func NewEocContext ¶
func NewEocContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *EocContext
func (*EocContext) AllNEWLINE ¶
func (s *EocContext) AllNEWLINE() []antlr.TerminalNode
func (*EocContext) EnterRule ¶
func (s *EocContext) EnterRule(listener antlr.ParseTreeListener)
func (*EocContext) ExitRule ¶
func (s *EocContext) ExitRule(listener antlr.ParseTreeListener)
func (*EocContext) GetParser ¶
func (s *EocContext) GetParser() antlr.Parser
func (*EocContext) GetRuleContext ¶
func (s *EocContext) GetRuleContext() antlr.RuleContext
func (*EocContext) IsEocContext ¶
func (*EocContext) IsEocContext()
func (*EocContext) NEWLINE ¶
func (s *EocContext) NEWLINE(i int) antlr.TerminalNode
func (*EocContext) ToStringTree ¶
func (s *EocContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string
type ErrorHandler ¶
type ErrorHandler struct {
// contains filtered or unexported fields
}
ErrorHandler handle errors of generated parser
func (*ErrorHandler) ReportAmbiguity ¶
func (eh *ErrorHandler) ReportAmbiguity(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex int, exact bool, ambigAlts *antlr.BitSet, configs antlr.ATNConfigSet)
ReportAmbiguity ...
func (*ErrorHandler) ReportAttemptingFullContext ¶
func (eh *ErrorHandler) ReportAttemptingFullContext(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex int, conflictingAlts *antlr.BitSet, configs antlr.ATNConfigSet)
ReportAttemptingFullContext dubious
func (*ErrorHandler) ReportContextSensitivity ¶
func (eh *ErrorHandler) ReportContextSensitivity(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex, prediction int, configs antlr.ATNConfigSet)
ReportContextSensitivity ...
func (*ErrorHandler) SyntaxError ¶
func (eh *ErrorHandler) SyntaxError(recognizer antlr.Recognizer, offendingSymbol interface{}, line, column int, msg string, e antlr.RecognitionException)
SyntaxError ...
type IBooleanContext ¶
type IBooleanContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // IsBooleanContext differentiates from other interfaces. IsBooleanContext() }
IBooleanContext is an interface to support dynamic dispatch.
type IEocContext ¶
type IEocContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // IsEocContext differentiates from other interfaces. IsEocContext() }
IEocContext is an interface to support dynamic dispatch.
type ILineContext ¶
type ILineContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // IsLineContext differentiates from other interfaces. IsLineContext() }
ILineContext is an interface to support dynamic dispatch.
type ISetContext ¶
type ISetContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // IsSetContext differentiates from other interfaces. IsSetContext() }
ISetContext is an interface to support dynamic dispatch.
type IValueContext ¶
type IValueContext interface { antlr.ParserRuleContext // GetParser returns the parser. GetParser() antlr.Parser // IsValueContext differentiates from other interfaces. IsValueContext() }
IValueContext is an interface to support dynamic dispatch.
type LineContext ¶
type LineContext struct { *antlr.BaseParserRuleContext // contains filtered or unexported fields }
func NewEmptyLineContext ¶
func NewEmptyLineContext() *LineContext
func NewLineContext ¶
func NewLineContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *LineContext
func (*LineContext) EnterRule ¶
func (s *LineContext) EnterRule(listener antlr.ParseTreeListener)
func (*LineContext) ExitRule ¶
func (s *LineContext) ExitRule(listener antlr.ParseTreeListener)
func (*LineContext) GetParser ¶
func (s *LineContext) GetParser() antlr.Parser
func (*LineContext) GetRuleContext ¶
func (s *LineContext) GetRuleContext() antlr.RuleContext
func (*LineContext) IDENTIFIER ¶
func (s *LineContext) IDENTIFIER() antlr.TerminalNode
func (*LineContext) IsLineContext ¶
func (*LineContext) IsLineContext()
func (*LineContext) ToStringTree ¶
func (s *LineContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string
func (*LineContext) Value ¶
func (s *LineContext) Value() IValueContext
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
Listener implementation of RawListener to scan over raw fenced code blocks
func NewListener ¶
func NewListener(lin, col int, storage TokenStorage) *Listener
NewListener constructor
func (*Listener) EnterEveryRule ¶
func (l *Listener) EnterEveryRule(ctx antlr.ParserRuleContext)
EnterEveryRule ...
func (*Listener) EnterLine ¶
func (l *Listener) EnterLine(c *LineContext)
EnterLine adds identifier as a header
func (*Listener) ExitEveryRule ¶
func (l *Listener) ExitEveryRule(ctx antlr.ParserRuleContext)
ExitEveryRule ...
func (*Listener) VisitErrorNode ¶
VisitErrorNode ...
func (*Listener) VisitTerminal ¶
func (l *Listener) VisitTerminal(node antlr.TerminalNode)
VisitTerminal ...
type RawLexer ¶
func NewRawLexer ¶
func NewRawLexer(input antlr.CharStream) *RawLexer
type RawListener ¶
type RawListener interface { antlr.ParseTreeListener // EnterSet is called when entering the set production. EnterSet(c *SetContext) // EnterEoc is called when entering the eoc production. EnterEoc(c *EocContext) // EnterLine is called when entering the line production. EnterLine(c *LineContext) // EnterValue is called when entering the value production. EnterValue(c *ValueContext) // EnterBoolean is called when entering the boolean production. EnterBoolean(c *BooleanContext) // ExitSet is called when exiting the set production. ExitSet(c *SetContext) // ExitEoc is called when exiting the eoc production. ExitEoc(c *EocContext) // ExitLine is called when exiting the line production. ExitLine(c *LineContext) // ExitValue is called when exiting the value production. ExitValue(c *ValueContext) // ExitBoolean is called when exiting the boolean production. ExitBoolean(c *BooleanContext) }
RawListener is a complete listener for a parse tree produced by RawParser.
type RawParser ¶
type RawParser struct {
*antlr.BaseParser
}
func NewRawParser ¶
func NewRawParser(input antlr.TokenStream) *RawParser
func (*RawParser) Boolean ¶
func (p *RawParser) Boolean() (localctx IBooleanContext)
func (*RawParser) Eoc ¶
func (p *RawParser) Eoc() (localctx IEocContext)
func (*RawParser) Line ¶
func (p *RawParser) Line() (localctx ILineContext)
func (*RawParser) Set ¶
func (p *RawParser) Set() (localctx ISetContext)
func (*RawParser) Value ¶
func (p *RawParser) Value() (localctx IValueContext)
type SetContext ¶
type SetContext struct { *antlr.BaseParserRuleContext // contains filtered or unexported fields }
func NewEmptySetContext ¶
func NewEmptySetContext() *SetContext
func NewSetContext ¶
func NewSetContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *SetContext
func (*SetContext) AllEoc ¶
func (s *SetContext) AllEoc() []IEocContext
func (*SetContext) AllLine ¶
func (s *SetContext) AllLine() []ILineContext
func (*SetContext) EOF ¶
func (s *SetContext) EOF() antlr.TerminalNode
func (*SetContext) EnterRule ¶
func (s *SetContext) EnterRule(listener antlr.ParseTreeListener)
func (*SetContext) Eoc ¶
func (s *SetContext) Eoc(i int) IEocContext
func (*SetContext) ExitRule ¶
func (s *SetContext) ExitRule(listener antlr.ParseTreeListener)
func (*SetContext) GetParser ¶
func (s *SetContext) GetParser() antlr.Parser
func (*SetContext) GetRuleContext ¶
func (s *SetContext) GetRuleContext() antlr.RuleContext
func (*SetContext) IsSetContext ¶
func (*SetContext) IsSetContext()
func (*SetContext) Line ¶
func (s *SetContext) Line(i int) ILineContext
func (*SetContext) ToStringTree ¶
func (s *SetContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string
type TokenStorage ¶
type TokenStorage interface { Header(lin, col, xcol int, value string) ValueNumber(lin, col, xcol int, value string) ValueString(lin, col, xcol int, value string) Boolean(lin, col, xcol int, value string) }
TokenStorage is an abstraction over token storage
type ValueContext ¶
type ValueContext struct { *antlr.BaseParserRuleContext // contains filtered or unexported fields }
func NewEmptyValueContext ¶
func NewEmptyValueContext() *ValueContext
func NewValueContext ¶
func NewValueContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ValueContext
func (*ValueContext) Boolean ¶
func (s *ValueContext) Boolean() IBooleanContext
func (*ValueContext) EnterRule ¶
func (s *ValueContext) EnterRule(listener antlr.ParseTreeListener)
func (*ValueContext) ExitRule ¶
func (s *ValueContext) ExitRule(listener antlr.ParseTreeListener)
func (*ValueContext) GetParser ¶
func (s *ValueContext) GetParser() antlr.Parser
func (*ValueContext) GetRuleContext ¶
func (s *ValueContext) GetRuleContext() antlr.RuleContext
func (*ValueContext) IDENTIFIER ¶
func (s *ValueContext) IDENTIFIER() antlr.TerminalNode
func (*ValueContext) INLINE_STRING ¶
func (s *ValueContext) INLINE_STRING() antlr.TerminalNode
func (*ValueContext) IsValueContext ¶
func (*ValueContext) IsValueContext()
func (*ValueContext) NUMBER ¶
func (s *ValueContext) NUMBER() antlr.TerminalNode
func (*ValueContext) STRING_LITERAL ¶
func (s *ValueContext) STRING_LITERAL() antlr.TerminalNode
func (*ValueContext) ToStringTree ¶
func (s *ValueContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string