Package xtc.parser

Examples of xtc.parser.Result


   * @throws IOException Signals an I/O error.
   */
  private Result pintegerLiteral(final int yyStart) throws IOException {
    int        yyC;
    int        yyIndex;
    Result     yyResult;
    int        yyOption1;
    String     yyValue;
    ParseError yyError = ParseError.DUMMY;

    // Alternative 1.

    yyResult = phexNumeral(yyStart);
    yyError  = yyResult.select(yyError);
    if (yyResult.hasValue()) {

      yyOption1  = yyResult.index;

      yyC = character(yyOption1);
      if (-1 != yyC) {
        yyIndex = yyOption1 + 1;

        switch (yyC) {
        case 'L':
        case 'l':
          {
            yyOption1  = yyIndex;
          }
          break;

        default:
          /* No match. */
        }
      }

      yyValue = difference(yyStart, yyOption1);

      return new SemanticValue(yyValue, yyOption1, yyError);
    }

    // Alternative 2.

    yyResult = poctalNumeral(yyStart);
    yyError  = yyResult.select(yyError);
    if (yyResult.hasValue()) {

      yyOption1  = yyResult.index;

      yyC = character(yyOption1);
      if (-1 != yyC) {
        yyIndex = yyOption1 + 1;

        switch (yyC) {
        case 'L':
        case 'l':
          {
            yyOption1  = yyIndex;
          }
          break;

        default:
          /* No match. */
        }
      }

      yyValue = difference(yyStart, yyOption1);

      return new SemanticValue(yyValue, yyOption1, yyError);
    }

    // Alternative 3.

    yyResult = pdecimalNumeral(yyStart);
    yyError  = yyResult.select(yyError);
    if (yyResult.hasValue()) {

      yyOption1  = yyResult.index;

      yyC = character(yyOption1);
      if (-1 != yyC) {
View Full Code Here


   * @param yyStart The index.
   * @return The result.
   * @throws IOException Signals an I/O error.
   */
  private Result pFloatingPointLiteral(final int yyStart) throws IOException {
    Result     yyResult;
    Node       yyValue;
    ParseError yyError = ParseError.DUMMY;

    // Alternative 1.

    yyResult = pfloatingPointLiteral(yyStart);
    yyError  = yyResult.select(yyError);
    if (yyResult.hasValue()) {
      String v$g$1 = yyResult.semanticValue();

      yyValue = GNode.create("FloatingPointLiteral", v$g$1);
      yyValue.setLocation(location(yyStart));

      return yyResult.createValue(yyValue, yyError);
    }

    // Done.
    return yyError;
  }
View Full Code Here

   * @throws IOException Signals an I/O error.
   */
  private Result pfloatingPointLiteral(final int yyStart) throws IOException {
    int        yyC;
    int        yyIndex;
    Result     yyResult;
    int        yyRepetition1;
    boolean    yyRepeated1;
    int        yyOption1;
    String     yyValue;
    ParseError yyError = ParseError.DUMMY;

    // Alternative 1.

    yyRepetition1 = yyStart;
    yyRepeated1   = false;
    while (true) {

      yyC = character(yyRepetition1);
      if (-1 != yyC) {
        yyIndex = yyRepetition1 + 1;

        switch (yyC) {
        case '0':
        case '1':
        case '2':
        case '3':
        case '4':
        case '5':
        case '6':
        case '7':
        case '8':
        case '9':
          {
            yyRepetition1 = yyIndex;
            yyRepeated1   = true;
            continue;
          }

        default:
          /* No match. */
        }
      }
      break;
    }

    if (yyRepeated1) {

      yyC = character(yyRepetition1);
      if ('.' == yyC) {
        yyIndex = yyRepetition1 + 1;

        yyRepetition1 = yyIndex;
        while (true) {

          yyC = character(yyRepetition1);
          if (-1 != yyC) {
            yyIndex = yyRepetition1 + 1;

            switch (yyC) {
            case '0':
            case '1':
            case '2':
            case '3':
            case '4':
            case '5':
            case '6':
            case '7':
            case '8':
            case '9':
              {
                yyRepetition1 = yyIndex;
                continue;
              }

            default:
              /* No match. */
            }
          }
          break;
        }

        yyOption1  = yyRepetition1;

        yyResult = pexponent(yyOption1);
        yyError  = yyResult.select(yyError, yyOption1);
        if (yyResult.hasValue()) {

          yyOption1  = yyResult.index;
        }


        yyC = character(yyOption1);
        if (-1 != yyC) {
          yyIndex = yyOption1 + 1;

          switch (yyC) {
          case 'D':
          case 'F':
          case 'd':
          case 'f':
            {
              yyOption1  = yyIndex;
            }
            break;

          default:
            /* No match. */
          }
        }

        yyValue = difference(yyStart, yyOption1);

        return new SemanticValue(yyValue, yyOption1, yyError);
      }
    }

    // Alternative 2.

    yyC = character(yyStart);
    if ('.' == yyC) {
      yyIndex = yyStart + 1;

      yyRepetition1 = yyIndex;
      yyRepeated1   = false;
      while (true) {

        yyC = character(yyRepetition1);
        if (-1 != yyC) {
          yyIndex = yyRepetition1 + 1;

          switch (yyC) {
          case '0':
          case '1':
          case '2':
          case '3':
          case '4':
          case '5':
          case '6':
          case '7':
          case '8':
          case '9':
            {
              yyRepetition1 = yyIndex;
              yyRepeated1   = true;
              continue;
            }

          default:
            /* No match. */
          }
        }
        break;
      }

      if (yyRepeated1) {

        yyOption1  = yyRepetition1;

        yyResult = pexponent(yyOption1);
        yyError  = yyResult.select(yyError, yyOption1);
        if (yyResult.hasValue()) {

          yyOption1  = yyResult.index;
        }


        yyC = character(yyOption1);
        if (-1 != yyC) {
          yyIndex = yyOption1 + 1;

          switch (yyC) {
          case 'D':
          case 'F':
          case 'd':
          case 'f':
            {
              yyOption1  = yyIndex;
            }
            break;

          default:
            /* No match. */
          }
        }

        yyValue = difference(yyStart, yyOption1);

        return new SemanticValue(yyValue, yyOption1, yyError);
      }
    }

    // Alternative 3.

    yyRepetition1 = yyStart;
    yyRepeated1   = false;
    while (true) {

      yyC = character(yyRepetition1);
      if (-1 != yyC) {
        yyIndex = yyRepetition1 + 1;

        switch (yyC) {
        case '0':
        case '1':
        case '2':
        case '3':
        case '4':
        case '5':
        case '6':
        case '7':
        case '8':
        case '9':
          {
            yyRepetition1 = yyIndex;
            yyRepeated1   = true;
            continue;
          }

        default:
          /* No match. */
        }
      }
      break;
    }

    if (yyRepeated1) {

      final int yyChoice1 = yyRepetition1;

      // Nested alternative 1.

      yyResult = pexponent(yyChoice1);
      yyError  = yyResult.select(yyError);
      if (yyResult.hasValue()) {

        yyOption1  = yyResult.index;

        yyC = character(yyOption1);
        if (-1 != yyC) {
          yyIndex = yyOption1 + 1;

          switch (yyC) {
          case 'D':
          case 'F':
          case 'd':
          case 'f':
            {
              yyOption1  = yyIndex;
            }
            break;

          default:
            /* No match. */
          }
        }

        yyValue = difference(yyStart, yyOption1);

        return new SemanticValue(yyValue, yyOption1, yyError);
      }

      // Nested alternative 2.

      yyOption1  = yyChoice1;

      yyResult = pexponent(yyOption1);
      yyError  = yyResult.select(yyError, yyOption1);
      if (yyResult.hasValue()) {

        yyOption1  = yyResult.index;
      }

      yyC = character(yyOption1);
View Full Code Here

   * @throws IOException Signals an I/O error.
   */
  private Result pSKIP(final int yyStart) throws IOException {
    int        yyC;
    int        yyIndex;
    Result     yyResult;
    int        yyBase;
    int        yyRepetition1;
    int        yyRepetition2;
    boolean    yyRepeated2;
    Void       yyValue;
    ParseError yyError = ParseError.DUMMY;

    // Alternative 1.

    if (yyState.newlineEnable()) {

      yyRepetition1 = yyStart;
      while (true) {

        final int yyChoice1 = yyRepetition1;

        // Nested alternative 1.

        yyRepetition2 = yyChoice1;
        yyRepeated2   = false;
        while (true) {

          final int yyChoice2 = yyRepetition2;

          // Nested alternative 1.

          yyC = character(yyChoice2);
          if (-1 != yyC) {
            yyIndex = yyChoice2 + 1;

            switch (yyC) {
            case ' ':
              {
                yyRepetition2 = yyIndex;
                yyRepeated2   = true;
                continue;
              }

            case '\f':
              {
                yyRepetition2 = yyIndex;
                yyRepeated2   = true;
                continue;
              }

            case '\t':
              {
                yyRepetition2 = yyIndex;
                yyRepeated2   = true;
                continue;
              }

            default:
              /* No match. */
            }
          }
          break;
        }

        if (yyRepeated2) {

          yyRepetition1 = yyRepetition2;
          continue;
        }

        // Nested alternative 2.

        yyResult = pDocComment(yyChoice1);
        yyError  = yyResult.select(yyError, yyRepetition1);
        if (yyResult.hasValue()) {

          yyRepetition1 = yyResult.index;
          continue;
        }

        // Nested alternative 3.

        yyResult = pBlockComment(yyChoice1);
        yyError  = yyResult.select(yyError, yyRepetition1);
        if (yyResult.hasValue()) {

          yyRepetition1 = yyResult.index;
          continue;
        }

        // Nested alternative 4.

        yyBase = yyChoice1;
        yyC    = character(yyBase);
        if ('/' == yyC) {
          yyIndex = yyChoice1 + 1;

          yyC = character(yyIndex);
          if ('/' == yyC) {
            yyIndex = yyIndex + 1;

            yyRepetition2 = yyIndex;
            while (true) {

              yyC = character(yyRepetition2);
              if (-1 != yyC) {
                yyIndex = yyRepetition2 + 1;

                switch (yyC) {
                case '\n':
                case '\r':
                  /* No match. */
                  break;

                default:
                  {
                    yyRepetition2 = yyIndex;
                    continue;
                  }
                }
              }
              break;
            }

            yyRepetition1 = yyRepetition2;
            continue;
          } else {
            yyError = yyError.select("'//' expected", yyBase);
          }
        } else {
          yyError = yyError.select("'//' expected", yyBase);
        }
        break;
      }

      yyValue = null;

      return new SemanticValue(yyValue, yyRepetition1, yyError);
    }

    // Alternative 2.

    yyRepetition1 = yyStart;
    while (true) {

      final int yyChoice1 = yyRepetition1;

      // Nested alternative 1.

      yyRepetition2 = yyChoice1;
      yyRepeated2   = false;
      while (true) {

        final int yyChoice2 = yyRepetition2;

        // Nested alternative 1.

        yyC = character(yyChoice2);
        if (-1 != yyC) {
          yyIndex = yyChoice2 + 1;

          switch (yyC) {
          case ' ':
            {
              yyRepetition2 = yyIndex;
              yyRepeated2   = true;
              continue;
            }

          case '\f':
            {
              yyRepetition2 = yyIndex;
              yyRepeated2   = true;
              continue;
            }

          case '\t':
            {
              yyRepetition2 = yyIndex;
              yyRepeated2   = true;
              continue;
            }

          default:
            /* No match. */
          }
        }
        break;
      }

      if (yyRepeated2) {

        yyRepetition1 = yyRepetition2;
        continue;
      }

      // Nested alternative 2.

      yyResult = pDocComment(yyChoice1);
      yyError  = yyResult.select(yyError, yyRepetition1);
      if (yyResult.hasValue()) {

        yyRepetition1 = yyResult.index;
        continue;
      }

      // Nested alternative 3.

      yyResult = pBlockComment(yyChoice1);
      yyError  = yyResult.select(yyError, yyRepetition1);
      if (yyResult.hasValue()) {

        yyRepetition1 = yyResult.index;
        continue;
      }

View Full Code Here

   * @param yyStart The index.
   * @return The result.
   * @throws IOException Signals an I/O error.
   */
  private Result pNl(final int yyStart) throws IOException {
    Result     yyResult;
    Node       yyValue;
    ParseError yyError = ParseError.DUMMY;

    // Alternative 1.

    yyResult = pn(yyStart);
    yyError  = yyResult.select(yyError);
    if (yyResult.hasValue()) {
      String v$g$1 = yyResult.semanticValue();

      yyValue = GNode.create("Nl", v$g$1);
      yyValue.setLocation(location(yyStart));

      return yyResult.createValue(yyValue, yyError);
    }

    // Done.
    return yyError;
  }
View Full Code Here

    return yyColumn.chunk7.fsep;
  }

  /** Actually parse org.netbeans.modules.scala.core.rats.Symbol.sep. */
  private Result psep$1(final int yyStart) throws IOException {
    Result     yyResult;
    int        yyBase;
    String     yyValue;
    ParseError yyError = ParseError.DUMMY;

    // Alternative 1.

    yyResult = pSKIP_N(yyStart);
    yyError  = yyResult.select(yyError);
    if (yyResult.hasValue()) {

      final int yyChoice1 = yyResult.index;

      // Nested alternative 1.

      yyBase   = yyChoice1;
      yyResult = pseparator(yyBase);
      if (yyResult.hasValue(",")) {
        yyValue = ",";

        yyResult = pSKIP_TILL_N(yyResult.index);
        yyError  = yyResult.select(yyError);
        if (yyResult.hasValue()) {

          return yyResult.createValue(yyValue, yyError);
        }
      } else {
        yyError = yyError.select("',' expected", yyBase);
      }

      // Nested alternative 2.

      yyBase   = yyChoice1;
      yyResult = pseparator(yyBase);
      if (yyResult.hasValue(".")) {
        yyValue = ".";

        yyResult = pSKIP_TILL_N(yyResult.index);
        yyError  = yyResult.select(yyError);
        if (yyResult.hasValue()) {

          return yyResult.createValue(yyValue, yyError);
        }
      } else {
        yyError = yyError.select("'.' expected", yyBase);
      }

      // Nested alternative 3.

      yyBase   = yyChoice1;
      yyResult = pseparator(yyBase);
      if (yyResult.hasValue(";")) {
        yyValue = ";";

        yyResult = pSKIP_TILL_N(yyResult.index);
        yyError  = yyResult.select(yyError);
        if (yyResult.hasValue()) {

          return yyResult.createValue(yyValue, yyError);
        }
      } else {
        yyError = yyError.select("';' expected", yyBase);
      }

      // Nested alternative 4.

      yyBase   = yyChoice1;
      yyResult = pseparator(yyBase);
      if (yyResult.hasValue("[")) {
        yyValue = "[";

        yyResult = pSKIP_TILL_N(yyResult.index);
        yyError  = yyResult.select(yyError);
        if (yyResult.hasValue()) {

          return yyResult.createValue(yyValue, yyError);
        }
      } else {
        yyError = yyError.select("'[' expected", yyBase);
      }

      // Nested alternative 5.

      yyBase   = yyChoice1;
      yyResult = pseparator(yyBase);
      if (yyResult.hasValue(")")) {
        yyValue = ")";

        return yyResult.createValue(yyValue, yyError);
      } else {
        yyError = yyError.select("')' expected", yyBase);
      }

      // Nested alternative 6.

      yyBase   = yyChoice1;
      yyResult = pseparator(yyBase);
      if (yyResult.hasValue("]")) {
        yyValue = "]";

        return yyResult.createValue(yyValue, yyError);
      } else {
        yyError = yyError.select("']' expected", yyBase);
      }

      // Nested alternative 7.

      yyBase   = yyChoice1;
      yyResult = pseparator(yyBase);
      if (yyResult.hasValue("}")) {
        yyValue = "}";

        return yyResult.createValue(yyValue, yyError);
      } else {
        yyError = yyError.select("'}' expected", yyBase);
      }
    }

    // Alternative 2.

    yyResult = pSKIP(yyStart);
    yyError  = yyResult.select(yyError);
    if (yyResult.hasValue()) {

      yyResult = pseparator(yyResult.index);
      yyError  = yyResult.select(yyError);
      if (yyResult.hasValue()) {
        yyValue = yyResult.semanticValue();

        yyResult = pSKIP_TILL_N(yyResult.index);
        yyError  = yyResult.select(yyError);
        if (yyResult.hasValue()) {

          return yyResult.createValue(yyValue, yyError);
        }
      }
    }

    // Done.
View Full Code Here

   * @param yyStart The index.
   * @return The result.
   * @throws IOException Signals an I/O error.
   */
  private Result pXmlPattern(final int yyStart) throws IOException {
    Result     yyResult;
    int        yyBase;
    Node       yyValue;
    ParseError yyError = ParseError.DUMMY;

    // Alternative 1.

    yyResult = pw(yyStart);
    yyError  = yyResult.select(yyError);
    if (yyResult.hasValue()) {

      yyResult = pXmlElementP(yyResult.index);
      yyError  = yyResult.select(yyError);
      if (yyResult.hasValue()) {
        Node v$g$1 = yyResult.semanticValue();

        yyValue = GNode.create("XmlPattern", v$g$1);
        yyValue.setLocation(location(yyStart));

        return yyResult.createValue(yyValue, yyError);
      }
    }

    // Alternative 2.

    yyResult = psep(yyStart);
    if (yyResult.hasValue("(")) {

      yyResult = pXmlElementP(yyResult.index);
      yyError  = yyResult.select(yyError);
      if (yyResult.hasValue()) {
        Node v$g$2 = yyResult.semanticValue();

        yyBase   = yyResult.index;
        yyResult = psep(yyBase);
        if (yyResult.hasValue(")")) {

          yyValue = GNode.create("XmlPattern", v$g$2);
          yyValue.setLocation(location(yyStart));

          return yyResult.createValue(yyValue, yyError);
        } else {
          yyError = yyError.select("')' expected", yyBase);
        }
      }
    }

    // Alternative 3.

    yyResult = psep(yyStart);
    if (yyResult.hasValue("{")) {

      yyResult = pXmlElementP(yyResult.index);
      yyError  = yyResult.select(yyError);
      if (yyResult.hasValue()) {
        Node v$g$3 = yyResult.semanticValue();

        yyBase   = yyResult.index;
        yyResult = psep(yyBase);
        if (yyResult.hasValue("}")) {

          yyValue = GNode.create("XmlPattern", v$g$3);
          yyValue.setLocation(location(yyStart));

          return yyResult.createValue(yyValue, yyError);
        } else {
          yyError = yyError.select("'}' expected", yyBase);
        }
      }
    }
View Full Code Here

   * @param yyStart The index.
   * @return The result.
   * @throws IOException Signals an I/O error.
   */
  private Result pXmlContentP(final int yyStart) throws IOException {
    Result     yyResult;
    Node       yyValue;
    ParseError yyError = ParseError.DUMMY;

    // Alternative <ScalaPatterns>.

    yyResult = pScalaPatterns(yyStart);
    yyError  = yyResult.select(yyError);
    if (yyResult.hasValue()) {
      Node v$g$1 = yyResult.semanticValue();

      yyValue = GNode.create("XmlContentP", v$g$1);
      yyValue.setLocation(location(yyStart));

      return yyResult.createValue(yyValue, yyError);
    }

    // Alternative <XmlCDSect>.

    yyResult = pParserScala$XmlCDSect(yyStart);
    yyError  = yyResult.select(yyError);
    if (yyResult.hasValue()) {
      Node v$g$2 = yyResult.semanticValue();

      yyValue = GNode.create("XmlContentP", v$g$2);
      yyValue.setLocation(location(yyStart));

      return yyResult.createValue(yyValue, yyError);
    }

    // Alternative <XmlPI>.

    yyResult = pParserScala$XmlPI(yyStart);
    yyError  = yyResult.select(yyError);
    if (yyResult.hasValue()) {
      String v$g$3 = yyResult.semanticValue();

      yyValue = GNode.create("XmlContentP", v$g$3);
      yyValue.setLocation(location(yyStart));

      return yyResult.createValue(yyValue, yyError);
    }

    // Alternative <XmlCharData>.

    yyResult = pParserScala$XmlCharData(yyStart);
    yyError  = yyResult.select(yyError);
    if (yyResult.hasValue()) {
      Node v$g$4 = yyResult.semanticValue();

      yyValue = GNode.create("XmlContentP", v$g$4);
      yyValue.setLocation(location(yyStart));

      return yyResult.createValue(yyValue, yyError);
    }

    // Alternative <XmlElement>.

    yyResult = pXmlElementP(yyStart);
    yyError  = yyResult.select(yyError);
    if (yyResult.hasValue()) {
      Node v$g$5 = yyResult.semanticValue();

      yyValue = GNode.create("XmlContentP", v$g$5);
      yyValue.setLocation(location(yyStart));

      return yyResult.createValue(yyValue, yyError);
    }

    // Alternative <XmlReference>.

    yyResult = pParserScala$XmlReference(yyStart);
    yyError  = yyResult.select(yyError);
    if (yyResult.hasValue()) {
      String v$g$6 = yyResult.semanticValue();

      yyValue = GNode.create("XmlContentP", v$g$6);
      yyValue.setLocation(location(yyStart));

      return yyResult.createValue(yyValue, yyError);
    }

    // Alternative <XmlComment>.

    yyResult = pParserScala$XmlComment(yyStart);
    yyError  = yyResult.select(yyError);
    if (yyResult.hasValue()) {
      Node v$g$7 = yyResult.semanticValue();

      yyValue = GNode.create("XmlContentP", v$g$7);
      yyValue.setLocation(location(yyStart));

      return yyResult.createValue(yyValue, yyError);
    }

    // Done.
    return yyError;
  }
View Full Code Here

   * @param yyStart The index.
   * @return The result.
   * @throws IOException Signals an I/O error.
   */
  private Result pImportSelectors(final int yyStart) throws IOException {
    Result     yyResult;
    int        yyBase;
    int        yyRepetition1;
    Pair<Node> yyRepValue1;
    Node       yyValue;
    ParseError yyError = ParseError.DUMMY;

    // Alternative 1.

    yyResult = psep(yyStart);
    if (yyResult.hasValue("{")) {

      yyRepetition1 = yyResult.index;
      yyRepValue1   = Pair.empty();
      while (true) {

        yyResult = pImportSelector(yyRepetition1);
        yyError  = yyResult.select(yyError, yyRepetition1);
        if (yyResult.hasValue()) {
          Node v$el$1 = yyResult.semanticValue();

          yyBase   = yyResult.index;
          yyResult = psep(yyBase);
          if (yyResult.hasValue(",")) {

            yyRepetition1 = yyResult.index;
            yyRepValue1   = new Pair<Node>(v$el$1, yyRepValue1);
            continue;
          } else {
            yyError = yyError.select("',' expected", yyBase);
          }
        }
        break;
      }
      { // Start scope for v$g$1.
        Pair<Node> v$g$1 = yyRepValue1.reverse();

        yyResult = pImportSelectors$$Choice1(yyRepetition1);
        yyError  = yyResult.select(yyError);
        if (yyResult.hasValue()) {
          Node v$g$2 = yyResult.semanticValue();

          yyBase   = yyResult.index;
          yyResult = psep(yyBase);
          if (yyResult.hasValue("}")) {

            yyValue = GNode.create("ImportSelectors", v$g$1, v$g$2);
            yyValue.setLocation(location(yyStart));

            return yyResult.createValue(yyValue, yyError);
          } else {
            yyError = yyError.select("'}' expected", yyBase);
          }
        }
      } // End scope for v$g$1.
View Full Code Here

   * @throws IOException Signals an I/O error.
   */
  private Result pImportSelectors$$Choice1(final int yyStart)
    throws IOException {

    Result     yyResult;
    Node       yyValue;
    ParseError yyError = ParseError.DUMMY;

    // Alternative 1.

    yyResult = pImportSelector(yyStart);
    yyError  = yyResult.select(yyError);
    if (yyResult.hasValue()) {
      yyValue = yyResult.semanticValue();

      return yyResult.createValue(yyValue, yyError);
    }

    // Alternative 2.

    yyResult = pWildKey(yyStart);
    yyError  = yyResult.select(yyError);
    if (yyResult.hasValue()) {
      yyValue = yyResult.semanticValue();

      return yyResult.createValue(yyValue, yyError);
    }

    // Done.
    return yyError;
  }
View Full Code Here

TOP

Related Classes of xtc.parser.Result

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.