本文整理汇总了C#中ICSharpCode.NRefactory.Parser.ModifierList类的典型用法代码示例。如果您正苦于以下问题:C# ModifierList类的具体用法?C# ModifierList怎么用?C# ModifierList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ModifierList类属于ICSharpCode.NRefactory.Parser命名空间,在下文中一共展示了ModifierList类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TypeDecl
void TypeDecl(
#line 371 "cs.ATG"
ModifierList m, List<AttributeSection> attributes) {
#line 373 "cs.ATG"
TypeReference type;
List<TypeReference> names;
List<ParameterDeclarationExpression> p = new List<ParameterDeclarationExpression>();
string name;
List<TemplateDefinition> templates;
if (la.kind == 59) {
#line 379 "cs.ATG"
m.Check(Modifiers.Classes);
lexer.NextToken();
#line 380 "cs.ATG"
TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes);
templates = newType.Templates;
AddChild(newType);
BlockStart(newType);
newType.StartLocation = m.GetDeclarationLocation(t.Location);
newType.Type = Types.Class;
Identifier();
#line 388 "cs.ATG"
newType.Name = t.val;
if (la.kind == 23) {
TypeParameterList(
#line 391 "cs.ATG"
templates);
}
if (la.kind == 9) {
ClassBase(
#line 393 "cs.ATG"
out names);
#line 393 "cs.ATG"
newType.BaseTypes = names;
}
while (la.kind == 127) {
TypeParameterConstraintsClause(
#line 396 "cs.ATG"
templates);
}
#line 398 "cs.ATG"
newType.BodyStartLocation = t.EndLocation;
Expect(16);
ClassBody();
Expect(17);
if (la.kind == 11) {
lexer.NextToken();
}
#line 402 "cs.ATG"
newType.EndLocation = t.EndLocation;
BlockEnd();
} else if (StartOf(9)) {
#line 405 "cs.ATG"
m.Check(Modifiers.StructsInterfacesEnumsDelegates);
if (la.kind == 109) {
lexer.NextToken();
#line 406 "cs.ATG"
TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes);
templates = newType.Templates;
newType.StartLocation = m.GetDeclarationLocation(t.Location);
AddChild(newType);
BlockStart(newType);
newType.Type = Types.Struct;
Identifier();
#line 413 "cs.ATG"
newType.Name = t.val;
if (la.kind == 23) {
TypeParameterList(
#line 416 "cs.ATG"
templates);
}
if (la.kind == 9) {
StructInterfaces(
#line 418 "cs.ATG"
out names);
#line 418 "cs.ATG"
newType.BaseTypes = names;
}
while (la.kind == 127) {
TypeParameterConstraintsClause(
#line 421 "cs.ATG"
templates);
}
//.........这里部分代码省略.........
示例2: AccessorModifiers
void AccessorModifiers(
#line 685 "cs.ATG"
out ModifierList m) {
#line 686 "cs.ATG"
m = new ModifierList();
if (la.kind == 96) {
lexer.NextToken();
#line 688 "cs.ATG"
m.Add(Modifiers.Private, t.Location);
} else if (la.kind == 97) {
lexer.NextToken();
#line 689 "cs.ATG"
m.Add(Modifiers.Protected, t.Location);
if (la.kind == 84) {
lexer.NextToken();
#line 690 "cs.ATG"
m.Add(Modifiers.Internal, t.Location);
}
} else if (la.kind == 84) {
lexer.NextToken();
#line 691 "cs.ATG"
m.Add(Modifiers.Internal, t.Location);
if (la.kind == 97) {
lexer.NextToken();
#line 692 "cs.ATG"
m.Add(Modifiers.Protected, t.Location);
}
} else SynErr(181);
}
示例3: TypeModifier
void TypeModifier(
#line 695 "cs.ATG"
ModifierList m) {
switch (la.kind) {
case 89: {
lexer.NextToken();
#line 697 "cs.ATG"
m.Add(Modifiers.New, t.Location);
break;
}
case 98: {
lexer.NextToken();
#line 698 "cs.ATG"
m.Add(Modifiers.Public, t.Location);
break;
}
case 97: {
lexer.NextToken();
#line 699 "cs.ATG"
m.Add(Modifiers.Protected, t.Location);
break;
}
case 84: {
lexer.NextToken();
#line 700 "cs.ATG"
m.Add(Modifiers.Internal, t.Location);
break;
}
case 96: {
lexer.NextToken();
#line 701 "cs.ATG"
m.Add(Modifiers.Private, t.Location);
break;
}
case 119: {
lexer.NextToken();
#line 702 "cs.ATG"
m.Add(Modifiers.Unsafe, t.Location);
break;
}
case 49: {
lexer.NextToken();
#line 703 "cs.ATG"
m.Add(Modifiers.Abstract, t.Location);
break;
}
case 103: {
lexer.NextToken();
#line 704 "cs.ATG"
m.Add(Modifiers.Sealed, t.Location);
break;
}
case 107: {
lexer.NextToken();
#line 705 "cs.ATG"
m.Add(Modifiers.Static, t.Location);
break;
}
case 126: {
lexer.NextToken();
#line 706 "cs.ATG"
m.Add(Modifiers.Partial, t.Location);
break;
}
default: SynErr(153); break;
}
}
示例4: StructMemberDecl
void StructMemberDecl(
#line 753 "cs.ATG"
ModifierList m, List<AttributeSection> attributes) {
#line 755 "cs.ATG"
string qualident = null;
TypeReference type;
Expression expr;
List<ParameterDeclarationExpression> p = new List<ParameterDeclarationExpression>();
BlockStatement stmt = null;
List<TemplateDefinition> templates = new List<TemplateDefinition>();
TypeReference explicitInterface = null;
bool isExtensionMethod = false;
if (la.kind == 60) {
#line 765 "cs.ATG"
m.Check(Modifiers.Constants);
lexer.NextToken();
#line 766 "cs.ATG"
Location startPos = t.Location;
Type(
#line 767 "cs.ATG"
out type);
Identifier();
#line 767 "cs.ATG"
FieldDeclaration fd = new FieldDeclaration(attributes, type, m.Modifier | Modifiers.Const);
fd.StartLocation = m.GetDeclarationLocation(startPos);
VariableDeclaration f = new VariableDeclaration(t.val);
f.StartLocation = t.Location;
f.TypeReference = type;
SafeAdd(fd, fd.Fields, f);
Expect(3);
Expr(
#line 774 "cs.ATG"
out expr);
#line 774 "cs.ATG"
f.Initializer = expr;
while (la.kind == 14) {
lexer.NextToken();
Identifier();
#line 775 "cs.ATG"
f = new VariableDeclaration(t.val);
f.StartLocation = t.Location;
f.TypeReference = type;
SafeAdd(fd, fd.Fields, f);
Expect(3);
Expr(
#line 780 "cs.ATG"
out expr);
#line 780 "cs.ATG"
f.EndLocation = t.EndLocation; f.Initializer = expr;
}
Expect(11);
#line 781 "cs.ATG"
fd.EndLocation = t.EndLocation; AddChild(fd);
} else if (
#line 785 "cs.ATG"
NotVoidPointer()) {
#line 785 "cs.ATG"
m.Check(Modifiers.PropertysEventsMethods);
Expect(123);
#line 786 "cs.ATG"
Location startPos = t.Location;
if (
#line 787 "cs.ATG"
IsExplicitInterfaceImplementation()) {
TypeName(
#line 788 "cs.ATG"
out explicitInterface, false);
#line 789 "cs.ATG"
if (la.kind != Tokens.Dot || Peek(1).kind != Tokens.This) {
qualident = TypeReference.StripLastIdentifierFromType(ref explicitInterface);
}
} else if (StartOf(18)) {
Identifier();
#line 792 "cs.ATG"
qualident = t.val;
} else SynErr(162);
if (la.kind == 23) {
TypeParameterList(
#line 795 "cs.ATG"
templates);
}
Expect(20);
if (la.kind == 111) {
lexer.NextToken();
//.........这里部分代码省略.........
示例5: NamespaceMemberDecl
void NamespaceMemberDecl() {
#line 335 "cs.ATG"
AttributeSection section;
List<AttributeSection> attributes = new List<AttributeSection>();
ModifierList m = new ModifierList();
string qualident;
if (la.kind == 88) {
lexer.NextToken();
#line 341 "cs.ATG"
Location startPos = t.Location;
Qualident(
#line 342 "cs.ATG"
out qualident);
#line 342 "cs.ATG"
INode node = new NamespaceDeclaration(qualident);
node.StartLocation = startPos;
AddChild(node);
BlockStart(node);
Expect(16);
while (la.kind == 71) {
ExternAliasDirective();
}
while (la.kind == 121) {
UsingDirective();
}
while (StartOf(1)) {
NamespaceMemberDecl();
}
Expect(17);
if (la.kind == 11) {
lexer.NextToken();
}
#line 352 "cs.ATG"
node.EndLocation = t.EndLocation;
BlockEnd();
} else if (StartOf(2)) {
while (la.kind == 18) {
AttributeSection(
#line 356 "cs.ATG"
out section);
#line 356 "cs.ATG"
attributes.Add(section);
}
while (StartOf(3)) {
TypeModifier(
#line 357 "cs.ATG"
m);
}
TypeDecl(
#line 358 "cs.ATG"
m, attributes);
} else SynErr(148);
}
示例6: MemberModifiers
void MemberModifiers(
#line 730 "cs.ATG"
ModifierList m) {
while (StartOf(19)) {
switch (la.kind) {
case 49: {
lexer.NextToken();
#line 733 "cs.ATG"
m.Add(Modifiers.Abstract, t.Location);
break;
}
case 71: {
lexer.NextToken();
#line 734 "cs.ATG"
m.Add(Modifiers.Extern, t.Location);
break;
}
case 84: {
lexer.NextToken();
#line 735 "cs.ATG"
m.Add(Modifiers.Internal, t.Location);
break;
}
case 89: {
lexer.NextToken();
#line 736 "cs.ATG"
m.Add(Modifiers.New, t.Location);
break;
}
case 94: {
lexer.NextToken();
#line 737 "cs.ATG"
m.Add(Modifiers.Override, t.Location);
break;
}
case 96: {
lexer.NextToken();
#line 738 "cs.ATG"
m.Add(Modifiers.Private, t.Location);
break;
}
case 97: {
lexer.NextToken();
#line 739 "cs.ATG"
m.Add(Modifiers.Protected, t.Location);
break;
}
case 98: {
lexer.NextToken();
#line 740 "cs.ATG"
m.Add(Modifiers.Public, t.Location);
break;
}
case 99: {
lexer.NextToken();
#line 741 "cs.ATG"
m.Add(Modifiers.ReadOnly, t.Location);
break;
}
case 103: {
lexer.NextToken();
#line 742 "cs.ATG"
m.Add(Modifiers.Sealed, t.Location);
break;
}
case 107: {
lexer.NextToken();
#line 743 "cs.ATG"
m.Add(Modifiers.Static, t.Location);
break;
}
case 74: {
lexer.NextToken();
#line 744 "cs.ATG"
m.Add(Modifiers.Fixed, t.Location);
break;
}
case 119: {
lexer.NextToken();
#line 745 "cs.ATG"
m.Add(Modifiers.Unsafe, t.Location);
break;
}
case 122: {
lexer.NextToken();
#line 746 "cs.ATG"
//.........这里部分代码省略.........
示例7: ClassMemberDecl
void ClassMemberDecl(
#line 1084 "cs.ATG"
ModifierList m, List<AttributeSection> attributes) {
#line 1085 "cs.ATG"
BlockStatement stmt = null;
if (StartOf(20)) {
StructMemberDecl(
#line 1087 "cs.ATG"
m, attributes);
} else if (la.kind == 27) {
#line 1088 "cs.ATG"
m.Check(Modifiers.Destructors); Location startPos = la.Location;
lexer.NextToken();
Identifier();
#line 1089 "cs.ATG"
DestructorDeclaration d = new DestructorDeclaration(t.val, m.Modifier, attributes);
d.Modifier = m.Modifier;
d.StartLocation = m.GetDeclarationLocation(startPos);
Expect(20);
Expect(21);
#line 1093 "cs.ATG"
d.EndLocation = t.EndLocation;
if (la.kind == 16) {
Block(
#line 1093 "cs.ATG"
out stmt);
} else if (la.kind == 11) {
lexer.NextToken();
} else SynErr(160);
#line 1094 "cs.ATG"
d.Body = stmt;
AddChild(d);
} else SynErr(161);
}
示例8: StructBody
void StructBody() {
#line 535 "cs.ATG"
AttributeSection section;
Expect(16);
while (StartOf(14)) {
#line 538 "cs.ATG"
List<AttributeSection> attributes = new List<AttributeSection>();
ModifierList m = new ModifierList();
while (la.kind == 18) {
AttributeSection(
#line 541 "cs.ATG"
out section);
#line 541 "cs.ATG"
attributes.Add(section);
}
MemberModifiers(
#line 542 "cs.ATG"
m);
StructMemberDecl(
#line 543 "cs.ATG"
m, attributes);
}
Expect(17);
}
示例9: ClassBody
void ClassBody() {
#line 512 "cs.ATG"
AttributeSection section;
while (StartOf(12)) {
#line 514 "cs.ATG"
List<AttributeSection> attributes = new List<AttributeSection>();
ModifierList m = new ModifierList();
while (!(StartOf(13))) {SynErr(156); lexer.NextToken(); }
while (la.kind == 18) {
AttributeSection(
#line 518 "cs.ATG"
out section);
#line 518 "cs.ATG"
attributes.Add(section);
}
MemberModifiers(
#line 519 "cs.ATG"
m);
ClassMemberDecl(
#line 520 "cs.ATG"
m, attributes);
}
}
示例10: TypeDecl
void TypeDecl(
#line 362 "Frames/cs.ATG"
ModifierList m, List<AttributeSection> attributes) {
#line 364 "Frames/cs.ATG"
TypeReference type;
List<TypeReference> names;
List<ParameterDeclarationExpression> p = new List<ParameterDeclarationExpression>();
string name;
List<TemplateDefinition> templates;
if (la.kind == 59) {
#line 370 "Frames/cs.ATG"
m.Check(Modifiers.Classes);
lexer.NextToken();
#line 371 "Frames/cs.ATG"
TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes);
templates = newType.Templates;
compilationUnit.AddChild(newType);
compilationUnit.BlockStart(newType);
newType.StartLocation = m.GetDeclarationLocation(t.Location);
newType.Type = Types.Class;
Identifier();
#line 379 "Frames/cs.ATG"
newType.Name = t.val;
if (la.kind == 23) {
TypeParameterList(
#line 382 "Frames/cs.ATG"
templates);
}
if (la.kind == 9) {
ClassBase(
#line 384 "Frames/cs.ATG"
out names);
#line 384 "Frames/cs.ATG"
newType.BaseTypes = names;
}
while (la.kind == 127) {
TypeParameterConstraintsClause(
#line 387 "Frames/cs.ATG"
templates);
}
#line 389 "Frames/cs.ATG"
newType.BodyStartLocation = t.EndLocation;
Expect(16);
ClassBody();
Expect(17);
if (la.kind == 11) {
lexer.NextToken();
}
#line 393 "Frames/cs.ATG"
newType.EndLocation = t.EndLocation;
compilationUnit.BlockEnd();
} else if (StartOf(9)) {
#line 396 "Frames/cs.ATG"
m.Check(Modifiers.StructsInterfacesEnumsDelegates);
if (la.kind == 109) {
lexer.NextToken();
#line 397 "Frames/cs.ATG"
TypeDeclaration newType = new TypeDeclaration(m.Modifier, attributes);
templates = newType.Templates;
newType.StartLocation = m.GetDeclarationLocation(t.Location);
compilationUnit.AddChild(newType);
compilationUnit.BlockStart(newType);
newType.Type = Types.Struct;
Identifier();
#line 404 "Frames/cs.ATG"
newType.Name = t.val;
if (la.kind == 23) {
TypeParameterList(
#line 407 "Frames/cs.ATG"
templates);
}
if (la.kind == 9) {
StructInterfaces(
#line 409 "Frames/cs.ATG"
out names);
#line 409 "Frames/cs.ATG"
newType.BaseTypes = names;
}
while (la.kind == 127) {
TypeParameterConstraintsClause(
#line 412 "Frames/cs.ATG"
templates);
}
//.........这里部分代码省略.........
示例11: StructMemberDecl
void StructMemberDecl(
#line 739 "cs.ATG"
ModifierList m, List<AttributeSection> attributes) {
#line 741 "cs.ATG"
string qualident = null;
TypeReference type;
Expression expr;
List<ParameterDeclarationExpression> p = new List<ParameterDeclarationExpression>();
Statement stmt = null;
List<TemplateDefinition> templates = new List<TemplateDefinition>();
TypeReference explicitInterface = null;
bool isExtensionMethod = false;
if (la.kind == 60) {
#line 751 "cs.ATG"
m.Check(Modifiers.Constants);
lexer.NextToken();
#line 752 "cs.ATG"
Location startPos = t.Location;
Type(
#line 753 "cs.ATG"
out type);
Identifier();
#line 753 "cs.ATG"
FieldDeclaration fd = new FieldDeclaration(attributes, type, m.Modifier | Modifiers.Const);
fd.StartLocation = m.GetDeclarationLocation(startPos);
VariableDeclaration f = new VariableDeclaration(t.val);
SafeAdd(fd, fd.Fields, f);
Expect(3);
Expr(
#line 758 "cs.ATG"
out expr);
#line 758 "cs.ATG"
f.Initializer = expr;
while (la.kind == 14) {
lexer.NextToken();
Identifier();
#line 759 "cs.ATG"
f = new VariableDeclaration(t.val);
SafeAdd(fd, fd.Fields, f);
Expect(3);
Expr(
#line 762 "cs.ATG"
out expr);
#line 762 "cs.ATG"
f.Initializer = expr;
}
Expect(11);
#line 763 "cs.ATG"
fd.EndLocation = t.EndLocation; compilationUnit.AddChild(fd);
} else if (
#line 767 "cs.ATG"
NotVoidPointer()) {
#line 767 "cs.ATG"
m.Check(Modifiers.PropertysEventsMethods);
Expect(123);
#line 768 "cs.ATG"
Location startPos = t.Location;
if (
#line 769 "cs.ATG"
IsExplicitInterfaceImplementation()) {
TypeName(
#line 770 "cs.ATG"
out explicitInterface, false);
#line 771 "cs.ATG"
if (la.kind != Tokens.Dot || Peek(1).kind != Tokens.This) {
qualident = TypeReference.StripLastIdentifierFromType(ref explicitInterface);
}
} else if (StartOf(19)) {
Identifier();
#line 774 "cs.ATG"
qualident = t.val;
} else SynErr(162);
if (la.kind == 23) {
TypeParameterList(
#line 777 "cs.ATG"
templates);
}
Expect(20);
if (la.kind == 111) {
lexer.NextToken();
#line 780 "cs.ATG"
isExtensionMethod = true; /* C# 3.0 */
}
if (StartOf(11)) {
//.........这里部分代码省略.........
示例12: MemberModifiers
void MemberModifiers(
#line 705 "cs.ATG"
ModifierList m) {
while (StartOf(20)) {
switch (la.kind) {
case 49: {
lexer.NextToken();
#line 708 "cs.ATG"
m.Add(Modifiers.Abstract, t.Location);
break;
}
case 71: {
lexer.NextToken();
#line 709 "cs.ATG"
m.Add(Modifiers.Extern, t.Location);
break;
}
case 84: {
lexer.NextToken();
#line 710 "cs.ATG"
m.Add(Modifiers.Internal, t.Location);
break;
}
case 89: {
lexer.NextToken();
#line 711 "cs.ATG"
m.Add(Modifiers.New, t.Location);
break;
}
case 94: {
lexer.NextToken();
#line 712 "cs.ATG"
m.Add(Modifiers.Override, t.Location);
break;
}
case 96: {
lexer.NextToken();
#line 713 "cs.ATG"
m.Add(Modifiers.Private, t.Location);
break;
}
case 97: {
lexer.NextToken();
#line 714 "cs.ATG"
m.Add(Modifiers.Protected, t.Location);
break;
}
case 98: {
lexer.NextToken();
#line 715 "cs.ATG"
m.Add(Modifiers.Public, t.Location);
break;
}
case 99: {
lexer.NextToken();
#line 716 "cs.ATG"
m.Add(Modifiers.ReadOnly, t.Location);
break;
}
case 103: {
lexer.NextToken();
#line 717 "cs.ATG"
m.Add(Modifiers.Sealed, t.Location);
break;
}
case 107: {
lexer.NextToken();
#line 718 "cs.ATG"
m.Add(Modifiers.Static, t.Location);
break;
}
case 74: {
lexer.NextToken();
#line 719 "cs.ATG"
m.Add(Modifiers.Fixed, t.Location);
break;
}
case 119: {
lexer.NextToken();
#line 720 "cs.ATG"
m.Add(Modifiers.Unsafe, t.Location);
break;
}
case 122: {
lexer.NextToken();
#line 721 "cs.ATG"
//.........这里部分代码省略.........