本文整理汇总了C#中Mono.CSharp.StackAlloc类的典型用法代码示例。如果您正苦于以下问题:C# StackAlloc类的具体用法?C# StackAlloc怎么用?C# StackAlloc使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StackAlloc类属于Mono.CSharp命名空间,在下文中一共展示了StackAlloc类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: case_824
void case_824()
#line 5519 "cs-parser.jay"
{
report.Error (1575, GetLocation (yyVals[-1+yyTop]), "A stackalloc expression requires [] after type");
yyVal = new StackAlloc ((Expression) yyVals[0+yyTop], null, GetLocation (yyVals[-1+yyTop]));
}
示例2: Visit
public override object Visit (StackAlloc stackAllocExpression)
{
var result = new StackAllocExpression ();
var location = LocationsBag.GetLocations (stackAllocExpression);
if (location != null)
result.AddChild (new CSharpTokenNode (Convert (location[0]), "stackalloc".Length), StackAllocExpression.StackAllocKeywordRole);
result.AddChild ((INode)stackAllocExpression.TypeExpression.Accept (this), StackAllocExpression.Roles.ReturnType);
if (location != null)
result.AddChild (new CSharpTokenNode (Convert (location[1]), 1), StackAllocExpression.Roles.LBracket);
result.AddChild ((INode)stackAllocExpression.CountExpression.Accept (this), StackAllocExpression.Roles.Expression);
if (location != null)
result.AddChild (new CSharpTokenNode (Convert (location[2]), 1), StackAllocExpression.Roles.RBracket);
return result;
}
示例3: Visit
public virtual object Visit (StackAlloc stackAllocExpression)
{
return null;
}
示例4: case_823
void case_823()
#line 5514 "cs-parser.jay"
{
yyVal = new StackAlloc ((Expression) yyVals[-3+yyTop], (Expression) yyVals[-1+yyTop], GetLocation (yyVals[-4+yyTop]));
lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop]));
}
示例5: Visit
public override object Visit (StackAlloc stackAllocExpression)
{
var result = new StackAllocExpression ();
var location = LocationsBag.GetLocations (stackAllocExpression);
if (location != null)
result.AddChild (new CSharpTokenNode (Convert (location[0]), "stackalloc".Length), StackAllocExpression.Roles.Keyword);
result.AddChild (ConvertToType (stackAllocExpression.TypeExpression), StackAllocExpression.Roles.Type);
if (location != null && location.Count > 1)
result.AddChild (new CSharpTokenNode (Convert (location[1]), 1), StackAllocExpression.Roles.LBracket);
result.AddChild ((MonoDevelop.CSharp.Ast.Expression)stackAllocExpression.CountExpression.Accept (this), StackAllocExpression.Roles.Expression);
if (location != null && location.Count > 2)
result.AddChild (new CSharpTokenNode (Convert (location[2]), 1), StackAllocExpression.Roles.RBracket);
return result;
}
示例6: yyparse
//.........这里部分代码省略.........
variables_bucket.Add (yyVals[0+yyTop]);
yyVal = variables_bucket;
}
break;
case 143:
#line 1169 "cs-parser.jay"
{
var decls = (List<object>) yyVals[-2+yyTop];
decls.Add (yyVals[0+yyTop]);
yyVal = yyVals[-2+yyTop];
}
break;
case 144:
#line 1178 "cs-parser.jay"
{
yyVal = new VariableDeclaration ((Tokenizer.LocatedToken) yyVals[-2+yyTop], (Expression) yyVals[0+yyTop]);
}
break;
case 145:
#line 1182 "cs-parser.jay"
{
yyVal = new VariableDeclaration ((Tokenizer.LocatedToken) yyVals[0+yyTop], null);
}
break;
case 146:
#line 1186 "cs-parser.jay"
{
yyVal = null;
}
break;
case 149:
#line 1195 "cs-parser.jay"
{
yyVal = new StackAlloc ((Expression) yyVals[-3+yyTop], (Expression) yyVals[-1+yyTop], GetLocation (yyVals[-4+yyTop]));
}
break;
case 150:
#line 1199 "cs-parser.jay"
{
yyVal = new ArglistAccess (GetLocation (yyVals[0+yyTop]));
}
break;
case 151:
#line 1203 "cs-parser.jay"
{
Report.Error (1575, GetLocation (yyVals[-1+yyTop]), "A stackalloc expression requires [] after type");
yyVal = new StackAlloc ((Expression) yyVals[0+yyTop], null, GetLocation (yyVals[-1+yyTop]));
}
break;
case 152:
#line 1211 "cs-parser.jay"
{
variables_bucket.Clear ();
if (yyVals[0+yyTop] != null)
variables_bucket.Add (yyVals[0+yyTop]);
yyVal = variables_bucket;
}
break;
case 153:
#line 1218 "cs-parser.jay"
{
var decls = (List<object>) yyVals[-2+yyTop];
decls.Add (yyVals[0+yyTop]);
yyVal = yyVals[-2+yyTop];
}
break;
示例7: case_772
void case_772()
{
report.Error (1575, GetLocation (yyVals[-1+yyTop]), "A stackalloc expression requires [] after type");
yyVal = new StackAlloc ((Expression) yyVals[0+yyTop], null, GetLocation (yyVals[-1+yyTop]));
}
示例8: case_771
void case_771()
{
yyVal = new StackAlloc ((Expression) yyVals[-3+yyTop], (Expression) yyVals[-1+yyTop], GetLocation (yyVals[-4+yyTop]));
lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop]));
}
示例9: yyparse
//.........这里部分代码省略.........
var li = new LocalVariable (current_variable.Variable, lt.Value, lt.Location);
var d = new BlockVariableDeclaration.Declarator (li, (Expression) yyVals[0+yyTop]);
current_variable.AddDeclarator (d);
current_block.AddLocalName (li);
lbag.AddLocation (d, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop]));
}
break;
case 784:
#line 5292 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
report.Error (145, lexer.Location, "A const field requires a value to be provided");
}
break;
case 785:
#line 5296 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
current_variable.Initializer = (Expression) yyVals[0+yyTop];
}
break;
case 790:
#line 5313 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop];
var li = new LocalVariable (current_block, lt.Value, LocalVariable.Flags.Constant, lt.Location);
var d = new BlockVariableDeclaration.Declarator (li, (Expression) yyVals[0+yyTop]);
current_variable.AddDeclarator (d);
current_block.AddLocalName (li);
lbag.AddLocation (d, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop]));
}
break;
case 792:
#line 5326 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
yyVal = new StackAlloc ((Expression) yyVals[-3+yyTop], (Expression) yyVals[-1+yyTop], GetLocation (yyVals[-4+yyTop]));
lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop]));
}
break;
case 793:
#line 5331 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
report.Error (1575, GetLocation (yyVals[-1+yyTop]), "A stackalloc expression requires [] after type");
yyVal = new StackAlloc ((Expression) yyVals[0+yyTop], null, GetLocation (yyVals[-1+yyTop]));
}
break;
case 794:
#line 5339 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
yyVal = yyVals[-1+yyTop];
lbag.AddStatement (yyVal, GetLocation (yyVals[0+yyTop]));
}
break;
case 795:
#line 5343 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{ yyVal = yyVals[-1+yyTop]; }
break;
case 796:
#line 5347 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{ yyVal = yyVals[-1+yyTop]; }
break;
case 797:
#line 5348 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{ yyVal = yyVals[-1+yyTop]; }
break;
case 798:
#line 5357 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
示例10: case_763
void case_763()
#line 4849 "C:\Projects\Junk\mono\mcs\class\Mono.CSharp\..\..\mcs\cs-parser.jay"
{
Report.Error (1575, GetLocation (yyVals[-1+yyTop]), "A stackalloc expression requires [] after type");
yyVal = new StackAlloc ((Expression) yyVals[0+yyTop], null, GetLocation (yyVals[-1+yyTop]));
}
示例11: case_762
void case_762()
#line 4844 "C:\Projects\Junk\mono\mcs\class\Mono.CSharp\..\..\mcs\cs-parser.jay"
{
yyVal = new StackAlloc ((Expression) yyVals[-3+yyTop], (Expression) yyVals[-1+yyTop], GetLocation (yyVals[-4+yyTop]));
lbag.AddLocation (yyVal, GetLocation (yyVals[-2+yyTop]), GetLocation (yyVals[0+yyTop]));
}