本文整理汇总了C#中ICSharpCode.NRefactory.Parser.ModifierList.Contains方法的典型用法代码示例。如果您正苦于以下问题:C# ModifierList.Contains方法的具体用法?C# ModifierList.Contains怎么用?C# ModifierList.Contains使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICSharpCode.NRefactory.Parser.ModifierList
的用法示例。
在下文中一共展示了ModifierList.Contains方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StructMemberDecl
//.........这里部分代码省略.........
#line 941 "cs.ATG"
if (op == OverloadableOperatorType.Add && secondType == null)
op = OverloadableOperatorType.UnaryPlus;
if (op == OverloadableOperatorType.Subtract && secondType == null)
op = OverloadableOperatorType.UnaryMinus;
OperatorDeclaration operatorDeclaration = new OperatorDeclaration {
Modifier = m.Modifier,
Attributes = attributes,
TypeReference = type,
OverloadableOperator = op,
Name = GetReflectionNameForOperator(op),
Body = (BlockStatement)stmt,
StartLocation = m.GetDeclarationLocation(startPos),
EndLocation = endPos
};
SafeAdd(operatorDeclaration, operatorDeclaration.Parameters, new ParameterDeclarationExpression(firstType, firstName) { StartLocation = firstStart, EndLocation = firstEnd });
if (secondType != null) {
SafeAdd(operatorDeclaration, operatorDeclaration.Parameters, new ParameterDeclarationExpression(secondType, secondName) { StartLocation = secondStart, EndLocation = secondEnd });
}
AddChild(operatorDeclaration);
} else if (
#line 963 "cs.ATG"
IsVarDecl()) {
#line 964 "cs.ATG"
m.Check(Modifiers.Fields);
FieldDeclaration fd = new FieldDeclaration(attributes, type, m.Modifier);
fd.StartLocation = m.GetDeclarationLocation(startPos);
if (
#line 968 "cs.ATG"
m.Contains(Modifiers.Fixed)) {
VariableDeclarator(
#line 969 "cs.ATG"
fd);
Expect(18);
Expr(
#line 971 "cs.ATG"
out expr);
#line 971 "cs.ATG"
if (fd.Fields.Count > 0)
fd.Fields[fd.Fields.Count-1].FixedArrayInitialization = expr;
Expect(19);
while (la.kind == 14) {
lexer.NextToken();
VariableDeclarator(
#line 975 "cs.ATG"
fd);
Expect(18);
Expr(
#line 977 "cs.ATG"
out expr);
#line 977 "cs.ATG"
if (fd.Fields.Count > 0)
fd.Fields[fd.Fields.Count-1].FixedArrayInitialization = expr;
Expect(19);
}
} else if (StartOf(18)) {
VariableDeclarator(
#line 982 "cs.ATG"
fd);
while (la.kind == 14) {
示例2: StructMemberDecl
//.........这里部分代码省略.........
#line 903 "cs.ATG"
out stmt);
} else if (la.kind == 11) {
lexer.NextToken();
} else SynErr(168);
#line 905 "cs.ATG"
OperatorDeclaration operatorDeclaration = new OperatorDeclaration {
Modifier = m.Modifier,
Attributes = attributes,
TypeReference = type,
OverloadableOperator = op,
Body = (BlockStatement)stmt,
StartLocation = m.GetDeclarationLocation(startPos),
EndLocation = endPos
};
SafeAdd(operatorDeclaration, operatorDeclaration.Parameters, new ParameterDeclarationExpression(firstType, firstName));
if (secondType != null) {
SafeAdd(operatorDeclaration, operatorDeclaration.Parameters, new ParameterDeclarationExpression(secondType, secondName));
}
compilationUnit.AddChild(operatorDeclaration);
} else if (
#line 922 "cs.ATG"
IsVarDecl()) {
#line 923 "cs.ATG"
m.Check(Modifiers.Fields);
FieldDeclaration fd = new FieldDeclaration(attributes, type, m.Modifier);
fd.StartLocation = m.GetDeclarationLocation(startPos);
if (
#line 927 "cs.ATG"
m.Contains(Modifiers.Fixed)) {
VariableDeclarator(
#line 928 "cs.ATG"
fd);
Expect(18);
Expr(
#line 930 "cs.ATG"
out expr);
#line 930 "cs.ATG"
if (fd.Fields.Count > 0)
fd.Fields[fd.Fields.Count-1].FixedArrayInitialization = expr;
Expect(19);
while (la.kind == 14) {
lexer.NextToken();
VariableDeclarator(
#line 934 "cs.ATG"
fd);
Expect(18);
Expr(
#line 936 "cs.ATG"
out expr);
#line 936 "cs.ATG"
if (fd.Fields.Count > 0)
fd.Fields[fd.Fields.Count-1].FixedArrayInitialization = expr;
Expect(19);
}
} else if (StartOf(19)) {
VariableDeclarator(
#line 941 "cs.ATG"
fd);
while (la.kind == 14) {