mu

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/mu"

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

type exampleListener struct {
	*mu.BaseMuParserListener
}

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 := mu.NewMuParserLexer(is)
	stream := antlr.NewCommonTokenStream(lexer, antlr.TokenDefaultChannel)

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

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

Index

Examples

Constants

View Source
const (
	MuParserLexerT__0          = 1
	MuParserLexerT__1          = 2
	MuParserLexerFUNCTION      = 3
	MuParserLexerFUNCTIONMULTI = 4
	MuParserLexerASSIGN        = 5
	MuParserLexerASSIGNADD     = 6
	MuParserLexerASSIGNSUB     = 7
	MuParserLexerASSIGNMUL     = 8
	MuParserLexerASSIGNDIV     = 9
	MuParserLexerAND           = 10
	MuParserLexerOR            = 11
	MuParserLexerLTEQ          = 12
	MuParserLexerGTEQ          = 13
	MuParserLexerNEQ           = 14
	MuParserLexerEQ            = 15
	MuParserLexerLT            = 16
	MuParserLexerGT            = 17
	MuParserLexerADD           = 18
	MuParserLexerSUB           = 19
	MuParserLexerMUL           = 20
	MuParserLexerDIV           = 21
	MuParserLexerPOW           = 22
	MuParserLexerNOT           = 23
	MuParserLexerQUESTION      = 24
	MuParserLexerCOLON         = 25
	MuParserLexerOPAR          = 26
	MuParserLexerCPAR          = 27
	MuParserLexerINT           = 28
	MuParserLexerFLOAT         = 29
	MuParserLexerTRUE          = 30
	MuParserLexerFALSE         = 31
	MuParserLexerE             = 32
	MuParserLexerPI            = 33
	MuParserLexerID            = 34
	MuParserLexerSPACE         = 35
)

MuParserLexer tokens.

View Source
const (
	MuParserParserEOF           = antlr.TokenEOF
	MuParserParserT__0          = 1
	MuParserParserT__1          = 2
	MuParserParserFUNCTION      = 3
	MuParserParserFUNCTIONMULTI = 4
	MuParserParserASSIGN        = 5
	MuParserParserASSIGNADD     = 6
	MuParserParserASSIGNSUB     = 7
	MuParserParserASSIGNMUL     = 8
	MuParserParserASSIGNDIV     = 9
	MuParserParserAND           = 10
	MuParserParserOR            = 11
	MuParserParserLTEQ          = 12
	MuParserParserGTEQ          = 13
	MuParserParserNEQ           = 14
	MuParserParserEQ            = 15
	MuParserParserLT            = 16
	MuParserParserGT            = 17
	MuParserParserADD           = 18
	MuParserParserSUB           = 19
	MuParserParserMUL           = 20
	MuParserParserDIV           = 21
	MuParserParserPOW           = 22
	MuParserParserNOT           = 23
	MuParserParserQUESTION      = 24
	MuParserParserCOLON         = 25
	MuParserParserOPAR          = 26
	MuParserParserCPAR          = 27
	MuParserParserINT           = 28
	MuParserParserFLOAT         = 29
	MuParserParserTRUE          = 30
	MuParserParserFALSE         = 31
	MuParserParserE             = 32
	MuParserParserPI            = 33
	MuParserParserID            = 34
	MuParserParserSPACE         = 35
)

MuParserParser tokens.

View Source
const (
	MuParserParserRULE_prog = 0
	MuParserParserRULE_expr = 1
	MuParserParserRULE_atom = 2
)

MuParserParser rules.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddSubExprContext

type AddSubExprContext struct {
	*ExprContext
	// contains filtered or unexported fields
}

func NewAddSubExprContext

func NewAddSubExprContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *AddSubExprContext

func (*AddSubExprContext) ADD

func (*AddSubExprContext) AllExpr

func (s *AddSubExprContext) AllExpr() []IExprContext

func (*AddSubExprContext) EnterRule

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

func (*AddSubExprContext) ExitRule

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

func (*AddSubExprContext) Expr

func (s *AddSubExprContext) Expr(i int) IExprContext

