Пример #1
0
 @Override
 protected void parse(File sourceFile) throws ParseException {
   try {
     GrammarConfiguration configuration =
         LanguageBase.createGrammarConfiguration(
             sourceFile, PHPLexer.class, PHPParser.class, new DefaultErrorListener(sourceFile));
     ParseTree tree = ((PHPParser) configuration.parser).htmlDocument();
     ParseTreeWalker walker = new ParseTreeWalker();
     walker.walk(new PHPParseTreeListener(this), tree);
   } catch (Exception e) {
     throw new ParseException(e);
   }
 }
Пример #2
0
  @Override
  public void graph() {
    // Before graphing, let's load composer configuration if there is any
    this.classFileResolver = new CompoundClassFileResolver();

    File composerJson = new File(PathUtil.CWD.toFile(), "composer.json");
    if (composerJson.isFile()) {
      try {
        ComposerSchemaJson configuration = ComposerConfiguration.getConfiguration(composerJson);
        initAutoLoader(configuration);
      } catch (IOException e) {
        LOGGER.warn("Failed to read composer configuration {}", e.getMessage());
      }
    }
    super.graph();
  }