using Flee.InternalTypes;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Reflection;
using System.Text;
namespace Convention.RScript.Variable
{
namespace Attr
{
[AttributeUsage(AttributeTargets.Method, Inherited = true, AllowMultiple = false)]
public sealed class MethodAttribute : Attribute
{
}
[AttributeUsage(AttributeTargets.Enum, Inherited = true, AllowMultiple = false)]
public sealed class EnumAttribute : Attribute
{
}
[AttributeUsage(AttributeTargets.Class|AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
public sealed class DefaultAttribute : Attribute
{
public string defaultScript;
public DefaultAttribute(string defaultScript)
{
this.defaultScript = defaultScript;
}
}
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
public sealed class DescriptionAttribute : Attribute
{
public string description;
public DescriptionAttribute(string description)
{
this.description = description;
}
}
}
public abstract class RScriptInjectVariableGenerater
{
public string RScriptString { get; private set; }
public abstract string GetFilename(Type currentType);
protected abstract string WritePageHead(Type currentType);
#region Enum
protected abstract string WriteEnumHead(Type currentEnum);
protected abstract string WriteEnumBodyEnter(Type currentType);
protected abstract string WriteEnumName(string enumName);
protected abstract string WriteEnumBodyExit(Type currentType);
protected abstract string WriteEnumTail(Type currentType);
#endregion
#region Class
protected abstract string WriteClassHead(Type currentType);
protected abstract string WriteClassBodyEnter(Type currentType);
protected abstract string WriteClassMethod(Type returnType, string methodName, string[] parameterNames, Type[] parameterTypes);
protected abstract string WriteClassBodyExit(Type currentType);
protected abstract string WriteClassTail(Type currentType);
#endregion
protected abstract string WritePageEnd(Type currentType);
///
/// 生成targetType类型的实体
///
///
public delegate object Generater();
public delegate void Destorier(object o);
private readonly Generater MyGenerater;
private readonly Destorier MyDestorier;
private readonly HashSet