func (*AddSubExprContext) GetOp

func (s *AddSubExprContext) GetOp() antlr.Token

func (*AddSubExprContext) GetRuleContext

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

func (*AddSubExprContext) SUB

func (*AddSubExprContext) SetOp

func (s *AddSubExprContext) SetOp(v antlr.Token)

type AndExprContext

type AndExprContext struct {
	*ExprContext
}

func NewAndExprContext

func NewAndExprContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *AndExprContext

func (*AndExprContext) AND

func (*AndExprContext) AllExpr

func (s *AndExprContext) AllExpr() []IExprContext

func (*AndExprContext) EnterRule

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

func (*AndExprContext) ExitRule

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

func (*AndExprContext) Expr

func (s *AndExprContext) Expr(i int) IExprContext

func (*AndExprContext) GetRuleContext

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

type AssignExprContext

type AssignExprContext struct {
	*ExprContext
	// contains filtered or unexported fields
}

func NewAssignExprContext

func NewAssignExprContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *AssignExprContext

func (*AssignExprContext) ASSIGN

func (s *AssignExprContext) ASSIGN() antlr.TerminalNode

func (*AssignExprContext) ASSIGNADD

func (s *AssignExprContext) ASSIGNADD() antlr.TerminalNode

func (*AssignExprContext) ASSIGNDIV

func (s *AssignExprContext) ASSIGNDIV() antlr.TerminalNode

func (*AssignExprContext) ASSIGNMUL

func (s *AssignExprContext) ASSIGNMUL() antlr.TerminalNode

func (*AssignExprContext) ASSIGNSUB

func (s *AssignExprContext) ASSIGNSUB() antlr.TerminalNode

func (*AssignExprContext) EnterRule

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

func (*AssignExprContext) ExitRule

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

func (*AssignExprContext) Expr

func (s *AssignExprContext) Expr() IExprContext

func (*AssignExprContext) GetOp

func (s *AssignExprContext) GetOp() antlr.Token

func (*AssignExprContext) GetRuleContext

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

func (*AssignExprContext) ID

func (*AssignExprContext) SetOp

func (s *AssignExprContext) SetOp(v antlr.Token)

type AtomContext

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

func NewAtomContext

func NewAtomContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *AtomContext

func NewEmptyAtomContext

func NewEmptyAtomContext() *AtomContext

func (*AtomContext) CopyFrom

func (s *AtomContext) CopyFrom(ctx *AtomContext)

func (*AtomContext) GetParser

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

func (*AtomContext) GetRuleContext

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

func (*AtomContext) IsAtomContext

func (*AtomContext) IsAtomContext()

func (*AtomContext) ToStringTree

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

type AtomExprContext

type AtomExprContext struct {
	*ExprContext
}

func NewAtomExprContext

func NewAtomExprContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *AtomExprContext

func (*AtomExprContext) Atom

func (s *AtomExprContext) Atom() IAtomContext

func (*AtomExprContext) EnterRule

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

func (*AtomExprContext) ExitRule

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

func (*AtomExprContext) GetRuleContext

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

type BaseMuParserListener

type BaseMuParserListener struct{}

BaseMuParserListener is a complete listener for a parse tree produced by MuParserParser.

func (*BaseMuParserListener) EnterAddSubExpr

func (s *BaseMuParserListener) EnterAddSubExpr(ctx *AddSubExprContext)

EnterAddSubExpr is called when production addSubExpr is entered.

func (*BaseMuParserListener) EnterAndExpr

func (s *BaseMuParserListener) EnterAndExpr(ctx *AndExprContext)

EnterAndExpr is called when production andExpr is entered.

func (*BaseMuParserListener) EnterAssignExpr

func (s *BaseMuParserListener) EnterAssignExpr(ctx *AssignExprContext)

EnterAssignExpr is called when production assignExpr is entered.

func (*BaseMuParserListener) EnterAtomExpr

func (s *BaseMuParserListener) EnterAtomExpr(ctx *AtomExprContext)

EnterAtomExpr is called when production atomExpr is entered.

func (*BaseMuParserListener) EnterBooleanAtom

