romannumerals

package
v0.0.0-...-4c43aeb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 4, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Example
package main

import (
	"bramp.net/antlr4/romannumerals"

	"fmt"
	"github.com/antlr/antlr4/runtime/Go/antlr"
)

type exampleListener struct {
	*romannumerals.BaseromannumeralsListener
}

func (l *exampleListener) EnterEveryRule(ctx antlr.ParserRuleContext) {
	fmt.Println(ctx.GetText())
}
func main() {
	// Setup the input
	is := antlr.NewInputStream("...some text to parse...")

	// Create the Lexer
	lexer := romannumerals.NewromannumeralsLexer(is)
	stream := antlr.NewCommonTokenStream(lexer, antlr.TokenDefaultChannel)

	// Create the Parser
	p := romannumerals.NewromannumeralsParser(stream)
	p.BuildParseTrees = true
	p.AddErrorListener(antlr.NewDiagnosticErrorListener(true))

	// Finally walk the tree
	tree := p.Expression()
	antlr.ParseTreeWalkerDefault.Walk(&exampleListener{}, tree)
}
Output:

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewromannumeralsLexer

func NewromannumeralsLexer(input antlr.CharStream) *romannumeralsLexer

func NewromannumeralsParser

func NewromannumeralsParser(input antlr.TokenStream) *romannumeralsParser

Types

type BaseromannumeralsListener

type BaseromannumeralsListener struct{}

BaseromannumeralsListener is a complete listener for a parse tree produced by romannumeralsParser.

func (*BaseromannumeralsListener) EnterEveryRule

func (s *BaseromannumeralsListener) EnterEveryRule(ctx antlr.ParserRuleContext)

EnterEveryRule is called when any rule is entered.

func (*BaseromannumeralsListener) EnterExpression

func (s *BaseromannumeralsListener) EnterExpression(ctx *ExpressionContext)

EnterExpression is called when production expression is entered.

func (*BaseromannumeralsListener) EnterHun_part

func (s *BaseromannumeralsListener) EnterHun_part(ctx *Hun_partContext)

EnterHun_part is called when production hun_part is entered.

func (*BaseromannumeralsListener) EnterHun_rep

func (s *BaseromannumeralsListener) EnterHun_rep(ctx *Hun_repContext)

EnterHun_rep is called when production hun_rep is entered.

func (*BaseromannumeralsListener) EnterHundreds

func (s *BaseromannumeralsListener) EnterHundreds(ctx *HundredsContext)

EnterHundreds is called when production hundreds is entered.

func (*BaseromannumeralsListener) EnterOnes

func (s *BaseromannumeralsListener) EnterOnes(ctx *OnesContext)

EnterOnes is called when production ones is entered.

func (*BaseromannumeralsListener) EnterOnes_rep

func (s *BaseromannumeralsListener) EnterOnes_rep(ctx *Ones_repContext)

EnterOnes_rep is called when production ones_rep is entered.

func (*BaseromannumeralsListener) EnterTens

func (s *BaseromannumeralsListener) EnterTens(ctx *TensContext)

EnterTens is called when production tens is entered.

func (*BaseromannumeralsListener) EnterTens_part

func (s *BaseromannumeralsListener) EnterTens_part(ctx *Tens_partContext)

EnterTens_part is called when production tens_part is entered.

func (*BaseromannumeralsListener) EnterTens_rep

func (s *BaseromannumeralsListener) EnterTens_rep(ctx *Tens_repContext)

EnterTens_rep is called when production tens_rep is entered.

func (*BaseromannumeralsListener) EnterThous_part

func (s *BaseromannumeralsListener) EnterThous_part(ctx *Thous_partContext)

EnterThous_part is called when production thous_part is entered.

func (*BaseromannumeralsListener) EnterThousands

func (s *BaseromannumeralsListener) EnterThousands(ctx *ThousandsContext)

EnterThousands is called when production thousands is entered.

func (*BaseromannumeralsListener) ExitEveryRule

func (s *BaseromannumeralsListener) ExitEveryRule(ctx antlr.ParserRuleContext)

ExitEveryRule is called when any rule is exited.

func (*BaseromannumeralsListener) ExitExpression

func (s *BaseromannumeralsListener) ExitExpression(ctx *ExpressionContext)

ExitExpression is called when production expression is exited.

func (*BaseromannumeralsListener) ExitHun_part

func (s *BaseromannumeralsListener) ExitHun_part(ctx *Hun_partContext)

