本文整理汇总了C#中Mono.CSharp.DeclSpace类的典型用法代码示例。如果您正苦于以下问题:C# DeclSpace类的具体用法?C# DeclSpace怎么用?C# DeclSpace使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DeclSpace类属于Mono.CSharp命名空间,在下文中一共展示了DeclSpace类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddMemberType
protected override bool AddMemberType (DeclSpace ds)
{
if (!AddToContainer (ds, ds.Name))
return false;
ds.NamespaceEntry.NS.AddDeclSpace (ds.Basename, ds);
return true;
}
示例2: MethodCore
public MethodCore (DeclSpace parent, GenericMethod generic,
FullNamedExpression type, Modifiers mod, Modifiers allowed_mod,
MemberName name, Attributes attrs, ParametersCompiled parameters)
: base (parent, generic, type, mod, allowed_mod, name, attrs)
{
this.parameters = parameters;
}
示例3: Const
public Const (DeclSpace parent, FullNamedExpression type, string name,
Expression expr, int mod_flags, Attributes attrs, Location loc)
: base (parent, type, mod_flags, AllowedModifiers,
new MemberName (name, loc), attrs)
{
initializer = expr;
ModFlags |= Modifiers.STATIC;
}
示例4: Event
protected Event(DeclSpace parent, FullNamedExpression type, Modifiers mod_flags, MemberName name, Attributes attrs)
: base(parent, null, type, mod_flags,
parent.PartialContainer.Kind == MemberKind.Interface ? AllowedModifiersInterface :
parent.PartialContainer.Kind == MemberKind.Struct ? AllowedModifiersStruct :
AllowedModifiersClass,
name, attrs)
{
}
示例5: Class
public Class(NamespaceEntry ns, DeclSpace parent, MemberName name, Modifiers mod,
Attributes attrs)
: base(ns, parent, name, attrs, MemberKind.Class)
{
var accmods = (Parent == null || Parent.Parent == null) ? Modifiers.INTERNAL : Modifiers.PRIVATE;
this.ModFlags = ModifiersExtensions.Check (AllowedModifiers, mod, accmods, Location, Report);
spec = new TypeSpec (Kind, null, this, null, ModFlags);
}
示例6: FieldBase
protected FieldBase (DeclSpace parent, FullNamedExpression type, Modifiers mod,
Modifiers allowed_mod, MemberName name, Attributes attrs)
: base (parent, null, type, mod, allowed_mod | Modifiers.ABSTRACT, Modifiers.PRIVATE,
name, attrs)
{
if ((mod & Modifiers.ABSTRACT) != 0)
Report.Error (681, Location, "The modifier 'abstract' is not valid on fields. Try using a property instead");
}
示例7: Enum
public Enum(NamespaceEntry ns, DeclSpace parent, TypeExpr type,
Modifiers mod_flags, MemberName name, Attributes attrs)
: base(ns, parent, name, attrs, MemberKind.Enum)
{
this.base_type = type;
var accmods = IsTopLevel ? Modifiers.INTERNAL : Modifiers.PRIVATE;
ModFlags = ModifiersExtensions.Check (AllowedModifiers, mod_flags, accmods, Location, Report);
spec = new EnumSpec (null, this, null, null, ModFlags);
}
示例8: HoistedStoreyClass
public HoistedStoreyClass (DeclSpace parent, MemberName name, TypeParameter[] tparams, Modifiers mod)
: base (parent, name, mod | Modifiers.PRIVATE)
{
if (tparams != null) {
type_params = new TypeParameter[tparams.Length];
for (int i = 0; i < type_params.Length; ++i) {
type_params[i] = tparams[i].CreateHoistedCopy (this, spec);
}
}
}
示例9: Const
public Const(DeclSpace parent, FullNamedExpression type, string name,
Expression expr, Modifiers mod_flags, Attributes attrs, Location loc)
: base(parent, type, mod_flags, AllowedModifiers,
new MemberName (name, loc), attrs)
{
if (expr != null)
initializer = new ConstInitializer (this, expr);
ModFlags |= Modifiers.STATIC;
}
示例10: CompilerGeneratedClass
protected CompilerGeneratedClass (DeclSpace parent, GenericMethod generic, MemberName name, int mod)
: this (parent, name, mod)
{
if (generic != null) {
ArrayList list = new ArrayList ();
foreach (TypeParameter tparam in generic.TypeParameters) {
if (tparam.Constraints != null)
list.Add (tparam.Constraints.Clone ());
}
SetParameterInfo (list);
}
}
示例11: Class
public Class(NamespaceEntry ns, DeclSpace parent, MemberName name, Modifiers mod,
Attributes attrs)
: base(ns, parent, name, attrs, MemberKind.Class)
{
var accmods = (Parent == null || Parent.Parent == null) ? Modifiers.INTERNAL : Modifiers.PRIVATE;
this.ModFlags = ModifiersExtensions.Check (AllowedModifiers, mod, accmods, Location, Report);
spec = new TypeSpec (Kind, null, this, null, ModFlags);
if (IsStatic && RootContext.Version == LanguageVersion.ISO_1) {
Report.FeatureIsNotAvailable (Location, "static classes");
}
}
示例12: Delegate
public Delegate (NamespaceEntry ns, DeclSpace parent, FullNamedExpression type,
int mod_flags, MemberName name, ParametersCompiled param_list,
Attributes attrs)
: base (ns, parent, name, attrs, Kind.Delegate)
{
this.ReturnType = type;
ModFlags = Modifiers.Check (AllowedModifiers, mod_flags,
IsTopLevel ? Modifiers.INTERNAL :
Modifiers.PRIVATE, name.Location, Report);
Parameters = param_list;
}
示例13: Delegate
public Delegate(NamespaceEntry ns, DeclSpace parent, FullNamedExpression type,
Modifiers mod_flags, MemberName name, ParametersCompiled param_list,
Attributes attrs)
: base(ns, parent, name, attrs, MemberKind.Delegate)
{
this.ReturnType = type;
ModFlags = ModifiersExtensions.Check (AllowedModifiers, mod_flags,
IsTopLevel ? Modifiers.INTERNAL :
Modifiers.PRIVATE, name.Location, Report);
parameters = param_list;
spec = new TypeSpec (Kind, null, this, null, ModFlags | Modifiers.SEALED);
}
示例14: GenerateTypeDocComment
// TypeContainer
//
// Generates xml doc comments (if any), and if required,
// handle warning report.
//
internal static void GenerateTypeDocComment (TypeContainer t,
DeclSpace ds, Report Report)
{
GenerateDocComment (t, ds, Report);
if (t.DefaultStaticConstructor != null)
t.DefaultStaticConstructor.GenerateDocComment (t);
if (t.InstanceConstructors != null)
foreach (Constructor c in t.InstanceConstructors)
c.GenerateDocComment (t);
if (t.Types != null)
foreach (TypeContainer tc in t.Types)
tc.GenerateDocComment (t);
if (t.Delegates != null)
foreach (Delegate de in t.Delegates)
de.GenerateDocComment (t);
if (t.Constants != null)
foreach (Const c in t.Constants)
c.GenerateDocComment (t);
if (t.Fields != null)
foreach (FieldBase f in t.Fields)
f.GenerateDocComment (t);
if (t.Events != null)
foreach (Event e in t.Events)
e.GenerateDocComment (t);
if (t.Indexers != null)
foreach (Indexer ix in t.Indexers)
ix.GenerateDocComment (t);
if (t.Properties != null)
foreach (Property p in t.Properties)
p.GenerateDocComment (t);
if (t.Methods != null)
foreach (MethodOrOperator m in t.Methods)
m.GenerateDocComment (t);
if (t.Operators != null)
foreach (Operator o in t.Operators)
o.GenerateDocComment (t);
}
示例15: HoistedStoreyClass
public HoistedStoreyClass (DeclSpace parent, MemberName name, TypeParameter[] tparams, Modifiers mod)
: base (parent, name, mod | Modifiers.PRIVATE)
{
if (tparams != null) {
type_params = new TypeParameter[tparams.Length];
var src = new TypeParameterSpec[tparams.Length];
var dst = new TypeParameterSpec[tparams.Length];
for (int i = 0; i < type_params.Length; ++i) {
type_params[i] = tparams[i].CreateHoistedCopy (this, spec);
src[i] = tparams[i].Type;
dst[i] = type_params[i].Type;
}
// A copy is not enough, inflate any type parameter constraints
// using a new type parameters
var inflator = new TypeParameterInflator (null, src, dst);
for (int i = 0; i < type_params.Length; ++i) {
src[i].InflateConstraints (inflator, dst[i]);
}
}
}