예제 #1
0
        public override void Visit(AmlParser.DefWhile defWhile)
        {
            // We create a sequence like this:
            // jump to pushPredicate
            // loopback:
            // (body instructions)
            // pushPredicate:
            // (push predicate)
            // jump if not zero to loopback

            Jump          jumpToPushPredicate = new Jump();
            JumpIfNonZero jumpLoopBack        = new JumpIfNonZero();

            result.Add(jumpToPushPredicate);
            jumpLoopBack.ThenTarget = result.Count;
            VisitSequence(defWhile.termList);
            jumpToPushPredicate.Target = result.Count;
            defWhile.predicate.Accept(this);
            result.Add(jumpLoopBack);
        }
예제 #2
0
 public virtual void Visit(AmlParser.DefWhile defWhile)
 {
     UnhandledNodeType("DefWhile");
 }