Examples of AnalysisResult


Examples of com.google.dart.engine.context.AnalysisResult

    long getEnd = System.currentTimeMillis();
    if (task == null && validateCacheConsistency()) {
      task = getNextAnalysisTask();
    }
    if (task == null) {
      return new AnalysisResult(getChangeNotices(true), getEnd - getStart, null, -1L);
    }
    String taskDescription = task.toString();
    if (!reportedLoop && !recentTasks.add(taskDescription)) {
      @SuppressWarnings("resource")
      PrintStringWriter writer = new PrintStringWriter();
      writer.print("Performing repeated task: ");
      writer.println(taskDescription);
      for (String description : recentTasks) {
        writer.print("  ");
        writer.println(description);
      }
      logInformation(writer.toString());
    }
    notifyAboutToPerformTask(taskDescription);
    if (TRACE_PERFORM_TASK) {
      System.out.println(taskDescription);
    }
    long performStart = System.currentTimeMillis();
    try {
      task.perform(resultRecorder);
    } catch (ObsoleteSourceAnalysisException exception) {
      AnalysisEngine.getInstance().getLogger().logInformation(
          "Could not perform analysis task: " + taskDescription,
          exception);
    } catch (AnalysisException exception) {
      if (!(exception.getCause() instanceof IOException)) {
        AnalysisEngine.getInstance().getLogger().logError(
            "Internal error while performing the task: " + task,
            exception);
      }
    }
    long performEnd = System.currentTimeMillis();
    ChangeNotice[] notices = getChangeNotices(false);
    int noticeCount = notices.length;
    for (int i = 0; i < noticeCount; i++) {
      ChangeNotice notice = notices[i];
      Source source = notice.getSource();
      // TODO(brianwilkerson) Figure out whether the compilation unit is always resolved, or whether
      // we need to decide whether to invoke the "parsed" or "resolved" method. This might be better
      // done when recording task results in order to reduce the chance of errors.
//      if (notice.getCompilationUnit() != null) {
//        notifyResolvedDart(source, notice.getCompilationUnit());
//      } else if (notice.getHtmlUnit() != null) {
//        notifyResolvedHtml(source, notice.getHtmlUnit());
//      }
      notifyErrors(source, notice.getErrors(), notice.getLineInfo());
    }
    return new AnalysisResult(notices, getEnd - getStart, task.getClass().getName(), performEnd
        - performStart);
  }
View Full Code Here

Examples of de.pdf_scrutinizer.data.AnalysisResult

                if (libemuTester != null) {
                    scrutinizer.getDynamicHeuristics().setShellcodeTester(libemuTester);
                }
            }

            AnalysisResult result = scrutinizer.analyze();
            System.out.println(AnalysisResultHelper.toString(result));
        } else {
            printHelp();
        }
    }
View Full Code Here

Examples of minecrafterror.analysis.AnalysisResult

      System.out.println("Debug: " + Boolean.toString(res.isSilly())
          + ": " + res.getMessage());
    }
    // If no other results (size = 1), get the first one
    // Otherwise, get the second one
    AnalysisResult conclusion = (results.size() > 1) ? (results.get(1))
        : (results.get(0));
    return conclusion;
  }
View Full Code Here

Examples of org.drools.compiler.AnalysisResult

        JavaDialect dialect = (JavaDialect) context.getDialect( "java" );
       
        Map<String, Class<?>> variables = new HashMap<String,Class<?>>();
        BoundIdentifiers boundIdentifiers = new BoundIdentifiers(variables, context.getPackageBuilder().getGlobals());
        AnalysisResult analysis = dialect.analyzeBlock( context,
                                                        actionDescr,
                                                        actionDescr.getText(),
                                                        boundIdentifiers);

        if ( analysis == null ) {
            // not possible to get the analysis results
            return;
        }

        Set<String> identifiers = analysis.getBoundIdentifiers().getGlobals().keySet();

        final Map map = createVariableContext( className,
                                               actionDescr.getText(),
                                               (ProcessBuildContext) context,
                                               (String[]) identifiers.toArray( new String[identifiers.size()] ),
                                               analysis.getNotBoundedIdentifiers(),
                                               contextResolver);
        map.put( "text",
                 ProcessKnowledgeHelperFixer.fix( actionDescr.getText() ));

        generatTemplates( "actionMethod",
View Full Code Here

Examples of org.drools.compiler.AnalysisResult

        JavaDialect dialect = (JavaDialect) context.getDialect( "java" );
       
        Map<String, Class<?>> variables = new HashMap<String,Class<?>>();
        BoundIdentifiers boundIdentifiers = new BoundIdentifiers(variables, context.getPackageBuilder().getGlobals());
        AnalysisResult analysis = dialect.analyzeBlock( context,
                                                        descr,
                                                        descr.getText(),
                                                        boundIdentifiers);

        if ( analysis == null ) {
            // not possible to get the analysis results
            return;
        }

        if ( analysis == null ) {
            // not possible to get the analysis results
            return;
        }

        Set<String> identifiers = analysis.getBoundIdentifiers().getGlobals().keySet();

        final Map map = createVariableContext( className,
                                               descr.getText(),
                                               (ProcessBuildContext) context,
                                               (String[]) identifiers.toArray( new String[identifiers.size()] ),
                                               analysis.getNotBoundedIdentifiers(),
                                               contextResolver);
        map.put( "text",
                 descr.getText() );

        generatTemplates( "returnValueEvaluatorMethod",
View Full Code Here

Examples of org.drools.compiler.AnalysisResult

        // it must be an EvalDescr
        final EvalDescr evalDescr = (EvalDescr) descr;

        Map<String, Declaration> decls = context.getDeclarationResolver().getDeclarations( context.getRule() );

        AnalysisResult analysis = context.getDialect().analyzeExpression( context,
                                                                          evalDescr,
                                                                          evalDescr.getContent(),
                                                                          new BoundIdentifiers( context.getDeclarationResolver().getDeclarationClasses(decls),
                                                                                                context.getPackageBuilder().getGlobals() ) );
View Full Code Here

Examples of org.drools.compiler.AnalysisResult

        }

        EvalDescr evalDescr = (EvalDescr) descr;

        PredicateDescr predicateDescr = new PredicateDescr( context.getRuleDescr().getResource(), evalDescr.getContent() );
        AnalysisResult analysis = buildAnalysis(context, prefixPattern, predicateDescr, null );

        Declaration[] declarations = getUsedDeclarations(context, prefixPattern, analysis);
        return buildEval(context, evalDescr, analysis, declarations);
    }
