Rename TokenDFA -> LexerDFA
This commit is contained in:
parent
aa92970c31
commit
c6bac6d3a1
@ -10,7 +10,7 @@ require_relative "imbecile/regex/fa/state"
|
||||
require_relative "imbecile/regex/fa/state/transition"
|
||||
require_relative "imbecile/regex/nfa"
|
||||
require_relative "imbecile/regex/unit"
|
||||
require_relative "imbecile/token_dfa"
|
||||
require_relative "imbecile/lexer_dfa"
|
||||
require_relative "imbecile/version"
|
||||
|
||||
module Imbecile
|
||||
@ -27,8 +27,8 @@ module Imbecile
|
||||
grammar.tokens.each do |token|
|
||||
puts token.nfa
|
||||
end
|
||||
token_dfa = TokenDFA.new(grammar.tokens)
|
||||
puts token_dfa
|
||||
lexer_dfa = LexerDFA.new(grammar.tokens)
|
||||
puts lexer_dfa
|
||||
rescue Error => e
|
||||
$stderr.puts e.message
|
||||
return 2
|
||||
|
@ -1,6 +1,6 @@
|
||||
module Imbecile
|
||||
|
||||
class TokenDFA < Regex::FA
|
||||
class LexerDFA < Regex::FA
|
||||
|
||||
def initialize(tokens)
|
||||
super()
|
@ -51,7 +51,7 @@ end
|
||||
|
||||
def run(grammar, input)
|
||||
g = Imbecile::Grammar.new(grammar)
|
||||
token_dfa = Imbecile::TokenDFA.new(g.tokens)
|
||||
token_dfa = Imbecile::LexerDFA.new(g.tokens)
|
||||
test_lexer = TestLexer.new(token_dfa)
|
||||
test_lexer.lex(input)
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user