本文整理汇总了C#中Mono.CSharp.Statement类的典型用法代码示例。如果您正苦于以下问题:C# Statement类的具体用法?C# Statement怎么用?C# Statement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Statement类属于Mono.CSharp命名空间,在下文中一共展示了Statement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CloneTo
protected override void CloneTo (CloneContext clonectx, Statement t)
{
Catch target = (Catch) t;
if (type_expr != null)
target.type_expr = (FullNamedExpression) type_expr.Clone (clonectx);
target.block = clonectx.LookupBlock (block);
}
示例2: CloneTo
protected override void CloneTo(CloneContext clonectx, Statement target)
{
throw new NotSupportedException ();
}
示例3: Visit
public override object Visit (Statement stmt)
{
Console.WriteLine ("unknown statement:" + stmt);
return null;
}
示例4: Add
public void Add (Statement statement)
{
statements.Add (statement);
}
示例5: RewriteForDeclarators
public Statement RewriteForDeclarators (BlockContext bc, Statement stmt)
{
for (int i = declarators.Count - 1; i >= 0; --i) {
var d = declarators [i];
var vd = new VariableDeclaration (d.Variable, type_expr.Location);
vd.Initializer = d.Initializer;
vd.IsNested = true;
vd.dispose_call = CreateDisposeCall (bc, d.Variable);
vd.dispose_call.Resolve (bc);
stmt = new Using (vd, stmt, d.Variable.Location);
}
declarators = null;
return stmt;
}
示例6: Using
public Using (VariableDeclaration decl, Statement stmt, Location loc)
: base (stmt, loc)
{
this.decl = decl;
}
示例7: ResolveInitializer
protected override Expression ResolveInitializer (BlockContext bc, LocalVariable li, Expression initializer)
{
Assign assign;
if (li.Type == InternalType.Dynamic) {
initializer = initializer.Resolve (bc);
if (initializer == null)
return null;
initializer = Convert.ImplicitConversionRequired (bc, initializer, TypeManager.idisposable_type, loc);
if (initializer == null)
return null;
var var = LocalVariable.CreateCompilerGenerated (TypeManager.idisposable_type, bc.CurrentBlock, loc);
assign = new SimpleAssign (var.CreateReferenceExpression (bc, loc), initializer, loc);
assign.ResolveStatement (bc);
dispose_call = CreateDisposeCall (bc, var);
dispose_call.Resolve (bc);
return assign;
}
if (li == Variable) {
CheckIDiposableConversion (bc, li, initializer);
dispose_call = CreateDisposeCall (bc, li);
dispose_call.Resolve (bc);
}
return base.ResolveInitializer (bc, li, initializer);
}
示例8: TryFinally
public TryFinally (Statement stmt, Block fini, Location loc)
: base (stmt, loc)
{
this.fini = fini;
}
示例9: For
public For (Statement init_statement,
BooleanExpression test,
Statement increment,
Statement statement,
Location l)
{
InitStatement = init_statement;
Test = test;
Increment = increment;
Statement = statement;
loc = l;
}
示例10: StatementList
public StatementList (Statement first, Statement second)
{
statements = new List<Statement> () { first, second };
}
示例11: ArrayForeach
public ArrayForeach (Foreach @foreach, int rank)
{
for_each = @foreach;
statement = for_each.statement;
loc = @foreach.loc;
variable = new LocalVariableReference (for_each.variable, loc);
counter = new StatementExpression[rank];
variables = new TemporaryVariableReference[rank];
length_exprs = new Expression [rank];
//
// Only use temporary length variables when dealing with
// multi-dimensional arrays
//
if (rank > 1)
lengths = new TemporaryVariableReference [rank];
}
示例12: Body
public Body (TypeSpec type, LocalVariable variable,
Expression current, Statement statement,
Location loc)
{
this.type = type;
this.variable = new LocalVariableReference (variable, loc);
this.current = current;
this.statement = statement;
this.loc = loc;
}
示例13: Foreach
public Foreach (Expression type, LocalVariable var, Expression expr, Statement stmt, Location l)
{
this.type = type;
this.variable = var;
this.expr = expr;
statement = stmt;
loc = l;
}
示例14: DynamicEventCompoundAssign
public DynamicEventCompoundAssign(string name, Arguments args, ExpressionStatement assignment, ExpressionStatement invoke, Location loc)
: base(null, args, loc)
{
this.name = name;
base.binder = this;
// Used by += or -= only
type = TypeManager.bool_type;
condition = new If (
new Binary (Binary.Operator.Equality, this, new BoolLiteral (true, loc), loc),
new StatementExpression (invoke), new StatementExpression (assignment),
loc);
}
示例15: CloneTo
protected override void CloneTo (CloneContext clonectx, Statement target)
{
// Nothing to clone
}