Package avrora.core

Examples of avrora.core.Program$Location


     */
    public static Program loadProgram(String[] args) throws Exception {
        Status.begin("Loading "+args[0]);
        ProgramReader reader = Defaults.getProgramReader(INPUT.get());
        reader.options.process(mainOptions);
        Program program = reader.read(args);
        Status.success();
        return program;
    }
View Full Code Here


            progName = props.getProperty("Program");
      interruptSched = props.getProperty("Interrupt-schedule");
        }

        public void run() throws Exception {
            Program p = Main.loadProgram(new String[] { progName });
            Simulator s = Defaults.newSimulator(0, p);
      new InterruptScheduler(interruptSched, s);
            probeTest.run(s);
        }
View Full Code Here

            probeTest = p.ProbeTest();
            progName = props.getProperty("Program");
        }

        public void run() throws Exception {
            Program p = Main.loadProgram(new String[] { progName });
            Simulator s = Defaults.newSimulator(0, p);
            probeTest.run(s);
        }
View Full Code Here

    public ISEAAction() {
        super("This action invokes the inter-procedural side-effect analysis tool.");
    }

    public void run(String[] args) throws Exception {
        Program p = Main.loadProgram(args);
        ISEAnalyzer a = new ISEAnalyzer(p);
        if ( !"".equals(START.get())) {
            SourceMapping.Location location = p.getSourceMapping().getLocation(START.get());
            if ( location == null )
                Avrora.userError("Cannot find program location "+START.get());
            a.analyze(location.address);
        } else {
            a.analyze();
View Full Code Here

    return b.toString();
  }

    public Location provideLocation(Location location, int index, int repetition) {
        if (location.getField() < 0)
            return new Location(location)
                .withField(index)
                .withFieldRepetition(repetition);
        if (location.getComponent() < 0)
            return new Location(location)
                .withComponent(index);
        return new Location(location)
            .withSubcomponent(index);
    }
View Full Code Here

        .createPopulatedSegmentIterator(message); iter.hasNext();) {
      Segment s = (Segment) iter.next();
      for (int field = 1; field <= s.numFields(); field++) {
        Type[] t = s.getField(field);
        for (int rep = 0; rep < t.length; rep++) {
          Location location = new Location();
          location.setSegmentName(s.getName());
          location.setField(field);
          location.setFieldRepetition(rep);
          testType(t[rep], handler, location);
        }
      }
    }
  }
View Full Code Here

  private void testType(Type type, ValidationExceptionHandler<R> handler, Location l) {
    if (type instanceof Composite) {
      Type[] components = ((Composite) type).getComponents();
      for (int comp = 0; comp < components.length; comp++) {
        Location location = new Location(l);
        location.setComponent(comp + 1);
        testComponent(components[comp], handler, location);
      }
    } else if (type instanceof Varies) {
      testType(((Varies) type).getData(), handler, l);
    } else {
View Full Code Here

  private void testComponent(Type type, ValidationExceptionHandler<R> handler, Location l) {
    if (type instanceof Composite) {
      Type[] component = ((Composite) type).getComponents();
      for (int sub = 0; sub < component.length; sub++) {
        Location location = new Location(l);
        location.setSubcomponent(sub + 1);
        testSubComponent(component[sub], handler, location);
      }
    } else if (type instanceof Varies) {
      testComponent(((Varies) type).getData(), handler, l);
    } else {
View Full Code Here

 
  public ValidationException[] apply(Message msg) {
    List<ValidationException> exceptions = new ArrayList<ValidationException>();

    ValidationException ve = new ValidationException("Invalid version: " + msg.getVersion());
    Location location = new Location();
    location.setSegmentName("MSH");
    location.setField(12);
    ve.setLocation(location);
    ve.setError(ErrorCode.UNSUPPORTED_VERSION_ID);
    exceptions.add(ve);

    return exceptions.toArray(new ValidationException[exceptions.size()]);
View Full Code Here

    public Location getLocation(Message msg) throws HL7Exception {
      Terser t = new Terser(msg);
      StringTokenizer tok = new StringTokenizer(expression, "-", false);
      Segment segment = t.getSegment(tok.nextToken());
      Location location = new Location();
      location.setSegmentName(segment.getName());
      location.setFieldIndizes(Terser.getIndices(expression));
      return location;
    }
View Full Code Here

TOP

Related Classes of avrora.core.Program$Location

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.