Documentation ¶
Index ¶
- type DiceParserListener
- func (s *DiceParserListener) EnterCount(ctx *fp.CountContext)
- func (s *DiceParserListener) EnterFormula(ctx *fp.FormulaContext)
- func (s *DiceParserListener) EnterFunccall(ctx *fp.FunccallContext)
- func (s *DiceParserListener) EnterFuncname(ctx *fp.FuncnameContext)
- func (s *DiceParserListener) EnterModifier(ctx *fp.ModifierContext)
- func (s *DiceParserListener) EnterParameter(ctx *fp.ParameterContext)
- func (s *DiceParserListener) EnterSides(ctx *fp.SidesContext)
- func (s *DiceParserListener) ExitFunccall(ctx *fp.FunccallContext)
- func (s *DiceParserListener) Roll() Roll
- type Formula
- type ListenerError
- type Parser
- type Roll
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiceParserListener ¶
type DiceParserListener struct { fp.BaseDiceListener // contains filtered or unexported fields }
DiceParserListener implements the BaseDiceListener
func (*DiceParserListener) EnterCount ¶
func (s *DiceParserListener) EnterCount(ctx *fp.CountContext)
EnterCount is called when production count is entered.
func (*DiceParserListener) EnterFormula ¶
func (s *DiceParserListener) EnterFormula(ctx *fp.FormulaContext)
EnterFormula is called when production formula is entered.
func (*DiceParserListener) EnterFunccall ¶
func (s *DiceParserListener) EnterFunccall(ctx *fp.FunccallContext)
EnterFunc_call is called when production func_call is entered.
func (*DiceParserListener) EnterFuncname ¶
func (s *DiceParserListener) EnterFuncname(ctx *fp.FuncnameContext)
EnterFunc_name is called when production func_name is entered.
func (*DiceParserListener) EnterModifier ¶
func (s *DiceParserListener) EnterModifier(ctx *fp.ModifierContext)
EnterModifier is called when production modifier is entered.
func (*DiceParserListener) EnterParameter ¶
func (s *DiceParserListener) EnterParameter(ctx *fp.ParameterContext)
EnterParameter is called when production parameter is entered.
func (*DiceParserListener) EnterSides ¶
func (s *DiceParserListener) EnterSides(ctx *fp.SidesContext)
EnterSides is called when production sides is entered.
func (*DiceParserListener) ExitFunccall ¶
func (s *DiceParserListener) ExitFunccall(ctx *fp.FunccallContext)
ExitFunc_call is called when production func_call is exited.
func (*DiceParserListener) Roll ¶
func (s *DiceParserListener) Roll() Roll
Roll returns the parsed dice
type Formula ¶
type Formula string
*
- Formula
- A dice formula is a string that breaks down the concept of rolling a number of dice
- with a number of sides into an algebraic like form. The idea is to quickly be able
- to describe a role in a more human friendly way. *
- count := uint
- sides := uint
- modifer := integer
- expr := count? 'd' sides modifier? *
- EXAMPLES:
- - d10 - Basic
- - 3d10 - With count
- - d10+10 - With modifier
- - 3d10+10 - With count and modifier
- - 3d10-2 - With negative modifier
type ListenerError ¶
type ListenerError struct {
antlr.ErrorListener
}
ListenerError Captures errors
Click to show internal directories.
Click to hide internal directories.