本文整理汇总了C#中Boo.Lang.Compiler.Ast.ReferenceExpression.assign方法的典型用法代码示例。如果您正苦于以下问题:C# ReferenceExpression.assign方法的具体用法?C# ReferenceExpression.assign怎么用?C# ReferenceExpression.assign使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Boo.Lang.Compiler.Ast.ReferenceExpression
的用法示例。
在下文中一共展示了ReferenceExpression.assign方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExpandImpl
//.........这里部分代码省略.........
MacroStatement afterall_macro = findmacro("afterall");
;
MacroStatement onempty_macro = findmacro("onempty");
;
MacroStatement beforeeach_macro = findmacro("beforeeach");
;
MacroStatement aftereach_macro = findmacro("aftereach");
MacroStatement prepare_macro = findmacro("prepare");
;
Block beforeall = extract(beforeall_macro);
Block onitem = extractMainItemBlock(macro, extract, onitem_macro, item, prefix, suffix);
Block onerror = extract(onerror_macro);
Block between = extract(between_macro);
Block afterall = extract(afterall_macro);
Block onempty = null;
bool proceed_on_empty = false;
if (onempty_macro != null && onempty_macro.Arguments.Count != 0 &&
onempty_macro.Arguments[0].ToCodeString() == "proceed"){
proceed_on_empty = true;
}
else{
onempty = extract(onempty_macro);
}
Block beforeeach = extract(beforeeach_macro);
Block aftereach = extract(aftereach_macro);
// _idx = 0
Statement betweener = getBetweener(idx, between);
result.Add(col.assign(new MethodInvocationExpression(new ReferenceExpression("_wrapcollection"), src)));
result.Add(new ReferenceExpression("___proceed").assign(new BoolLiteralExpression(proceed_on_empty)));
var mainblock = new Block();
mainblock.Add(idx.assign(0));
mainblock.Add(new IfStatement(
new BinaryExpression(BinaryOperatorType.Equality, new NullLiteralExpression(), col),
new Block().add(new BinaryExpression(BinaryOperatorType.Assign, col,
new MethodInvocationExpression(
new ReferenceExpression("_wrapcollection"),
new ArrayLiteralExpression()))),
null
));
if (beforeall != null){
mainblock.Add(beforeall);
}
var maincycle = new ForStatement();
maincycle.Iterator = col;
string declname = item.ToCodeString();
TypeReference decltype = null;
if (item is TryCastExpression){
declname = ((TryCastExpression) item).Target.ToCodeString();
decltype = ((TryCastExpression) item).Type;
}
maincycle.Declarations.Add(new Declaration(maincycle.LexicalInfo, declname, decltype));
maincycle.Block = new Block();
maincycle.ThenBlock = afterall;
if (betweener != null){
maincycle.Block.Add(betweener);
}
if (null != prepare_macro){
maincycle.Block.Add(prepare_macro.Body);
}