本文整理汇总了C#中Modifiers.Check方法的典型用法代码示例。如果您正苦于以下问题:C# Modifiers.Check方法的具体用法?C# Modifiers.Check怎么用?C# Modifiers.Check使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Modifiers
的用法示例。
在下文中一共展示了Modifiers.Check方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Field
void Field(Modifiers m)
{
Expect(1);
if (la.kind == 40) {
Get();
m.Check(Modifier.fields);
Init();
BindingObject.Ident = t.val;
}
}
示例2: ParseTypeDeclaration
void ParseTypeDeclaration(Modifiers m)
{
TypeKind dummy;
if (StartOf(5)) {
if (la.kind == 1) {
Get();
if (!"partial".Equals(t.val)) { Error("partial expected, found: " + t.val); }
}
if (la.kind == 16) {
m.Check(classesMod);
Get();
Expect(1);
if (la.kind == 101) {
ParseTypeParameterList();
}
if (la.kind == 87) {
ParseClassBase();
}
while (la.kind == 1) {
ParseTypeParameterConstraintsClause();
}
ParseClassBody();
if (la.kind == 116) {
Get();
}
} else if (la.kind == 66) {
m.Check(nonClassTypesMod);
Get();
Expect(1);
if (la.kind == 101) {
ParseTypeParameterList();
}
if (la.kind == 87) {
Get();
ParseTypeName();
while (la.kind == 88) {
Get();
ParseTypeName();
}
}
while (la.kind == 1) {
ParseTypeParameterConstraintsClause();
}
ParseStructBody();
if (la.kind == 116) {
Get();
}
} else if (la.kind == 40) {
m.Check(nonClassTypesMod);
Get();
Expect(1);
if (la.kind == 101) {
ParseTypeParameterList();
}
if (la.kind == 87) {
Get();
ParseTypeName();
while (la.kind == 88) {
Get();
ParseTypeName();
}
}
while (la.kind == 1) {
ParseTypeParameterConstraintsClause();
}
Expect(97);
while (StartOf(6)) {
ParseInterfaceMemberDeclaration();
}
Expect(113);
if (la.kind == 116) {
Get();
}
} else SynErr(145);
} else if (la.kind == 25) {
m.Check(nonClassTypesMod);
Get();
Expect(1);
if (la.kind == 87) {
Get();
ParseIntegralType();
}
ParseEnumBody();
if (la.kind == 116) {
Get();
}
} else if (la.kind == 21) {
m.Check(nonClassTypesMod);
Get();
ParseType(out dummy, true);
Expect(1);
if (la.kind == 101) {
ParseTypeParameterList();
}
Expect(99);
if (StartOf(7)) {
ParseFormalParameterList();
}
Expect(115);
while (la.kind == 1) {
//.........这里部分代码省略.........
示例3: ScriptMember
void ScriptMember()
{
Modifiers m = new Modifiers(this);
string id;
if (IsFieldDecl()) {
Expect(36);
Field(m);
while (la.kind == 42) {
Get();
Field(m);
}
Expect(65);
} else if (la.kind == 20) {
Get();
Qualident(out id);
m.Check(Modifier.propEvntMeths);
Expect(53);
if (StartOf(1)) {
FormalParams();
}
Expect(64);
if (la.kind == 51) {
Block();
} else if (la.kind == 65) {
Get();
} else SynErr(83);
} else SynErr(84);
}
示例4: ParseStructMemberDeclaration
void ParseStructMemberDeclaration(Modifiers m)
{
TypeKind type; int op;
if (la.kind == 17) {
m.Check(constantsMod);
Get();
ParseType(out type, false);
Expect(1);
Expect(86);
ParseExpression();
while (la.kind == 88) {
Get();
Expect(1);
Expect(86);
ParseExpression();
}
Expect(116);
} else if (la.kind == 26) {
m.Check(propEvntMethsMod);
Get();
ParseType(out type, false);
if (IsFieldDecl()) {
ParseVariableDeclarators(m);
Expect(116);
} else if (la.kind == 1) {
ParseTypeName();
Expect(97);
ParseEventAccessorDeclarations();
Expect(113);
} else SynErr(157);
} else if (kindInContext(la.kind) == _ident && Peek(1).kind == _lpar) {
m.Check(constructorsMod|staticConstrMod);
Expect(1);
Expect(99);
if (StartOf(7)) {
m.Check(constructorsMod);
ParseFormalParameterList();
}
Expect(115);
if (la.kind == 87) {
m.Check(constructorsMod);
Get();
if (la.kind == 8) {
Get();
} else if (la.kind == 68) {
Get();
} else SynErr(158);
Expect(99);
if (StartOf(15)) {
ParseArgument();
while (la.kind == 88) {
Get();
ParseArgument();
}
}
Expect(115);
} else if (la.kind == 97 || la.kind == 116) {
} else SynErr(159);
if (la.kind == 97) {
ParseBlock();
} else if (la.kind == 116) {
Get();
} else SynErr(160);
} else if (la.kind == 31) {
Get();
ParseType(out type, true);
Expect(1);
Expect(98);
ParseExpression();
Expect(114);
Expect(116);
} else if (IsTypeDeclaration()) {
ParseTypeDeclaration(m);
} else if (StartOf(16)) {
if ("partial".Equals(la.val)) {
Expect(1);
}
ParseType(out type, true);
if (la.kind == 49) {
m.Check(operatorsMod);
m.CheckMust(operatorsMustMod);
if (type == [email protected]) { Error("operator not allowed on void"); }
Get();
ParseOverloadableOp(out op);
Expect(99);
ParseType(out type, false);
Expect(1);
if (la.kind == 88) {
Get();
ParseType(out type, false);
if ((op & binaryOp) == 0) Error("too many operands for unary operator");
Expect(1);
} else if (la.kind == 115) {
if ((op & unaryOp) == 0) Error("too few operands for binary operator");
} else SynErr(161);
Expect(115);
if (la.kind == 97) {
ParseBlock();
} else if (la.kind == 116) {
//.........这里部分代码省略.........
示例5: ParseAccessorDeclarations
void ParseAccessorDeclarations(Modifiers m)
{
Modifiers am = new Modifiers(this);
bool getFound = false, setFound = false;
while (la.kind == 98) {
ParseAttributes();
}
ParseModifierList(am);
am.Check(accessorsPossib1Mod, accessorsPossib2Mod);
if (la.val.Equals("get")) {
Expect(1);
getFound = true;
} else if (la.val.Equals("set")) {
Expect(1);
setFound = true;
} else if (la.kind == 1) {
Get();
Error("set or get expected");
} else SynErr(174);
if (la.kind == 97) {
ParseBlock();
} else if (la.kind == 116) {
Get();
} else SynErr(175);
if (StartOf(22)) {
am = new Modifiers(this);
while (la.kind == 98) {
ParseAttributes();
}
ParseModifierList(am);
am.Check(accessorsPossib1Mod, accessorsPossib2Mod);
if (la.val.Equals("get")) {
Expect(1);
if (getFound) Error("get already declared"); getFound = true;
} else if (la.val.Equals("set")) {
Expect(1);
if (setFound) Error("set already declared"); setFound = true;
} else if (la.kind == 1) {
Get();
Error("set or get expected");
} else SynErr(176);
if (la.kind == 97) {
ParseBlock();
} else if (la.kind == 116) {
Get();
} else SynErr(177);
}
}
示例6: ClassMemberDecl
private void ClassMemberDecl(Modifiers m, List<ICSharpCode.NRefactory.Parser.AST.AttributeSection> attributes)
{
ICSharpCode.NRefactory.Parser.AST.Statement stmt = null;
if (this.StartOf(0x10))
{
this.StructMemberDecl(m, attributes);
}
else if (this.la.kind == 0x1b)
{
m.Check(Modifier.Destructors);
Point location = this.t.Location;
base.lexer.NextToken();
base.Expect(1);
DestructorDeclaration childNode = new DestructorDeclaration(this.t.val, m.Modifier, attributes);
childNode.Modifier = m.Modifier;
childNode.StartLocation = m.GetDeclarationLocation(location);
base.Expect(20);
base.Expect(0x15);
childNode.EndLocation = this.t.EndLocation;
if (this.la.kind == 0x10)
{
this.Block(out stmt);
}
else if (this.la.kind == 11)
{
base.lexer.NextToken();
}
else
{
base.SynErr(0x8a);
}
childNode.Body = (BlockStatement) stmt;
base.compilationUnit.AddChild(childNode);
}
else
{
base.SynErr(0x8b);
}
}
示例7: TypeDecl
private void TypeDecl(Modifiers m, List<ICSharpCode.NRefactory.Parser.AST.AttributeSection> attributes)
{
List<TypeReference> list;
List<TemplateDefinition> templates;
List<ParameterDeclarationExpression> parameter = new List<ParameterDeclarationExpression>();
if (this.la.kind == 0x3a)
{
m.Check(Modifier.Classes);
base.lexer.NextToken();
TypeDeclaration childNode = new TypeDeclaration(m.Modifier, attributes);
templates = childNode.Templates;
base.compilationUnit.AddChild(childNode);
base.compilationUnit.BlockStart(childNode);
childNode.StartLocation = m.GetDeclarationLocation(this.t.Location);
childNode.Type = ICSharpCode.NRefactory.Parser.AST.ClassType.Class;
base.Expect(1);
childNode.Name = this.t.val;
if (this.la.kind == 0x17)
{
this.TypeParameterList(templates);
}
if (this.la.kind == 9)
{
this.ClassBase(out list);
childNode.BaseTypes = list;
}
while (this.IdentIsWhere())
{
this.TypeParameterConstraintsClause(templates);
}
this.ClassBody();
if (this.la.kind == 11)
{
base.lexer.NextToken();
}
childNode.EndLocation = this.t.Location;
base.compilationUnit.BlockEnd();
}
else if (this.StartOf(8))
{
m.Check(Modifier.StructsInterfacesEnumsDelegates);
if (this.la.kind == 0x6c)
{
base.lexer.NextToken();
TypeDeclaration declaration2 = new TypeDeclaration(m.Modifier, attributes);
templates = declaration2.Templates;
declaration2.StartLocation = m.GetDeclarationLocation(this.t.Location);
base.compilationUnit.AddChild(declaration2);
base.compilationUnit.BlockStart(declaration2);
declaration2.Type = ICSharpCode.NRefactory.Parser.AST.ClassType.Struct;
base.Expect(1);
declaration2.Name = this.t.val;
if (this.la.kind == 0x17)
{
this.TypeParameterList(templates);
}
if (this.la.kind == 9)
{
this.StructInterfaces(out list);
declaration2.BaseTypes = list;
}
while (this.IdentIsWhere())
{
this.TypeParameterConstraintsClause(templates);
}
this.StructBody();
if (this.la.kind == 11)
{
base.lexer.NextToken();
}
declaration2.EndLocation = this.t.Location;
base.compilationUnit.BlockEnd();
}
else if (this.la.kind == 0x52)
{
base.lexer.NextToken();
TypeDeclaration declaration3 = new TypeDeclaration(m.Modifier, attributes);
templates = declaration3.Templates;
base.compilationUnit.AddChild(declaration3);
base.compilationUnit.BlockStart(declaration3);
declaration3.StartLocation = m.GetDeclarationLocation(this.t.Location);
declaration3.Type = ICSharpCode.NRefactory.Parser.AST.ClassType.Interface;
base.Expect(1);
declaration3.Name = this.t.val;
if (this.la.kind == 0x17)
{
this.TypeParameterList(templates);
}
if (this.la.kind == 9)
{
this.InterfaceBase(out list);
declaration3.BaseTypes = list;
}
while (this.IdentIsWhere())
{
this.TypeParameterConstraintsClause(templates);
}
this.InterfaceBody();
if (this.la.kind == 11)
{
//.........这里部分代码省略.........
示例8: StructMemberDecl
private void StructMemberDecl(Modifiers m, List<ICSharpCode.NRefactory.Parser.AST.AttributeSection> attributes)
{
string name = null;
TypeReference reference;
List<ParameterDeclarationExpression> parameter = new List<ParameterDeclarationExpression>();
ICSharpCode.NRefactory.Parser.AST.Statement stmt = null;
List<VariableDeclaration> fieldDeclaration = new List<VariableDeclaration>();
List<TemplateDefinition> templates = new List<TemplateDefinition>();
TypeReference typeRef = null;
if (this.la.kind == 0x3b)
{
Expression expression;
m.Check(Modifier.VBInterfacs);
base.lexer.NextToken();
Point location = this.t.Location;
this.Type(out reference);
base.Expect(1);
FieldDeclaration childNode = new FieldDeclaration(attributes, reference, m.Modifier | Modifier.Const);
childNode.StartLocation = m.GetDeclarationLocation(location);
VariableDeclaration item = new VariableDeclaration(this.t.val);
childNode.Fields.Add(item);
base.Expect(3);
this.Expr(out expression);
item.Initializer = expression;
while (this.la.kind == 14)
{
base.lexer.NextToken();
base.Expect(1);
item = new VariableDeclaration(this.t.val);
childNode.Fields.Add(item);
base.Expect(3);
this.Expr(out expression);
item.Initializer = expression;
}
base.Expect(11);
childNode.EndLocation = this.t.EndLocation;
base.compilationUnit.AddChild(childNode);
}
else if (this.NotVoidPointer())
{
m.Check(Modifier.PropertysEventsMethods);
base.Expect(0x7a);
Point keywordLocation = this.t.Location;
if (this.IsExplicitInterfaceImplementation())
{
this.TypeName(out typeRef, false);
if ((this.la.kind != 15) || (this.Peek(1).kind != 110))
{
name = TypeReference.StripLastIdentifierFromType(ref typeRef);
}
}
else if (this.la.kind == 1)
{
base.lexer.NextToken();
name = this.t.val;
}
else
{
base.SynErr(140);
}
if (this.la.kind == 0x17)
{
this.TypeParameterList(templates);
}
base.Expect(20);
if (this.StartOf(10))
{
this.FormalParameterList(parameter);
}
base.Expect(0x15);
MethodDeclaration declaration3 = new MethodDeclaration(name, m.Modifier, new TypeReference("void"), parameter, attributes);
declaration3.StartLocation = m.GetDeclarationLocation(keywordLocation);
declaration3.EndLocation = this.t.EndLocation;
declaration3.Templates = templates;
if (typeRef != null)
{
declaration3.InterfaceImplementations.Add(new InterfaceImplementation(typeRef, name));
}
base.compilationUnit.AddChild(declaration3);
base.compilationUnit.BlockStart(declaration3);
while (this.IdentIsWhere())
{
this.TypeParameterConstraintsClause(templates);
}
if (this.la.kind == 0x10)
{
this.Block(out stmt);
}
else if (this.la.kind == 11)
{
base.lexer.NextToken();
}
else
{
base.SynErr(0x8d);
}
base.compilationUnit.BlockEnd();
declaration3.Body = (BlockStatement) stmt;
}
else if (this.la.kind == 0x44)
//.........这里部分代码省略.........