本文整理汇总了C#中UnsafeStatement类的典型用法代码示例。如果您正苦于以下问题:C# UnsafeStatement类的具体用法?C# UnsafeStatement怎么用?C# UnsafeStatement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UnsafeStatement类属于命名空间,在下文中一共展示了UnsafeStatement类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: VisitUnsafeStatement
public virtual void VisitUnsafeStatement(UnsafeStatement unsafeStatement)
{
if (this.ThrowException)
{
throw (Exception)this.CreateException(unsafeStatement);
}
}
开发者ID:fabriciomurta,项目名称:BridgeUnified,代码行数:7,代码来源:Visitor.Exception.cs
示例2: VisitUnsafeStatement
public override void VisitUnsafeStatement(UnsafeStatement unsafeStatement) {
throw new InvalidOperationException("unsafe statement is not supported"); // Should be caught during the compilation step.
}
开发者ID:chenxustu1,项目名称:SaltarelleCompiler,代码行数:3,代码来源:StatementCompiler.cs
示例3: VisitUnsafeStatement
public StringBuilder VisitUnsafeStatement(UnsafeStatement unsafeStatement, int data)
{
throw new SLSharpException("SL# does not allow unsafe code.");
}
开发者ID:hach-que,项目名称:SLSharp,代码行数:4,代码来源:VisitorBase.Illegal.cs
示例4: VisitUnsafeStatement
public override void VisitUnsafeStatement(UnsafeStatement unsafeStatement)
{
FixEmbeddedStatment(policy.StatementBraceStyle, BraceForcement.DoNotChange, unsafeStatement.Body);
}
开发者ID:txdv,项目名称:monodevelop,代码行数:4,代码来源:AstFormattingVisitor.cs
示例5: VisitUnsafeStatement
public sealed override object VisitUnsafeStatement(UnsafeStatement unsafeStatement, object data) {
BeginVisit(unsafeStatement);
object result = TrackedVisitUnsafeStatement(unsafeStatement, data);
EndVisit(unsafeStatement);
return result;
}
开发者ID:mgagne-atman,项目名称:Projects,代码行数:6,代码来源:NodeTrackingAstVisitor.cs
示例6: Process_Unsafe_Statement
private void Process_Unsafe_Statement(StringBuilder sb, UnsafeStatement statement)
{
sb.Append("unsafe");
sb.Append(ProcessStatement(statement.Statement));
}
开发者ID:uQr,项目名称:Visual-NHibernate,代码行数:5,代码来源:CSharpCodeFormatter.cs
示例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);
}
开发者ID:mgagne-atman,项目名称:Projects,代码行数:5,代码来源:AbstractASTVisitor.cs
示例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;
}
开发者ID:pgoron,项目名称:monodevelop,代码行数:7,代码来源:CSharpParser.cs
示例9: VisitUnsafeStatement
public void VisitUnsafeStatement(UnsafeStatement node)
{
NotSupported(node);
}
开发者ID:evanw,项目名称:minisharp,代码行数:4,代码来源:Lower.cs
示例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();
}
开发者ID:CompilerKit,项目名称:CodeWalk,代码行数:10,代码来源:AstCsToJson.cs
示例11: VisitUnsafeStatement
public virtual object VisitUnsafeStatement(UnsafeStatement unsafeStatement, object data) {
throw new global::System.NotImplementedException("UnsafeStatement");
}
开发者ID:mgagne-atman,项目名称:Projects,代码行数:3,代码来源:NotImplementedAstVisitor.cs
示例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);
}
}
开发者ID:KnowNo,项目名称:test-code-backup,代码行数:101,代码来源:Parser.cs
示例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;
}
开发者ID:mgagne-atman,项目名称:Projects,代码行数:8,代码来源:AbstractAstTransformer.cs
示例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;
}
开发者ID:0xb1dd1e,项目名称:NRefactory,代码行数:8,代码来源:CSharpParser.cs
示例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;
}
}
开发者ID:mgagne-atman,项目名称:Projects,代码行数:101,代码来源:Parser.cs
示例16: VisitUnsafeStatement
public virtual void VisitUnsafeStatement (UnsafeStatement unsafeStatement)
{
VisitChildren (unsafeStatement);
}
开发者ID:modulexcite,项目名称:ICSharpCode.Decompiler-retired,代码行数:4,代码来源:DepthFirstAstVisitor.cs
示例17: VisitUnsafeStatement
public virtual void VisitUnsafeStatement(UnsafeStatement unsafeStatement)
{
DebugExpression(unsafeStatement);
StartNode(unsafeStatement);
WriteKeyword(UnsafeStatement.UnsafeKeywordRole);
unsafeStatement.Body.AcceptVisitor(this);
EndNode(unsafeStatement);
}
开发者ID:0xd4d,项目名称:NRefactory,代码行数:8,代码来源:CSharpOutputVisitor.cs
示例18: VisitUnsafeStatement
public void VisitUnsafeStatement(UnsafeStatement unsafeStatement)
{
StartNode(unsafeStatement);
WriteKeyword(UnsafeStatement.UnsafeKeywordRole);
unsafeStatement.Body.AcceptVisitor(this);
EndNode(unsafeStatement);
}
开发者ID:x-strong,项目名称:ILSpy,代码行数:7,代码来源:CSharpOutputVisitor.cs
示例19: TrackedVisitUnsafeStatement
public virtual object TrackedVisitUnsafeStatement(UnsafeStatement unsafeStatement, object data) {
return base.VisitUnsafeStatement(unsafeStatement, data);
}
开发者ID:mgagne-atman,项目名称:Projects,代码行数:3,代码来源:NodeTrackingAstVisitor.cs
注:本文中的UnsafeStatement类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论