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

      Class svClass = getSemanticValueClass();

      // Already verified that other is not a String - the default type in super.dataTypeMatches
      if (svClass == null) {
         return false;
      }

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

      // In this case the specific type of the class
      if (parameterType == ParameterType.INHERIT)
         return true;

      if (parselets == null)
         return false;
      int sz = parselets.size();
      for (int i = 0; i < sz; i++) {
         Parselet child = parselets.get(i);
         if (parameterMapping == null)
            continue;
         switch (parameterMapping[i]) {
            case PROPAGATE:
               return child.dataTypeMatches(other);
         }
      }

      // We have no children which could produce this type so it is not a match
      return false;
   }
/**
    * When we are trying to determine if a given node is produced by a given parselet, we use this method.
    * It returns true if this parselet could have produced this data type.
    */
When we are trying to determine if a given node is produced by a given parselet, we use this method.
It returns true if this parselet could have produced this data type.
When we are trying to determine if a given node is produced by a given parselet we use this method . It returns true if this parselet could have produced this data type .
public boolean dataTypeMatches(Object other) {
      if (super.dataTypeMatches(other))
         return true;
      Class svClass = getSemanticValueClass();
      if (svClass == null) {
         return false;
      }
      if (!svClass.isInstance(other))
         return false;
      if (parameterType == ParameterType.INHERIT)
         return true;
      if (parselets == null)
         return false;
      int sz = parselets.size();
      for (int i = 0; i < sz; i++) {
         Parselet child = parselets.get(i);
         if (parameterMapping == null)
            continue;
         switch (parameterMapping[i]) {
            case PROPAGATE:
               return child.dataTypeMatches(other);
         }
      }
      return false;
   }
public boolean dataTypeMatches ( Object other ) { if ( super . dataTypeMatches ( other ) ) return true ; Class svClass = getSemanticValueClass ( ) ; if ( svClass == null ) { return false ; } if ( ! svClass . isInstance ( other ) ) return false ; if ( parameterType == ParameterType . INHERIT ) return true ; if ( parselets == null ) return false ; int sz = parselets . size ( ) ; for ( int i = 0 ; i < sz ; i ++ ) { Parselet child = parselets . get ( i ) ; if ( parameterMapping == null ) continue ; switch ( parameterMapping [ i ] ) { case PROPAGATE : return child . dataTypeMatches ( other ) ; } } return false ; }
When we are trying to determine if a given node is produced by a given parselet, we use this method.
When we are trying to determine if a given node is produced by a given parselet we use this method .
// Already verified that other is not a String - the default type in super.dataTypeMatches // Could not be a match - the data types do not match // In this case the specific type of the class // We have no children which could produce this type so it is not a match