public ParserState(IEnumerable <string> knownNames) : this() { foreach (var name in knownNames) { Typedefs.Add(name); } }
public TypedefNameDecl FindTypedef(string name, bool createDecl = false) { var entries = name.Split(new string[] { "::" }, StringSplitOptions.RemoveEmptyEntries).ToList(); if (entries.Count <= 1) { var typeDef = Typedefs.Find(e => e.Name.Equals(name)); if (typeDef == null && createDecl) { typeDef = new TypedefDecl { Name = name, Namespace = this }; Typedefs.Add(typeDef); } return(typeDef); } var typeDefName = entries[entries.Count - 1]; var namespaces = entries.Take(entries.Count - 1); var @namespace = FindNamespace(namespaces); if (@namespace == null) { return(null); } return(@namespace.FindTypedef(typeDefName, createDecl)); }
public void AddTypeAliase(ITypeAlias value) { Typedefs.Add((TypeAlias)value); }
public void AddTypedef(ITypedefDecl value) { Typedefs.Add((TypedefDecl)value); }