Jparsec is now ported to Ruby, with a way lighter syntax than Java. Calculator demo The following is the ruby version of calculator: require 'rparsec' include RParsec class Calculator include Parsers include Functors def parser ops = OperatorTable.new. infixl(char(?+) >> Plus, 20). infixl(char(?-) >> Minus, 20). infixl(char(?*) >> Mul, 40). infixl(char(?/) >> Div, 40). prefix(char(?-) >
{{#tags}}- {{label}}
{{/tags}}