Exemplo n.º 1
0
        public override void Visit(IfNode node)
        {
            var pnum = this.IdentNumber++;

            node.ConditionNode.Accept(this);
            this.Add("   pop rax");
            this.Add("   cmp rax, 0");
            this.Add($"   je .Lelse{pnum}");
            node.StatementNode.Accept(this);
            this.Add($"   jmp .Lend{pnum}");
            this.Add($".Lelse{pnum}:");
            if (node.ElseNode != default)
            {
                node.ElseNode.Accept(this);
            }
            this.Add($".Lend{pnum}:");
        }
Exemplo n.º 2
0
 public abstract void Visit(IfNode node);