static void Main(string[] args) { var tokens = File.ReadAllLines(args[0]); var global = new GlobalDecl(); { int index = 0; CppDeclParser.ParseSymbols(tokens, ref index, global); if (index != tokens.Length) { throw new ArgumentException("Failed to parse."); } } var xml = new XDocument(global.Serialize()); xml.Save(args[1]); global.BuildSymbolTree(null, null); var grouping = ExpandChildren(global) .Where(decl => decl.OverloadKey != null) .GroupBy(decl => decl.OverloadKey) .ToDictionary(g => g.Key, g => g.ToArray()) ; foreach (var pair in grouping) { if (pair.Value.Length > 1 && pair.Value.Any(decl => !(decl is NamespaceDecl))) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("Duplicate key founds: " + pair.Key); Console.ResetColor(); } } }
public void Visit(GlobalDecl decl) { Deserialize(decl); }
public void Visit(GlobalDecl decl) { }
public void Visit(GlobalDecl decl) { this.Result = ""; }
public void Visit(GlobalDecl decl) { Serialize(decl); }
static SymbolDecl Convert(string input) { var tokens = input.Split(" \r\n".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); int index = 0; var decl = new GlobalDecl(); CppDeclParser.ParseSymbols(tokens, ref index, decl); Assert.AreEqual(tokens.Length, index); TestSymbolDeclSerialization(decl); return decl; }