void ITreeWalker.Visit(CaseStatement statement)
 {
     statement.Validate(this);
     statement.Condition.Accept(this);
     _loops.Push(statement);
     statement.Body.Accept(this);
     _loops.Pop();
 }
Ejemplo n.º 2
0
        void ITreeWalker.Visit(CaseStatement statement)
        {
            var loop = _loops.Pop();

            statement.Validate(this);
            _operations.Add(new GetsOperation("^~#" + _loops.Count));
            statement.Condition.Accept(this);
            _operations.Add(new GetcOperation(1));
            _operations.Add(PopIfOperation.Instance);
            var jumpToNext = InsertMarker();

            _loops.Push(new LoopInfo {
                Break = loop.Break, Continue = jumpToNext
            });
            statement.Body.Accept(this);
            var end = _operations.Count;

            InsertJump(jumpToNext, end - 1);
        }
Ejemplo n.º 3
0
 void ITreeWalker.Visit(CaseStatement statement)
 {
     statement.Validate(this);
     InsertCase(() => statement.Condition.Accept(this), () => statement.Body.Accept(this));
 }