本文整理汇总了C#中Mono.CSharp.FieldBase类的典型用法代码示例。如果您正苦于以下问题:C# FieldBase类的具体用法?C# FieldBase怎么用?C# FieldBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FieldBase类属于Mono.CSharp命名空间,在下文中一共展示了FieldBase类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ConstInitializer
public ConstInitializer (FieldBase field, Expression value, Location loc)
: base (value)
{
this.loc = loc;
this.field = field;
}
示例2: AddField
public bool AddField (FieldBase field)
{
if (!AddMember (field))
return false;
if (fields == null)
fields = new List<FieldBase> ();
fields.Add (field);
if ((field.ModFlags & Modifiers.STATIC) != 0)
return true;
if (first_nonstatic_field == null) {
first_nonstatic_field = field;
return true;
}
if (Kind == MemberKind.Struct && first_nonstatic_field.Parent != field.Parent) {
Report.SymbolRelatedToPreviousError (first_nonstatic_field.Parent);
Report.Warning (282, 3, field.Location,
"struct instance field `{0}' found in different declaration from instance field `{1}'",
field.GetSignatureForError (), first_nonstatic_field.GetSignatureForError ());
}
return true;
}
示例3: FieldExpr
public FieldExpr(FieldBase fi, Location l)
: this(fi.Spec, l)
{
}
示例4: ConstInitializer
public ConstInitializer(FieldBase field, Expression value)
: base(value)
{
if (value != null)
this.loc = value.Location;
this.field = field;
}
示例5: FieldInitializer
public FieldInitializer(FieldBase field, Expression expression, IMemberContext rc)
: base(new FieldExpr (field, expression.Location), expression, expression.Location)
{
this.rc = rc;
if (!field.IsStatic)
((FieldExpr)target).InstanceExpression = CompilerGeneratedThis.Instance;
}
示例6: GetFieldTypeExpression
public virtual FullNamedExpression GetFieldTypeExpression (FieldBase field)
{
return new TypeExpression (field.MemberType, Name.Location);
}
示例7: FieldInitializer
public FieldInitializer (FieldBase mc, Expression expression, Location loc)
: base (new FieldExpr (mc.Spec, expression.Location), expression, loc)
{
this.mc = mc;
if (!mc.IsStatic)
((FieldExpr)target).InstanceExpression = new CompilerGeneratedThis (mc.CurrentType, expression.Location);
}
示例8: case_124
void case_124()
#line 1124 "cs-parser.jay"
{
if (doc_support) {
current_field.DocComment = Lexer.consume_doc_comment ();
Lexer.doc_state = XmlCommentState.Allowed;
}
lbag.AddMember (current_field, GetModifierLocations (), GetLocation (yyVals[0+yyTop]));
yyVal = current_field;
current_field = null;
}
示例9: case_110
void case_110()
#line 1024 "cs-parser.jay"
{
var lt = (LocatedToken) yyVals[0+yyTop];
var mod = (Modifiers) yyVals[-3+yyTop];
current_field = new Const (current_type, (FullNamedExpression) yyVals[-1+yyTop], mod, new MemberName (lt.Value, lt.Location), (Attributes) yyVals[-4+yyTop]);
current_type.AddMember (current_field);
if ((mod & Modifiers.STATIC) != 0) {
report.Error (504, current_field.Location, "The constant `{0}' cannot be marked static", current_field.GetSignatureForError ());
}
yyVal = current_field;
}
示例10: case_123
void case_123()
#line 1109 "cs-parser.jay"
{
lexer.parsing_generic_declaration = false;
FullNamedExpression type = (FullNamedExpression) yyVals[-1+yyTop];
if (type.Type != null && type.Type.Kind == MemberKind.Void)
report.Error (670, GetLocation (yyVals[-1+yyTop]), "Fields cannot have void type");
var lt = (LocatedToken) yyVals[0+yyTop];
current_field = new Field (current_type, type, (Modifiers) yyVals[-2+yyTop], new MemberName (lt.Value, lt.Location), (Attributes) yyVals[-3+yyTop]);
current_type.AddField (current_field);
yyVal = current_field;
}
示例11: case_136
void case_136()
#line 1094 "C:\Projects\Junk\mono\mcs\class\Mono.CSharp\..\..\mcs\cs-parser.jay"
{
if (lang_version < LanguageVersion.ISO_2)
FeatureIsNotAvailable (GetLocation (yyVals[-2+yyTop]), "fixed size buffers");
var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop];
current_field = new FixedField (current_class, (FullNamedExpression) yyVals[-1+yyTop], (Modifiers) yyVals[-3+yyTop],
new MemberName (lt.Value, lt.Location), (Attributes) yyVals[-4+yyTop]);
current_container.AddField (current_field);
}
示例12: case_138
void case_138()
#line 1109 "cs-parser.jay"
{
if (RootContext.Version < LanguageVersion.ISO_2)
Report.FeatureIsNotAvailable (GetLocation (yyVals[-2+yyTop]), "fixed size buffers");
var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop];
current_field = new FixedField (current_class, (FullNamedExpression) yyVals[-1+yyTop], (Modifiers) yyVals[-3+yyTop],
new MemberName (lt.Value, lt.Location), (Attributes) yyVals[-4+yyTop]);
current_container.AddField (current_field);
}
示例13: case_125
void case_125()
#line 1015 "cs-parser.jay"
{
if (RootContext.Documentation != null) {
current_field.DocComment = Lexer.consume_doc_comment ();
Lexer.doc_state = XmlCommentState.Allowed;
}
current_field.Initializer = (ConstInitializer) yyVals[-2+yyTop];
lbag.AddMember (current_field, GetModifierLocations (), GetLocation (yyVals[-6+yyTop]), GetLocation (yyVals[0+yyTop]));
current_field = null;
}
示例14: case_120
void case_120()
{
if (doc_support) {
current_field.DocComment = Lexer.consume_doc_comment ();
Lexer.doc_state = XmlCommentState.Allowed;
}
current_field.Initializer = (ConstInitializer) yyVals[-2+yyTop];
lbag.AddMember (current_field, mod_locations, GetLocation (yyVals[0+yyTop]));
yyVal = current_field;
current_field = null;
}
示例15: yyparse
/** the generated parser.
Maintains a state and a value stack, currently with fixed maximum size.
@param yyLex scanner.
@return result of the last reduction, if any.
@throws yyException on irrecoverable parse error.
*/
internal Object yyparse (yyParser.yyInput yyLex)
{
if (yyMax <= 0) yyMax = 256; // initial size
int yyState = 0; // state stack ptr
int [] yyStates = new int[yyMax]; // state stack
Object yyVal = null; // value stack ptr
Object [] yyVals = new Object[yyMax]; // value stack
int yyToken = -1; // current input
int yyErrorFlag = 0; // #tks to shift
/*yyLoop:*/ for (int yyTop = 0;; ++ yyTop) {
if (yyTop >= yyStates.Length) { // dynamically increase
int[] i = new int[yyStates.Length+yyMax];
yyStates.CopyTo (i, 0);
yyStates = i;
Object[] o = new Object[yyVals.Length+yyMax];
yyVals.CopyTo (o, 0);
yyVals = o;
}
yyStates[yyTop] = yyState;
yyVals[yyTop] = yyVal;
if (debug != null) debug.push(yyState, yyVal);
/*yyDiscarded:*/ for (;;) { // discarding a token does not change stack
int yyN;
if ((yyN = yyDefRed[yyState]) == 0) { // else [default] reduce (yyN)
if (yyToken < 0) {
yyToken = yyLex.advance() ? yyLex.token() : 0;
if (debug != null)
debug.lex(yyState, yyToken, yyname(yyToken), yyLex.value());
}
if ((yyN = yySindex[yyState]) != 0 && ((yyN += yyToken) >= 0)
&& (yyN < yyTable.Length) && (yyCheck[yyN] == yyToken)) {
if (debug != null)
debug.shift(yyState, yyTable[yyN], yyErrorFlag-1);
yyState = yyTable[yyN]; // shift to yyN
yyVal = yyLex.value();
yyToken = -1;
if (yyErrorFlag > 0) -- yyErrorFlag;
goto continue_yyLoop;
}
if ((yyN = yyRindex[yyState]) != 0 && (yyN += yyToken) >= 0
&& yyN < yyTable.Length && yyCheck[yyN] == yyToken)
yyN = yyTable[yyN]; // reduce (yyN)
else
switch (yyErrorFlag) {
case 0:
yyExpectingState = yyState;
// yyerror(String.Format ("syntax error, got token `{0}'", yyname (yyToken)), yyExpecting(yyState));
if (debug != null) debug.error("syntax error");
if (yyToken == 0 /*eof*/ || yyToken == eof_token) throw new yyParser.yyUnexpectedEof ();
goto case 1;
case 1: case 2:
yyErrorFlag = 3;
do {
if ((yyN = yySindex[yyStates[yyTop]]) != 0
&& (yyN += Token.yyErrorCode) >= 0 && yyN < yyTable.Length
&& yyCheck[yyN] == Token.yyErrorCode) {
if (debug != null)
debug.shift(yyStates[yyTop], yyTable[yyN], 3);
yyState = yyTable[yyN];
yyVal = yyLex.value();
goto continue_yyLoop;
}
if (debug != null) debug.pop(yyStates[yyTop]);
} while (-- yyTop >= 0);
if (debug != null) debug.reject();
throw new yyParser.yyException("irrecoverable syntax error");
case 3:
if (yyToken == 0) {
if (debug != null) debug.reject();
throw new yyParser.yyException("irrecoverable syntax error at end-of-file");
}
if (debug != null)
debug.discard(yyState, yyToken, yyname(yyToken),
yyLex.value());
yyToken = -1;
goto continue_yyDiscarded; // leave stack alone
}
}
int yyV = yyTop + 1-yyLen[yyN];
if (debug != null)
debug.reduce(yyState, yyStates[yyV-1], yyN, YYRules.getRule (yyN), yyLen[yyN]);
yyVal = yyDefault(yyV > yyTop ? null : yyVals[yyV]);
switch (yyN) {
case 1:
#line 391 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
Lexer.check_incorrect_doc_comment ();
}
break;
case 2:
//.........这里部分代码省略.........