ExitHun_part is called when production hun_part is exited.

func (*BaseromannumeralsListener) ExitHun_rep

func (s *BaseromannumeralsListener) ExitHun_rep(ctx *Hun_repContext)

ExitHun_rep is called when production hun_rep is exited.

func (*BaseromannumeralsListener) ExitHundreds

func (s *BaseromannumeralsListener) ExitHundreds(ctx *HundredsContext)

ExitHundreds is called when production hundreds is exited.

func (*BaseromannumeralsListener) ExitOnes

func (s *BaseromannumeralsListener) ExitOnes(ctx *OnesContext)

ExitOnes is called when production ones is exited.

func (*BaseromannumeralsListener) ExitOnes_rep

func (s *BaseromannumeralsListener) ExitOnes_rep(ctx *Ones_repContext)

ExitOnes_rep is called when production ones_rep is exited.

func (*BaseromannumeralsListener) ExitTens

func (s *BaseromannumeralsListener) ExitTens(ctx *TensContext)

ExitTens is called when production tens is exited.

func (*BaseromannumeralsListener) ExitTens_part

func (s *BaseromannumeralsListener) ExitTens_part(ctx *Tens_partContext)

ExitTens_part is called when production tens_part is exited.

func (*BaseromannumeralsListener) ExitTens_rep

func (s *BaseromannumeralsListener) ExitTens_rep(ctx *Tens_repContext)

ExitTens_rep is called when production tens_rep is exited.

func (*BaseromannumeralsListener) ExitThous_part

func (s *BaseromannumeralsListener) ExitThous_part(ctx *Thous_partContext)

ExitThous_part is called when production thous_part is exited.

func (*BaseromannumeralsListener) ExitThousands

func (s *BaseromannumeralsListener) ExitThousands(ctx *ThousandsContext)

ExitThousands is called when production thousands is exited.

func (*BaseromannumeralsListener) VisitErrorNode

func (s *BaseromannumeralsListener) VisitErrorNode(node antlr.ErrorNode)

VisitErrorNode is called when an error node is visited.

func (*BaseromannumeralsListener) VisitTerminal

func (s *BaseromannumeralsListener) VisitTerminal(node antlr.TerminalNode)

VisitTerminal is called when a terminal node is visited.

type ExpressionContext

type ExpressionContext struct {
	*antlr.BaseParserRuleContext
	// contains filtered or unexported fields
}

func NewEmptyExpressionContext

func NewEmptyExpressionContext() *ExpressionContext

func NewExpressionContext

func NewExpressionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ExpressionContext

func (*ExpressionContext) EnterRule

func (s *ExpressionContext) EnterRule(listener antlr.ParseTreeListener)

func (*ExpressionContext) ExitRule

func (s *ExpressionContext) ExitRule(listener antlr.ParseTreeListener)

func (*ExpressionContext) GetParser

func (s *ExpressionContext) GetParser() antlr.Parser

func (*ExpressionContext) GetRuleContext

func (s *ExpressionContext) GetRuleContext() antlr.RuleContext

func (*ExpressionContext) IsExpressionContext

func (*ExpressionContext) IsExpressionContext()

func (*ExpressionContext) Thousands

func (s *ExpressionContext) Thousands() IThousandsContext

func (*ExpressionContext) ToStringTree

