static FeatureSet detectFeatures( ProgramTree tree, StaticSourceFile sourceFile, String sourceString) { IRFactory irFactory = new IRFactory(sourceString, sourceFile, NULL_CONFIG, NULL_REPORTER, tree.sourceComments); Node n = irFactory.transformDispatcher.process(tree); irFactory.validateAll(n); return irFactory.features; }
public static IRFactory transformTree(ProgramTree tree, StaticSourceFile sourceFile, String sourceString, Config config, ErrorReporter errorReporter) { IRFactory irFactory = new IRFactory(sourceString, sourceFile, config, errorReporter, tree.sourceComments); // don't call transform as we don't want standard jsdoc handling. Node n = irFactory.transformDispatcher.process(tree); irFactory.setSourceInfo(n, tree); if (tree.sourceComments != null) { for (Comment comment : tree.sourceComments) { if ((comment.type == Comment.Type.JSDOC || comment.type == Comment.Type.IMPORTANT) && !irFactory.parsedComments.contains(comment)) { irFactory.handlePossibleFileOverviewJsDoc(comment); } } } irFactory.setFileOverviewJsDoc(n); irFactory.validateAll(n); irFactory.resultNode = n; return irFactory; }
public static IRFactory transformTree(ProgramTree tree, StaticSourceFile sourceFile, String sourceString, Config config, ErrorReporter errorReporter) { IRFactory irFactory = new IRFactory(sourceString, sourceFile, config, errorReporter, tree.sourceComments); // don't call transform as we don't want standard jsdoc handling. Node n = irFactory.transformDispatcher.process(tree); irFactory.setSourceInfo(n, tree); if (tree.sourceComments != null) { for (Comment comment : tree.sourceComments) { if (comment.type == Comment.Type.JSDOC && !irFactory.parsedComments.contains(comment)) { irFactory.handlePossibleFileOverviewJsDoc(comment); } else if (comment.type == Comment.Type.BLOCK) { irFactory.handleBlockComment(comment); } } } irFactory.setFileOverviewJsDoc(n); irFactory.validateAll(n); irFactory.resultNode = n; return irFactory; }