本文整理汇总了C#中Mono.CSharp.NamespaceEntry类的典型用法代码示例。如果您正苦于以下问题:C# NamespaceEntry类的具体用法?C# NamespaceEntry怎么用?C# NamespaceEntry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NamespaceEntry类属于Mono.CSharp命名空间,在下文中一共展示了NamespaceEntry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
}
示例2: 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);
}
示例3: 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;
}
示例4: 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");
}
}
示例5: 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);
}
示例6: LookupExtensionMethod
public IList<MethodSpec> LookupExtensionMethod (TypeSpec extensionType, string name, int arity, ref NamespaceEntry scope)
{
throw new NotImplementedException ();
}
示例7: GlobalAttribute
public GlobalAttribute (NamespaceEntry ns, string target, ATypeNameExpression expression,
Arguments[] args, Location loc, bool nameEscaped):
base (target, expression, args, loc, nameEscaped)
{
this.ns = ns;
}
示例8: LookupExtensionMethod
public override IList<MethodSpec> LookupExtensionMethod (TypeSpec extensionType, string name, int arity, ref NamespaceEntry scope)
{
DeclSpace top_level = Parent;
if (top_level != null) {
while (top_level.Parent != null)
top_level = top_level.Parent;
var candidates = NamespaceEntry.NS.LookupExtensionMethod (extensionType, this, name, arity);
if (candidates != null) {
scope = NamespaceEntry;
return candidates;
}
}
return NamespaceEntry.LookupExtensionMethod (extensionType, name, arity, ref scope);
}
示例9: ParseString
//
// Parses the string @input and returns a CSharpParser if succeeful.
//
// if @silent is set to true then no errors are
// reported to the user. This is used to do various calls to the
// parser and check if the expression is parsable.
//
// @partial_input: if @silent is true, then it returns whether the
// parsed expression was partial, and more data is needed
//
static CSharpParser ParseString (ParseMode mode, string input, out bool partial_input)
{
partial_input = false;
Reset ();
queued_fields.Clear ();
Tokenizer.LocatedToken.Initialize ();
Stream s = new MemoryStream (Encoding.Default.GetBytes (input));
SeekableStreamReader seekable = new SeekableStreamReader (s, Encoding.Default);
InputKind kind = ToplevelOrStatement (seekable);
if (kind == InputKind.Error){
if (mode == ParseMode.ReportErrors)
ctx.Report.Error (-25, "Detection Parsing Error");
partial_input = false;
return null;
}
if (kind == InputKind.EOF){
if (mode == ParseMode.ReportErrors)
Console.Error.WriteLine ("Internal error: EOF condition should have been detected in a previous call with silent=true");
partial_input = true;
return null;
}
seekable.Position = 0;
if (ns == null)
ns = new NamespaceEntry (RootContext.ToplevelTypes, null, Location.SourceFiles[0], null);
CSharpParser parser = new CSharpParser (seekable, Location.SourceFiles [0], RootContext.ToplevelTypes, ns);
if (kind == InputKind.StatementOrExpression){
parser.Lexer.putback_char = Tokenizer.EvalStatementParserCharacter;
RootContext.StatementMode = true;
} else {
parser.Lexer.putback_char = Tokenizer.EvalCompilationUnitParserCharacter;
RootContext.StatementMode = false;
}
if (mode == ParseMode.GetCompletions)
parser.Lexer.CompleteOnEOF = true;
ReportPrinter old_printer = null;
if ((mode == ParseMode.Silent || mode == ParseMode.GetCompletions) && CSharpParser.yacc_verbose_flag == 0)
old_printer = SetPrinter (new StreamReportPrinter (TextWriter.Null));
try {
parser.parse ();
} finally {
if (ctx.Report.Errors != 0){
if (mode != ParseMode.ReportErrors && parser.UnexpectedEOF)
partial_input = true;
parser.undo.ExecuteUndo ();
parser = null;
}
if (old_printer != null)
SetPrinter (old_printer);
}
return parser;
}
示例10: ClassOrStruct
public ClassOrStruct (NamespaceEntry ns, DeclSpace parent,
MemberName name, Attributes attrs, MemberKind kind)
: base (ns, parent, name, attrs, kind)
{
}
示例11: NamespaceEntry
private NamespaceEntry (NamespaceEntry parent, CompilationUnit file, Namespace ns, bool slave)
{
this.parent = parent;
this.file = file;
this.IsImplicit = true;
this.ns = ns;
this.SlaveDeclSpace = slave ? new RootDeclSpace (this) : null;
}
示例12: LookupExtensionMethod
public virtual IList<MethodSpec> LookupExtensionMethod (TypeSpec extensionType, string name, int arity, ref NamespaceEntry scope)
{
return Parent.LookupExtensionMethod (extensionType, name, arity, ref scope);
}
示例13: RootDeclSpace
public RootDeclSpace(NamespaceEntry ns)
: base(ns, null, MemberName.Null, null, 0)
{
PartialContainer = RootContext.ToplevelTypes;
}
示例14: yyparse
//.........这里部分代码省略.........
if (RootContext.Documentation != null)
Lexer.doc_state = XmlCommentState.Allowed;
}
break;
case 22:
#line 449 "cs-parser.jay"
{
var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop];
current_namespace.AddUsingAlias (lt.Value, (MemberName) yyVals[-1+yyTop], GetLocation (yyVals[-4+yyTop]));
}
break;
case 23:
#line 453 "cs-parser.jay"
{
CheckIdentifierToken (yyToken, GetLocation (yyVals[0+yyTop]));
yyVal = null;
}
break;
case 24:
#line 461 "cs-parser.jay"
{
current_namespace.AddUsing ((MemberName) yyVals[-1+yyTop], GetLocation (yyVals[-2+yyTop]));
}
break;
case 25:
#line 473 "cs-parser.jay"
{
MemberName name = (MemberName) yyVals[0+yyTop];
if (yyVals[-2+yyTop] != null) {
Report.Error(1671, name.Location, "A namespace declaration cannot have modifiers or attributes");
}
current_namespace = new NamespaceEntry (
current_namespace, file, name.GetName ());
current_class = current_namespace.SlaveDeclSpace;
current_container = current_class.PartialContainer;
}
break;
case 26:
#line 486 "cs-parser.jay"
{
current_namespace = current_namespace.Parent;
current_class = current_namespace.SlaveDeclSpace;
current_container = current_class.PartialContainer;
}
break;
case 27:
#line 495 "cs-parser.jay"
{
var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop];
yyVal = new MemberName (lt.Value, lt.Location);
}
break;
case 28:
#line 500 "cs-parser.jay"
{
var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop];
yyVal = new MemberName ((MemberName) yyVals[-2+yyTop], lt.Value, lt.Location);
}
break;
case 29:
#line 505 "cs-parser.jay"
{
syntax_error (lexer.Location, "`.' expected");
yyVal = new MemberName ("<invalid>", lexer.Location);
示例15: ResolveOverloadExtensions
MethodGroupExpr ResolveOverloadExtensions(ResolveContext ec, ref Arguments arguments, NamespaceEntry ns, Location loc)
{
// Use normal resolve rules
MethodGroupExpr mg = base.OverloadResolve (ec, ref arguments, ns != null, loc);
if (mg != null)
return mg;
if (ns == null)
return null;
// Search continues
int arity = type_arguments == null ? -1 : type_arguments.Count;
ExtensionMethodGroupExpr e = ns.LookupExtensionMethod (type, Name, arity, loc);
if (e == null)
return base.OverloadResolve (ec, ref arguments, false, loc);
e.ExtensionExpression = ExtensionExpression;
e.SetTypeArguments (ec, type_arguments);
return e.ResolveOverloadExtensions (ec, ref arguments, e.namespace_entry, loc);
}