本文整理汇总了C#中JavaCompiler.Compilation.ByteCode.ByteCodeGenerator.PushScope方法的典型用法代码示例。如果您正苦于以下问题:C# ByteCodeGenerator.PushScope方法的具体用法?C# ByteCodeGenerator.PushScope怎么用?C# ByteCodeGenerator.PushScope使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JavaCompiler.Compilation.ByteCode.ByteCodeGenerator
的用法示例。
在下文中一共展示了ByteCodeGenerator.PushScope方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
}
示例2: 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);
}
示例3: 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);
}