Package it.halfone.parser

Examples of it.halfone.parser.Step


    for (int i = 0; i < symbolList.size(); i++) {
      Symbol actualSymbol = symbolList.get(i);
      if (i == 0 || (Symbol.isMetaSymbol(actualSymbol.getType()) == false)) {
        boundary.clear();
        boundary.add(new Step(tokens[i], new ArrayList<Event>()));
        explored.clear();
        successorList.clear();

        while (boundary.isEmpty() == false) {
          Step actual = boundary.remove(0);
          explored.add(actual.getDestination());

          for (int succ : connectionsMap.get(actual.getDestination())) {
            Symbol succSymbol = symbolList.get(succ);
            List<Event> eventList = new ArrayList<Event>(actual.getEventList());
            if (succSymbol.getLikeness() != 0) {
              eventList.add(new LikenessEvent(succSymbol.getLikeness()));
            }
            if (succSymbol.getMarkIndex() != 0) {
              eventList.add(new MarkEvent(succSymbol.getMarkIndex() > 0, Math.abs(succSymbol.getMarkIndex()), succSymbol.getMarkName()));
            }
            if (succSymbol.getType() == Type.CHECK_IN || succSymbol.getType() == Type.CHECK_OUT) {
              eventList.add(new CheckEvent(succSymbol.getType() == Type.CHECK_IN));
            }
            if (succSymbol.getType() == Type.CLOSED_SELF_START || succSymbol.getType() == Type.CLOSED_SELF_END) {
              eventList.add(new LateralStepEvent(closedSelfIdMap.get(succ)));
            }
            if (Symbol.isStackRelated(succSymbol.getType())) {
              String minDepth = "";
              String maxDepth = "";
              switch (succSymbol.getType()) {
              case PUSH:
                minDepth = "1";
                maxDepth = "1";
                break;
              case POP:
                minDepth = "-1";
                maxDepth = "-1";
                break;
              case INFINI_PUSH:
                minDepth = "1";
                maxDepth = "+I";
                eventList.add(new LateralStepEvent(infiniLateralStackMap.get(succ)));
                break;
              case INFINI_POP:
                minDepth = "-I";
                maxDepth = "-1";
                eventList.add(new LateralStepEvent(infiniLateralStackMap.get(succ)));
                break;
              }
              eventList.add(new ChangeDepthEvent(minDepth, maxDepth));
            }
            if ((Symbol.isMetaSymbol(succSymbol.getType()) == false) || succ == symbolList.size() - 1) {
              successorList.add(new Step(tokens[succ], eventList));
            } else {
              Step newStep = new Step(tokens[succ], eventList);
              if (explored.contains(tokens[succ]) == false) {
                boundary.add(newStep);
              }
            }
          }
View Full Code Here

TOP

Related Classes of it.halfone.parser.Step

Copyright © 2018 www.massapicom. 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.