system/src/sc/parser/NestedParselet.java
public boolean addResultToParent(Object node, ParentParseNode parent, int index, Parser parser) {
      // Exclude this entirely from the result
      if (getDiscard() || getLookahead())
         return false;

      NestedParselet parentParselet = parent.parselet;

      if (getSkip() && node instanceof ParentParseNode) {
         ParentParseNode ppnode = (ParentParseNode) node;
         Object propagatedValue = null;

         // We have no information to preserve in this level of the hierarchy so we merge
         // it into the parentNode.
         if (parentParselet.parameterMapping == null) {
            ArrayList<Object> children = ppnode.children;
            int childSz = children.size();
            for (int i = 0; i < childSz; i++) {
               Object c = children.get(i);

               // We are adding a nested child which is marked as being skipped.  At this
               // point we add its children directly to the parentNode node - we'll throw away
               // this temporary parentNode node.  At this point, the value is the semantic value
               parent.add(c, this, -1, index, false, parser);
            }
            return false; // Do not add to the parentNode node
         }
         /* We are skipping this value and propagating one slot up.  If there are any slot
         * names, we set the corresponding property on the value we are propagating up.
         * This corresponds to a pattern like (foobar,.) which means set the foobar property
         * on the "." slot which becomes the value for this node.
         else if (parentParselet.propagatedValueIndex != -1)
         {
            Object[] mapping = parentParselet.slotMapping;
            if (ppnode.children.size() != mapping.length)
                System.err.println("*** - wrong number of children for nested parselet");

            if (parentNode.value == null)
               System.err.println("*** Error: No semantic value class defined on parentNode with slot mapping: " + this);
            else
            {
               for (int i = 0; i < mapping.length; i++)
                  if (mapping[i] != null)
                     TypeUtil.setProperty(parentNode.value, mapping[i], ParseNode.nodeToSemanticValue(ppnode.children.get(i)));
            }
         }
         */
      }

      return true;
   }
/**
    * Adds the supplied result node produced by this parselet to the parent parse node.
    * We are also provided the index of this parselet in the parent's sequence.
    * Basically, this handles parselet specific options which handle how the result's value
    * is produced.  You might override this method if you want to determine how a particular
    * parselet's result is merged into the parent pareselet's result.
    * <p>
    * If you are skipping "node" in the results, you instead directly add children nodes
    * to the parent.  When you add a child node, it is important to specificy the value of
    * the "skipsemanticValue" flag.  This determines whether or not this element's value is
    * included in the semantic value produced by the parent node.
    * </p>
    *
    * @param node   the result value for this parselet - usually a ParseNode or a ParentParseNode
    *               or some subclass of those.
    * @param parent the parent parse node we are added this result into.
    * @param index  the position of this parselet in the parent's sequence
    * @return true if we are to add "node" directly to the parent and false if this method took
    * care already of propagating node to the parent.
    */
Adds the supplied result node produced by this parselet to the parent parse node.
We are also provided the index of this parselet in the parent's sequence.
Basically, this handles parselet specific options which handle how the result's value
is produced.  You might override this method if you want to determine how a particular
parselet's result is merged into the parent pareselet's result.

If you are skipping "node" in the results, you instead directly add children nodes
to the parent.  When you add a child node, it is important to specificy the value of
the "skipsemanticValue" flag.  This determines whether or not this element's value is
included in the semantic value produced by the parent node.

