Sha256: 41cc544f842609fbe5b41309e1d0cefb89221ec92898c7e8555bae226337f7cb

Contents?: true

Size: 960 Bytes

Versions: 4

Compression:

Stored size: 960 Bytes

Contents

module Qlang
  module Lexer
    class MainLexer < Base
      rule(/(#{FUNCCV})#{ANYSP}#{EQL}#{ANYSP}(#{FORMULA})/) { :def_func }
      rule(/#{ITGRLSYM}#{ANYSP}#{LPRN}(#{ANYSTR})#{RPRN}#{LBRCT}(#{ANYSTR})#{RBRCT}/) { :integral }
      rule(/d\/d(#{VAR}) (#{FORMULA})/) { :differential }

      rule(/lim#{LBRCT}(#{VAR})#{RSARW}(#{VARNUM})#{RBRCT} (#{FORMULA})/) { :limit }

      rule(/#{LPRN}(#{NUMS_BY_SP})#{RPRN}/) { :vector }
      rule(/#{LPRN}(#{NUMS_BY_SP_BY_SCLN_OR_NELN})#{RPRN}t/m) { :tmatrix }
      rule(/#{LPRN}(#{NUMS_BY_SP_BY_SCLN_OR_NELN})#{RPRN}/m) { :matrix }

      rule(/∑#{LBRCT}(#{VAR})=(#{INT}),#{ANYSP}(#{INT})#{RBRCT} (#{FORMULA})/) { :sigma }

      rule(/#{FUNCCN}/) { :FUNCCN }

      rule(/#{LPRN}/) { :LPRN }
      rule(/#{RPRN}/) { :RPRN }
      rule(/#{LBRCS}/) { :LBRCS }
      rule(/#{RBRCS}/) { :RBRCS }

      rule(/[ \t\f]/)

      rule(/(\r|\n)+/) { :NULL }

      rule(/[^\(\)\{\}(\n\n)]+/) { :CONT }
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
qlang-0.0.27182123 lib/qlang/lexer/main_lexer.rb
qlang-0.0.27182122 lib/qlang/lexer/main_lexer.rb
qlang-0.0.27182121 lib/qlang/lexer/main_lexer.rb
qlang-0.0.27182120 lib/qlang/lexer/main_lexer.rb