本文整理汇总了C#中JavaCompiler.Compilation.ByteCode.ByteCodeGenerator.Branch方法的典型用法代码示例。如果您正苦于以下问题:C# ByteCodeGenerator.Branch方法的具体用法?C# ByteCodeGenerator.Branch怎么用?C# ByteCodeGenerator.Branch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JavaCompiler.Compilation.ByteCode.ByteCodeGenerator
的用法示例。
在下文中一共展示了ByteCodeGenerator.Branch方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Compile
public Item Compile(ByteCodeGenerator generator)
{
Chain thenExit = null;
var item = new ConditionCompiler(node.Condition).Compile(generator);
var elseChain = item.JumpFalse();
Item x = null;
if (!item.IsFalse())
{
generator.ResolveChain(item.TrueJumps);
x = new ExpressionCompiler(node.ThenExpression).Compile(generator).Load();
thenExit = generator.Branch([email protected]);
}
if (elseChain != null)
{
generator.ResolveChain(elseChain);
x = new ExpressionCompiler(node.ElseExpression).Compile(generator).Load();
}
generator.ResolveChain(thenExit);
//var type = tb.Type.FindCommonType(fb.Type);
var type = x.Type;
return new StackItem(generator, type);
}
示例2: Compile
public void Compile(ByteCodeGenerator generator)
{
var item = new ConditionCompiler(node.Condition).Compile(generator);
var elseChain = item.JumpFalse();
Chain thenExit = null;
if (!item.IsFalse())
{
generator.ResolveChain(item.TrueJumps);
generator.PushScope();
new StatementCompiler(node.TrueBranch).Compile(generator);
thenExit = generator.Branch([email protected]);
generator.PopScope();
}
if (elseChain != null)
{
generator.ResolveChain(elseChain);
if (node.FalseBranch != null)
{
generator.PushScope();
new StatementCompiler(node.FalseBranch).Compile(generator);
generator.PopScope();
}
}
generator.ResolveChain(thenExit);
}
示例3: Compile
public void Compile(ByteCodeGenerator generator)
{
var start = generator.EntryPoint();
// Test Condition
var item = new ConditionCompiler(node.Expression).Compile(generator);
var loopDone = item.JumpFalse();
generator.ResolveChain(item.TrueJumps);
// Run Body
generator.PushScope();
new StatementCompiler(node.Statement).Compile(generator);
generator.ResolveChain(generator.Branch([email protected]), start);
generator.PopScope();
// End
generator.ResolveChain(loopDone);
}
示例4: Compile
public void Compile(ByteCodeGenerator generator)
{
generator.PushScope();
var start = generator.CurrentPC();
new StatementCompiler(node.Initialiser).Compile(generator);
var item = new ConditionCompiler(node.Condition).Compile(generator);
var loopDone = item.JumpFalse();
generator.ResolveChain(item.TrueJumps);
new StatementCompiler(node.Body).Compile(generator);
new StatementCompiler(node.Updater).Compile(generator);
generator.ResolveChain(generator.Branch([email protected]), start);
generator.PopScope();
generator.ResolveChain(loopDone);
}