Skip to content

ams-pro/filter-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AMS-Pro Logo

Filter-Parser

Getting Started

  1. Install the package
go get -u github.com/ams-pro/filter-parser
  1. Use the package
package main

import (
	"fmt"

	filterparser "github.com/ams-pro/filter-parser"
)

func main() {
	filterExpr := "and(gt(id,40),lt(id,60))"

	tree := filterparser.ParseFilter(filterExpr)

	fmt.Println(tree)
}
// Output: 
// Node {
// 		Token: "and"
// 		Left: Node {
// 			Token: "gt"
// 			Left: Node {
// 				Token: "id"
// 			}
// 			Right: Node {
// 				Token: "40"
// 			}
// 		}
// 		Right: Node {
// 			Token: "lt"
// 			Left: Node {
// 				Token: "id"
// 			}
// 			Right: Node {
// 				Token: "60"
// 			}
// 		}
// 	}

About

A parser for the ams filter language written in go

Topics

Resources

License

Stars

Watchers

Forks

Languages