Examples of ForkOperation


Examples of net.sf.jmatchparser.template.engine.operation.ForkOperation

    if (optional) {
      // jump around here to make sure every path has at least one unique
      // operation
      Label dummyEndLabel = new Label();
      Label dummyContLabel = new Label();
      template.appendOperation(new ForkOperation(template.getCurrentTemplatePosition(), dummyEndLabel, false));
      template.appendOperation(new JumpOperation(template.getCurrentTemplatePosition(), dummyContLabel));
      dummyEndLabel.setDestinationToNextCommand(template);
      template.appendOperation(new JumpOperation(template.getCurrentTemplatePosition(), endLabel));
      dummyContLabel.setDestinationToNextCommand(template);
    }
    int lastForkPoint = template.getNextOperationIndex();
    template.appendOperation(new ForkOperation(template.getCurrentTemplatePosition(), forkLabel, false));
    template.appendOperation(new JumpOperation(template.getCurrentTemplatePosition(), nextPartLabel));
    forkLabel.setDestinationToNextCommand(template);
    return new AlternativeCommandState(template, lastForkPoint, nextPartLabel, endLabel);
  }
View Full Code Here

Examples of net.sf.jmatchparser.template.engine.operation.ForkOperation

        template.appendOperation(new JumpOperation(template.getCurrentTemplatePosition(), endLabel));
        nextPartLabel.setDestinationToNextCommand(template);
        nextPartLabel = new Label();
        Label forkLabel = new Label();
        lastForkPoint = template.getNextOperationIndex();
        template.appendOperation(new ForkOperation(template.getCurrentTemplatePosition(), forkLabel, false));
        template.appendOperation(new JumpOperation(template.getCurrentTemplatePosition(), nextPartLabel));
        forkLabel.setDestinationToNextCommand(template);
        return this;
      }
    }
View Full Code Here

Examples of net.sf.jmatchparser.template.engine.operation.ForkOperation

public class CheckOthersCommand extends ParameterlessCommand {

  @Override
  protected PlainBlockCommandState parse(MatchTemplateImpl template) {
    Label forkLabel = new Label();
    template.appendOperation(new ForkOperation(template.getCurrentTemplatePosition(), forkLabel, true));
    forkLabel.setDestinationToNextCommand(template);
    return null;
  }
View Full Code Here

Examples of net.sf.jmatchparser.template.engine.operation.ForkOperation

  @Override
  public PlainBlockCommandState parse(MatchTemplateImpl template, String parameters) {
    Label startLabel = new Label(), endLabel = new Label(), forkLabel = new Label();
    startLabel.setDestinationToNextCommand(template);
    template.appendOperation(new ForkOperation(template.getCurrentTemplatePosition(), forkLabel, false));
    template.appendOperation(new JumpOperation(template.getCurrentTemplatePosition(), endLabel));
    forkLabel.setDestinationToNextCommand(template);
    int pos = parameters.indexOf(" ");
    int pos2 = parameters.indexOf("\t");
    if (pos2 != -1 && (pos == -1 || pos > pos2))
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.