Package xtc.tree

Examples of xtc.tree.Node


   */
  private Result pEnumerators(final int yyStart) throws IOException {
    Result     yyResult;
    int        yyRepetition1;
    Pair<Node> yyRepValue1;
    Node       yyValue;
    ParseError yyError = ParseError.DUMMY;

    // Alternative 1.

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

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

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

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

            yyRepetition1 = yyResult.index;
            yyRepValue1   = new Pair<Node>(v$el$1, yyRepValue1);
            continue;
          }
View Full Code Here


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

    // Alternative 1.

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

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

      return yyResult.createValue(yyValue, yyError);
    }

    // Alternative 2.

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

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

      return yyResult.createValue(yyValue, yyError);
    }

    // Alternative 3.

    yyResult = pkey(yyStart);
    if (yyResult.hasValue("val")) {

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

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

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

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

            return yyResult.createValue(yyValue, yyError);
View Full Code Here

      n.getGeneric(1).setProperty(INANALYZE, Boolean.TRUE);
   

    List<String> upVars = getUpVariables(n);
    if (null != upVars) n.getGeneric(0).setProperty(UPVARS, upVars);
    Node left = (Node)dispatch(n.getGeneric(0));
    List<LetBinding> bl1 = getBindings(left);
    List<String> vars = extractVariables(bl1);
    upVars = groupList(upVars,vars);

    if (null != upVars) n.getGeneric(1).setProperty(UPVARS, upVars);
    Node right = (Node)dispatch(n.getGeneric(1));
    List<LetBinding> bl2 = getBindings(right);
    bl1 = groupList(bl1, bl2);
    Node ret = factory.or(left, right);
    if (null != bl1) ret.setProperty(LETBINDINGS, bl1);
    return ret;
  }
