# binexpr **Repository Path**: zhi/binexpr ## Basic Information - **Project Name**: binexpr - **Description**: 一个 Go 语言编写的简单表达式解释和执行引擎。 An expression parser and executor engine written in Go lang. - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-03-30 - **Last Updated**: 2025-03-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: Go语言 ## README binexpr (bin/expr) ================== Binexpr is a simple implementation of a C-like expression interpreter. It includes a tokenizer, parser, executor and a commnad line program named expr, where the name is inspired. Features -------- Currently, it supports: - [x] basic arithmetics, like `+`, `-`, `*`, `/` and `%` (mod) - [x] unary operator, like `-` (negative) - [x] custom function calls, like `func()` - [x] object chain expression for map and struct via reflection, like `obj.prop` Installation ------------ ```sh go get gitee.com/zhi/binexpr ``` Getting Started --------------- ```go import "gitee.com/zhi/binexpr" func main() { interpreter := binexpr.NewInterpreter() val, err := interpreter.Evaluate(string(line), nil) if err != nil { return err } fmt.Printf("%v\n", val) } ``` License ------- MIT.