/* ocaml.dot - Don Yang (uguu.org) OCaml comments: strings = text quoted by ' or ", can contained escaped characters preceded by \ comments = text outside of strings, enclosed by (* *), nestable. Because of the nestable feature, OCaml comments can not be extracted using a pure DFA. */ digraph OCaml { size = "7.5, 9"; ratio = compress; /* Code */ init -> string [label = "\" \'", fontcolor = blue]; init -> start_comment [label = "(", color = blue]; init -> init [label = "any"]; start_comment -> init [label = "any"]; start_comment -> start_comment [label = "(", color = blue]; start_comment -> comment [label = "'*'; nest = 1", color = red, fontcolor = blue]; /* Strings */ string -> escape [label = "\\"]; escape -> string [label = "any"]; string -> init [label = "quote"]; string -> string [label = "any"]; /* Comment */ comment -> end_comment [label = "*", color = red]; comment -> nest_comment [label = "(", color = red]; comment -> comment [label = "any", color = red]; nest_comment -> nest_comment [label = "(", color = red]; nest_comment -> comment [label = "any", color = red]; nest_comment -> comment [label = "'*'; nest++", color = red, fontcolor = blue] end_comment -> end_comment [label = "*", color = red]; end_comment -> comment [label = "any", color = red]; end_comment -> comment [label = "')' && --nest > 0", color = red, fontcolor = blue]; end_comment -> init [label = "')' && --nest == 0", color = red, fontcolor = blue]; }