Class | RParsec::OperatorTable |
In: |
rparsec/expressions.rb
|
Parent: | Object |
operators | [R] | operators attribute is used internally. Do not access it. |
To create an OperatorTable instance. If a block is given, it is invoked to do post-instantiation. For example:
OperatorTable.new do |tbl|
tbl.infixl(char(?+) >> Plus, 10) tbl.infixl(char(?-) >> Minus, 10) tbl.infixl(char(?*) >> Mul, 20) tbl.infixl(char(?/) >> Div, 20) tbl.prefix(char(?-) >> Neg, 50)
end
Defines a left associative infix operator that returns a binary Proc object with a precedence associated. Returns self.
Defines a non-associative infix operator that returns a binary Proc object with a precedence associated. Returns self.
Defines a right associative infix operator that returns a binary Proc object with a precedence associated. Returns self.