Module: RegularExpression::NFA

Defined in:
lib/regular_expression/nfa.rb

Defined Under Namespace

Modules: Transition Classes: FinishState, StartState, State

Class Method Summary collapse

Class Method Details

.to_dot(nfa) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/regular_expression/nfa.rb', line 5

def self.to_dot(nfa)
  graph = Graphviz::Graph.new(rankdir: "LR")
  nfa.to_dot(graph, {})

  Graphviz.output(graph, path: "build/nfa.svg", format: "svg")
  graph.to_dot
end