Ejemplo n.º 1
0
        private void Generate(injectionParser.WhileContext whileContext)
        {
            var whileInstruction = new WhileInstruction(whileContext);
            int whileAddress     = currentAddress;

            AddInstruction(whileInstruction);

            var statements = whileContext.codeBlock()?.statement()
                             ?? Enumerable.Empty <injectionParser.StatementContext>();

            foreach (var statement in statements)
            {
                VisitStatement(statement);
            }

            AddInstruction(new JumpInstruction(whileAddress));

            whileInstruction.WendAddress = currentAddress;
        }
Ejemplo n.º 2
0
 public WhileInstruction(injectionParser.WhileContext whileSyntax)
 {
     WhileSyntax = whileSyntax;
     Statement   = (injectionParser.StatementContext)whileSyntax.Parent;
 }