/// <summary>
        /// Adds the given struct member to the struct.
        /// </summary>
        /// <param name="member">Member.</param>
        private void AddStructMember(MessageMemberDescription member)
        {
            if (member.IsNested)
            {
                Console.WriteLine("Nested member: " + member.MemberType + " " + member.Name);
                if (member.IsBoundedArray)
                {
                    Console.WriteLine("Is bounded array");
                }
                if (member.IsArray)
                {
                    Console.WriteLine("Is array");
                }
                //Create new field
                CodeMemberField memberField = new CodeMemberField();
                memberField.Comments.Add(new CodeCommentStatement("Nested member: " + member.RosType));
                //Set it to public
                memberField.Attributes = MemberAttributes.Public;
                //Set the member name
                memberField.Name = member.Name;
                //Set the member type
                if (member.IsArray)
                {
                    memberField.Type = new CodeTypeReference(member.MemberType + "_array");
                }
                else
                {
                    memberField.Type = new CodeTypeReference(member.MemberType);
                }
                //Add the field to the struct
                MessageStruct.Members.Add(memberField);
            }
            else if (member.IsFixedSizeArray)
            {
                //For a fixed size array we need a customMeber
                CodeSnippetTypeMember customMember = new CodeSnippetTypeMember();
                customMember.Comments.Add(new CodeCommentStatement("Fixed size array member: " + member.RosType));
                //With some custom code
                customMember.Text = "        public fixed " + member.MemberType + " " + member.Name + "[" + member.FixedArraySize.ToString() + "];\n";
                //Add this code to the struct
                MessageStruct.Members.Add(customMember);
            }
            else
            {
                //Create new field
                CodeMemberField memberField = new CodeMemberField();
                memberField.Comments.Add(new CodeCommentStatement("Standard member: " + member.RosType));
                //Set it to public
                memberField.Attributes = MemberAttributes.Public;
                //Set the member name
                memberField.Name = member.Name;
                //Set the member type
                memberField.Type = new CodeTypeReference(member.MemberType);
                //Add the field to the struct
                MessageStruct.Members.Add(memberField);
                //Handling for DefaultValue
                if (member.DefaultInitialisation != "")
                {
                    //Parse for ints //TODO parse other types

                    /*int val;
                     * bool success = int.TryParse(member.DefaultInitialisation, out val);
                     * if (success)
                     * {
                     *      CodeAssignStatement assignDefaultVal = new CodeAssignStatement(new CodeVariableReferenceExpression(member.Name), new CodePrimitiveExpression(val));
                     *      constructor.Statements.Add(assignDefaultVal);
                     * }*/
                }
            }
        }
        /// <summary>
        /// Starts the parsing process
        /// </summary>
        public void Parse()
        {
            string[] Lines = Description.InputFile.Split(new string[] { "\n" }, StringSplitOptions.RemoveEmptyEntries);
            //Step through all lines
            foreach (var item in Lines)
            {
                //Read a new line
                string LastLine = item;

                //First check if it's an empty line
                if (LastLine.Trim() == "")
                {
                    //Do nothing -> it's nothing ;)
                }
                //Second check if it's a comment
                else if (IsComment(LastLine))
                {
                    //Do nothing -> it's just a comment
                }
                //Okey we can start with the real parsing
                else
                {
                    //Create a new MessageMember and fill it
                    MessageMemberDescription MessageMember = new MessageMemberDescription();

                    MessageMember.Name = GetMemberName(LastLine);
                    MessageMember.DefaultInitialisation = GetDefaultInitialisation(LastLine);
                    MessageMember.IsArray          = IsArray(LastLine);
                    MessageMember.IsFixedSizeArray = IsFixedSizeArray(LastLine);
                    MessageMember.IsBoundedArray   = IsBoundedArray(LastLine);
                    MessageMember.FixedArraySize   = GetFixedArraySize(LastLine);
                    MessageMember.IsNested         = IsNestedType(LastLine);
                    MessageMember.RosType          = GetRosMessageType(LastLine);

                    //Now we make difference between arrays, nested types and primitive types
                    if (MessageMember.IsNested)
                    {
                        string NestedNamespace = "";
                        string NestedType      = "";
                        if (MessageMember.RosType.Contains("/"))
                        {
                            //It's a nested type
                            NestedNamespace = MessageMember.RosType.Split(new string[] { "/" }, StringSplitOptions.RemoveEmptyEntries) [0];
                            NestedType      = MessageMember.RosType.Split(new string[] { "/" }, StringSplitOptions.RemoveEmptyEntries) [1];
                        }
                        else
                        {
                            NestedType = MessageMember.RosType;
                        }
                        //Build the C# type (The full qualified name we can find the generated message afterwards")
                        string CsType = NestedNamespace + ".msg." + NestedType + "_t";
                        //Fix in case the type is in the same namespace
                        if (CsType.StartsWith(".msg."))
                        {
                            CsType = CsType.Insert(0, Description.Namespace);
                        }

                        MessageMember.MemberType = CsType;

                        //Just some debug outputs
                        if (MessageMember.IsArray)
                        {
                            //It's a nested array
                            Console.WriteLine("Assuming" + MessageMember.RosType + "  is a nested array: " + LastLine);
                        }
                        else
                        {
                            Console.WriteLine("Assuming " + MessageMember.RosType + "  is a nested type: " + LastLine);
                        }

                        //TODO this is an ugly statement
                    }
                    else if (MessageMember.IsArray && !MessageMember.IsNested)
                    {
                        //TODO How can I check for a nested type without a /
                        Console.WriteLine("Assuming " + MessageMember.RosType + "  is an array type and NOT a nested type: " + LastLine);
                        //It's an array
                        if (!MessageMember.IsFixedSizeArray)
                        {
                            //Unbounded array
                            //Get the primitive type of the array and make it an array type
                            string CsType = "rosidl_generator_c__primitive_array_" + MessageMember.RosType;

                            //And now let it be the type
                            MessageMember.MemberType      = CsType;
                            MessageMember.ArrayReturnType = GetCsPrimitiveType(MessageMember.RosType);
                        }
                        else
                        {
                            //Fixed size array
                            //It's simply the primitive type
                            MessageMember.MemberType = GetCsPrimitiveType(MessageMember.RosType);
                        }
                    }
                    else if (IsPrimitiveType(MessageMember.RosType))
                    {
                        Console.WriteLine("Assuming " + MessageMember.RosType + "  is a primitve type: " + LastLine);
                        //It's a primitive type
                        string CsType = GetCsPrimitiveType(MessageMember.RosType);
                        MessageMember.MemberType = CsType;
                    }
                    else
                    {
                        Console.ForegroundColor = ConsoleColor.Blue;
                        Console.WriteLine("Unknown Type: " + MessageMember.RosType + " : " + LastLine);
                        Console.WriteLine("Trying the type as a nested type");
                        MessageMember.IsNested   = true;
                        MessageMember.MemberType = MessageMember.RosType;
                        Console.ResetColor();
                        continue;
                    }
                    Description.AddMemberDescription(MessageMember);
                }
            }
        }
 /// <summary>
 /// Adds a new member description to the
 /// </summary>
 /// <param name="_Description">Description.</param>
 public void AddMemberDescription(MessageMemberDescription _Description)
 {
     Members.Add(_Description);
 }