View Full Code Here

   */
  private Result pGenerator(final int yyStart) throws IOException {
    Result     yyResult;
    int        yyBase;
    int        yyOption1;
    Node       yyOpValue1;
    Node       yyValue;
    ParseError yyError = ParseError.DUMMY;

    // Alternative 1.

    yyOption1  = yyStart;

    yyBase   = yyOption1;
    yyResult = pkey(yyBase);
    if (yyResult.hasValue("val")) {

      yyOption1  = yyResult.index;
    } else {
      yyError = yyError.select("'val' expected", yyBase);
    }

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

      yyBase   = yyResult.index;
      yyResult = pkey(yyBase);
      if (yyResult.hasValue("<-")) {

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

          yyOption1  = yyResult.index;
          yyOpValue1 = null;

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

            yyOption1  = yyResult.index;
            yyOpValue1 = v$el$1;
          }
          { // Start scope for v$g$3.
            Node v$g$3 = yyOpValue1;

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

            return new SemanticValue(yyValue, yyOption1, yyError);
View Full Code Here

      n.getGeneric(1).setProperty(INANALYZE, Boolean.TRUE);
   

    List<String> upVars = getUpVariables(n);
    if (null != upVars) n.getGeneric(0).setProperty(UPVARS, upVars);
    Node left = (Node)dispatch(n.getGeneric(0));
    List<LetBinding> bl1 = getBindings(left);
    List<String> vars = extractVariables(bl1);
    upVars = groupList(upVars,vars);

    if (null != upVars) n.getGeneric(1).setProperty(UPVARS, upVars);
    Node right = (Node)dispatch(n.getGeneric(1));
    List<LetBinding> bl2 = getBindings(right);
    bl1 = groupList(bl1, bl2);
    Node ret = factory.and(left, right);
    if (null != bl1) ret.setProperty(LETBINDINGS, bl1);
    return ret;
  }
View Full Code Here

   */
  private Result pCaseClauses(final int yyStart) throws IOException {
    Result     yyResult;
    int        yyRepetition1;
    Pair<Node> yyRepValue1;
    Node       yyValue;
    ParseError yyError = ParseError.DUMMY;

    // Alternative 1.

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

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

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

          yyRepetition1 = yyResult.index;
          yyRepValue1   = new Pair<Node>(v$el$1, yyRepValue1);
          continue;
        }
View Full Code Here

  public Node visitLogicalNegationExpression(GNode n) {
    if (n.hasProperty(INANALYZE)) {
      n.getGeneric(0).setProperty(INANALYZE, Boolean.TRUE);     
   
    passVariables(n, n.getGeneric(0));
    Node expr = (Node)dispatch(n.getGeneric(0));
    Node ret = factory.not(expr);
    passBindings(expr, ret);
    return ret;
  }
View Full Code Here

      n.getGeneric(2).setProperty(INANALYZE, Boolean.TRUE);
   

    List<String> upVars = getUpVariables(n);
    if (null != upVars) n.getGeneric(0).setProperty(UPVARS, upVars);
    Node left = (Node)dispatch(n.getGeneric(0));
    List<LetBinding> bl1 = getBindings(left);
    List<String> vars = extractVariables(bl1);
    upVars = groupList(upVars,vars);

    if (null != upVars) n.getGeneric(2).setProperty(UPVARS, upVars);
    Node right = (Node)dispatch(n.getGeneric(2));
    List<LetBinding> bl2 = getBindings(right);
    bl1 = groupList(bl1, bl2);
    Node ret;           
   
    if ("=".equals(op)) {
      if ("Bottom".equals(n.getGeneric(0).getName())) {   
        ret = factory.equalsBottom(right);
        if (null != bl1) ret.setProperty(LETBINDINGS, bl1);
        return ret;     
      } else if ("Bottom".equals(n.getGeneric(2).getName())) {
        ret = factory.equalsBottom(left);
        if (null != bl1) ret.setProperty(LETBINDINGS, bl1);
        return ret;   
      }
    } else {
       if ("Bottom".equals(n.getGeneric(0).getName())) {   
        ret = factory.notEqualsBottom(right);
        if (null != bl1) ret.setProperty(LETBINDINGS, bl1);
        return ret;     
      } else if ("Bottom".equals(n.getGeneric(2).getName())) {
        ret = factory.notEqualsBottom(left);
        if (null != bl1) ret.setProperty(LETBINDINGS, bl1);
        return ret;   
      }
    }

    ret =
      ("=".equals(n.getString(1))) ? factory.equal(left, right)
                                   : factory.not(factory.equal(left, right));
    if (null != bl1) ret.setProperty(LETBINDINGS, bl1);
    return ret;
  }
View Full Code Here

  /** Actually parse org.netbeans.modules.scala.core.rats.ParserScala.CaseClause. */
  private Result pCaseClause$1(final int yyStart) throws IOException {
    Result     yyResult;
    int        yyBase;
    int        yyOption1;
    Node       yyOpValue1;
    Node       yyValue;
    ParseError yyError = ParseError.DUMMY;

    // Alternative 1.

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

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

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

          final int yyChoice1 = yyResult.index;

          // Nested alternative 1.

          yyResult = pCaseClause$$Choice1(yyChoice1);
          yyError  = yyResult.select(yyError);
          if (yyResult.hasValue()) {
            Object v$g$1 = yyResult.semanticValue();

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

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

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

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

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

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

          // Nested alternative 2.

          yyResult = pPattern(yyChoice1);
          yyError  = yyResult.select(yyError);
          if (yyResult.hasValue()) {
            Node v$g$4 = yyResult.semanticValue();

            yyResult = p$$Shared2(yyResult.index);
            yyError  = yyResult.select(yyError);
            if (yyResult.hasValue()) {

              yyOption1  = yyResult.index;
              yyOpValue1 = null;

              yyResult = pGuard(yyOption1);
              yyError  = yyResult.select(yyError, yyOption1);
              if (yyResult.hasValue()) {
                Node v$el$3 = yyResult.semanticValue();

                yyOption1  = yyResult.index;
                yyOpValue1 = v$el$3;
              }
              { // Start scope for v$g$5.
                Node v$g$5 = yyOpValue1;

                yyBase   = yyOption1;
                yyResult = pkey(yyBase);
                if (yyResult.hasValue("=>")) {

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

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

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

                      return yyResult.createValue(yyValue, yyError);
View Full Code Here

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

    // Alternative 1.

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

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

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

        return yyResult.createValue(yyValue, yyError);
View Full Code Here

TOP

Related Classes of xtc.tree.Node

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.