Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.dynjs.parser.ast;
 
 import static me.qmx.jitescript.util.CodegenUtils.*;
 
 import java.util.List;
 
 
public abstract class AbstractIteratingStatement extends BaseStatement {
    public AbstractIteratingStatement(Position position) {
        superposition );
    }
    public CodeBlock isInLabelSet() {
        return new CodeBlock() {
            {
                LabelNode returnTrue = new LabelNode();
                LabelNode end = new LabelNode();
                // IN: target
                
                dup();
                // target target
                ifnullreturnTrue );
                
                List<Stringlabels = getLabels();
                int numLabels = labels.size();
                // target
                
                bipush(numLabels);
                // target int
                anewarray(p(String.class));
                // target array
                for (int i = 0; i < numLabels; ++i) {
                    dup();
                    // target array array
                    bipush(i);
                    // target array array idx
                    ldc(labels.get(i));
                    // target array array idx val
                    aastore();
                    // target array
                }
                // target array
                invokestatic(p(AbstractIteratingStatement.class), "isInLabelSet"sig(boolean.classString.classString[].class));
                // boolean
                
                go_toend );
                
                labelreturnTrue );
                // target
                pop();
                // <empty>
                
                iconst_1();
                // true
                
                labelend );
                // boolean
            }
        };
    }
    public static boolean isInLabelSet(String targetString[] labelSet) {
        for (int i = 0; i < labelSet.length; ++i) {
            if (labelSet[i].equals(target)) {
                return true;
            }
        }
        return false;
    }
New to GrepCode? Check out our FAQ X