system/src/sc/parser/NestedParselet.java
public boolean emptyValue(GenerateContext ctx, Object value) {
      if (super.emptyValue(ctx, value))
         return true;

      if (parameterType == ParameterType.INHERIT || parameterType == ParameterType.DEFAULT) {
         // Not doing this for arrays.
         if (!getSemanticValueIsArray() && getSemanticValueClass() != null && getSemanticValueClass().isInstance(value)) {
            int numParselets = parselets.size();
            for (int i = 0; i < numParselets; i++) {
               Parselet childParselet = parselets.get(i);
               if (parameterMapping == null || parameterMapping[i] == ParameterMapping.INHERIT) {
                  if (!childParselet.emptyValue(ctx, value))
                     return false;
               }
               else if (parameterMapping[i] == ParameterMapping.NAMED_SLOT) {
                  Object slotValue = ctx != null ? ctx.getPropertyValue(value, slotMapping[i]) : TypeUtil.getPropertyValue(value, slotMapping[i]);

                  // Special case: when we are populating a slot, we'll set it as null
                  // if there is no entries in the list.  An empty list means something
                  // different.  So in this case only, we consider an empty list as
                  // a non-empty value.
                  if (slotValue instanceof List && ((List) slotValue).size() == 0)
                     return false;
                  if (!childParselet.emptyValue(ctx, slotValue))
                     return false;
               }
               // If there are keywords that are matched at the end of the sequence, e.g. the close brace in a block statement
               // that counts as a non-empty value.  We can't just skip all keywords because there's the case where IfStatement
               // optionally matches 'else elseStatement'.  If elseStatement is null, there's an empty value.
               else if (parameterMapping[i] == ParameterMapping.SKIP && i == numParselets - 1)
                  return false;
            }
            return true;
         }
      }
      return false;
   }
/**
    * Determines if there is any semantic information left in the value supplied as
    * determined by the parselet.  If the value is null, it is empty.  If the parselet
    * sets properties on its parent object during the parse phase, we view that parent
    * as empty if all of the slots are null.
    * <p>
    * This method lets us determine when an optional slot has failed... if it is empty
    * a failure is not reported.
    *
    * @param ctx
    * @param value
    * @return true if there's no real value.
    */
Determines if there is any semantic information left in the value supplied as
determined by the parselet.  If the value is null, it is empty.  If the parselet
sets properties on its parent object during the parse phase, we view that parent
as empty if all of the slots are null.

This method lets us determine when an optional slot has failed... if it is empty
a failure is not reported.

@param ctx
@param value
@return true if there's no real value.
Determines if there is any semantic information left in the value supplied as determined by the parselet . If the value is null it is empty . If the parselet sets properties on its parent object during the parse phase we view that parent as empty if all of the slots are null . This method lets us determine when an optional slot has failed ... if it is empty a failure is not reported . @param ctx @param value @return true if there ' s no real value .
public boolean emptyValue(GenerateContext ctx, Object value) {
      if (super.emptyValue(ctx, value))
         return true;
      if (parameterType == ParameterType.INHERIT || parameterType == ParameterType.DEFAULT) {
         if (!getSemanticValueIsArray() && getSemanticValueClass() != null && getSemanticValueClass().isInstance(value)) {
            int numParselets = parselets.size();
            for (int i = 0; i < numParselets; i++) {
               Parselet childParselet = parselets.get(i);
               if (parameterMapping == null || parameterMapping[i] == ParameterMapping.INHERIT) {
                  if (!childParselet.emptyValue(ctx, value))
                     return false;
               }
               else if (parameterMapping[i] == ParameterMapping.NAMED_SLOT) {
                  Object slotValue = ctx != null ? ctx.getPropertyValue(value, slotMapping[i]) : TypeUtil.getPropertyValue(value, slotMapping[i]);
                  if (slotValue instanceof List && ((List) slotValue).size() == 0)
                     return false;
                  if (!childParselet.emptyValue(ctx, slotValue))
                     return false;
               }
               else if (parameterMapping[i] == ParameterMapping.SKIP && i == numParselets - 1)
                  return false;
            }
            return true;
         }
      }
      return false;
   }
public boolean emptyValue ( GenerateContext ctx , Object value ) { if ( super . emptyValue ( ctx , value ) ) return true ; if ( parameterType == ParameterType . INHERIT || parameterType == ParameterType . DEFAULT ) { if ( ! getSemanticValueIsArray ( ) && getSemanticValueClass ( ) != null && getSemanticValueClass ( ) . isInstance ( value ) ) { int numParselets = parselets . size ( ) ; for ( int i = 0 ; i < numParselets ; i ++ ) { Parselet childParselet = parselets . get ( i ) ; if ( parameterMapping == null || parameterMapping [ i ] == ParameterMapping . INHERIT ) { if ( ! childParselet . emptyValue ( ctx , value ) ) return false ; } else if ( parameterMapping [ i ] == ParameterMapping . NAMED_SLOT ) { Object slotValue = ctx != null ? ctx . getPropertyValue ( value , slotMapping [ i ] ) : TypeUtil . getPropertyValue ( value , slotMapping [ i ] ) ; if ( slotValue instanceof List && ( ( List ) slotValue ) . size ( ) == 0 ) return false ; if ( ! childParselet . emptyValue ( ctx , slotValue ) ) return false ; } else if ( parameterMapping [ i ] == ParameterMapping . SKIP && i == numParselets - 1 ) return false ; } return true ; } } return false ; }
Determines if there is any semantic information left in the value supplied as
 determined by the parselet.
Determines if there is any semantic information left in the value supplied as determined by the parselet .
// Not doing this for arrays. // Special case: when we are populating a slot, we'll set it as null // if there is no entries in the list.  An empty list means something // different.  So in this case only, we consider an empty list as // a non-empty value. // If there are keywords that are matched at the end of the sequence, e.g. the close brace in a block statement // that counts as a non-empty value.  We can't just skip all keywords because there's the case where IfStatement // optionally matches 'else elseStatement'.  If elseStatement is null, there's an empty value.