本文整理汇总了C#中UnsafeStatement类的典型用法代码示例。如果您正苦于以下问题:C# UnsafeStatement类的具体用法?C# UnsafeStatement怎么用?C# UnsafeStatement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UnsafeStatement类属于命名空间,在下文中一共展示了UnsafeStatement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VisitUnsafeStatement
public virtual void VisitUnsafeStatement(UnsafeStatement unsafeStatement)
{
if (this.ThrowException)
{
throw (Exception)this.CreateException(unsafeStatement);
}
}
示例2: VisitUnsafeStatement
public override void VisitUnsafeStatement(UnsafeStatement unsafeStatement) {
throw new InvalidOperationException("unsafe statement is not supported"); // Should be caught during the compilation step.
}
示例3: VisitUnsafeStatement
public StringBuilder VisitUnsafeStatement(UnsafeStatement unsafeStatement, int data)
{
throw new SLSharpException("SL# does not allow unsafe code.");
}
示例4: VisitUnsafeStatement
public override void VisitUnsafeStatement(UnsafeStatement unsafeStatement)
{
FixEmbeddedStatment(policy.StatementBraceStyle, BraceForcement.DoNotChange, unsafeStatement.Body);
}
示例5: VisitUnsafeStatement
public sealed override object VisitUnsafeStatement(UnsafeStatement unsafeStatement, object data) {
BeginVisit(unsafeStatement);
object result = TrackedVisitUnsafeStatement(unsafeStatement, data);
EndVisit(unsafeStatement);
return result;
}
示例6: Process_Unsafe_Statement
private void Process_Unsafe_Statement(StringBuilder sb, UnsafeStatement statement)
{
sb.Append("unsafe");
sb.Append(ProcessStatement(statement.Statement));
}
示例7: VisitUnsafeStatement
public virtual object VisitUnsafeStatement(UnsafeStatement unsafeStatement, object data) {
Debug.Assert((unsafeStatement != null));
Debug.Assert((unsafeStatement.Block != null));
return unsafeStatement.Block.AcceptVisitor(this, data);
}
示例8: Visit
public override object Visit (Unsafe unsafeStatement)
{
var result = new UnsafeStatement ();
result.AddChild (new CSharpTokenNode (Convert (unsafeStatement.loc), "unsafe".Length), UnsafeStatement.Roles.Keyword);
result.AddChild ((INode)unsafeStatement.Block.Accept (this), UnsafeStatement.Roles.Body);
return result;
}
示例9: VisitUnsafeStatement
public void VisitUnsafeStatement(UnsafeStatement node)
{
NotSupported(node);
}
示例10: VisitUnsafeStatement
public void VisitUnsafeStatement(UnsafeStatement unsafeStatement)
{
JsonObject statement = CreateJsonStatement(unsafeStatement);
AddKeyword(statement, UnsafeStatement.UnsafeKeywordRole);
statement.AddJsonValue("body", GenStatement(unsafeStatement.Body));
Push(statement);
throw new FirstTimeUseException();
}
示例11: VisitUnsafeStatement
public virtual object VisitUnsafeStatement(UnsafeStatement unsafeStatement, object data) {
throw new global::System.NotImplementedException("UnsafeStatement");
}
示例12: EmbeddedStatement
//.........这里部分代码省略.........
statement = new YieldStatement(new ReturnStatement(expr));
}
else if (this.la.kind == 0x34)
{
base.lexer.NextToken();
statement = new YieldStatement(new BreakStatement());
}
else
{
base.SynErr(0xab);
}
base.Expect(11);
}
else if (this.la.kind == 100)
{
base.lexer.NextToken();
if (this.StartOf(5))
{
this.Expr(out expr);
}
base.Expect(11);
statement = new ReturnStatement(expr);
}
else if (this.la.kind == 0x6f)
{
base.lexer.NextToken();
if (this.StartOf(5))
{
this.Expr(out expr);
}
base.Expect(11);
statement = new ThrowStatement(expr);
}
else if (this.StartOf(5))
{
this.StatementExpr(out statement);
base.Expect(11);
}
else if (this.la.kind == 0x71)
{
this.TryStatement(out statement);
}
else if (this.la.kind == 0x55)
{
base.lexer.NextToken();
base.Expect(20);
this.Expr(out expr);
base.Expect(0x15);
this.EmbeddedStatement(out statement2);
statement = new LockStatement(expr, statement2);
}
else if (this.la.kind == 120)
{
ICSharpCode.NRefactory.Parser.AST.Statement stmt = null;
base.lexer.NextToken();
base.Expect(20);
this.ResourceAcquisition(out stmt);
base.Expect(0x15);
this.EmbeddedStatement(out statement2);
statement = new UsingStatement(stmt, statement2);
}
else if (this.la.kind == 0x76)
{
base.lexer.NextToken();
this.Block(out statement2);
statement = new UnsafeStatement(statement2);
}
else if (this.la.kind == 0x49)
{
base.lexer.NextToken();
base.Expect(20);
this.Type(out type);
if (type.PointerNestingLevel == 0)
{
this.Error("can only fix pointer types");
}
List<VariableDeclaration> pointerDeclarators = new List<VariableDeclaration>(1);
base.Expect(1);
string name = this.t.val;
base.Expect(3);
this.Expr(out expr);
pointerDeclarators.Add(new VariableDeclaration(name, expr));
while (this.la.kind == 14)
{
base.lexer.NextToken();
base.Expect(1);
name = this.t.val;
base.Expect(3);
this.Expr(out expr);
pointerDeclarators.Add(new VariableDeclaration(name, expr));
}
base.Expect(0x15);
this.EmbeddedStatement(out statement2);
statement = new FixedStatement(type, pointerDeclarators, statement2);
}
else
{
base.SynErr(0xac);
}
}
示例13: VisitUnsafeStatement
public virtual object VisitUnsafeStatement(UnsafeStatement unsafeStatement, object data) {
Debug.Assert((unsafeStatement != null));
Debug.Assert((unsafeStatement.Block != null));
nodeStack.Push(unsafeStatement.Block);
unsafeStatement.Block.AcceptVisitor(this, data);
unsafeStatement.Block = ((Statement)(nodeStack.Pop()));
return null;
}
示例14: Visit
public override object Visit(Unsafe unsafeStatement)
{
var result = new UnsafeStatement();
result.AddChild(new CSharpTokenNode(Convert(unsafeStatement.loc), UnsafeStatement.UnsafeKeywordRole), UnsafeStatement.UnsafeKeywordRole);
if (unsafeStatement.Block != null)
result.AddChild((BlockStatement)unsafeStatement.Block.Accept(this), Roles.Body);
return result;
}
示例15: EmbeddedStatement
//.........这里部分代码省略.........
lexer.NextToken();
#line 1585 "cs.ATG"
statement = new YieldStatement(new BreakStatement());
} else SynErr(198);
Expect(11);
} else if (la.kind == 101) {
lexer.NextToken();
if (StartOf(6)) {
Expr(
#line 1588 "cs.ATG"
out expr);
}
Expect(11);
#line 1588 "cs.ATG"
statement = new ReturnStatement(expr);
} else if (la.kind == 112) {
lexer.NextToken();
if (StartOf(6)) {
Expr(
#line 1589 "cs.ATG"
out expr);
}
Expect(11);
#line 1589 "cs.ATG"
statement = new ThrowStatement(expr);
} else if (StartOf(6)) {
StatementExpr(
#line 1592 "cs.ATG"
out statement);
while (!(la.kind == 0 || la.kind == 11)) {SynErr(199); lexer.NextToken(); }
Expect(11);
} else if (la.kind == 114) {
TryStatement(
#line 1595 "cs.ATG"
out statement);
} else if (la.kind == 86) {
lexer.NextToken();
Expect(20);
Expr(
#line 1598 "cs.ATG"
out expr);
Expect(21);
EmbeddedStatement(
#line 1599 "cs.ATG"
out embeddedStatement);
#line 1599 "cs.ATG"
statement = new LockStatement(expr, embeddedStatement);
} else if (la.kind == 121) {
#line 1602 "cs.ATG"
Statement resourceAcquisitionStmt = null;
lexer.NextToken();
Expect(20);
ResourceAcquisition(
#line 1604 "cs.ATG"
out resourceAcquisitionStmt);
Expect(21);
EmbeddedStatement(
#line 1605 "cs.ATG"
out embeddedStatement);
#line 1605 "cs.ATG"
statement = new UsingStatement(resourceAcquisitionStmt, embeddedStatement);
} else if (la.kind == 119) {
lexer.NextToken();
Block(
#line 1608 "cs.ATG"
out embeddedStatement);
#line 1608 "cs.ATG"
statement = new UnsafeStatement(embeddedStatement);
} else if (la.kind == 74) {
#line 1610 "cs.ATG"
Statement pointerDeclarationStmt = null;
lexer.NextToken();
Expect(20);
ResourceAcquisition(
#line 1612 "cs.ATG"
out pointerDeclarationStmt);
Expect(21);
EmbeddedStatement(
#line 1613 "cs.ATG"
out embeddedStatement);
#line 1613 "cs.ATG"
statement = new FixedStatement(pointerDeclarationStmt, embeddedStatement);
} else SynErr(200);
#line 1615 "cs.ATG"
if (statement != null) {
statement.StartLocation = startLocation;
statement.EndLocation = t.EndLocation;
}
}