Sha256: c0890afa08ace1923088ddf91efc1dc51e72655458670a1410fcc4673edcd833

Contents?: true

Size: 1.24 KB

Versions: 1

Compression:

Stored size: 1.24 KB

Contents

require_relative 'lamep/exceptions/not_enough_operands_exception'
require_relative 'lamep/exceptions/not_enough_operators_exception'
require_relative 'lamep/exceptions/missing_left_parentheses_error'
require_relative 'lamep/exceptions/missing_right_parentheses_error'
require_relative 'lamep/Expressions/operator'
require_relative 'lamep/Expressions/arity1_operators'
require_relative 'lamep/Expressions/arity2_operators'
require_relative 'lamep/Expressions/value_expression'
require_relative 'lamep/token_parser'
require_relative 'lamep/shunting_yard'
require_relative 'lamep/Expressions/equal'
require_relative 'lamep/Expressions/greater_than'
require_relative 'lamep/Expressions/less_than'
require_relative 'lamep/Expressions/greater_than_equal'
require_relative 'lamep/Expressions/less_than_equal'
require_relative 'lamep/Expressions/and'
require_relative 'lamep/Expressions/or'
require_relative 'lamep/Expressions/unary_minus'
require_relative 'lamep/Expressions/not_equal'
require_relative '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.1 lib/lamep.rb