/// <summary> /// Parses the tokens of components. /// </summary> /// <param name="tokens">The tokens.</param> /// <returns>The components.</returns> internal static List <An8Component> ParseComponents(string[] tokens) { var components = new List <An8Component>(); var chunks = Tokenizer.SplitChunks(tokens); foreach (var chunk in chunks) { An8Component component = null; switch (chunk.Ident) { case "mesh": component = new An8Mesh(); break; case "sphere": component = new An8Sphere(); break; case "cylinder": component = new An8Cylinder(); break; case "cube": component = new An8Cube(); break; case "subdivision": component = new An8Subdivision(); break; case "path": component = new An8Path(); break; case "textcom": component = new An8TextCom(); break; case "modifier": component = new An8Modifier(); break; case "image": component = new An8Image(); break; case "namedobject": component = new An8NamedObject(); break; case "group": component = new An8Group(); break; } if (component != null) { component.ParseTokens(chunk.Tokens); components.Add(component); } } return(components); }