Add DFA class
This commit is contained in:
1 parent
24054461a2
commit
7196a0605a
3 files changed
+14
No files matched your search
@@ -1,6 +1,7 @@
|
||||
require_relative "imbecile/cli"
|
||||
require_relative "imbecile/grammar"
|
||||
require_relative "imbecile/regex"
|
||||
require_relative "imbecile/regex/dfa"
|
||||
require_relative "imbecile/regex/nfa"
|
||||
require_relative "imbecile/regex/unit"
|
||||
require_relative "imbecile/version"
|
||||
|
||||
@@ -42,6 +42,7 @@ module Imbecile
|
||||
@tokens.each do |token_name, token_def|
|
||||
token_def[:regex] = Regex.new(token_def[:pattern])
|
||||
end
|
||||
dfa = DFA.new(@tokens.map {|token_name, token_def| token_def[:regex].nfa})
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
module Imbecile
|
||||
class Regex
|
||||
|
||||
class DFA
|
||||
|
||||
def initialize(nfas)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user