func (s *BaseMuParserListener) EnterBooleanAtom(ctx *BooleanAtomContext)

EnterBooleanAtom is called when production booleanAtom is entered.

func (*BaseMuParserListener) EnterEqualityExpr

func (s *BaseMuParserListener) EnterEqualityExpr(ctx *EqualityExprContext)

EnterEqualityExpr is called when production equalityExpr is entered.

func (*BaseMuParserListener) EnterEveryRule

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

EnterEveryRule is called when any rule is entered.

func (*BaseMuParserListener) EnterFunctionExpr

func (s *BaseMuParserListener) EnterFunctionExpr(ctx *FunctionExprContext)

EnterFunctionExpr is called when production functionExpr is entered.

func (*BaseMuParserListener) EnterFunctionMultiExpr

func (s *BaseMuParserListener) EnterFunctionMultiExpr(ctx *FunctionMultiExprContext)

EnterFunctionMultiExpr is called when production functionMultiExpr is entered.

func (*BaseMuParserListener) EnterIdAtom

func (s *BaseMuParserListener) EnterIdAtom(ctx *IdAtomContext)

EnterIdAtom is called when production idAtom is entered.

func (*BaseMuParserListener) EnterIteExpr

func (s *BaseMuParserListener) EnterIteExpr(ctx *IteExprContext)

EnterIteExpr is called when production iteExpr is entered.

func (*BaseMuParserListener) EnterMulDivExpr

func (s *BaseMuParserListener) EnterMulDivExpr(ctx *MulDivExprContext)

EnterMulDivExpr is called when production mulDivExpr is entered.

func (*BaseMuParserListener) EnterNumberAtom

func (s *BaseMuParserListener) EnterNumberAtom(ctx *NumberAtomContext)

EnterNumberAtom is called when production numberAtom is entered.

func (*BaseMuParserListener) EnterOrExpr

func (s *BaseMuParserListener) EnterOrExpr(ctx *OrExprContext)

EnterOrExpr is called when production orExpr is entered.

func (*BaseMuParserListener) EnterParExpr

func (s *BaseMuParserListener) EnterParExpr(ctx *ParExprContext)

EnterParExpr is called when production parExpr is entered.

func (*BaseMuParserListener) EnterPowExpr

func (s *BaseMuParserListener) EnterPowExpr(ctx *PowExprContext)

EnterPowExpr is called when production powExpr is entered.

func (*BaseMuParserListener) EnterPredefinedConstantAtom

func (s *BaseMuParserListener) EnterPredefinedConstantAtom(ctx *PredefinedConstantAtomContext)

EnterPredefinedConstantAtom is called when production predefinedConstantAtom is entered.

func (*BaseMuParserListener) EnterProgExpr

func (s *BaseMuParserListener) EnterProgExpr(ctx *ProgExprContext)

EnterProgExpr is called when production progExpr is entered.

func (*BaseMuParserListener) EnterRelationalExpr

func (s *BaseMuParserListener) EnterRelationalExpr(ctx *RelationalExprContext)

EnterRelationalExpr is called when production relationalExpr is entered.

func (*BaseMuParserListener) EnterUnaryMinusExpr

func (s *BaseMuParserListener) EnterUnaryMinusExpr(ctx *UnaryMinusExprContext)

EnterUnaryMinusExpr is called when production unaryMinusExpr is entered.

func (*BaseMuParserListener) ExitAddSubExpr

func (s *BaseMuParserListener) ExitAddSubExpr(ctx *AddSubExprContext)

ExitAddSubExpr is called when production addSubExpr is exited.

func (*BaseMuParserListener) ExitAndExpr

func (s *BaseMuParserListener) ExitAndExpr(ctx *AndExprContext)

ExitAndExpr is called when production andExpr is exited.

func (*BaseMuParserListener) ExitAssignExpr

func (s *BaseMuParserListener) ExitAssignExpr(ctx *AssignExprContext)

ExitAssignExpr is called when production assignExpr is exited.

func (*BaseMuParserListener) ExitAtomExpr

func (s *BaseMuParserListener) ExitAtomExpr(ctx *AtomExprContext)

