Rename TokenDFA -> LexerDFA

This commit is contained in:
Josh Holtrop 2021-06-08 13:54:46 -04:00
parent aa92970c31
commit c6bac6d3a1
3 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -1,6 +1,6 @@
module Imbecile
class TokenDFA < Regex::FA
class LexerDFA < Regex::FA
def initialize(tokens)
super()

View File

@ -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