Module: RParsec::Expressions
- Defined in:
- lib/rparsec/expressions.rb
Overview
This module helps build an expression parser using an OperatorTable instance and a parser that parses the term expression.
Constant Summary collapse
- KindPrecedence =
array_to_dict Associativities
Class Method Summary collapse
-
.build(term, table, delim = nil) ⇒ Object
build an expression parser using the given
termparser and operatortable.
Class Method Details
.build(term, table, delim = nil) ⇒ Object
build an expression parser using the given term parser and operator table. When delim is specified, patterns recognized by delim is automatically ignored.
33 34 35 36 |
# File 'lib/rparsec/expressions.rb', line 33 def self.build(term, table, delim = nil) # sort so that higher precedence first. apply_operators(term, prepare_suites(table).sort, delim) end |