Package avrora.core

Examples of avrora.core.SourceMapping$Location


        }

        private void updateNodeID() {
            if ( UPDATE_NODE_ID.get() ) {
                Program p = path.getProgram();
                SourceMapping smap = p.getSourceMapping();
                SourceMapping.Location location = smap.getLocation("TOS_LOCAL_ADDRESS");
                if ( location == null ) location = smap.getLocation("node_address");
                if ( location != null ) {
                    BaseInterpreter bi = simulator.getInterpreter();
                    bi.writeFlashByte(location.address, Arithmetic.low(id));
                    bi.writeFlashByte(location.address+1, Arithmetic.high(id));
                }
View Full Code Here


     * @return a list of program locations
     */
    public static List getLocationList(Program program, List v) {
        HashSet locset = new HashSet(v.size()*2);

        SourceMapping lm = program.getSourceMapping();
        Iterator i = v.iterator();

        while (i.hasNext()) {
            String val = (String)i.next();

            SourceMapping.Location l = lm.getLocation(val);
            if ( l == null )
                Avrora.userError("Label unknown", val);
            locset.add(l);
        }

View Full Code Here

                addPair(loc.address, tar.address);
            }
        }

        private LabelMapping.Location getLocation(String src) {
            SourceMapping lm = program.getSourceMapping();
            SourceMapping.Location loc = lm.getLocation(src);
            if ( loc == null )
                Avrora.userError("Invalid program address: ", src);
            if ( program.readInstr(loc.address) == null )
                Avrora.userError("Invalid program address: ", src);
            return loc;
View Full Code Here

            return loc;
        }

        private void addFrom() {
            Iterator i = FROM.get().iterator();
            SourceMapping sm = program.getSourceMapping();
            while (i.hasNext()) {
                String str = (String)i.next();
                SourceMapping.Location loc = sm.getLocation(str);
                for ( int cntr = 0; cntr < program.program_end; cntr = program.getNextPC(cntr) )
                    addPair(loc.address, cntr);
            }
        }
View Full Code Here

            }
        }

        private void addTo() {
            Iterator i = TO.get().iterator();
            SourceMapping sm = program.getSourceMapping();
            while (i.hasNext()) {
                String str = (String)i.next();
                SourceMapping.Location loc = sm.getLocation(str);
                for ( int cntr = 0; cntr < program.program_end; cntr = program.getNextPC(cntr) )
                    addPair(cntr, loc.address);
            }
        }
View Full Code Here

    }

    private void updateNodeID() {
      if ( UPDATE_NODE_ID.get() ) {
        Program p = path.getProgram();
        SourceMapping smap = p.getSourceMapping();
        SourceMapping.Location location = smap.getLocation("TOS_LOCAL_ADDRESS");
        if ( location == null ) location = smap.getLocation("node_address");
        if ( location != null ) {
          BaseInterpreter bi = simulator.getInterpreter();
          bi.writeFlashByte(location.address, Arithmetic.low(id));
          bi.writeFlashByte(location.address+1, Arithmetic.high(id));
        }
View Full Code Here

                addPair(loc.address, tar.address);
            }
        }

        private LabelMapping.Location getLocation(String src) {
            SourceMapping lm = program.getSourceMapping();
            SourceMapping.Location loc = lm.getLocation(src);
            if ( loc == null )
                Avrora.userError("Invalid program address: ", src);
            if ( program.readInstr(loc.address) == null )
                Avrora.userError("Invalid program address: ", src);
            return loc;
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

TOP

Related Classes of avrora.core.SourceMapping$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.