ExitAtomExpr is called when production atomExpr is exited.

func (*BaseMuParserListener) ExitBooleanAtom

func (s *BaseMuParserListener) ExitBooleanAtom(ctx *BooleanAtomContext)

ExitBooleanAtom is called when production booleanAtom is exited.

func (*BaseMuParserListener) ExitEqualityExpr

func (s *BaseMuParserListener) ExitEqualityExpr(ctx *EqualityExprContext)

ExitEqualityExpr is called when production equalityExpr is exited.

func (*BaseMuParserListener) ExitEveryRule

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

ExitEveryRule is called when any rule is exited.

func (*BaseMuParserListener) ExitFunctionExpr

func (s *BaseMuParserListener) ExitFunctionExpr(ctx *FunctionExprContext)

ExitFunctionExpr is called when production functionExpr is exited.

func (*BaseMuParserListener) ExitFunctionMultiExpr

func (s *BaseMuParserListener) ExitFunctionMultiExpr(ctx *FunctionMultiExprContext)

ExitFunctionMultiExpr is called when production functionMultiExpr is exited.

func (*BaseMuParserListener) ExitIdAtom

func (s *BaseMuParserListener) ExitIdAtom(ctx *IdAtomContext)

ExitIdAtom is called when production idAtom is exited.

func (*BaseMuParserListener) ExitIteExpr

func (s *BaseMuParserListener) ExitIteExpr(ctx *IteExprContext)

ExitIteExpr is called when production iteExpr is exited.

func (*BaseMuParserListener) ExitMulDivExpr

func (s *BaseMuParserListener) ExitMulDivExpr(ctx *MulDivExprContext)

ExitMulDivExpr is called when production mulDivExpr is exited.

func (*BaseMuParserListener) ExitNumberAtom

func (s *BaseMuParserListener) ExitNumberAtom(ctx *NumberAtomContext)

ExitNumberAtom is called when production numberAtom is exited.

func (*BaseMuParserListener) ExitOrExpr

func (s *BaseMuParserListener) ExitOrExpr(ctx *OrExprContext)

ExitOrExpr is called when production orExpr is exited.

func (*BaseMuParserListener) ExitParExpr

func (s *BaseMuParserListener) ExitParExpr(ctx *ParExprContext)

ExitParExpr is called when production parExpr is exited.

func (*BaseMuParserListener) ExitPowExpr

func (s *BaseMuParserListener) ExitPowExpr(ctx *PowExprContext)

ExitPowExpr is called when production powExpr is exited.

func (*BaseMuParserListener) ExitPredefinedConstantAtom

func (s *BaseMuParserListener) ExitPredefinedConstantAtom(ctx *PredefinedConstantAtomContext)

ExitPredefinedConstantAtom is called when production predefinedConstantAtom is exited.

func (*BaseMuParserListener) ExitProgExpr

func (s *BaseMuParserListener) ExitProgExpr(ctx *ProgExprContext)

ExitProgExpr is called when production progExpr is exited.

func (*BaseMuParserListener) ExitRelationalExpr

func (s *BaseMuParserListener) ExitRelationalExpr(ctx *RelationalExprContext)

ExitRelationalExpr is called when production relationalExpr is exited.

func (*BaseMuParserListener) ExitUnaryMinusExpr

func (s *BaseMuParserListener) ExitUnaryMinusExpr(ctx *UnaryMinusExprContext)

ExitUnaryMinusExpr is called when production unaryMinusExpr is exited.

func (*BaseMuParserListener) VisitErrorNode

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

VisitErrorNode is called when an error node is visited.

func (*BaseMuParserListener) VisitTerminal

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

VisitTerminal is called when a terminal node is visited.

type BooleanAtomContext

type BooleanAtomContext struct {
	*AtomContext
}

func NewBooleanAtomContext

func NewBooleanAtomContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *BooleanAtomContext

func (*BooleanAtomContext) EnterRule

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

func (*BooleanAtomContext) ExitRule

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

func (*BooleanAtomContext) FALSE

func (*BooleanAtomContext) GetRuleContext

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

func (*BooleanAtomContext) TRUE

