system/src/sc/lang/pattern/Pattern.java
public static Object initPattern(Language language, Object pageType, String pattern) {
      Object res = PatternLanguage.getPatternLanguage().parseString(pattern);
      if (res instanceof ParseError)
         return res;
      res = ParseUtil.nodeToSemanticValue(res);
      if (!(res instanceof Pattern))
         return res;
      Pattern patternRes = (Pattern) res;
      // ignoring the result - just because this initializes the parslet and language
      patternRes.getParselet(language, pageType);
      // Need to set the system class loader so we can find the user defined model class in the pattern in case there are properties to set
      if (pageType instanceof BodyTypeDeclaration)
         language.classLoader = ((BodyTypeDeclaration) pageType).getLayeredSystem().getSysClassLoader();
      else if (pageType != null)
         language.classLoader = ((Class) pageType).getClassLoader();
      patternRes.clearParseNode();
      return res;
   }
/**
    * Initializes a pattern string written in the PatternLanguage.  Returns either a Pattern object or a ParseError if the pattern string is not valid
    * The supplied pattern can use parselets from a second language to parse a chunk in the pattern (e.g. {integerLiteral}, or {identifier} if you supply the JavaLanguage)
    * or the pattern can be matched to properties of the pageType (e.g. {blogId=integerLiteral}).
    */
Initializes a pattern string written in the PatternLanguage.  Returns either a Pattern object or a ParseError if the pattern string is not valid
The supplied pattern can use parselets from a second language to parse a chunk in the pattern
or the pattern can be matched to properties of the pageType .
Initializes a pattern string written in the PatternLanguage . Returns either a Pattern object or a ParseError if the pattern string is not valid The supplied pattern can use parselets from a second language to parse a chunk in the pattern or the pattern can be matched to properties of the pageType .
public static Object initPattern(Language language, Object pageType, String pattern) {
      Object res = PatternLanguage.getPatternLanguage().parseString(pattern);
      if (res instanceof ParseError)
         return res;
      res = ParseUtil.nodeToSemanticValue(res);
      if (!(res instanceof Pattern))
         return res;
      Pattern patternRes = (Pattern) res;
      patternRes.getParselet(language, pageType);
      if (pageType instanceof BodyTypeDeclaration)
         language.classLoader = ((BodyTypeDeclaration) pageType).getLayeredSystem().getSysClassLoader();
      else if (pageType != null)
         language.classLoader = ((Class) pageType).getClassLoader();
      patternRes.clearParseNode();
      return res;
   }
public static Object initPattern ( Language language , Object pageType , String pattern ) { Object res = PatternLanguage . getPatternLanguage ( ) . parseString ( pattern ) ; if ( res instanceof ParseError ) return res ; res = ParseUtil . nodeToSemanticValue ( res ) ; if ( ! ( res instanceof Pattern ) ) return res ; Pattern patternRes = ( Pattern ) res ; patternRes . getParselet ( language , pageType ) ; if ( pageType instanceof BodyTypeDeclaration ) language . classLoader = ( ( BodyTypeDeclaration ) pageType ) . getLayeredSystem ( ) . getSysClassLoader ( ) ; else if ( pageType != null ) language . classLoader = ( ( Class ) pageType ) . getClassLoader ( ) ; patternRes . clearParseNode ( ) ; return res ; }
Initializes a pattern string written in the PatternLanguage.
Initializes a pattern string written in the PatternLanguage .
// ignoring the result - just because this initializes the parslet and language // Need to set the system class loader so we can find the user defined model class in the pattern in case there are properties to set