protected void WriteFunctionBody(IndentedStreamWriter writer)
        {
            writer.WriteLine("{");

            //TODO maybe write loclas as initialized list
            writer.IncreaseIndentLevel();

            for (int i = 0; i < codeStructures.Count; i++)
            {
                codeStructures[i].Write(writer);
            }
            writer.DecreaseIndentLevel();
            writer.WriteLine("}\n");
        }
Ejemplo n.º 2
0
 public void Write(string pathDirectory)
 {
     //Write every class in namepace
     for (int i = 0; i < classesInNameSpace.Count; i++)
     {
         //open streamwriter
         using (var sw = new StreamWriter(pathDirectory + $"/{classesInNameSpace[i].Name}.cs"))
         {
             var writer = new IndentedStreamWriter(sw);
             //write namspace header and start body
             WriteHeader(writer);
             WriteBodyStart(writer);
             //write class
             writer.IncreaseIndentLevel();
             classesInNameSpace[0].Write(writer);
             writer.DecreaseIndentLevel();
             //end namespace body
             WriteBodyEnd(writer);
         }
     }
     //done
 }
Ejemplo n.º 3
0
        void writeBody(IndentedStreamWriter writer)
        {
            writer.WriteLine("{");

            writer.IncreaseIndentLevel();
            //Members
            for (int i = 0; i < members.Count; i++)
            {
                //TODO FORMATTING
                members[i].WriteAsDefinition(writer);
            }

            //functions
            for (int i = 0; i < functions.Count; i++)
            {
                functions[i].Write(writer);
            }

            //TODO More formatting
            writer.DecreaseIndentLevel();

            writer.WriteLine("}");
        }