lib/distcalc/calculator/calculator.rb
#calculate based on a string... good for testing purposes
calculate based on a string... good for testing purposes
calculate based on a string ... good for testing purposes
def calculate(input)
	UTIL::Log.debug("processing: #{input}")
        expr = @scanner.tokenize(input)
	UTIL::Log.debug("tokenized expression: #{expr}")
        postfix_expr = @translate.to_postfix(expr)
	UTIL::Log.debug("postfix expression: #{postfix_expr}")
        result = @calc.eval(postfix_expr)
        UTIL::Log.debug("result: #{result}")
	result
    end
def calculate ( input ) UTIL :: Log . debug ( "processing: #{input}" ) expr = @scanner . tokenize ( input ) UTIL :: Log . debug ( "tokenized expression: #{expr}" ) postfix_expr = @translate . to_postfix ( expr ) UTIL :: Log . debug ( "postfix expression: #{postfix_expr}" ) result = @calc . eval ( postfix_expr ) UTIL :: Log . debug ( "result: #{result}" ) result end
calculate based on a string... good for testing purposes
calculate based on a string ... good for testing purposes
input
<not_specific>