Module: Hilbert::Parser::FuncParser

Includes:
Lexer::Tokens, Base
Defined in:
lib/hilbert/parser/func_parser.rb

Constant Summary

Constants included from Lexer::Tokens

Lexer::Tokens::ANYSP, Lexer::Tokens::ANYSTR, Lexer::Tokens::BICO, Lexer::Tokens::BRCS, Lexer::Tokens::BRCT, Lexer::Tokens::CLN, Lexer::Tokens::CMA, Lexer::Tokens::COND, Lexer::Tokens::CONJ, Lexer::Tokens::DEFLOGIC, Lexer::Tokens::DIFF_SYM, Lexer::Tokens::DISJ, Lexer::Tokens::DIV, Lexer::Tokens::E, Lexer::Tokens::EMBEDDED_FUNC, Lexer::Tokens::EQL, Lexer::Tokens::EVALOGIC, Lexer::Tokens::EXP, Lexer::Tokens::FLO, Lexer::Tokens::FORMULA, Lexer::Tokens::FUNCCN, Lexer::Tokens::FUNCCV, Lexer::Tokens::FUNCCVN, Lexer::Tokens::FUNCV, Lexer::Tokens::INF, Lexer::Tokens::INT, Lexer::Tokens::INTE_SYM, Lexer::Tokens::LBRCS, Lexer::Tokens::LBRCT, Lexer::Tokens::LDARW, Lexer::Tokens::LIM_SYM, Lexer::Tokens::LPRN, Lexer::Tokens::LSARW, Lexer::Tokens::MUL, Lexer::Tokens::NEGA, Lexer::Tokens::NLIN, Lexer::Tokens::NONL, Lexer::Tokens::NUM, Lexer::Tokens::NUMS_BY_CMA, Lexer::Tokens::NUMS_BY_SP, Lexer::Tokens::NUMS_BY_SP_BY_SCLN_OR_NELN, Lexer::Tokens::OPE, Lexer::Tokens::PI, Lexer::Tokens::PLS, Lexer::Tokens::PRN, Lexer::Tokens::PROVAR, Lexer::Tokens::RBRCS, Lexer::Tokens::RBRCT, Lexer::Tokens::RDARW, Lexer::Tokens::RPRN, Lexer::Tokens::RSARW, Lexer::Tokens::SCLN, Lexer::Tokens::SCLN_OR_NELN, Lexer::Tokens::SGM_SYM, Lexer::Tokens::SPC, Lexer::Tokens::SPCS, Lexer::Tokens::SUB, Lexer::Tokens::USER_FUNC, Lexer::Tokens::VAR, Lexer::Tokens::VARNUM, Lexer::Tokens::VARNUMS_BY_CMA, Lexer::Tokens::VARS_BY_CMA

Class Method Summary collapse

Class Method Details

.execute(els) ⇒ Object



7
8
9
10
11
# File 'lib/hilbert/parser/func_parser.rb', line 7

def execute(els)
  def_func, formula = els[0], els[1]
  def_func =~ /(#{USER_FUNC})#{LPRN}#{ANYSP}(#{VARS_BY_CMA})#{ANYSP}#{RPRN}/
  FuncApi.execute($1, $2.split(' *,'), FormulaParser.execute(formula))
end