type EqualityExprContext

type EqualityExprContext struct {
	*ExprContext
	// contains filtered or unexported fields
}

func NewEqualityExprContext

func NewEqualityExprContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *EqualityExprContext

func (*EqualityExprContext) AllExpr

func (s *EqualityExprContext) AllExpr() []IExprContext

func (*EqualityExprContext) EQ

func (*EqualityExprContext) EnterRule

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

func (*EqualityExprContext) ExitRule

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

func (*EqualityExprContext) Expr

func (*EqualityExprContext) GetOp

func (s *EqualityExprContext) GetOp() antlr.Token

func (*EqualityExprContext) GetRuleContext

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

func (*EqualityExprContext) NEQ

func (*EqualityExprContext) SetOp

func (s *EqualityExprContext) SetOp(v antlr.Token)

type ExprContext

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

func NewEmptyExprContext

func NewEmptyExprContext() *ExprContext

func NewExprContext

func NewExprContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ExprContext

func (*ExprContext) CopyFrom

func (s *ExprContext) CopyFrom(ctx *ExprContext)

func (*ExprContext) GetParser

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

func (*ExprContext) GetRuleContext

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

func (*ExprContext) IsExprContext

func (*ExprContext) IsExprContext()

func (*ExprContext) ToStringTree

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

type FunctionExprContext

type FunctionExprContext struct {
	*ExprContext
	// contains filtered or unexported fields
}

func NewFunctionExprContext

func NewFunctionExprContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *FunctionExprContext

func (*FunctionExprContext) CPAR

func (*FunctionExprContext) EnterRule

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

func (*FunctionExprContext) ExitRule

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

func (*FunctionExprContext) Expr

func (*FunctionExprContext) FUNCTION

func (s *FunctionExprContext) FUNCTION() antlr.TerminalNode

func (*FunctionExprContext) GetOp

func (s *FunctionExprContext) GetOp() antlr.Token

func (*FunctionExprContext) GetRuleContext

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

func (*FunctionExprContext) OPAR

func (*FunctionExprContext) SetOp

func (s *FunctionExprContext) SetOp(v antlr.Token)

type FunctionMultiExprContext

type FunctionMultiExprContext struct {
	*ExprContext
	// contains filtered or unexported fields
}

func NewFunctionMultiExprContext

func NewFunctionMultiExprContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *FunctionMultiExprContext

func (*FunctionMultiExprContext) AllExpr

func (s *FunctionMultiExprContext) AllExpr() []IExprContext

func (*FunctionMultiExprContext) CPAR

func (*FunctionMultiExprContext) EnterRule

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

func (*FunctionMultiExprContext) ExitRule

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

func (*FunctionMultiExprContext) Expr

func (*FunctionMultiExprContext) FUNCTIONMULTI

func (s *FunctionMultiExprContext) FUNCTIONMULTI() antlr.TerminalNode

func (*FunctionMultiExprContext) GetOp

func (*FunctionMultiExprContext) GetRuleContext

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

func (*FunctionMultiExprContext) OPAR

func (*FunctionMultiExprContext) SetOp

func (s *FunctionMultiExprContext) SetOp(v antlr.Token)

type IAtomContext

