Sha256: d1b0ebd65a3b1a1191b13067a70def1ee860b1ba3b083455d6cd63f2f5cbf1c2

Contents?: true

Size: 1.54 KB

Versions: 1

Compression:

Stored size: 1.54 KB

Contents

module Hilbert
  module Lexer
    class MainLexer < Base
      # TODO: So far so good, but...
      rule(/postulate zfc_analysis/) { :POST_ZFC }
      rule(/#{EVALOGIC}/) { :EVALOGIC }
      rule(/#{DEFLOGIC}/) { :DEFLOGIC }
      rule(/[ \t\f]/)

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

      rule(/[^\(\)\{\}(\n\n)]+/) { :CONT }
      class << self
        include Tokens
        def zfc_analysis!
          clear!
          rule(/postulate zfc_analysis/) { :POST_ZFC }
          rule(/#{EVALOGIC}/) { :EVALOGIC }
          rule(/#{DEFLOGIC}/) { :DEFLOGIC }
          rule(/(#{FUNCCV})#{ANYSP}#{EQL}#{ANYSP}(#{FORMULA})/) { :DEF_FUNC }
          rule(/#{INTE_SYM}#{ANYSP}#{LPRN}(#{ANYSTR})#{RPRN}#{LBRCT}(#{ANYSTR})#{RBRCT}/) { :INTEGRAL }
          rule(/#{DIFF_SYM}(#{VAR}) (#{FORMULA})/) { :DIFFERENTIAL }
          rule(/#{LIM_SYM}#{LBRCT}(#{VAR})#{RSARW}(#{VARNUM})#{RBRCT} (#{FORMULA})/) { :LIMIT }
          rule(/#{SGM_SYM}#{LBRCT}(#{VAR})#{EQL}(#{INT})#{CMA}#{ANYSP}(#{INT})#{RBRCT} (#{FORMULA})/) { :SIGMA }

          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(/#{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
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hilbert-0.0.2700100 lib/hilbert/lexer/main_lexer.rb