system/src/sc/parser/OrderedChoice.java
public boolean elementTypeMatches(Object other) {
      if (super.elementTypeMatches(other))
         return true;

      Class svClass = getSemanticValueComponentClass();

      // Could not be a match - the data types do not match
      if (svClass == null || !svClass.isInstance(other))
         return false;

      boolean isArray = getSemanticValueIsArray();

      if (parselets == null)
         return false;
      int sz = parselets.size();
      for (int i = 0; i < sz; i++) {
         Parselet child = parselets.get(i);
         if (isArray) {
            if (child.dataTypeMatches(other))
               return true;
         }
         // If this guy is not the array, the choice itself must be an array?
         else if (child.elementTypeMatches(other))
            return true;
      }
      return false;
   }
/** Returns true if this parselet could have produced the given semanticValue. */
Returns true if this parselet could have produced the given semanticValue.
Returns true if this parselet could have produced the given semanticValue .
public boolean elementTypeMatches(Object other) {
      if (super.elementTypeMatches(other))
         return true;
      Class svClass = getSemanticValueComponentClass();
      if (svClass == null || !svClass.isInstance(other))
         return false;
      boolean isArray = getSemanticValueIsArray();
      if (parselets == null)
         return false;
      int sz = parselets.size();
      for (int i = 0; i < sz; i++) {
         Parselet child = parselets.get(i);
         if (isArray) {
            if (child.dataTypeMatches(other))
               return true;
         }
         else if (child.elementTypeMatches(other))
            return true;
      }
      return false;
   }
public boolean elementTypeMatches ( Object other ) { if ( super . elementTypeMatches ( other ) ) return true ; Class svClass = getSemanticValueComponentClass ( ) ; if ( svClass == null || ! svClass . isInstance ( other ) ) return false ; boolean isArray = getSemanticValueIsArray ( ) ; if ( parselets == null ) return false ; int sz = parselets . size ( ) ; for ( int i = 0 ; i < sz ; i ++ ) { Parselet child = parselets . get ( i ) ; if ( isArray ) { if ( child . dataTypeMatches ( other ) ) return true ; } else if ( child . elementTypeMatches ( other ) ) return true ; } return false ; }
Returns true if this parselet could have produced the given semanticValue.
Returns true if this parselet could have produced the given semanticValue .
// Could not be a match - the data types do not match // If this guy is not the array, the choice itself must be an array?