Exemplo n.º 1
0
 public override void Write(SchemaWriter writer)
 {
     if (parameter == null)
         writer.Append(string.Format("default({0})", ReturnType.FullName));
     else
         parameter.Write(writer);
 }
Exemplo n.º 2
0
        public void Compile()
        {
            AssetDatabase.SaveAssets();

            if (!IsValid())
            {
                throw new InvalidDataException("One or more nodes are invalid.");
            }

            var path = Path.ChangeExtension(AssetDatabase.GetAssetPath(this), ".cs");

            using (var stream = File.Exists(path) ? File.Open(path, FileMode.Truncate) : File.Create(path))
            {
                using (var writer = new SchemaWriter(stream))
                {
                    writer.BeginTypeDeclaration(Name, BaseType.FullName);

                    var functionDeclarations = GetFunctionDeclarations();

                    for (int i = 0; i < functionDeclarations.Length; i++)
                    {
                        functionDeclarations[i].Write(writer);
                    }

                    writer.EndTypeDeclaration();
                }
            }

            AssetDatabase.Refresh();
        }
Exemplo n.º 3
0
 public override void Write(SchemaWriter writer)
 {
     if (parameter == null)
     {
         writer.Append(string.Format("default({0})", ReturnType.FullName));
     }
     else
     {
         parameter.Write(writer);
     }
 }
Exemplo n.º 4
0
        public override void Write(SchemaWriter writer)
        {
            writer.BeginMethodDeclaration(Name, "void");

            for (int i = 0; i < functions.Count; i++)
            {
                writer.AppendIndentation();
                functions[i].Write(writer);
                writer.AppendLine(";", false);
            }

            writer.EndMethodDeclaration();
        }
        public override void Write(SchemaWriter writer)
        {
            writer.BeginMethodDeclaration(Name, "void");

            for (int i = 0; i < functions.Count; i++)
            {
                writer.AppendIndentation();
                functions[i].Write(writer);
                writer.AppendLine(";", false);
            }

            writer.EndMethodDeclaration();
        }
        public override void Write(SchemaWriter writer)
        {
            writer.Append(Caller.FullName);
            writer.Append("." + Name + "(");

            for (int i = 0; i < Parameters.Length; i++)
            {
                Parameters[i].Write(writer);

                if (i < Parameters.Length - 1)
                    writer.Append(", ");
            }

            writer.Append(")");
        }
Exemplo n.º 7
0
        public override void Write(SchemaWriter writer)
        {
            caller.Write(writer);
            writer.Append("." + Name + "(");

            for (int i = 0; i < Parameters.Length; i++)
            {
                Parameters[i].Write(writer);

                if (i < Parameters.Length - 1)
                {
                    writer.Append(", ");
                }
            }

            writer.Append(")");
        }
Exemplo n.º 8
0
 public override void Write(SchemaWriter writer)
 {
     writer.Append("this");
 }
 public override void Write(SchemaWriter writer)
 {
     writer.Append(Caller.FullName);
     writer.Append("." + Name);
 }
 public override void Write(SchemaWriter writer)
 {
     Caller.Write(writer);
     writer.Append("." + Name);
 }
Exemplo n.º 11
0
 public override void Write(SchemaWriter writer)
 {
     writer.Append(Caller.FullName);
     writer.Append("." + Name);
 }
Exemplo n.º 12
0
 public override void Write(SchemaWriter writer)
 {
     writer.Append("this");
 }
Exemplo n.º 13
0
 public override void Write(SchemaWriter writer)
 {
     Caller.Write(writer);
     writer.Append("." + Name);
 }
Exemplo n.º 14
0
 public abstract void Write(SchemaWriter writer);
Exemplo n.º 15
0
 public abstract void Write(SchemaWriter writer);