public void print() { CLI.setConsoleForegroundColor(ConsoleColor.Yellow); Console.WriteLine("{"); int i = 0; foreach (KeyValuePair <string, JSONType> kvp in map) { CLI.setConsoleForegroundColor(ConsoleColor.DarkCyan); Console.Write($" {kvp.Key}: "); CLI.setConsoleForegroundColor(ConsoleColor.Green); Console.Write($"{kvp.Value}"); CLI.setConsoleForegroundColor(ConsoleColor.White); if (i < map.Count - 1) { Console.Write(",\n"); } else { Console.Write("\n"); } i++; } CLI.setConsoleForegroundColor(ConsoleColor.Yellow); Console.WriteLine("}"); CLI.resetConsoleForegroundColor(); }
public static void runFMBParserWithDefaultTokenizer(string input) { List <Token> tokens = CLI.tokenize(input); CLI.printTokens(tokens); JSONDict json = new JSONDict(tokens); CLI.setConsoleForegroundColor(ConsoleColor.Blue); Console.WriteLine("\nStarting the Parsing Process"); Console.WriteLine("Parsing tokens..."); CLI.setConsoleForegroundColor(ConsoleColor.Green); Console.WriteLine("Parsing Complete!"); Console.Write("New object "); CLI.setConsoleForegroundColor(ConsoleColor.Yellow); Console.Write("json "); CLI.setConsoleForegroundColor(ConsoleColor.Green); Console.Write("of type "); CLI.setConsoleForegroundColor(ConsoleColor.Yellow); Console.Write("JSONDict "); CLI.setConsoleForegroundColor(ConsoleColor.Green); Console.Write("created\n"); CLI.setConsoleForegroundColor(ConsoleColor.Blue); Console.WriteLine("Outputing JSON object...\n"); CLI.setConsoleForegroundColor(ConsoleColor.DarkYellow); Console.WriteLine("Stringifying JSON object...\n"); json.print(); CLI.toJSON(json.ToString()); }
public void printKeys() { Console.Write("Keys: ["); int i = 0; foreach (KeyValuePair <string, JSONType> kvp in map) { CLI.setConsoleForegroundColor(ConsoleColor.DarkBlue); Console.Write(kvp.Key); CLI.resetConsoleForegroundColor(); if (i < map.Count - 1) { Console.Write(", "); } else { Console.Write("]"); } i++; } }