public static DPattern parsePattern(final PsiFile file, final ErrorHandler eh, boolean checking) {
    try {
      final Parseable p = createParsable(file, eh);
      if (checking) {
        p.parse(new SchemaBuilderImpl(eh, DT_LIBRARY_FACTORY.getValue(), new SchemaPatternBuilder()));
      } else {
        return p.parse(new DSchemaBuilderImpl());
      }
    } catch (BuildException e) {
      LOG.info(e);
    } catch (IllegalSchemaException e) {
      final VirtualFile virtualFile = file.getVirtualFile();
      if (virtualFile != null) {
        if (LOG.isDebugEnabled()) {
          LOG.debug("invalid schema: " + virtualFile.getPresentableUrl(), e);
        } else {
          LOG.info("invalid schema: " + virtualFile.getPresentableUrl() + ". [" + e.getMessage() + "]");
        }
      }
    }
    return null;
  }
public static DPattern parsePattern(final PsiFile file, final ErrorHandler eh, boolean checking)