func (s *ExpressionContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string

type Hun_partContext

type Hun_partContext struct {
	*antlr.BaseParserRuleContext
	// contains filtered or unexported fields
}

func NewEmptyHun_partContext

func NewEmptyHun_partContext() *Hun_partContext

func NewHun_partContext

func NewHun_partContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Hun_partContext

func (*Hun_partContext) CD

func (*Hun_partContext) CM

func (*Hun_partContext) D

func (*Hun_partContext) EnterRule

func (s *Hun_partContext) EnterRule(listener antlr.ParseTreeListener)

func (*Hun_partContext) ExitRule

func (s *Hun_partContext) ExitRule(listener antlr.ParseTreeListener)

func (*Hun_partContext) GetParser

func (s *Hun_partContext) GetParser() antlr.Parser

func (*Hun_partContext) GetRuleContext

func (s *Hun_partContext) GetRuleContext() antlr.RuleContext

func (*Hun_partContext) Hun_rep

func (s *Hun_partContext) Hun_rep() IHun_repContext

func (*Hun_partContext) IsHun_partContext

func (*Hun_partContext) IsHun_partContext()

func (*Hun_partContext) ToStringTree

func (s *Hun_partContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string

type Hun_repContext

type Hun_repContext struct {
	*antlr.BaseParserRuleContext
	// contains filtered or unexported fields
}

func NewEmptyHun_repContext

func NewEmptyHun_repContext() *Hun_repContext

func NewHun_repContext

func NewHun_repContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Hun_repContext

func (*Hun_repContext) C

func (*Hun_repContext) CC

func (*Hun_repContext) CCC

func (*Hun_repContext) EnterRule

func (s *Hun_repContext) EnterRule(listener antlr.ParseTreeListener)

func (*Hun_repContext) ExitRule

func (s *Hun_repContext) ExitRule(listener antlr.ParseTreeListener)

func (*Hun_repContext) GetParser

func (s *Hun_repContext) GetParser() antlr.Parser

func (*Hun_repContext) GetRuleContext

func (s *Hun_repContext) GetRuleContext() antlr.RuleContext

func (*Hun_repContext) IsHun_repContext

func (*Hun_repContext) IsHun_repContext()

func (*Hun_repContext) ToStringTree

func (s *Hun_repContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string

type HundredsContext

type HundredsContext struct {
	*antlr.BaseParserRuleContext
	// contains filtered or unexported fields
}

func NewEmptyHundredsContext

func NewEmptyHundredsContext() *HundredsContext

func NewHundredsContext

func NewHundredsContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *HundredsContext

func (*HundredsContext) EnterRule

func (s *HundredsContext) EnterRule(listener antlr.ParseTreeListener)

func (*HundredsContext) ExitRule

func (s *HundredsContext) ExitRule(listener antlr.ParseTreeListener)

func (*HundredsContext) GetParser

func (s *HundredsContext) GetParser() antlr.Parser

func (*HundredsContext) GetRuleContext

func (s *HundredsContext) GetRuleContext() antlr.RuleContext

func (*HundredsContext) Hun_part

func (s *HundredsContext) Hun_part() IHun_partContext

func (*HundredsContext) IsHundredsContext

func (*HundredsContext) IsHundredsContext()

func (*HundredsContext) Tens

func (s *HundredsContext) Tens() ITensContext

func (*HundredsContext) ToStringTree

func (s *HundredsContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string

type IExpressionContext

type IExpressionContext interface {
	antlr.ParserRuleContext

	// GetParser returns the parser.
	GetParser() antlr.Parser

	// IsExpressionContext differentiates from other interfaces.
	IsExpressionContext()
}

IExpressionContext is an interface to support dynamic dispatch.

type IHun_partContext

type IHun_partContext interface {
	antlr.ParserRuleContext

	// GetParser returns the parser.
	GetParser() antlr.Parser

	// IsHun_partContext differentiates from other interfaces.
	IsHun_partContext()
}

IHun_partContext is an interface to support dynamic dispatch.

type IHun_repContext

type IHun_repContext interface {
	antlr.ParserRuleContext

	// GetParser returns the parser.
	GetParser() antlr.Parser

	// IsHun_repContext differentiates from other interfaces.
	IsHun_repContext()
}

IHun_repContext is an interface to support dynamic dispatch.

type IHundredsContext

type IHundredsContext interface {
	antlr.ParserRuleContext

	// GetParser returns the parser.
	GetParser() antlr.Parser

	// IsHundredsContext differentiates from other interfaces.
	IsHundredsContext()
}

IHundredsContext is an interface to support dynamic dispatch.

type IOnesContext

type IOnesContext interface {
	antlr.ParserRuleContext

	// GetParser returns the parser.
	GetParser() antlr.Parser

	// IsOnesContext differentiates from other interfaces.
	IsOnesContext()
}

IOnesContext is an interface to support dynamic dispatch.

type IOnes_repContext

type IOnes_repContext interface {
	antlr.ParserRuleContext

	// GetParser returns the parser.
	GetParser() antlr.Parser

	// IsOnes_repContext differentiates from other interfaces.
	IsOnes_repContext()
}

IOnes_repContext is an interface to support dynamic dispatch.

type ITensContext

type ITensContext interface {
	antlr.ParserRuleContext

	// GetParser returns the parser.
	GetParser() antlr.Parser

	// IsTensContext differentiates from other interfaces.
	IsTensContext()
}

ITensContext is an interface to support dynamic dispatch.

type ITens_partContext

type ITens_partContext interface {
	antlr.ParserRuleContext

	// GetParser returns the parser.
	GetParser() antlr.Parser

	// IsTens_partContext differentiates from other interfaces.
	IsTens_partContext()
}

ITens_partContext is an interface to support dynamic dispatch.

type ITens_repContext

type ITens_repContext interface {
	antlr.ParserRuleContext

	// GetParser returns the parser.
	GetParser() antlr.Parser

	// IsTens_repContext differentiates from other interfaces.
	IsTens_repContext()
}

ITens_repContext is an interface to support dynamic dispatch.

type IThous_partContext

type IThous_partContext interface {
	antlr.ParserRuleContext

	// GetParser returns the parser.
	GetParser() antlr.Parser

	// IsThous_partContext differentiates from other interfaces.
	IsThous_partContext()
}

IThous_partContext is an interface to support dynamic dispatch.

type IThousandsContext

type IThousandsContext interface {
	antlr.ParserRuleContext

	// GetParser returns the parser.
	GetParser() antlr.Parser

	// IsThousandsContext differentiates from other interfaces.
	IsThousandsContext()
}

IThousandsContext is an interface to support dynamic dispatch.

type OnesContext

type OnesContext struct {
	*antlr.BaseParserRuleContext
	// contains filtered or unexported fields
}

func NewEmptyOnesContext

func NewEmptyOnesContext() *OnesContext

func NewOnesContext

func NewOnesContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *OnesContext

func (*OnesContext) EnterRule

func (s *OnesContext) EnterRule(listener antlr.ParseTreeListener)

func (*OnesContext) ExitRule

func (s *OnesContext) ExitRule(listener antlr.ParseTreeListener)

func (*OnesContext) GetParser

func (s *OnesContext) GetParser() antlr.Parser

func (*OnesContext) GetRuleContext

func (s *OnesContext) GetRuleContext() antlr.RuleContext

func (*OnesContext) IV

func (s *OnesContext) IV() antlr.TerminalNode

func (*OnesContext) IX

func (s *OnesContext) IX() antlr.TerminalNode

func (*OnesContext) IsOnesContext

func (*OnesContext) IsOnesContext()

func (*OnesContext) Ones_rep

func (s *OnesContext) Ones_rep() IOnes_repContext

func (*OnesContext) ToStringTree

func (s *OnesContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string

func (*OnesContext) V

type Ones_repContext

type Ones_repContext struct {
	*antlr.BaseParserRuleContext
	// contains filtered or unexported fields
}

func NewEmptyOnes_repContext

func NewEmptyOnes_repContext() *Ones_repContext

func NewOnes_repContext

func NewOnes_repContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Ones_repContext

func (*Ones_repContext) EnterRule

func (s *Ones_repContext) EnterRule(listener antlr.ParseTreeListener)

func (*Ones_repContext) ExitRule

func (s *Ones_repContext) ExitRule(listener antlr.ParseTreeListener)

func (*Ones_repContext) GetParser

func (s *Ones_repContext) GetParser() antlr.Parser

func (*Ones_repContext) GetRuleContext

func (s *Ones_repContext) GetRuleContext() antlr.RuleContext

func (*Ones_repContext) I

func (*Ones_repContext) II

func (*Ones_repContext) III

func (*Ones_repContext) IsOnes_repContext

func (*Ones_repContext) IsOnes_repContext()

func (*Ones_repContext) ToStringTree

func (s *Ones_repContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string

type TensContext

type TensContext struct {
	*antlr.BaseParserRuleContext
	// contains filtered or unexported fields
}

func NewEmptyTensContext

func NewEmptyTensContext() *TensContext

func NewTensContext

func NewTensContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TensContext

func (*TensContext) EnterRule

func (s *TensContext) EnterRule(listener antlr.ParseTreeListener)

func (*TensContext) ExitRule

func (s *TensContext) ExitRule(listener antlr.ParseTreeListener)

func (*TensContext) GetParser

func (s *TensContext) GetParser() antlr.Parser

func (*TensContext) GetRuleContext

func (s *TensContext) GetRuleContext() antlr.RuleContext

func (*TensContext) IsTensContext

func (*TensContext) IsTensContext()

func (*TensContext) Ones

func (s *TensContext) Ones() IOnesContext

func (*TensContext) Tens_part

func (s *TensContext) Tens_part() ITens_partContext

func (*TensContext) ToStringTree

func (s *TensContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string

type Tens_partContext

type Tens_partContext struct {
	*antlr.BaseParserRuleContext
	// contains filtered or unexported fields
}

func NewEmptyTens_partContext

func NewEmptyTens_partContext() *Tens_partContext

func NewTens_partContext

func NewTens_partContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Tens_partContext

func (*Tens_partContext) EnterRule

func (s *Tens_partContext) EnterRule(listener antlr.ParseTreeListener)

func (*Tens_partContext) ExitRule

func (s *Tens_partContext) ExitRule(listener antlr.ParseTreeListener)

func (*Tens_partContext) GetParser

func (s *Tens_partContext) GetParser() antlr.Parser

func (*Tens_partContext) GetRuleContext

func (s *Tens_partContext) GetRuleContext() antlr.RuleContext

func (*Tens_partContext) IsTens_partContext

func (*Tens_partContext) IsTens_partContext()

func (*Tens_partContext) L

func (*Tens_partContext) Tens_rep

func (s *Tens_partContext) Tens_rep() ITens_repContext

func (*Tens_partContext) ToStringTree

func (s *Tens_partContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string

func (*Tens_partContext) XC

func (*Tens_partContext) XL

type Tens_repContext

type Tens_repContext struct {
	*antlr.BaseParserRuleContext
	// contains filtered or unexported fields
}

func NewEmptyTens_repContext

func NewEmptyTens_repContext() *Tens_repContext

func NewTens_repContext

func NewTens_repContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Tens_repContext

func (*Tens_repContext) EnterRule

func (s *Tens_repContext) EnterRule(listener antlr.ParseTreeListener)

func (*Tens_repContext) ExitRule

func (s *Tens_repContext) ExitRule(listener antlr.ParseTreeListener)

func (*Tens_repContext) GetParser

func (s *Tens_repContext) GetParser() antlr.Parser

func (*Tens_repContext) GetRuleContext

func (s *Tens_repContext) GetRuleContext() antlr.RuleContext

func (*Tens_repContext) IsTens_repContext

func (*Tens_repContext) IsTens_repContext()

func (*Tens_repContext) ToStringTree

func (s *Tens_repContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string

func (*Tens_repContext) X

func (*Tens_repContext) XX

func (*Tens_repContext) XXX

type Thous_partContext

type Thous_partContext struct {
	*antlr.BaseParserRuleContext
	// contains filtered or unexported fields
}

func NewEmptyThous_partContext

func NewEmptyThous_partContext() *Thous_partContext

func NewThous_partContext

func NewThous_partContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Thous_partContext

func (*Thous_partContext) EnterRule

func (s *Thous_partContext) EnterRule(listener antlr.ParseTreeListener)

func (*Thous_partContext) ExitRule

func (s *Thous_partContext) ExitRule(listener antlr.ParseTreeListener)

func (*Thous_partContext) GetParser

func (s *Thous_partContext) GetParser() antlr.Parser

func (*Thous_partContext) GetRuleContext

func (s *Thous_partContext) GetRuleContext() antlr.RuleContext

func (*Thous_partContext) IsThous_partContext

func (*Thous_partContext) IsThous_partContext()

func (*Thous_partContext) M

func (*Thous_partContext) Thous_part

func (s *Thous_partContext) Thous_part() IThous_partContext

func (*Thous_partContext) ToStringTree

func (s *Thous_partContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string

type ThousandsContext

type ThousandsContext struct {
	*antlr.BaseParserRuleContext
	// contains filtered or unexported fields
}

func NewEmptyThousandsContext

func NewEmptyThousandsContext() *ThousandsContext

func NewThousandsContext

func NewThousandsContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ThousandsContext

func (*ThousandsContext) EnterRule

func (s *ThousandsContext) EnterRule(listener antlr.ParseTreeListener)

func (*ThousandsContext) ExitRule

func (s *ThousandsContext) ExitRule(listener antlr.ParseTreeListener)

func (*ThousandsContext) GetParser

func (s *ThousandsContext) GetParser() antlr.Parser

func (*ThousandsContext) GetRuleContext

func (s *ThousandsContext) GetRuleContext() antlr.RuleContext

func (*ThousandsContext) Hundreds

func (s *ThousandsContext) Hundreds() IHundredsContext

func (*ThousandsContext) IsThousandsContext

func (*ThousandsContext) IsThousandsContext()

func (*ThousandsContext) Thous_part

func (s *ThousandsContext) Thous_part() IThous_partContext

func (*ThousandsContext) ToStringTree

func (s *ThousandsContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL