Пример #1
0
 public override string ToString()
 {
     return(String.Format(
                @"{{""name"":""{0}"", ""raw-comment"":{1}, ""value"":{2}}}",
                Name,
                RawComment == null ? "null" : HeaderParser.ToJsonString(RawComment),
                Value));
 }
Пример #2
0
        static void Main(string[] args)
        {
            var text        = File.ReadAllText(args[0]);
            var tokenStream = CHeaderLexer.Lex(text);
            var parser      = new HeaderParser(tokenStream);
            var serializer  = JsonSerializer.Create(new JsonSerializerSettings {
                Formatting = Formatting.Indented
            });

            serializer.Serialize(Console.Out, parser.ParseHeader());
        }