本文整理汇总了C#中Mono.CSharp.Lock类的典型用法代码示例。如果您正苦于以下问题:C# Lock类的具体用法?C# Lock怎么用?C# Lock使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Lock类属于Mono.CSharp命名空间,在下文中一共展示了Lock类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Visit
public override object Visit (Lock lockStatement)
{
var result = new LockStatement ();
var location = LocationsBag.GetLocations (lockStatement);
result.AddChild (new CSharpTokenNode (Convert (lockStatement.loc), "lock".Length), LockStatement.Roles.Keyword);
if (location != null)
result.AddChild (new CSharpTokenNode (Convert (location[0]), 1), LockStatement.Roles.LPar);
result.AddChild ((INode)lockStatement.Expr.Accept (this), LockStatement.Roles.Expression);
if (location != null)
result.AddChild (new CSharpTokenNode (Convert (location[1]), 1), LockStatement.Roles.RPar);
result.AddChild ((INode)lockStatement.Statement.Accept (this), LockStatement.Roles.EmbeddedStatement);
return result;
}
示例2: case_929
void case_929()
#line 6221 "cs-parser.jay"
{
Error_SyntaxError (yyToken);
yyVal = new Lock ((Expression) yyVals[-1+yyTop], null, GetLocation (yyVals[-3+yyTop]));
lbag.AddStatement (yyVal, GetLocation (yyVals[-2+yyTop]));
}
示例3: Visit
public override object Visit(Lock lockStatement)
{
var result = new LockStatement();
var location = LocationsBag.GetLocations(lockStatement);
result.AddChild(new CSharpTokenNode(Convert(lockStatement.loc), LockStatement.LockKeywordRole), LockStatement.LockKeywordRole);
if (location != null)
result.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);
if (lockStatement.Expr != null)
result.AddChild((Expression)lockStatement.Expr.Accept(this), Roles.Expression);
if (location != null && location.Count > 1)
result.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);
if (lockStatement.Statement != null)
result.AddChild((Statement)lockStatement.Statement.Accept(this), Roles.EmbeddedStatement);
return result;
}
示例4: case_928
void case_928()
#line 6213 "cs-parser.jay"
{
if (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE)
Warning_EmptyStatement (GetLocation (yyVals[0+yyTop]));
yyVal = new Lock ((Expression) yyVals[-2+yyTop], (Statement) yyVals[0+yyTop], GetLocation (yyVals[-4+yyTop]));
lbag.AddStatement (yyVal, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop]));
}
示例5: Visit
public virtual object Visit (Lock lockStatement)
{
return null;
}
示例6: case_878
void case_878()
{
Error_SyntaxError (yyToken);
yyVal = new Lock ((Expression) yyVals[-1+yyTop], null, GetLocation (yyVals[-3+yyTop]));
lbag.AddStatement (yyVal, GetLocation (yyVals[-2+yyTop]));
}
示例7: yyparse
//.........这里部分代码省略.........
}
break;
case 872:
#line 5830 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
yyVal = new Checked ((Block) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop]));
}
break;
case 873:
#line 5837 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
yyVal = new Unchecked ((Block) yyVals[0+yyTop], GetLocation (yyVals[-1+yyTop]));
}
break;
case 874:
#line 5844 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
if (!settings.Unsafe)
Error_UnsafeCodeNotAllowed (GetLocation (yyVals[0+yyTop]));
}
break;
case 875:
#line 5847 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
yyVal = new Unsafe ((Block) yyVals[0+yyTop], GetLocation (yyVals[-2+yyTop]));
}
break;
case 876:
#line 5854 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
if (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE)
Warning_EmptyStatement (GetLocation (yyVals[0+yyTop]));
yyVal = new Lock ((Expression) yyVals[-2+yyTop], (Statement) yyVals[0+yyTop], GetLocation (yyVals[-4+yyTop]));
lbag.AddStatement (yyVal, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop]));
}
break;
case 877:
#line 5865 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
start_block (GetLocation (yyVals[-2+yyTop]));
current_block.IsCompilerGenerated = true;
var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop];
var li = new LocalVariable (current_block, lt.Value, LocalVariable.Flags.FixedVariable | LocalVariable.Flags.Used, lt.Location);
current_block.AddLocalName (li);
current_variable = new Fixed.VariableDeclaration ((FullNamedExpression) yyVals[-1+yyTop], li);
}
break;
case 878:
#line 5875 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
yyVal = current_variable;
current_variable = null;
}
break;
case 879:
#line 5880 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
if (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE)
Warning_EmptyStatement (GetLocation (yyVals[0+yyTop]));
Fixed f = new Fixed ((Fixed.VariableDeclaration) yyVals[-1+yyTop], (Statement) yyVals[0+yyTop], GetLocation (yyVals[-9+yyTop]));
current_block.AddStatement (f);
yyVal = end_block (GetLocation (yyVals[-2+yyTop]));
}
示例8: case_846
void case_846()
#line 5372 "C:\Projects\Junk\mono\mcs\class\Mono.CSharp\..\..\mcs\cs-parser.jay"
{
if (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE)
Warning_EmptyStatement (GetLocation (yyVals[0+yyTop]));
yyVal = new Lock ((Expression) yyVals[-2+yyTop], (Statement) yyVals[0+yyTop], GetLocation (yyVals[-4+yyTop]));
lbag.AddStatement (yyVal, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop]));
}