本文整理汇总了C#中ParameterModifierType类的典型用法代码示例。如果您正苦于以下问题:C# ParameterModifierType类的具体用法?C# ParameterModifierType怎么用?C# ParameterModifierType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ParameterModifierType类属于命名空间,在下文中一共展示了ParameterModifierType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: yyparse
//.........这里部分代码省略.........
case 154:
#line 1207 "cs-parser.jay"
{
current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]);
}
break;
case 155:
case_155();
break;
case 156:
#line 1223 "cs-parser.jay"
{
++lexer.parsing_block;
}
break;
case 157:
case_157();
break;
case 158:
case_158();
break;
case 161:
case_161();
break;
case 162:
case_162();
break;
case 163:
case_163();
break;
case 164:
#line 1277 "cs-parser.jay"
{
valid_param_mod = ParameterModifierType.All;
}
break;
case 165:
#line 1281 "cs-parser.jay"
{
lexer.ConstraintsParsing = true;
}
break;
case 166:
case_166();
break;
case 167:
#line 1322 "cs-parser.jay"
{
valid_param_mod = ParameterModifierType.All;
}
break;
case 168:
#line 1326 "cs-parser.jay"
{
lexer.ConstraintsParsing = true;
}
break;
case 169:
case_169();
break;
case 170:
case_170();
break;
case 172:
#line 1402 "cs-parser.jay"
{ yyVal = null; }
示例2: yyparse
//.........这里部分代码省略.........
case 141:
#line 1235 "cs-parser.jay"
{
current_field.AddDeclarator ((FieldDeclarator) yyVals[0+yyTop]);
}
break;
case 142:
case_142();
break;
case 143:
#line 1251 "cs-parser.jay"
{
++lexer.parsing_block;
}
break;
case 144:
case_144();
break;
case 145:
case_145();
break;
case 148:
case_148();
break;
case 149:
case_149();
break;
case 150:
case_150();
break;
case 151:
#line 1319 "cs-parser.jay"
{
valid_param_mod = ParameterModifierType.All;
}
break;
case 152:
case_152();
break;
case 153:
case_153();
break;
case 154:
#line 1358 "cs-parser.jay"
{
lexer.parsing_generic_declaration = true;
}
break;
case 155:
case_155();
break;
case 156:
#line 1368 "cs-parser.jay"
{
lexer.ConstraintsParsing = true;
}
break;
case 157:
case_157();
break;
case 158:
case_158();
break;
case 159:
case_159();
break;
示例3: case_155
void case_155()
#line 1361 "cs-parser.jay"
{
lexer.parsing_generic_declaration = false;
valid_param_mod = ParameterModifierType.All;
}
示例4: case_283
void case_283()
#line 2174 "cs-parser.jay"
{
if (RootContext.Documentation != null) {
tmpComment = Lexer.consume_doc_comment ();
Lexer.doc_state = XmlCommentState.Allowed;
}
valid_param_mod = ParameterModifierType.All;
}
示例5: case_625
void case_625()
#line 4149 "cs-parser.jay"
{
if (RootContext.Version <= LanguageVersion.ISO_2)
Report.FeatureIsNotAvailable (GetLocation (yyVals[0+yyTop]), "lambda expressions");
valid_param_mod = ParameterModifierType.Ref | ParameterModifierType.Out;
}
示例6: case_110
void case_110()
#line 1027 "cs-parser.jay"
{
lexer.ConstraintsParsing = true;
valid_param_mod = ParameterModifierType.PrimaryConstructor;
push_current_container (new Struct (current_container, (MemberName) yyVals[0+yyTop], (Modifiers) yyVals[-4+yyTop], (Attributes) yyVals[-5+yyTop]), yyVals[-3+yyTop]);
lbag.AddMember (current_container, GetModifierLocations (), GetLocation (yyVals[-2+yyTop]));
}
示例7: case_274
void case_274()
#line 2276 "cs-parser.jay"
{
valid_param_mod = 0;
current_local_parameters = (ParametersCompiled) yyVals[-1+yyTop];
var lt = (LocatedToken) yyVals[-4+yyTop];
var mods = (Modifiers) yyVals[-5+yyTop];
var c = new Constructor (current_type, lt.Value, mods, (Attributes) yyVals[-6+yyTop], current_local_parameters, lt.Location);
if (lt.Value != current_container.MemberName.Name) {
report.Error (1520, c.Location, "Class, struct, or interface method must have a return type");
} else if ((mods & Modifiers.STATIC) != 0) {
if ((mods & Modifiers.AccessibilityMask) != 0){
report.Error (515, c.Location,
"`{0}': static constructor cannot have an access modifier",
c.GetSignatureForError ());
}
}
current_type.AddConstructor (c);
lbag.AddMember (c, GetModifierLocations (), GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop]));
yyVal = c;
/**/
/* start block here, so possible anonymous methods inside*/
/* constructor initializer can get correct parent block*/
/**/
start_block (lexer.Location);
}
void case_275()
#line 2305 "cs-parser.jay"
{
if (yyVals[0+yyTop] != null) {
var c = (Constructor) yyVals[-1+yyTop];
c.Initializer = (ConstructorInitializer) yyVals[0+yyTop];
if (c.IsStatic) {
report.Error (514, c.Location,
"`{0}': static constructor cannot have an explicit `this' or `base' constructor call",
c.GetSignatureForError ());
}
}
yyVal = yyVals[-1+yyTop];
}
void case_281()
#line 2337 "cs-parser.jay"
{
--lexer.parsing_block;
yyVal = new ConstructorBaseInitializer ((Arguments) yyVals[-1+yyTop], GetLocation (yyVals[-4+yyTop]));
lbag.AddLocation (yyVal, GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[0+yyTop]));
}
void case_283()
#line 2347 "cs-parser.jay"
{
--lexer.parsing_block;
yyVal = new ConstructorThisInitializer ((Arguments) yyVals[-1+yyTop], GetLocation (yyVals[-4+yyTop]));
lbag.AddLocation (yyVal, GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[0+yyTop]));
}
void case_284()
#line 2353 "cs-parser.jay"
{
Error_SyntaxError (yyToken);
yyVal = new ConstructorThisInitializer (null, GetLocation (yyVals[0+yyTop]));
lbag.AddLocation (yyVal, GetLocation (yyVals[-1+yyTop]));
}
void case_285()
#line 2359 "cs-parser.jay"
{
Error_SyntaxError (yyToken);
yyVal = null;
}
void case_286()
#line 2367 "cs-parser.jay"
{
if (doc_support) {
tmpComment = Lexer.consume_doc_comment ();
Lexer.doc_state = XmlCommentState.NotAllowed;
}
current_local_parameters = ParametersCompiled.EmptyReadOnlyParameters;
}
void case_287()
#line 2376 "cs-parser.jay"
{
var lt = (LocatedToken) yyVals[-3+yyTop];
if (lt.Value != current_container.MemberName.Name){
report.Error (574, lt.Location, "Name of destructor must match name of class");
} else if (current_container.Kind != MemberKind.Class){
report.Error (575, lt.Location, "Only class types can contain destructor");
}
//.........这里部分代码省略.........
示例8: case_555
void case_555()
#line 4018 "cs-parser.jay"
{
valid_param_mod = 0;
yyVal = yyVals[-1+yyTop];
savedOpenLocation = GetLocation (yyVals[-3+yyTop]);
savedCloseLocation = GetLocation (yyVals[-2+yyTop]);
}
示例9: case_201
void case_201()
#line 1801 "cs-parser.jay"
{
valid_param_mod = 0;
var type = (FullNamedExpression) yyVals[-5+yyTop];
Indexer indexer = new Indexer (current_type, type, (MemberName) yyVals[-4+yyTop], (Modifiers) yyVals[-6+yyTop], (ParametersCompiled) yyVals[-1+yyTop], (Attributes) yyVals[-7+yyTop]);
current_property = indexer;
current_type.AddIndexer (indexer);
lbag.AddMember (current_property, GetModifierLocations (), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[0+yyTop]));
if (type.Type != null && type.Type.Kind == MemberKind.Void)
report.Error (620, GetLocation (yyVals[-5+yyTop]), "`{0}': indexer return type cannot be `void'", indexer.GetSignatureForError ());
if (indexer.ParameterInfo.IsEmpty) {
report.Error (1551, GetLocation (yyVals[-3+yyTop]), "Indexers must have at least one parameter");
}
if (doc_support) {
tmpComment = Lexer.consume_doc_comment ();
Lexer.doc_state = XmlCommentState.Allowed;
}
lexer.PropertyParsing = true;
}
示例10: case_269
void case_269()
#line 2215 "cs-parser.jay"
{
valid_param_mod = 0;
Location loc = GetLocation (yyVals[-5+yyTop]);
current_local_parameters = (ParametersCompiled)yyVals[-1+yyTop];
if (current_local_parameters.Count != 1) {
report.Error (1535, loc, "Overloaded unary operator `explicit' takes one parameter");
}
if (doc_support) {
tmpComment = Lexer.consume_doc_comment ();
Lexer.doc_state = XmlCommentState.NotAllowed;
}
yyVal = new OperatorDeclaration (Operator.OpType.Explicit, (FullNamedExpression) yyVals[-4+yyTop], loc);
lbag.AddLocation (yyVal, GetLocation (yyVals[-6+yyTop]), GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[0+yyTop]));
}
示例11: case_341
void case_341()
#line 2634 "cs-parser.jay"
{
valid_param_mod = 0;
MemberName name = MakeName ((MemberName) yyVals[-4+yyTop]);
ParametersCompiled p = (ParametersCompiled) yyVals[-1+yyTop];
Delegate del = new Delegate (current_namespace, current_class, (FullNamedExpression) yyVals[-5+yyTop],
(Modifiers) yyVals[-7+yyTop], name, p, (Attributes) yyVals[-8+yyTop]);
ubag.AddTypeDeclaration (del);
if (RootContext.Documentation != null) {
del.DocComment = Lexer.consume_doc_comment ();
Lexer.doc_state = XmlCommentState.Allowed;
}
current_container.AddDelegate (del);
current_delegate = del;
lexer.ConstraintsParsing = true;
}
示例12: case_550
void case_550()
#line 3772 "cs-parser.jay"
{
valid_param_mod = 0;
yyVal = yyVals[-1+yyTop];
}
示例13: case_284
void case_284()
#line 2183 "cs-parser.jay"
{
valid_param_mod = 0;
current_local_parameters = (ParametersCompiled) yyVals[-1+yyTop];
/**/
/* start block here, so possible anonymous methods inside*/
/* constructor initializer can get correct parent block*/
/**/
start_block (lexer.Location);
}
void case_285()
#line 2194 "cs-parser.jay"
{
var lt = (Tokenizer.LocatedToken) yyVals[-6+yyTop];
var mods = (Modifiers) yyVals[-7+yyTop];
ConstructorInitializer ci = (ConstructorInitializer) yyVals[0+yyTop];
Constructor c = new Constructor (current_class, lt.Value, mods,
(Attributes) yyVals[-8+yyTop], current_local_parameters, ci, lt.Location);
if (lt.Value != current_container.MemberName.Name) {
Report.Error (1520, c.Location, "Class, struct, or interface method must have a return type");
} else if ((mods & Modifiers.STATIC) != 0) {
if ((mods & Modifiers.AccessibilityMask) != 0){
Report.Error (515, c.Location,
"`{0}': static constructor cannot have an access modifier",
c.GetSignatureForError ());
}
if (ci != null) {
Report.Error (514, c.Location,
"`{0}': static constructor cannot have an explicit `this' or `base' constructor call",
c.GetSignatureForError ());
}
}
lbag.AddMember (c, GetModifierLocations (), GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-2+yyTop]));
yyVal = c;
}
void case_291()
#line 2239 "cs-parser.jay"
{
--lexer.parsing_block;
yyVal = new ConstructorBaseInitializer ((Arguments) yyVals[-1+yyTop], GetLocation (yyVals[-4+yyTop]));
lbag.AddLocation (yyVal, GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[0+yyTop]));
}
void case_293()
#line 2249 "cs-parser.jay"
{
--lexer.parsing_block;
yyVal = new ConstructorThisInitializer ((Arguments) yyVals[-1+yyTop], GetLocation (yyVals[-4+yyTop]));
lbag.AddLocation (yyVal, GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[0+yyTop]));
}
void case_294()
#line 2255 "cs-parser.jay"
{
Error_SyntaxError (yyToken);
yyVal = null;
}
void case_295()
#line 2263 "cs-parser.jay"
{
if (RootContext.Documentation != null) {
tmpComment = Lexer.consume_doc_comment ();
Lexer.doc_state = XmlCommentState.NotAllowed;
}
current_local_parameters = ParametersCompiled.EmptyReadOnlyParameters;
}
void case_296()
#line 2272 "cs-parser.jay"
{
var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop];
if (lt.Value != current_container.MemberName.Name){
Report.Error (574, lt.Location, "Name of destructor must match name of class");
} else if (current_container.Kind != MemberKind.Class){
Report.Error (575, lt.Location, "Only class types can contain destructor");
}
Destructor d = new Destructor (current_class, (Modifiers) yyVals[-6+yyTop],
ParametersCompiled.EmptyReadOnlyParameters, (Attributes) yyVals[-7+yyTop], lt.Location);
if (RootContext.Documentation != null)
d.DocComment = ConsumeStoredComment ();
d.Block = (ToplevelBlock) yyVals[0+yyTop];
current_container.AddMethod (d);
lbag.AddMember (d, GetModifierLocations (), GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[-1+yyTop]));
current_local_parameters = null;
}
void case_297()
//.........这里部分代码省略.........
示例14: case_211
void case_211()
#line 1738 "cs-parser.jay"
{
valid_param_mod = 0;
Indexer indexer = new Indexer (current_class, (FullNamedExpression) yyVals[-6+yyTop],
(MemberName)yyVals[-5+yyTop], (Modifiers) yyVals[-7+yyTop], (ParametersCompiled) yyVals[-2+yyTop], (Attributes) yyVals[-8+yyTop]);
current_property = indexer;
current_container.AddIndexer (indexer);
lbag.AddMember (current_property, GetModifierLocations (), GetLocation (yyVals[-4+yyTop]), GetLocation (yyVals[-1+yyTop]), GetLocation (yyVals[0+yyTop]));
if (indexer.TypeExpression.Type == TypeManager.void_type)
Report.Error (620, GetLocation (yyVals[-6+yyTop]), "`{0}': indexer return type cannot be `void'", indexer.GetSignatureForError ());
if (indexer.Parameters.IsEmpty) {
Report.Error (1551, GetLocation (yyVals[-4+yyTop]), "Indexers must have at least one parameter");
}
if (RootContext.Documentation != null) {
tmpComment = Lexer.consume_doc_comment ();
Lexer.doc_state = XmlCommentState.Allowed;
}
lexer.PropertyParsing = true;
}
示例15: case_169
void case_169()
#line 1328 "cs-parser.jay"
{
lexer.ConstraintsParsing = false;
valid_param_mod = 0;
MemberName name = (MemberName) yyVals[-6+yyTop];
current_local_parameters = (ParametersCompiled) yyVals[-3+yyTop];
if (yyVals[-1+yyTop] != null && name.TypeArguments == null)
Report.Error (80, lexer.Location,
"Constraints are not allowed on non-generic declarations");
Method method;
GenericMethod generic = null;
if (name.TypeArguments != null) {
generic = new GenericMethod (current_namespace, current_class, name,
new TypeExpression (TypeManager.void_type, GetLocation (yyVals[-7+yyTop])),
current_local_parameters);
generic.SetParameterInfo ((List<Constraints>) yyVals[0+yyTop]);
}
var modifiers = (Modifiers) yyVals[-9+yyTop];
const Modifiers invalid_partial_mod = Modifiers.AccessibilityMask | Modifiers.ABSTRACT | Modifiers.EXTERN |
Modifiers.NEW | Modifiers.OVERRIDE | Modifiers.SEALED | Modifiers.VIRTUAL;
if ((modifiers & invalid_partial_mod) != 0) {
Report.Error (750, name.Location, "A partial method cannot define access modifier or " +
"any of abstract, extern, new, override, sealed, or virtual modifiers");
modifiers &= ~invalid_partial_mod;
}
if ((current_class.ModFlags & Modifiers.PARTIAL) == 0) {
Report.Error (751, name.Location, "A partial method must be declared within a " +
"partial class or partial struct");
}
modifiers |= Modifiers.PARTIAL | Modifiers.PRIVATE;
method = new Method (current_class, generic, new TypeExpression (TypeManager.void_type, GetLocation (yyVals[-7+yyTop])),
modifiers, name, current_local_parameters, (Attributes) yyVals[-10+yyTop]);
if (RootContext.Documentation != null)
method.DocComment = Lexer.consume_doc_comment ();
/* TODO: lbag, push void*/
StoreModifierLocation (Modifiers.PARTIAL, GetLocation (yyVals[-8+yyTop]));
lbag.AddMember (method, GetModifierLocations (), GetLocation (yyVals[-5+yyTop]), GetLocation (yyVals[-2+yyTop]));
yyVal = method;
}