View Full Code Here

Examples of org.drools.compiler.AnalysisResult

        if ( pattern.getObjectType() instanceof ClassObjectType ) {
            thisClass = ((ClassObjectType) pattern.getObjectType()).getClassType();
        }

        Map<String, Class< ? >> globals = context.getPackageBuilder().getGlobals();
        AnalysisResult analysis = context.getDialect().analyzeExpression( context,
                returnValueRestrictionDescr,
                returnValueRestrictionDescr.getContent(),
                new BoundIdentifiers( declarationsMap,
                        globals,
                        null,
                        thisClass ) );
        if ( analysis == null ) {
            // something bad happened
            return null;
        }
        final BoundIdentifiers usedIdentifiers = analysis.getBoundIdentifiers();

        final List<Declaration> tupleDeclarations = new ArrayList<Declaration>();
        final List<Declaration> factDeclarations = new ArrayList<Declaration>();
        for ( String id : usedIdentifiers.getDeclrClasses().keySet() ) {
            final Declaration decl = context.getDeclarationResolver().getDeclaration( context.getRule(), id );
            if ( decl.getPattern() == pattern ) {
                factDeclarations.add( decl );
            } else {
                tupleDeclarations.add( decl );
            }
        }
        createImplicitBindings( context,
                pattern,
                analysis.getNotBoundedIdentifiers(),
                usedIdentifiers,
                factDeclarations );

        final Declaration[] previousDeclarations = tupleDeclarations.toArray( new Declaration[tupleDeclarations.size()] );
        final Declaration[] localDeclarations = factDeclarations.toArray( new Declaration[factDeclarations.size()] );
View Full Code Here

Examples of org.drools.compiler.AnalysisResult

                            final PredicateDescr predicateDescr,
                            final Map<String, OperatorDescr> aliases,
                            final String expr,
                            final boolean isEvalExpression) {

        AnalysisResult analysis = buildAnalysis(context, pattern, predicateDescr, aliases );

        if ( analysis == null ) {
            // something bad happened
            return;
        }

        Declaration[][] usedDeclarations = getUsedDeclarations(context, pattern, analysis);
        Declaration[] previousDeclarations = usedDeclarations[0];
        Declaration[] localDeclarations = usedDeclarations[1];

        BoundIdentifiers usedIdentifiers = analysis.getBoundIdentifiers();
        String[] requiredGlobals = usedIdentifiers.getGlobals().keySet().toArray( new String[usedIdentifiers.getGlobals().size()] );
        String[] requiredOperators = usedIdentifiers.getOperators().keySet().toArray( new String[usedIdentifiers.getOperators().size()] );

        Arrays.sort( previousDeclarations,
                     SortDeclarations.instance );
View Full Code Here

Examples of org.drools.compiler.AnalysisResult

                Map<String, Class< ? >> declarations = getDeclarationsMap( descr,
                                                                           context,
                                                                           false );
                Map<String, Class< ? >> globals = context.getPackageBuilder().getGlobals();

                final AnalysisResult analysis = context.getDialect().analyzeExpression( context,
                                                                                        descr,
                                                                                        fieldName,
                                                                                        new BoundIdentifiers( declarations,
                                                                                                              globals,
                                                                                                              null,
                                                                                                              ((ClassObjectType) objectType).getClassType() ) );

                if ( analysis == null ) {
                    // something bad happened
                    if ( reportError ) {
                        context.addError(new DescrBuildError(context.getParentDescr(),
                                descr,
                                null,
                                "Unable to analyze expression '" + fieldName + "'"));
                    }
                    return null;
                }

                final BoundIdentifiers usedIdentifiers = analysis.getBoundIdentifiers();

                if ( !usedIdentifiers.getDeclrClasses().isEmpty() ) {
                    if ( reportError && descr instanceof BindingDescr ) {
                        context.addError(new DescrBuildError(context.getParentDescr(),
                                descr,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.