Package dk.brics.xact.analysis.flowgraph.statements

Examples of dk.brics.xact.analysis.flowgraph.statements.AnalyzeStm


    stmt.apply(this);
    return cfg.finish();
  }
 
  private void addHotspotStatement(ValueBox box) {
    AnalyzeStm stm = new AnalyzeStm(Kind.HOTSPOT, makevar(), translateExpr(box.getValue()), null, context.getCurrentOrigin());
    cfg.addStatement(stm);
    context.putHotspot(box, stm);
  }
View Full Code Here


    }
  }
  private void checkTypeAnnotation(SchemaType annotation, Variable var) {
    if (annotation == null)
      return;
    cfg.addStatement(new AnalyzeStm(AnalyzeStm.Kind.TYPEANNOTATION, makevar(), var, annotation, context.getCurrentOrigin()));
  }
View Full Code Here

  /**
   * Generates an AnalyzeStm.
   */
  private void putAnalyze(Value base, Value type) {
    SchemaType schema = context.parseSchemaType(context.getConstantString(type), context.getCurrentOrigin());
    cfg.addStatement(new AnalyzeStm(AnalyzeStm.Kind.ANALYZECALL, hardcodeResult = makevar(), translateExpr(base),
        schema,
        context.getCurrentOrigin()));
  }
View Full Code Here

        int counter = 0;
        for (Map.Entry<ValueBox, AnalyzeStm> en : result.getHotspots()
                .entrySet()) {
            ValueBox value = en.getKey();
            AnalyzeStm stm = en.getValue();
            XMLGraph g = xmlGraphs.getIn(stm, stm.getBase());
            List<Automaton> findInputNameValues = findInputNameValues(g);
            for (Automaton automaton : findInputNameValues) {
                System.out.println(automaton.getFiniteStrings());
            }
            SootMethod method = hotspot2method.get(value);
View Full Code Here

    s.visitBy(new StatementVisitor() {

      private void handleAssign(Assignment s, VariableElementType value) {
        val.assign(value, s);
        if (s instanceof AnalyzeStm) {
          AnalyzeStm as = (AnalyzeStm) s;
          if (as.getDest().getID() == as.getBase().getID())
            return; // skip AnalyzeStm assignment if dest==base
        }
        for (Variable v : in.getVariables()) {
          if (v == s.getDest()) {
            changed[0] |= val.merge(getVar(in, v), getVar(out, v));
View Full Code Here

            TranslationResult result, XMLGraphBuilder xmlGraphs) {
        // link xml gaps to their plug values
        Map<ChoiceNode, Set<Plugging>> gap2plug = new HashMap<ChoiceNode, Set<Plugging>>();
        for (Plugging plugging : pluggings) {
            final AssignStmt statement = plugging.getStmt();
            AnalyzeStm analyzeStm = result.getHotspots().get(
                    stmt2box.get(statement));
            if (analyzeStm != null) {
                XMLGraph xg = xmlGraphs.getIn(analyzeStm, analyzeStm.getBase());
                final GapFinderByName gapFinder = new GapFinderByName(
                        plugging.getNames());
                log.debug("looking for gaps with the name: "
                        + plugging.getNames().getFiniteStrings());
                log.debug("the xml graph is known to have the following gaps:");
View Full Code Here

            if (!(stmt instanceof ReturnStmt)) // ignore plugs
                continue;

            ReturnStmt returnStmt = (ReturnStmt) stmt;

            AnalyzeStm analyzeStm = result.getHotspots().get(
                    stmt2box.get(returnStmt));
            if (analyzeStm == null) {
                final MethodStatementContainer container = returnLocations
                        .get(returnStmt);
                System.err.println(returnStmt
                        + " -- "
                        + stmt2box.get(returnStmt)
                        + " @ "
                        + SourceUtil.getLocation(container.getMethod(),
                                container.getStatement())
                        + " --> null analyzestmt");
            } else {
                XMLGraph xg = xmlGraphs.getIn(analyzeStm, analyzeStm.getBase());
                new XMLGraph2Dot(new PrintWriter(System.out)).print(xg);
                ret2xg.put(returnStmt, xg);
            }
        }
        return ret2xg;
View Full Code Here

TOP

Related Classes of dk.brics.xact.analysis.flowgraph.statements.AnalyzeStm

Copyright © 2018 www.massapicom. 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.