/* c.dot - Don Yang (uguu.org) C/C++ comments: strings = text quoted by ' or ", can contain escaped characters preceded by \ comments = text outside strings, enclosed by / * * / single line comments = text outside strings, from // until end of line. Other languages where this applies: Java, JavsScript, C#, dot, yacc. Almost compatible with D, except the /+ +/ comments are not supported. */ digraph C { size = "7.5, 9"; ratio = compress; /* Code */ init -> string [label = "\" \'", fontcolor = blue]; init -> start_comment [label = "/", color = blue]; init -> init [label = "any"]; init [peripheries = 2]; start_comment -> comment [label = "*", color = red]; start_comment -> s_comment [label = "/", color = red]; start_comment -> init [label = "any"]; /* Strings / character literals */ string -> escape [label = "\\"]; escape -> string [label = "any"]; string -> init [label = "quote"]; string -> string [label = "any"]; /* Multiline comment */ comment -> end_comment [label = "*", color = red]; comment -> comment [label = "any", color = red]; end_comment -> init [label = "/", color = red]; end_comment -> end_comment [label = "*", color = red]; end_comment -> comment [label = "any", color = red]; /* Single line comment */ s_comment -> init [label = "\\n"]; s_comment -> s_comment [label = "any", color = red]; }