@param node   the result value for this parselet - usually a ParseNode or a ParentParseNode
or some subclass of those.
@param parent the parent parse node we are added this result into.
@param index  the position of this parselet in the parent's sequence
@return true if we are to add "node" directly to the parent and false if this method took
care already of propagating node to the parent.
Adds the supplied result node produced by this parselet to the parent parse node . We are also provided the index of this parselet in the parent ' s sequence . Basically this handles parselet specific options which handle how the result ' s value is produced . You might override this method if you want to determine how a particular parselet ' s result is merged into the parent pareselet ' s result . If you are skipping " node " in the results you instead directly add children nodes to the parent . When you add a child node it is important to specificy the value of the " skipsemanticValue " flag . This determines whether or not this element ' s value is included in the semantic value produced by the parent node . @param node the result value for this parselet - usually a ParseNode or a ParentParseNode or some subclass of those . @param parent the parent parse node we are added this result into . @param index the position of this parselet in the parent ' s sequence @return true if we are to add " node " directly to the parent and false if this method took care already of propagating node to the parent .
public boolean addResultToParent(Object node, ParentParseNode parent, int index, Parser parser) {
      if (getDiscard() || getLookahead())
         return false;
      NestedParselet parentParselet = parent.parselet;
      if (getSkip() && node instanceof ParentParseNode) {
         ParentParseNode ppnode = (ParentParseNode) node;
         Object propagatedValue = null;
         if (parentParselet.parameterMapping == null) {
            ArrayList<Object> children = ppnode.children;
            int childSz = children.size();
            for (int i = 0; i < childSz; i++) {
               Object c = children.get(i);
               parent.add(c, this, -1, index, false, parser);
            }
            return false; 
         }
         /* We are skipping this value and propagating one slot up.  If there are any slot
         * names, we set the corresponding property on the value we are propagating up.
         * This corresponds to a pattern like (foobar,.) which means set the foobar property
         * on the "." slot which becomes the value for this node.
         else if (parentParselet.propagatedValueIndex != -1)
         {
            Object[] mapping = parentParselet.slotMapping;
            if (ppnode.children.size() != mapping.length)
                System.err.println("*** - wrong number of children for nested parselet");
            if (parentNode.value == null)
               System.err.println("*** Error: No semantic value class defined on parentNode with slot mapping: " + this);
            else
            {
               for (int i = 0; i < mapping.length; i++)
                  if (mapping[i] != null)
                     TypeUtil.setProperty(parentNode.value, mapping[i], ParseNode.nodeToSemanticValue(ppnode.children.get(i)));
            }
         }
         */
      }
      return true;
   }
public boolean addResultToParent ( Object node , ParentParseNode parent , int index , Parser parser ) { if ( getDiscard ( ) || getLookahead ( ) ) return false ; NestedParselet parentParselet = parent . parselet ; if ( getSkip ( ) && node instanceof ParentParseNode ) { ParentParseNode ppnode = ( ParentParseNode ) node ; Object propagatedValue = null ; if ( parentParselet . parameterMapping == null ) { ArrayList < Object > children = ppnode . children ; int childSz = children . size ( ) ; for ( int i = 0 ; i < childSz ; i ++ ) { Object c = children . get ( i ) ; parent . add ( c , this , - 1 , index , false , parser ) ; } return false ; } /* We are skipping this value and propagating one slot up.  If there are any slot
         * names, we set the corresponding property on the value we are propagating up.
         * This corresponds to a pattern like (foobar,.) which means set the foobar property
         * on the "." slot which becomes the value for this node.
         else if (parentParselet.propagatedValueIndex != -1)
         {
            Object[] mapping = parentParselet.slotMapping;
            if (ppnode.children.size() != mapping.length)
                System.err.println("*** - wrong number of children for nested parselet");

            if (parentNode.value == null)
               System.err.println("*** Error: No semantic value class defined on parentNode with slot mapping: " + this);
            else
            {
               for (int i = 0; i < mapping.length; i++)
                  if (mapping[i] != null)
                     TypeUtil.setProperty(parentNode.value, mapping[i], ParseNode.nodeToSemanticValue(ppnode.children.get(i)));
            }
         }
         */ } return true ; }
Adds the supplied result node produced by this parselet to the parent parse node.
Adds the supplied result node produced by this parselet to the parent parse node .
// Exclude this entirely from the result // We have no information to preserve in this level of the hierarchy so we merge // it into the parentNode. // We are adding a nested child which is marked as being skipped.  At this // point we add its children directly to the parentNode node - we'll throw away // this temporary parentNode node.  At this point, the value is the semantic value // Do not add to the parentNode node