Module: Jaina
- Extended by:
- Forwardable
- Defined in:
- lib/jaina.rb,
lib/jaina/version.rb
Overview
Defined Under Namespace
Classes: Parser
Constant Summary collapse
- TerminalExpr =
Parser::Expression::Operator::Terminal
- NonTerminalExpr =
Parser::Expression::Operator::NonTerminal
- GroupingExpr =
Parser::Expression::Operator::Grouping
- VERSION =
'0.6.0'
Class Method Summary collapse
- .evaluate(program, **initial_context) ⇒ Any
- .expressions ⇒ Array<String>
- .fetch_expression(expression_token) ⇒ Class{Jaina::Parser::Expressions::Operator::Abstract} (also: [])
- .parse(program) ⇒ Jaina::Parser::AST
- .redefine_expression(expression_klass) ⇒ void
- .register_expression(expression_klass) ⇒ void
Class Method Details
.evaluate(program, **initial_context) ⇒ Any
32 33 34 |
# File 'lib/jaina.rb', line 32 def evaluate(program, **initial_context) parse(program).evaluate(**initial_context) end |
.expressions ⇒ Array<String>
58 59 60 |
# File 'lib/jaina.rb', line 58 def expressions Jaina::Parser::Expression.expressions end |
.fetch_expression(expression_token) ⇒ Class{Jaina::Parser::Expressions::Operator::Abstract} Also known as: []
67 68 69 |
# File 'lib/jaina.rb', line 67 def fetch_expression(expression_token) Jaina::Parser::Expression.fetch(expression_token) end |
.parse(program) ⇒ Jaina::Parser::AST
22 23 24 |
# File 'lib/jaina.rb', line 22 def parse(program) Parser.parse(program) end |
.redefine_expression(expression_klass) ⇒ void
This method returns an undefined value.
50 51 52 |
# File 'lib/jaina.rb', line 50 def redefine_expression(expression_klass) Jaina::Parser::Expression.redefine(expression_klass) end |
.register_expression(expression_klass) ⇒ void
This method returns an undefined value.
41 42 43 |
# File 'lib/jaina.rb', line 41 def register_expression(expression_klass) Jaina::Parser::Expression.register(expression_klass) end |