type IAtomContext interface {
	antlr.ParserRuleContext

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

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

IAtomContext is an interface to support dynamic dispatch.

type IExprContext

type IExprContext interface {
	antlr.ParserRuleContext

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

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

IExprContext is an interface to support dynamic dispatch.

type IProgContext

type IProgContext interface {
	antlr.ParserRuleContext

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

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

IProgContext is an interface to support dynamic dispatch.

type IdAtomContext

type IdAtomContext struct {
	*AtomContext
}

func NewIdAtomContext

func NewIdAtomContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *IdAtomContext

func (*IdAtomContext) EnterRule

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

func (*IdAtomContext) ExitRule

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

func (*IdAtomContext) GetRuleContext

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

func (*IdAtomContext) ID

type IteExprContext

type IteExprContext struct {
	*ExprContext
}

func NewIteExprContext

func NewIteExprContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *IteExprContext

func (*IteExprContext) AllExpr

func (s *IteExprContext) AllExpr() []IExprContext

func (*IteExprContext) COLON

func (s *IteExprContext) COLON() antlr.TerminalNode

func (*IteExprContext) EnterRule

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

func (*IteExprContext) ExitRule

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

func (*IteExprContext) Expr

func (s *IteExprContext) Expr(i int) IExprContext

func (*IteExprContext) GetRuleContext

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

func (*IteExprContext) QUESTION

func (s *IteExprContext) QUESTION() antlr.TerminalNode

type MuParserLexer

type MuParserLexer struct {
	*antlr.BaseLexer
	// contains filtered or unexported fields
}

func NewMuParserLexer

func NewMuParserLexer(input antlr.CharStream) *MuParserLexer

type MuParserListener

type MuParserListener interface {
	antlr.ParseTreeListener

	// EnterProgExpr is called when entering the progExpr production.
	EnterProgExpr(c *ProgExprContext)

	// EnterFunctionMultiExpr is called when entering the functionMultiExpr production.
	EnterFunctionMultiExpr(c *FunctionMultiExprContext)

	// EnterAddSubExpr is called when entering the addSubExpr production.
	EnterAddSubExpr(c *AddSubExprContext)

	// EnterAtomExpr is called when entering the atomExpr production.
	EnterAtomExpr(c *AtomExprContext)

	// EnterOrExpr is called when entering the orExpr production.
	EnterOrExpr(c *OrExprContext)

	// EnterRelationalExpr is called when entering the relationalExpr production.
	EnterRelationalExpr(c *RelationalExprContext)

	// EnterFunctionExpr is called when entering the functionExpr production.
	EnterFunctionExpr(c *FunctionExprContext)

	// EnterUnaryMinusExpr is called when entering the unaryMinusExpr production.
	EnterUnaryMinusExpr(c *UnaryMinusExprContext)

	// EnterPowExpr is called when entering the powExpr production.
	EnterPowExpr(c *PowExprContext)

	// EnterAssignExpr is called when entering the assignExpr production.
	EnterAssignExpr(c *AssignExprContext)

	// EnterMulDivExpr is called when entering the mulDivExpr production.
	EnterMulDivExpr(c *MulDivExprContext)

	// EnterEqualityExpr is called when entering the equalityExpr production.
	EnterEqualityExpr(c *EqualityExprContext)

	// EnterAndExpr is called when entering the andExpr production.
	EnterAndExpr(c *AndExprContext)

	// EnterIteExpr is called when entering the iteExpr production.
	EnterIteExpr(c *IteExprContext)

	// EnterParExpr is called when entering the parExpr production.
	EnterParExpr(c *ParExprContext)

	// EnterNumberAtom is called when entering the numberAtom production.
	EnterNumberAtom(c *NumberAtomContext)

	// EnterBooleanAtom is called when entering the booleanAtom production.
	EnterBooleanAtom(c *BooleanAtomContext)

	// EnterPredefinedConstantAtom is called when entering the predefinedConstantAtom production.
	EnterPredefinedConstantAtom(c *PredefinedConstantAtomContext)

	// EnterIdAtom is called when entering the idAtom production.
	EnterIdAtom(c *IdAtomContext)

	// ExitProgExpr is called when exiting the progExpr production.
	ExitProgExpr(c *ProgExprContext)

	// ExitFunctionMultiExpr is called when exiting the functionMultiExpr production.
	ExitFunctionMultiExpr(c *FunctionMultiExprContext)

	// ExitAddSubExpr is called when exiting the addSubExpr production.
	ExitAddSubExpr(c *AddSubExprContext)

	// ExitAtomExpr is called when exiting the atomExpr production.
	ExitAtomExpr(c *AtomExprContext)

	// ExitOrExpr is called when exiting the orExpr production.
	ExitOrExpr(c *OrExprContext)

	// ExitRelationalExpr is called when exiting the relationalExpr production.
	ExitRelationalExpr(c *RelationalExprContext)

	// ExitFunctionExpr is called when exiting the functionExpr production.
	ExitFunctionExpr(c *FunctionExprContext)

	// ExitUnaryMinusExpr is called when exiting the unaryMinusExpr production.
	ExitUnaryMinusExpr(c *UnaryMinusExprContext)

	// ExitPowExpr is called when exiting the powExpr production.
	ExitPowExpr(c *PowExprContext)

	// ExitAssignExpr is called when exiting the assignExpr production.
	ExitAssignExpr(c *AssignExprContext)

	// ExitMulDivExpr is called when exiting the mulDivExpr production.
	ExitMulDivExpr(c *MulDivExprContext)

	// ExitEqualityExpr is called when exiting the equalityExpr production.
	ExitEqualityExpr(c *EqualityExprContext)

	// ExitAndExpr is called when exiting the andExpr production.
	ExitAndExpr(c *AndExprContext)

	// ExitIteExpr is called when exiting the iteExpr production.
	ExitIteExpr(c *IteExprContext)

	// ExitParExpr is called when exiting the parExpr production.
	ExitParExpr(c *ParExprContext)

	// ExitNumberAtom is called when exiting the numberAtom production.
	ExitNumberAtom(c *NumberAtomContext)

	// ExitBooleanAtom is called when exiting the booleanAtom production.
	ExitBooleanAtom(c *BooleanAtomContext)

	// ExitPredefinedConstantAtom is called when exiting the predefinedConstantAtom production.
	ExitPredefinedConstantAtom(c *PredefinedConstantAtomContext)

	// ExitIdAtom is called when exiting the idAtom production.
	ExitIdAtom(c *IdAtomContext)
}

MuParserListener is a complete listener for a parse tree produced by MuParserParser.

type MuParserParser

type MuParserParser struct {
	*antlr.BaseParser
}

func NewMuParserParser

func NewMuParserParser(input antlr.TokenStream) *MuParserParser

func (*MuParserParser) Atom

func (p *MuParserParser) Atom() (localctx IAtomContext)

func (*MuParserParser) Expr

func (p *MuParserParser) Expr() (localctx IExprContext)

func (*MuParserParser) Expr_Sempred

func (p *MuParserParser) Expr_Sempred(localctx antlr.RuleContext, predIndex int) bool

func (*MuParserParser) Prog

func (p *MuParserParser) Prog() (localctx IProgContext)

func (*MuParserParser) Sempred

func (p *MuParserParser) Sempred(localctx antlr.RuleContext, ruleIndex, predIndex int) bool

type MulDivExprContext

type MulDivExprContext struct {
	*ExprContext
	// contains filtered or unexported fields
}

func NewMulDivExprContext

func NewMulDivExprContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *MulDivExprContext

func (*MulDivExprContext) AllExpr

func (s *MulDivExprContext) AllExpr() []IExprContext

func (*MulDivExprContext) DIV

func (*MulDivExprContext) EnterRule

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

func (*MulDivExprContext) ExitRule

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

func (*MulDivExprContext) Expr

func (s *MulDivExprContext) Expr(i int) IExprContext

func (*MulDivExprContext) GetOp

func (s *MulDivExprContext) GetOp() antlr.Token

func (*MulDivExprContext) GetRuleContext

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

func (*MulDivExprContext) MUL

func (*MulDivExprContext) SetOp

func (s *MulDivExprContext) SetOp(v antlr.Token)

type NumberAtomContext

type NumberAtomContext struct {
	*AtomContext
}

func NewNumberAtomContext

func NewNumberAtomContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *NumberAtomContext

func (*NumberAtomContext) EnterRule

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

func (*NumberAtomContext) ExitRule

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

func (*NumberAtomContext) FLOAT

func (*NumberAtomContext) GetRuleContext

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

func (*NumberAtomContext) INT

type OrExprContext

type OrExprContext struct {
	*ExprContext
}

func NewOrExprContext

func NewOrExprContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *OrExprContext

func (*OrExprContext) AllExpr

func (s *OrExprContext) AllExpr() []IExprContext

func (*OrExprContext) EnterRule

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

func (*OrExprContext) ExitRule

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

func (*OrExprContext) Expr

func (s *OrExprContext) Expr(i int) IExprContext

func (*OrExprContext) GetRuleContext

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

func (*OrExprContext) OR

type ParExprContext

type ParExprContext struct {
	*AtomContext
}

func NewParExprContext

func NewParExprContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ParExprContext

func (*ParExprContext) CPAR

func (s *ParExprContext) CPAR() antlr.TerminalNode

func (*ParExprContext) EnterRule

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

func (*ParExprContext) ExitRule

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

func (*ParExprContext) Expr

func (s *ParExprContext) Expr() IExprContext

func (*ParExprContext) GetRuleContext

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

func (*ParExprContext) OPAR

func (s *ParExprContext) OPAR() antlr.TerminalNode

type PowExprContext

type PowExprContext struct {
	*ExprContext
}

func NewPowExprContext

func NewPowExprContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *PowExprContext

func (*PowExprContext) AllExpr

func (s *PowExprContext) AllExpr() []IExprContext

func (*PowExprContext) EnterRule

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

func (*PowExprContext) ExitRule

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

func (*PowExprContext) Expr

func (s *PowExprContext) Expr(i int) IExprContext

func (*PowExprContext) GetRuleContext

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

func (*PowExprContext) POW

type PredefinedConstantAtomContext

type PredefinedConstantAtomContext struct {
	*AtomContext
}

func NewPredefinedConstantAtomContext

func NewPredefinedConstantAtomContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *PredefinedConstantAtomContext

func (*PredefinedConstantAtomContext) E

func (*PredefinedConstantAtomContext) EnterRule

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

func (*PredefinedConstantAtomContext) ExitRule

func (*PredefinedConstantAtomContext) GetRuleContext

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

func (*PredefinedConstantAtomContext) PI

type ProgContext

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

func NewEmptyProgContext

func NewEmptyProgContext() *ProgContext

func NewProgContext

func NewProgContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ProgContext

func (*ProgContext) CopyFrom

func (s *ProgContext) CopyFrom(ctx *ProgContext)

func (*ProgContext) GetParser

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

func (*ProgContext) GetRuleContext

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

func (*ProgContext) IsProgContext

func (*ProgContext) IsProgContext()

func (*ProgContext) ToStringTree

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

type ProgExprContext

type ProgExprContext struct {
	*ProgContext
}

func NewProgExprContext

func NewProgExprContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ProgExprContext

func (*ProgExprContext) AllExpr

func (s *ProgExprContext) AllExpr() []IExprContext

func (*ProgExprContext) EnterRule

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

func (*ProgExprContext) ExitRule

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

func (*ProgExprContext) Expr

func (s *ProgExprContext) Expr(i int) IExprContext

func (*ProgExprContext) GetRuleContext

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

type RelationalExprContext

type RelationalExprContext struct {
	*ExprContext
	// contains filtered or unexported fields
}

func NewRelationalExprContext

func NewRelationalExprContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *RelationalExprContext

func (*RelationalExprContext) AllExpr

func (s *RelationalExprContext) AllExpr() []IExprContext

func (*RelationalExprContext) EnterRule

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

func (*RelationalExprContext) ExitRule

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

func (*RelationalExprContext) Expr

func (*RelationalExprContext) GT

func (*RelationalExprContext) GTEQ

func (*RelationalExprContext) GetOp

func (s *RelationalExprContext) GetOp() antlr.Token

func (*RelationalExprContext) GetRuleContext

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

func (*RelationalExprContext) LT

func (*RelationalExprContext) LTEQ

func (*RelationalExprContext) SetOp

func (s *RelationalExprContext) SetOp(v antlr.Token)

type UnaryMinusExprContext

type UnaryMinusExprContext struct {
	*ExprContext
}

func NewUnaryMinusExprContext

func NewUnaryMinusExprContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *UnaryMinusExprContext

func (*UnaryMinusExprContext) EnterRule

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

func (*UnaryMinusExprContext) ExitRule

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

func (*UnaryMinusExprContext) Expr

func (*UnaryMinusExprContext) GetRuleContext

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

func (*UnaryMinusExprContext) SUB

Jump to

Keyboard shortcuts

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