Beispiel #1
0
        public static void WriteVariableString(LangStreamWrapper stream, VariableObj variableObj, string namespaceName = "")
        {
            string typeString = ConvertDataType(variableObj.Type);

            if (typeString != "")
            {
                typeString += " ";
            }

            stream.Write(typeString + CreateNamespaceString(variableObj.Name, namespaceName));
        }
Beispiel #2
0
        public static void WriteFunctionString(LangStreamWrapper stream, FunctionObj functionObj, string namespaceName = "")
        {
            WriteVariableString(stream, functionObj.TypeAndName, namespaceName);
            stream.Write("(");

            int index = 0;

            foreach (VariableObj funcParam in functionObj.FuncParams)
            {
                WriteVariableString(stream, funcParam, "");

                //add comma if not the last param
                if (index != functionObj.FuncParams.Count - 1)
                {
                    stream.Write(", ");
                }

                index++;
            }
            stream.Write(")");
        }