Documentation ¶
Overview ¶
Package evaluator contains expression evaluator with the ability to provide named values into expressions. Evaluator supports all arithmetic operators, logical operators, arithmetic operators, and it is possible to use parenthesis to change priority of operations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Stack ¶
type Stack struct {
// contains filtered or unexported fields
}
Stack struct is naive but fully functional implementation of operand stack
type TokenWithValue ¶
TokenWithValue structure represents token tied with its value (if any)
func IdentifierToken ¶
func IdentifierToken(tok token.Token, identifier string) TokenWithValue
IdentifierToken is constructor for TokenWithValue structure
func OperatorToken ¶
func OperatorToken(tok token.Token) TokenWithValue
OperatorToken is constructor for TokenWithValue structure
func ValueToken ¶
func ValueToken(tok token.Token, value int) TokenWithValue
ValueToken is constructor for TokenWithValue structure
Click to show internal directories.
Click to hide internal directories.