示例#1
0
文件: rxplor.go 项目: proebsting/re
//  synthx generates and prints synthetic examples from a DFA.
func synthx(dfa *rx.DFA) {
	_, isMulti := dfa.Tree.(*rx.AltNode) // true if MultiDFA
	synthx := dfa.Synthesize()           // synthesize examples
	rx.ShowLabel(os.Stdout, "Examples from DFA")
	for _, x := range synthx {
		fmt.Printf("s%d:  %s", x.State, rx.Protect(x.Example))
		if isMulti {
			fmt.Printf("  %s\n", x.RXset)
		} else {
			fmt.Println()
		}
	}
}