GO package for analysis and calculation of expressions
Go to file
2024-03-28 06:32:37 +01:00
ast_test.go Added copyrighr note to all sources 2024-03-26 08:45:18 +01:00
ast.go Added copyrighr note to all sources 2024-03-26 08:45:18 +01:00
byte-slider.go Added copyrighr note to all sources 2024-03-26 08:45:18 +01:00
context.go Added copyrighr note to all sources 2024-03-26 08:45:18 +01:00
go.mod added go.mod 2024-03-26 08:56:20 +01:00
helpers.go helpers.go provides easy functions to parse and evaluate expressions 2024-03-28 06:32:37 +01:00
operand-const.go Added copyrighr note to all sources 2024-03-26 08:45:18 +01:00
operand-func.go Added copyrighr note to all sources 2024-03-26 08:45:18 +01:00
operand-var.go Added copyrighr note to all sources 2024-03-26 08:45:18 +01:00
operator-bool.go Added copyrighr note to all sources 2024-03-26 08:45:18 +01:00
operator-fact.go Added copyrighr note to all sources 2024-03-26 08:45:18 +01:00
operator-prod.go added operator '%' (division remainder) and test 2024-03-26 09:27:14 +01:00
operator-rel.go Added copyrighr note to all sources 2024-03-26 08:45:18 +01:00
operator-sign.go Added copyrighr note to all sources 2024-03-26 08:45:18 +01:00
operator-sum.go Added copyrighr note to all sources 2024-03-26 08:45:18 +01:00
parser_test.go New test on the tilde operator. Now it is based on simple-var-store 2024-03-28 06:30:45 +01:00
parser.go Added copyrighr note to all sources 2024-03-26 08:45:18 +01:00
README.adoc First incomplete draft 2024-03-26 07:36:12 +01:00
scanner_test.go Added copyrighr note to all sources 2024-03-26 08:45:18 +01:00
scanner.go Added the tilde '~' operator acting as NOT 2024-03-28 06:25:29 +01:00
simple-func-store.go Added simple context objects 2024-03-28 06:29:11 +01:00
simple-var-store.go Added simple context objects 2024-03-28 06:29:11 +01:00
symbol.go Added the tilde '~' operator acting as NOT 2024-03-28 06:25:29 +01:00
term_test.go Added copyrighr note to all sources 2024-03-26 08:45:18 +01:00
term-constuctor-registry.go Added copyrighr note to all sources 2024-03-26 08:45:18 +01:00
term.go Added the tilde '~' operator acting as NOT 2024-03-28 06:25:29 +01:00
token_test.go Added copyrighr note to all sources 2024-03-26 08:45:18 +01:00
token.go Added copyrighr note to all sources 2024-03-26 08:45:18 +01:00
utils.go utils.go: added functions anyInteger() and anyFloat() 2024-03-28 06:26:20 +01:00

Expr

1. Expr

Expr is a GO package capable of analysing, interpreting and calculating expressions.

1.1. Data types

Expr supports numerical, string, relational, and boolean expressions.

1.1.1. Numbers

Numbers can be integers (GO int64) and float (GO float64). In mixed operations involving integers and floats, integers are automatically promoted to floats.

Table 1. Arithmetic operators
Symbol Operation Description Examples

+ / -

change sign

Change the sign of values

-1 [-1], -(+2) [-2]

+

sum

Add two values

-1 + 2 [1], 4 + 0.5 [4.5]

-

subtracion

Subtract the right value from the left one

3 - 1 [2], 4 - 0.5 [3.5]

*

product

Multiply two values

-1 * 2 [-1], 4 * 0.5 [2.0]