MCPcopy Create free account

hub / github.com/Meyhem/go-simple-expression-eval / functions

Functions60 in github.com/Meyhem/go-simple-expression-eval

↓ 8 callersMethodemit
Emits lexer item to output channel
lexer.go:165
↓ 7 callersMethodLen
()
stack.go:35
↓ 7 callersFunctionParse
Parse parses given infix expression and produces Abstract syntax tree
parser.go:189
↓ 7 callersMethodPop
()
stack.go:17
↓ 6 callersFunctionNewParserError
NewParserError intantiates new Parser error
errors.go:54
↓ 4 callersFunctionInterpret
Interpret is function that evaluates AST and returns corresponding result
interpreter.go:81
↓ 4 callersMethodPush
(val interface{})
stack.go:13
↓ 4 callersMethodTop
()
stack.go:31
↓ 4 callersFunctionrunLexing
(expr string)
lexer_test.go:7
↓ 4 callersFunctiontraversePreorder
helper debug func
parser.go:156
↓ 3 callersFunctionNewAstNode
(typ AstNodeType, value *string)
ast.go:50
↓ 3 callersFunctionNewInterpreterError
NewInterpreterError intantiates new Interpreter error
errors.go:62
↓ 3 callersMethodconsume
Consume next rune if its one of 'runes' parameter, otherwise no effect
lexer.go:144
↓ 3 callersMethodnext
Move to next ASCII or UTF-8 character/rune
lexer.go:115
↓ 2 callersMethodItems
Items method gets channel of lex items
lexer.go:255
↓ 2 callersFunctionLex
Lex is constructor for lexer
lexer.go:272
↓ 2 callersFunctionNewStack
()
stack.go:7
↓ 2 callersMethodRun
Run method will is the core part of this lexer It fires off the state machine, starting with lexFn and takes return function as next state once some f
lexer.go:262
↓ 2 callersMethodbackup
Go back one character/rune
lexer.go:130
↓ 2 callersMethodconsumeAll
Consume all following runes that are one of 'runes'
lexer.go:153
↓ 2 callersMethoderrorf
Helper func that emits error item IERR with message
lexer.go:175
↓ 2 callersFunctionprecedence
Determines precedence of operator given
parser.go:9
↓ 1 callersFunctionNewLexerError
NewLexerError intantiates new Lexer error
errors.go:46
↓ 1 callersFunctionconstructAst
Takes list of postfix formed lexer items and builds binary expression tree
parser.go:111
↓ 1 callersMethodignore
Ignores all un-emitted characters (moves start to current pos)
lexer.go:159
↓ 1 callersMethodpeek
Check what rune is next in input
lexer.go:137
↓ 1 callersFunctionpostOrderTraversal
Recursive post order traversal that evaluates AST 1. Visit left 2. Visit right 3. Visit self
interpreter.go:37
↓ 1 callersFunctiontoPostfix
Converts infix output form of Lexer to postfix form
parser.go:27
↓ 1 callersFunctiontranslateLexToAstType
helper method that translates Lexer item types to AST node types
parser.go:95
MethodString
()
ast.go:15
MethodString
()
ast.go:40
MethodString
()
errors.go:19
MethodString
()
errors.go:41
MethodString
()
lexer.go:12
MethodString
Debug stringify lex item
lexer.go:88
FunctionTestEmptyExprItems
(t *testing.T)
lexer_test.go:63
FunctionTestInterpreter
(t *testing.T)
interpreter_test.go:7
FunctionTestInvalidRune
(t *testing.T)
lexer_test.go:79
FunctionTestOperator
(t *testing.T)
interpreter_test.go:35
FunctionTestParserAst
(t *testing.T)
parser_test.go:7
FunctionTestParserEmptyExpr
(t *testing.T)
parser_test.go:43
FunctionTestParserEmptyParenExpr
(t *testing.T)
parser_test.go:55
FunctionTestParserPrecedence
(t *testing.T)
parser_test.go:67
FunctionTestSimpleExprItems
(t *testing.T)
lexer_test.go:31
FunctionTestSimpleExprLen
(t *testing.T)
lexer_test.go:20
FunctionTestSingleValue
(t *testing.T)
interpreter_test.go:21
Functionadd
Implementation of ADD operation
interpreter.go:8
Functiondiv
Implementation of DIVIDE operation
interpreter.go:23
MethoddumpState
()
lexer.go:110
FunctionlexFn
Starting state of state machine, peeks forward and decides what lexing function should be used
lexer.go:185
FunctionlexLpar
Lexes left parenthesis
lexer.go:227
FunctionlexNumber
lexes numbers
lexer.go:241
FunctionlexOperator
Lexes operators
lexer.go:208
FunctionlexRpar
Lexes right parenthesis
lexer.go:234
FunctionlexWhite
Lexes whitespaces and thrashes them (no emitting)
lexer.go:248
Functionmain
()
main.go:8
Functionmul
Implementation of MULTIPLY operation
interpreter.go:18
Functionsub
Implementation of SUBTRACT operation
interpreter.go:13
FunctiontraverseInorder
helper debug func
parser.go:167
FunctiontraversePostorder
helper debug func
parser.go:178