Documentation
¶
Index ¶
- Constants
- Variables
- func DiceLexerInit()
- func DiceParserInit()
- func InitEmptyCountContext(p *CountContext)
- func InitEmptyModifierContext(p *ModifierContext)
- func InitEmptyNotationContext(p *NotationContext)
- func InitEmptySidesContext(p *SidesContext)
- type BaseDiceListener
- func (s *BaseDiceListener) EnterCount(ctx *CountContext)
- func (s *BaseDiceListener) EnterEveryRule(ctx antlr.ParserRuleContext)
- func (s *BaseDiceListener) EnterModifier(ctx *ModifierContext)
- func (s *BaseDiceListener) EnterNotation(ctx *NotationContext)
- func (s *BaseDiceListener) EnterSides(ctx *SidesContext)
- func (s *BaseDiceListener) ExitCount(ctx *CountContext)
- func (s *BaseDiceListener) ExitEveryRule(ctx antlr.ParserRuleContext)
- func (s *BaseDiceListener) ExitModifier(ctx *ModifierContext)
- func (s *BaseDiceListener) ExitNotation(ctx *NotationContext)
- func (s *BaseDiceListener) ExitSides(ctx *SidesContext)
- func (s *BaseDiceListener) VisitErrorNode(node antlr.ErrorNode)
- func (s *BaseDiceListener) VisitTerminal(node antlr.TerminalNode)
- type CountContext
- func (s *CountContext) EnterRule(listener antlr.ParseTreeListener)
- func (s *CountContext) ExitRule(listener antlr.ParseTreeListener)
- func (s *CountContext) GetParser() antlr.Parser
- func (s *CountContext) GetRuleContext() antlr.RuleContext
- func (s *CountContext) Integer() antlr.TerminalNode
- func (*CountContext) IsCountContext()
- func (s *CountContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string
- type DiceLexer
- type DiceListener
- type DiceParser
- type ICountContext
- type IModifierContext
- type INotationContext
- type ISidesContext
- type ModifierContext
- func (s *ModifierContext) EnterRule(listener antlr.ParseTreeListener)
- func (s *ModifierContext) ExitRule(listener antlr.ParseTreeListener)
- func (s *ModifierContext) GetParser() antlr.Parser
- func (s *ModifierContext) GetRuleContext() antlr.RuleContext
- func (s *ModifierContext) Integer() antlr.TerminalNode
- func (*ModifierContext) IsModifierContext()
- func (s *ModifierContext) SIGN() antlr.TerminalNode
- func (s *ModifierContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string
- type NotationContext
- func (s *NotationContext) Count() ICountContext
- func (s *NotationContext) EnterRule(listener antlr.ParseTreeListener)
- func (s *NotationContext) ExitRule(listener antlr.ParseTreeListener)
- func (s *NotationContext) GetParser() antlr.Parser
- func (s *NotationContext) GetRuleContext() antlr.RuleContext
- func (*NotationContext) IsNotationContext()
- func (s *NotationContext) Modifier() IModifierContext
- func (s *NotationContext) Sides() ISidesContext
- func (s *NotationContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string
- type SidesContext
- func (s *SidesContext) EnterRule(listener antlr.ParseTreeListener)
- func (s *SidesContext) ExitRule(listener antlr.ParseTreeListener)
- func (s *SidesContext) GetParser() antlr.Parser
- func (s *SidesContext) GetRuleContext() antlr.RuleContext
- func (s *SidesContext) Id() antlr.TerminalNode
- func (*SidesContext) IsSidesContext()
- func (s *SidesContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string
Constants ¶
const ( DiceLexerD = 1 DiceLexerSIGN = 2 DiceLexerLPAREN = 3 DiceLexerRPAREN = 4 DiceLexerCOMMA = 5 DiceLexerSPACE = 6 DiceLexerWS = 7 DiceLexerInteger = 8 DiceLexerId = 9 DiceLexerStringLiteral = 10 )
DiceLexer tokens.
const ( DiceParserEOF = antlr.TokenEOF DiceParserD = 1 DiceParserSIGN = 2 DiceParserLPAREN = 3 DiceParserRPAREN = 4 DiceParserCOMMA = 5 DiceParserSPACE = 6 DiceParserWS = 7 DiceParserInteger = 8 DiceParserId = 9 DiceParserStringLiteral = 10 )
DiceParser tokens.
const ( DiceParserRULE_notation = 0 DiceParserRULE_count = 1 DiceParserRULE_sides = 2 DiceParserRULE_modifier = 3 )
DiceParser rules.
Variables ¶
var DiceLexerLexerStaticData struct { ChannelNames []string ModeNames []string LiteralNames []string SymbolicNames []string RuleNames []string PredictionContextCache *antlr.PredictionContextCache // contains filtered or unexported fields }
var DiceParserStaticData struct { LiteralNames []string SymbolicNames []string RuleNames []string PredictionContextCache *antlr.PredictionContextCache // contains filtered or unexported fields }
Functions ¶
func DiceLexerInit ¶
func DiceLexerInit()
DiceLexerInit initializes any static state used to implement DiceLexer. By default the static state used to implement the lexer is lazily initialized during the first call to NewDiceLexer(). You can call this function if you wish to initialize the static state ahead of time.
func DiceParserInit ¶
func DiceParserInit()
DiceParserInit initializes any static state used to implement DiceParser. By default the static state used to implement the parser is lazily initialized during the first call to NewDiceParser(). You can call this function if you wish to initialize the static state ahead of time.
func InitEmptyCountContext ¶
func InitEmptyCountContext(p *CountContext)
func InitEmptyModifierContext ¶
func InitEmptyModifierContext(p *ModifierContext)
func InitEmptyNotationContext ¶
func InitEmptyNotationContext(p *NotationContext)
func InitEmptySidesContext ¶
func InitEmptySidesContext(p *SidesContext)
Types ¶
type BaseDiceListener ¶
type BaseDiceListener struct{}
BaseDiceListener is a complete listener for a parse tree produced by DiceParser.
func (*BaseDiceListener) EnterCount ¶
func (s *BaseDiceListener) EnterCount(ctx *CountContext)
EnterCount is called when production count is entered.
func (*BaseDiceListener) EnterEveryRule ¶
func (s *BaseDiceListener) EnterEveryRule(ctx antlr.ParserRuleContext)
EnterEveryRule is called when any rule is entered.
func (*BaseDiceListener) EnterModifier ¶
func (s *BaseDiceListener) EnterModifier(ctx *ModifierContext)
EnterModifier is called when production modifier is entered.
func (*BaseDiceListener) EnterNotation ¶
func (s *BaseDiceListener) EnterNotation(ctx *NotationContext)
EnterNotation is called when production notation is entered.
func (*BaseDiceListener) EnterSides ¶
func (s *BaseDiceListener) EnterSides(ctx *SidesContext)
EnterSides is called when production sides is entered.
func (*BaseDiceListener) ExitCount ¶
func (s *BaseDiceListener) ExitCount(ctx *CountContext)
ExitCount is called when production count is exited.
func (*BaseDiceListener) ExitEveryRule ¶
func (s *BaseDiceListener) ExitEveryRule(ctx antlr.ParserRuleContext)
ExitEveryRule is called when any rule is exited.
func (*BaseDiceListener) ExitModifier ¶
func (s *BaseDiceListener) ExitModifier(ctx *ModifierContext)
ExitModifier is called when production modifier is exited.
func (*BaseDiceListener) ExitNotation ¶
func (s *BaseDiceListener) ExitNotation(ctx *NotationContext)
ExitNotation is called when production notation is exited.
func (*BaseDiceListener) ExitSides ¶
func (s *BaseDiceListener) ExitSides(ctx *SidesContext)
ExitSides is called when production sides is exited.
func (*BaseDiceListener) VisitErrorNode ¶
func (s *BaseDiceListener) VisitErrorNode(node antlr.ErrorNode)
VisitErrorNode is called when an error node is visited.
func (*BaseDiceListener) VisitTerminal ¶
func (s *BaseDiceListener) VisitTerminal(node antlr.TerminalNode)
VisitTerminal is called when a terminal node is visited.
type CountContext ¶
type CountContext struct {
antlr.BaseParserRuleContext
// contains filtered or unexported fields
}
func NewCountContext ¶
func NewCountContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CountContext
func NewEmptyCountContext ¶
func NewEmptyCountContext() *CountContext
func (*CountContext) EnterRule ¶
func (s *CountContext) EnterRule(listener antlr.ParseTreeListener)
func (*CountContext) ExitRule ¶
func (s *CountContext) ExitRule(listener antlr.ParseTreeListener)
func (*CountContext) GetParser ¶
func (s *CountContext) GetParser() antlr.Parser
func (*CountContext) GetRuleContext ¶
func (s *CountContext) GetRuleContext() antlr.RuleContext
func (*CountContext) Integer ¶
func (s *CountContext) Integer() antlr.TerminalNode
func (*CountContext) IsCountContext ¶
func (*CountContext) IsCountContext()
func (*CountContext) ToStringTree ¶
func (s *CountContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string
type DiceLexer ¶
func NewDiceLexer ¶
func NewDiceLexer(input antlr.CharStream) *DiceLexer
NewDiceLexer produces a new lexer instance for the optional input antlr.CharStream.
type DiceListener ¶
type DiceListener interface {
antlr.ParseTreeListener
// EnterNotation is called when entering the notation production.
EnterNotation(c *NotationContext)
// EnterCount is called when entering the count production.
EnterCount(c *CountContext)
// EnterSides is called when entering the sides production.
EnterSides(c *SidesContext)
// EnterModifier is called when entering the modifier production.
EnterModifier(c *ModifierContext)
// ExitNotation is called when exiting the notation production.
ExitNotation(c *NotationContext)
// ExitCount is called when exiting the count production.
ExitCount(c *CountContext)
// ExitSides is called when exiting the sides production.
ExitSides(c *SidesContext)
// ExitModifier is called when exiting the modifier production.
ExitModifier(c *ModifierContext)
}
DiceListener is a complete listener for a parse tree produced by DiceParser.
type DiceParser ¶
type DiceParser struct {
*antlr.BaseParser
}
func NewDiceParser ¶
func NewDiceParser(input antlr.TokenStream) *DiceParser
NewDiceParser produces a new parser instance for the optional input antlr.TokenStream.
func (*DiceParser) Count ¶
func (p *DiceParser) Count() (localctx ICountContext)
func (*DiceParser) Modifier ¶
func (p *DiceParser) Modifier() (localctx IModifierContext)
func (*DiceParser) Notation ¶
func (p *DiceParser) Notation() (localctx INotationContext)
func (*DiceParser) Sides ¶
func (p *DiceParser) Sides() (localctx ISidesContext)
type ICountContext ¶
type ICountContext interface {
antlr.ParserRuleContext
// GetParser returns the parser.
GetParser() antlr.Parser
// Getter signatures
Integer() antlr.TerminalNode
// IsCountContext differentiates from other interfaces.
IsCountContext()
}
ICountContext is an interface to support dynamic dispatch.
type IModifierContext ¶
type IModifierContext interface {
antlr.ParserRuleContext
// GetParser returns the parser.
GetParser() antlr.Parser
// Getter signatures
SIGN() antlr.TerminalNode
Integer() antlr.TerminalNode
// IsModifierContext differentiates from other interfaces.
IsModifierContext()
}
IModifierContext is an interface to support dynamic dispatch.
type INotationContext ¶
type INotationContext interface {
antlr.ParserRuleContext
// GetParser returns the parser.
GetParser() antlr.Parser
// Getter signatures
Sides() ISidesContext
Count() ICountContext
Modifier() IModifierContext
// IsNotationContext differentiates from other interfaces.
IsNotationContext()
}
INotationContext is an interface to support dynamic dispatch.
type ISidesContext ¶
type ISidesContext interface {
antlr.ParserRuleContext
// GetParser returns the parser.
GetParser() antlr.Parser
// Getter signatures
Id() antlr.TerminalNode
// IsSidesContext differentiates from other interfaces.
IsSidesContext()
}
ISidesContext is an interface to support dynamic dispatch.
type ModifierContext ¶
type ModifierContext struct {
antlr.BaseParserRuleContext
// contains filtered or unexported fields
}
func NewEmptyModifierContext ¶
func NewEmptyModifierContext() *ModifierContext
func NewModifierContext ¶
func NewModifierContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ModifierContext
func (*ModifierContext) EnterRule ¶
func (s *ModifierContext) EnterRule(listener antlr.ParseTreeListener)
func (*ModifierContext) ExitRule ¶
func (s *ModifierContext) ExitRule(listener antlr.ParseTreeListener)
func (*ModifierContext) GetParser ¶
func (s *ModifierContext) GetParser() antlr.Parser
func (*ModifierContext) GetRuleContext ¶
func (s *ModifierContext) GetRuleContext() antlr.RuleContext
func (*ModifierContext) Integer ¶
func (s *ModifierContext) Integer() antlr.TerminalNode
func (*ModifierContext) IsModifierContext ¶
func (*ModifierContext) IsModifierContext()
func (*ModifierContext) SIGN ¶
func (s *ModifierContext) SIGN() antlr.TerminalNode
func (*ModifierContext) ToStringTree ¶
func (s *ModifierContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string
type NotationContext ¶
type NotationContext struct {
antlr.BaseParserRuleContext
// contains filtered or unexported fields
}
func NewEmptyNotationContext ¶
func NewEmptyNotationContext() *NotationContext
func NewNotationContext ¶
func NewNotationContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *NotationContext
func (*NotationContext) Count ¶
func (s *NotationContext) Count() ICountContext
func (*NotationContext) EnterRule ¶
func (s *NotationContext) EnterRule(listener antlr.ParseTreeListener)
func (*NotationContext) ExitRule ¶
func (s *NotationContext) ExitRule(listener antlr.ParseTreeListener)
func (*NotationContext) GetParser ¶
func (s *NotationContext) GetParser() antlr.Parser
func (*NotationContext) GetRuleContext ¶
func (s *NotationContext) GetRuleContext() antlr.RuleContext
func (*NotationContext) IsNotationContext ¶
func (*NotationContext) IsNotationContext()
func (*NotationContext) Modifier ¶
func (s *NotationContext) Modifier() IModifierContext
func (*NotationContext) Sides ¶
func (s *NotationContext) Sides() ISidesContext
func (*NotationContext) ToStringTree ¶
func (s *NotationContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string
type SidesContext ¶
type SidesContext struct {
antlr.BaseParserRuleContext
// contains filtered or unexported fields
}
func NewEmptySidesContext ¶
func NewEmptySidesContext() *SidesContext
func NewSidesContext ¶
func NewSidesContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *SidesContext
func (*SidesContext) EnterRule ¶
func (s *SidesContext) EnterRule(listener antlr.ParseTreeListener)
func (*SidesContext) ExitRule ¶
func (s *SidesContext) ExitRule(listener antlr.ParseTreeListener)
func (*SidesContext) GetParser ¶
func (s *SidesContext) GetParser() antlr.Parser
func (*SidesContext) GetRuleContext ¶
func (s *SidesContext) GetRuleContext() antlr.RuleContext
func (*SidesContext) Id ¶
func (s *SidesContext) Id() antlr.TerminalNode
func (*SidesContext) IsSidesContext ¶
func (*SidesContext) IsSidesContext()
func (*SidesContext) ToStringTree ¶
func (s *SidesContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string