Sha256: 4e4ae1b934442a6336fa6d199eed9819988a375f34e22afb8bb6432daa2de2e4

Contents?: true

Size: 1.18 KB

Versions: 1

Compression:

Stored size: 1.18 KB

Contents

require './lib/lamep/exceptions/not_enough_operands_exception'
require './lib/lamep/exceptions/not_enough_operators_exception'
require './lib/lamep/exceptions/missing_left_parentheses_error'
require './lib/lamep/exceptions/missing_right_parentheses_error'
require './lib/lamep/Expressions/operator'
require './lib/lamep/Expressions/arity1_operators'
require './lib/lamep/Expressions/arity2_operators'
require './lib/lamep/Expressions/value_expression'
require './lib/lamep/token_parser'
require './lib/lamep/shunting_yard'
require './lib/lamep/Expressions/equal'
require './lib/lamep/Expressions/greater_than'
require './lib/lamep/Expressions/less_than'
require './lib/lamep/Expressions/greater_than_equal'
require './lib/lamep/Expressions/less_than_equal'
require './lib/lamep/Expressions/and'
require './lib/lamep/Expressions/or'
require './lib/lamep/Expressions/unary_minus'
require './lib/lamep/Expressions/not_equal'
require './lib/lamep/abstract_syntax_tree_builder'

class Lamep
  def evaluate(expression, attributes={})
    tokens = TokenParser.new.parse(expression)
    postfix = ShuntingYard.new(tokens).postfix
    AbstractSyntaxTreeBuilder.new(postfix).build_tree.evaluate(attributes)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lamep-0.2 lib/lamep.rb