Skip to content

Latest commit

 

History

History
66 lines (44 loc) · 1.16 KB

README.md

File metadata and controls

66 lines (44 loc) · 1.16 KB

Beebotte Expression Evaluator

About

A Beebotte Expressions is a mathematical expression with values and operators.

The values can be:

  • Resource value: my_channel.my_resource
  • Nested resource value: my_channel.my_resource.nested_element.nested_element2
  • Primitive value
    • boolean
    • number
    • string

Expressions Grammar

The following operators are supported:

Logical Operators

  • AND
  • OR
  • NOT or !

Comparison Operators

  • ==
  • !=
  • >
  • >=
  • <
  • <=

Arithmetic Operators

  • +
  • -
  • *
  • idiv (integral division: 5 idiv 2 is 2)
  • /
  • % (modulo)

Operators can be mixed with parentheses.

Expression Examples

    "34" == "34"

    (1+2)*2*2 + 22 == 34

    channel1.resource1 - channel2.resource1

    channel1.resource1 == channel2.resource1 OR channel1.resource1 == 44

    channel1.resource1.param1 + channel2.resource1.param1

    channel1.resource1 <= channel2.resource1 AND channel1.resource1 == channel3.resource1

    channel1.resource1 <= channel2.resource1 AND !channel1.resource1 > channel2.resource1

License

Copyright 2017 Beebotte.

The MIT License