package com.poco.PoCoRuntime;

import java.util.ArrayList;

/**
 * Base class that both sequential and alternating executions inherit from. Defines functionality
 * that any execution should have.
 */
public abstract class AbstractExecution extends EventResponder implements Matchable, Queryable {
    protected boolean isZeroPlus, isOnePlus;
    protected ArrayList<EventResponder> children = new ArrayList<>();

    public AbstractExecution(String modifier) throws PoCoException {
        interpretModifier(modifier);
    }

    public AbstractExecution() throws PoCoException {
        interpretModifier("none");
    }

    private void interpretModifier(String modifier) throws PoCoException {
        switch (modifier) {
            case "none":
                isZeroPlus = isOnePlus = false;
                break;
            case "*":
                isZeroPlus = true;
                isOnePlus = false;
                break;
            case "+":
                isZeroPlus = false;
                isOnePlus = true;
                break;
            default:
                throw new PoCoException("Incorrect execution modifier " + modifier);
        }
    }

    public void addChild(EventResponder child) {
        children.add(child);
    }

    public ArrayList<EventResponder> getChildren() {
        return children;
    }
    public boolean isZeroPlus() {
        return isZeroPlus;
    }

    public boolean isOnePlus() {
        return isOnePlus;
    }
}

@@ -407,16 +407,95 @@
 t%3C%3E();%0A%0A
+    protected Boolean resultBool = false;%0A    protected SRE resultSRE = null;%0A%0A
     publ
@@ -1242,25 +1242,24 @@
     %7D%0A    %7D%0A
-%0A
     public v
@@ -1322,33 +1322,32 @@
 d(child);%0A    %7D%0A
-%0A
     public Array
@@ -1473,33 +1473,32 @@
 ZeroPlus;%0A    %7D%0A
-%0A
     public boole

add missing field