Commit ac6fb561 authored by thomas@cs.ru.nl's avatar thomas@cs.ru.nl
Browse files

Removed redundant casts

parent def72399
This diff is collapsed.
/** * Simple Stack Machine * * Written by Atze Dijkstra, atze@cs.uu.nl, * Copyright Utrecht University. * */ package nl.uu.cs.ssm ; import java.awt.Color;import java.util.Hashtable;import java.util.Vector; public abstract class MetaInstruction{ private static Hashtable<String,Color> colorMap ; static { colorMap = new Hashtable<String,Color>() ; colorMap.put( "black" , Color.black ) ; colorMap.put( "blue" , Color.blue ) ; colorMap.put( "cyan" , Color.cyan ) ; colorMap.put( "darkGray" , Color.darkGray ) ; colorMap.put( "gray" , Color.gray ) ; colorMap.put( "green" , Color.green ) ; colorMap.put( "lightGray" , Color.lightGray ) ; colorMap.put( "magenta" , Color.magenta ) ; colorMap.put( "orange" , Color.orange ) ; colorMap.put( "pink" , Color.pink ) ; colorMap.put( "red" , Color.red ) ; colorMap.put( "yellow" , Color.yellow ) ; } protected Instruction instruction ; private MetaInstruction( Instruction instr ) { instruction = instr ; } public abstract void exec( MachineState machineState ) ; private static class Annote extends MetaInstruction { int register ; int loDispl, hiDispl ; Color color ; String text ; Annote( Instruction i, int r, int l, int h, Color c, String t ) { super( i ) ; register = r ; loDispl = l ; hiDispl = h ; color = c ; text = t ; } public void exec( MachineState machineState ) { Memory mem = machineState.getMemory() ; Registers regs = machineState.getRegisters() ; for ( int i = loDispl ; i <= hiDispl ; i++ ) { mem.setAnnotationAt( regs.getRegDispl( register, i ), new MemoryAnnotation( text, color ) ) ; } } public String toString() { return "Annote reg=" + register + " displ=" + loDispl + "/" + hiDispl + " col=" + color + " text=" + text ; } } public static MetaInstruction newAnnote( Instruction instr, Vector<String> args ) { int r = Registers.findRegOfName( (String)args.elementAt(0) ) ; int l = Utils.fromHex( (String)args.elementAt(1) ) ; int h = Utils.fromHex( (String)args.elementAt(2) ) ; Color c = (Color)colorMap.get( (String)args.elementAt(3) ) ; String t = args.elementAt(4) ; if ( r >= 0 && l <= h && c != null && t != null ) return new Annote( instr, r, l, h, c, t ) ; else return null ; } }
\ No newline at end of file
/** * Simple Stack Machine * * Written by Atze Dijkstra, atze@cs.uu.nl, * Copyright Utrecht University. * */ package nl.uu.cs.ssm ; import java.awt.Color;import java.util.Hashtable;import java.util.Vector; public abstract class MetaInstruction{ private static Hashtable<String,Color> colorMap ; static { colorMap = new Hashtable<String,Color>() ; colorMap.put( "black" , Color.black ) ; colorMap.put( "blue" , Color.blue ) ; colorMap.put( "cyan" , Color.cyan ) ; colorMap.put( "darkGray" , Color.darkGray ) ; colorMap.put( "gray" , Color.gray ) ; colorMap.put( "green" , Color.green ) ; colorMap.put( "lightGray" , Color.lightGray ) ; colorMap.put( "magenta" , Color.magenta ) ; colorMap.put( "orange" , Color.orange ) ; colorMap.put( "pink" , Color.pink ) ; colorMap.put( "red" , Color.red ) ; colorMap.put( "yellow" , Color.yellow ) ; } protected Instruction instruction ; private MetaInstruction( Instruction instr ) { instruction = instr ; } public abstract void exec( MachineState machineState ) ; private static class Annote extends MetaInstruction { int register ; int loDispl, hiDispl ; Color color ; String text ; Annote( Instruction i, int r, int l, int h, Color c, String t ) { super( i ) ; register = r ; loDispl = l ; hiDispl = h ; color = c ; text = t ; } public void exec( MachineState machineState ) { Memory mem = machineState.getMemory() ; Registers regs = machineState.getRegisters() ; for ( int i = loDispl ; i <= hiDispl ; i++ ) { mem.setAnnotationAt( regs.getRegDispl( register, i ), new MemoryAnnotation( text, color ) ) ; } } public String toString() { return "Annote reg=" + register + " displ=" + loDispl + "/" + hiDispl + " col=" + color + " text=" + text ; } } public static MetaInstruction newAnnote( Instruction instr, Vector<String> args ) { int r = Registers.findRegOfName( args.elementAt(0) ) ; int l = Utils.fromHex( args.elementAt(1) ) ; int h = Utils.fromHex( args.elementAt(2) ) ; Color c = colorMap.get( args.elementAt(3) ) ; String t = args.elementAt(4) ; if ( r >= 0 && l <= h && c != null && t != null ) return new Annote( instr, r, l, h, c, t ) ; else return null ; } }
\ No newline at end of file
......
This diff is collapsed.
/* Help.java Title: Simple Stack Machine Runner Author: atze Description: */ package nl.uu.cs.ssmui; //import javax.swing.*; import java.util.Enumeration; import java.util.Vector; import nl.uu.cs.ssm.HelpSupplier; public class Help { private Vector<HelpSupplier> helpSuppliers ; public Help() { helpSuppliers = new Vector<HelpSupplier>() ; } public void addHelpSupplier( HelpSupplier hs ) { helpSuppliers.addElement( hs ) ; } private static void addSorted( Vector<HelpTopic> v, HelpTopic ht ) { int max = v.size() ; int i ; for ( i = 0 ; i < max ; i++ ) { if ( ht.toString().toLowerCase().compareTo( v.elementAt(i).toString().toLowerCase() ) < 0 ) break ; } if ( i >= max ) v.addElement( ht ) ; else v.insertElementAt( ht, i ) ; } public Vector<HelpTopic> findTopics( String key ) { Vector<HelpTopic> topics = new Vector<HelpTopic>() ; if ( key != null ) key = key.toLowerCase() ; for ( Enumeration<HelpSupplier> hss = helpSuppliers.elements() ; hss.hasMoreElements() ; ) { HelpSupplier hs = (HelpSupplier)hss.nextElement() ; for ( Enumeration<String> ts = hs.getTopics() ; ts.hasMoreElements() ; ) { String t = (String)ts.nextElement() ; if ( key == null || t.toLowerCase().indexOf( key ) >= 0 ) addSorted( topics, new HelpTopic( hs, t ) ) ; } } return topics ; } }
\ No newline at end of file
/* Help.java Title: Simple Stack Machine Runner Author: atze Description: */ package nl.uu.cs.ssmui; //import javax.swing.*; import java.util.Enumeration; import java.util.Vector; import nl.uu.cs.ssm.HelpSupplier; public class Help { private Vector<HelpSupplier> helpSuppliers ; public Help() { helpSuppliers = new Vector<HelpSupplier>() ; } public void addHelpSupplier( HelpSupplier hs ) { helpSuppliers.addElement( hs ) ; } private static void addSorted( Vector<HelpTopic> v, HelpTopic ht ) { int max = v.size() ; int i ; for ( i = 0 ; i < max ; i++ ) { if ( ht.toString().toLowerCase().compareTo( v.elementAt(i).toString().toLowerCase() ) < 0 ) break ; } if ( i >= max ) v.addElement( ht ) ; else v.insertElementAt( ht, i ) ; } public Vector<HelpTopic> findTopics( String key ) { Vector<HelpTopic> topics = new Vector<HelpTopic>() ; if ( key != null ) key = key.toLowerCase() ; for ( Enumeration<HelpSupplier> hss = helpSuppliers.elements() ; hss.hasMoreElements() ; ) { HelpSupplier hs = hss.nextElement() ; for ( Enumeration<String> ts = hs.getTopics() ; ts.hasMoreElements() ; ) { String t = ts.nextElement() ; if ( key == null || t.toLowerCase().indexOf( key ) >= 0 ) addSorted( topics, new HelpTopic( hs, t ) ) ; } } return topics ; } }
\ No newline at end of file
......
/* Runner.java Title: Simple Stack Machine Runner Author: atze Description: */ package nl.uu.cs.ssmui; import java.io.IOException;import java.net.URL;import java.util.Enumeration;import java.util.Hashtable;import java.util.Properties;import java.util.Vector; import nl.uu.cs.ssm.HelpAccumulator;import nl.uu.cs.ssm.HelpSupplier;import nl.uu.cs.ssm.Utils; public class HelpFromProp implements HelpSupplier{ private static final char US = '_' ; private static final char SEP = ',' ; private static final char INDIRECT = '@' ; private static final String PROP_DESCR = "descr" ; private static final String PROP_PREPOST = "prepost" ; private static final String PROP_EXAMPLE = "example" ; private boolean doForInstr ; private static Properties getProps( String nm ) { URL url = nm.getClass().getResource( "/Help/" + nm + ".prop" ) ; Properties props = new Properties() ; try { props.load( url.openStream() ) ; } catch( IOException ex ) { } return props ; } private Properties props ; private Vector<String> topics = null ; private HelpSupplier instrHelpSupplier ; protected HelpFromProp( String propnm, HelpSupplier ih, boolean doForInstr ) { this.doForInstr = doForInstr ; props = getProps( propnm ) ; instrHelpSupplier = ih ; } private void checkTopics() { if ( topics == null ) { Hashtable<String,String> ts = new Hashtable<String,String>() ; for ( Enumeration ps = props.propertyNames() ; ps.hasMoreElements() ; ) { String s = (String)ps.nextElement() ; if ( doForInstr ) { int i = s.indexOf( US ) ; if ( i > 0 ) s = s.substring( 0, i ) ; } ts.put( s, s ) ; } topics = new Vector<String>( ) ; Utils.addAllTo( topics, ts.elements() ) ; } } public Enumeration<String> getTopics() { checkTopics() ; return topics.elements() ; } public String getHelpSupplierName() { return doForInstr ? "Semantics" : "General" ; } public String getShortSummaryForTopic( String topic ) { return topic + " " + getHelpSupplierName().toLowerCase() ; } private String getTopicProperty( String topicProp ) { String p = props.getProperty( topicProp ) ; if ( p != null && p.length() > 0 && p.charAt(0) == INDIRECT ) { p = getTopicProperty( p.substring(1) ) ; } if ( p == null ) p = "No info" ; return p ; } private String getTopicProperty( String topic, String prop ) { return getTopicProperty( topic + US + prop ) ; } /* private void commasep( String s, HelpAccumulator acc ) { Vector v = Utils.splitAt( s, SEP ) ; if ( v.size() < 1 ) return ; int max = v.size() - 1 ; for ( int i = 0 ; i < max ; i++ ) { acc.append( ((String)v.elementAt(i)).trim() ) ; acc.linebreak() ; } acc.append( ((String)v.elementAt( max )).trim() ) ; } */ private Enumeration<String> splitByComma( String s ) { Vector<String> v = Utils.splitAt( s, SEP ) ; Vector<String> vv = new Vector<String>() ; for ( Enumeration<String> e = v.elements() ; e.hasMoreElements() ; ) vv.addElement( ((String)e.nextElement()).trim() ) ; return vv.elements() ; } public void getHelpForTopic( String topic, HelpAccumulator acc ) { Enumeration<String> e ; if ( doForInstr ) { instrHelpSupplier.getHelpForTopic( topic, acc ) ; acc.linebreak() ; acc.beginAttributeList() ; acc.attributeName( "Description" ) ; acc.beginAttributeValue() ; acc.append( getTopicProperty( topic, PROP_DESCR ) ) ; acc.endAttributeValue() ; acc.attributeName( "Pre and Post State" ) ; acc.beginAttributeValue() ; e = splitByComma( getTopicProperty( topic, PROP_PREPOST) ) ; acc.mathEquationList( e, US ) ; acc.endAttributeValue() ; acc.attributeName( "Example" ) ; acc.beginAttributeValue() ; e = splitByComma( getTopicProperty( topic, PROP_EXAMPLE) ) ; acc.verbatimList( e ) ; acc.endAttributeValue() ; acc.endAttributeList() ; } else { acc.beginBlockQuote() ; acc.append( getTopicProperty( topic ) ) ; acc.endBlockQuote() ; } } }
\ No newline at end of file
/* Runner.java Title: Simple Stack Machine Runner Author: atze Description: */ package nl.uu.cs.ssmui; import java.io.IOException;import java.net.URL;import java.util.Enumeration;import java.util.Hashtable;import java.util.Properties;import java.util.Vector; import nl.uu.cs.ssm.HelpAccumulator;import nl.uu.cs.ssm.HelpSupplier;import nl.uu.cs.ssm.Utils; public class HelpFromProp implements HelpSupplier{ private static final char US = '_' ; private static final char SEP = ',' ; private static final char INDIRECT = '@' ; private static final String PROP_DESCR = "descr" ; private static final String PROP_PREPOST = "prepost" ; private static final String PROP_EXAMPLE = "example" ; private boolean doForInstr ; private static Properties getProps( String nm ) { URL url = nm.getClass().getResource( "/Help/" + nm + ".prop" ) ; Properties props = new Properties() ; try { props.load( url.openStream() ) ; } catch( IOException ex ) { } return props ; } private Properties props ; private Vector<String> topics = null ; private HelpSupplier instrHelpSupplier ; protected HelpFromProp( String propnm, HelpSupplier ih, boolean doForInstr ) { this.doForInstr = doForInstr ; props = getProps( propnm ) ; instrHelpSupplier = ih ; } private void checkTopics() { if ( topics == null ) { Hashtable<String,String> ts = new Hashtable<String,String>() ; for ( Enumeration ps = props.propertyNames() ; ps.hasMoreElements() ; ) { String s = (String)ps.nextElement() ; if ( doForInstr ) { int i = s.indexOf( US ) ; if ( i > 0 ) s = s.substring( 0, i ) ; } ts.put( s, s ) ; } topics = new Vector<String>( ) ; Utils.addAllTo( topics, ts.elements() ) ; } } public Enumeration<String> getTopics() { checkTopics() ; return topics.elements() ; } public String getHelpSupplierName() { return doForInstr ? "Semantics" : "General" ; } public String getShortSummaryForTopic( String topic ) { return topic + " " + getHelpSupplierName().toLowerCase() ; } private String getTopicProperty( String topicProp ) { String p = props.getProperty( topicProp ) ; if ( p != null && p.length() > 0 && p.charAt(0) == INDIRECT ) { p = getTopicProperty( p.substring(1) ) ; } if ( p == null ) p = "No info" ; return p ; } private String getTopicProperty( String topic, String prop ) { return getTopicProperty( topic + US + prop ) ; } /* private void commasep( String s, HelpAccumulator acc ) { Vector v = Utils.splitAt( s, SEP ) ; if ( v.size() < 1 ) return ; int max = v.size() - 1 ; for ( int i = 0 ; i < max ; i++ ) { acc.append( ((String)v.elementAt(i)).trim() ) ; acc.linebreak() ; } acc.append( ((String)v.elementAt( max )).trim() ) ; } */ private Enumeration<String> splitByComma( String s ) { Vector<String> v = Utils.splitAt( s, SEP ) ; Vector<String> vv = new Vector<String>() ; for ( Enumeration<String> e = v.elements() ; e.hasMoreElements() ; ) vv.addElement( e.nextElement().trim() ) ; return vv.elements() ; } public void getHelpForTopic( String topic, HelpAccumulator acc ) { Enumeration<String> e ; if ( doForInstr ) { instrHelpSupplier.getHelpForTopic( topic, acc ) ; acc.linebreak() ; acc.beginAttributeList() ; acc.attributeName( "Description" ) ; acc.beginAttributeValue() ; acc.append( getTopicProperty( topic, PROP_DESCR ) ) ; acc.endAttributeValue() ; acc.attributeName( "Pre and Post State" ) ; acc.beginAttributeValue() ; e = splitByComma( getTopicProperty( topic, PROP_PREPOST) ) ; acc.mathEquationList( e, US ) ; acc.endAttributeValue() ; acc.attributeName( "Example" ) ; acc.beginAttributeValue() ; e = splitByComma( getTopicProperty( topic, PROP_EXAMPLE) ) ; acc.verbatimList( e ) ; acc.endAttributeValue() ; acc.endAttributeList() ; } else { acc.beginBlockQuote() ; acc.append( getTopicProperty( topic ) ) ; acc.endBlockQuote() ; } } }
\ No newline at end of file
......
/* Title: Simple Stack Machine Runner Author: atze Description: */ package nl.uu.cs.ssmui; import java.util.Enumeration;import java.util.Hashtable;import java.util.Vector; class Labels{ public static final int UNDEFINED = Integer.MAX_VALUE ; private class Label { String label ; boolean isAbsolute ; boolean isWhatItIs ; boolean isResolved ; int row ; Label( String nm, int r, boolean reslv ) { label = nm ; row = r ; isAbsolute = false ; isResolved = reslv ; isWhatItIs = false ; } } protected class UnresolvedLabelUsage { Label label ; int row ; int insideInstOffset ; int pcOffset ; boolean isRelative ; UnresolvedLabelUsage( Label l, int r, int offs, int pcoffs, boolean isRel ) { label = l ; row = r ; insideInstOffset = offs ; pcOffset = pcoffs ; isRelative = isRel ; } public String toString() { return label.label ; } } private Hashtable<String,Label> labels ; private Vector<UnresolvedLabelUsage> unresolvedUsages ; private CodeRowSupplier codeSupplier ; protected Labels( CodeRowSupplier cs ) { codeSupplier = cs ; reset(null) ; } protected void reset( Enumeration<String> regNames ) { if ( regNames != null ) { labels = new Hashtable<String,Label>() ; for ( ; regNames.hasMoreElements() ; ) { String nm = regNames.nextElement() ; defineRegName( nm, nl.uu.cs.ssm.Registers.findRegOfName( nm ) ) ; // not neat, ??? TBD } } unresolvedUsages = new Vector<UnresolvedLabelUsage>() ; } protected void shiftAt( int row, int v ) { } private Label findLabelByName( String nm ) { Label res = (Label)labels.get( nm ) ; return res ; } protected String findLabelNameAtRow( int row ) { for ( Enumeration<Label> e = labels.elements() ; e.hasMoreElements() ; ) { Label l = (Label)e.nextElement() ; if ( l.row == row ) return l.label ; } return "" ; } protected boolean labelIsDefined( String nm ) { return findLabelByName( nm ) != null ; } private void defineRegName( String nm, int val ) { Label l = new Label( nm, val, true ) ; l.isAbsolute = l.isWhatItIs = true ; labels.put( nm, l ) ; } private Label defineLabel( String nm, int row, boolean resolved ) { Label l ; if ( ( l = findLabelByName( nm ) ) != null ) { if ( ! l.isResolved ) { l.isResolved = true ; l.row = row ; } } else { l = new Label( nm, row, resolved ) ; labels.put( nm, l ) ; } //System.out.println( "defined label " + nm + " row=" + row + " loc=" + codeSupplier.memLocOfRow(row) ) ; return l ; } protected void defineLabel( String nm, int row ) { defineLabel( nm, row, true ) ; } protected int useLabel( String nm, int row, int offset, int pcOffset, boolean isRelative ) { return useLabel( nm, row, offset, pcOffset, true, isRelative) ; } private int useLabel( String nm, int row, int offset, int pcOffset, boolean doAddUnresolved, boolean isRelative ) { int res ; Label l = findLabelByName( nm ) ; if ( l != null && l.isResolved ) { if ( l.isWhatItIs ) { res = l.row ; } else { int labelLoc = codeSupplier.memLocOfRow( l.row ) ; int useLoc = codeSupplier.memLocOfRow( row ) + pcOffset ; res = ( (l.isAbsolute || (! isRelative)) ? labelLoc : labelLoc - useLoc ) ; //System.out.println( "use label " + nm + " res=" + res + " useloc=" + useLoc ) ; } } else { if ( l == null ) { l = defineLabel( nm, 0, false ) ; } if ( doAddUnresolved ) unresolvedUsages.addElement( new UnresolvedLabelUsage( l, row, offset, pcOffset, isRelative ) ) ; res = UNDEFINED ; } return res ; } protected Vector<UnresolvedLabelUsage> resolveUnresolved() { Vector<UnresolvedLabelUsage> stillUnresolved = new Vector<UnresolvedLabelUsage>() ; for ( Enumeration<UnresolvedLabelUsage> ls = unresolvedUsages.elements() ; ls.hasMoreElements() ; ) { UnresolvedLabelUsage ul = (UnresolvedLabelUsage)ls.nextElement() ; int val = useLabel( ul.label.label, ul.row, ul.insideInstOffset, ul.pcOffset, false, ul.isRelative ) ; if ( val == UNDEFINED ) stillUnresolved.addElement( ul ) ; else codeSupplier.setInstrArgAt( ul.row, ul.insideInstOffset, val ) ; } return stillUnresolved ; } }
\ No newline at end of file
/* Title: Simple Stack Machine Runner Author: atze Description: */ package nl.uu.cs.ssmui; import java.util.Enumeration;import java.util.Hashtable;import java.util.Vector; class Labels{ public static final int UNDEFINED = Integer.MAX_VALUE ; private class Label { String label ; boolean isAbsolute ; boolean isWhatItIs ; boolean isResolved ; int row ; Label( String nm, int r, boolean reslv ) { label = nm ; row = r ; isAbsolute = false ; isResolved = reslv ; isWhatItIs = false ; } } protected class UnresolvedLabelUsage { Label label ; int row ; int insideInstOffset ; int pcOffset ; boolean isRelative ; UnresolvedLabelUsage( Label l, int r, int offs, int pcoffs, boolean isRel ) { label = l ; row = r ; insideInstOffset = offs ; pcOffset = pcoffs ; isRelative = isRel ; } public String toString() { return label.label ; } } private Hashtable<String,Label> labels ; private Vector<UnresolvedLabelUsage> unresolvedUsages ; private CodeRowSupplier codeSupplier ; protected Labels( CodeRowSupplier cs ) { codeSupplier = cs ; reset(null) ; } protected void reset( Enumeration<String> regNames ) { if ( regNames != null ) { labels = new Hashtable<String,Label>() ; for ( ; regNames.hasMoreElements() ; ) { String nm = regNames.nextElement() ; defineRegName( nm, nl.uu.cs.ssm.Registers.findRegOfName( nm ) ) ; // not neat, ??? TBD } } unresolvedUsages = new Vector<UnresolvedLabelUsage>() ; } protected void shiftAt( int row, int v ) { } private Label findLabelByName( String nm ) { Label res = labels.get( nm ) ; return res ; } protected String findLabelNameAtRow( int row ) { for ( Enumeration<Label> e = labels.elements() ; e.hasMoreElements() ; ) { Label l = e.nextElement() ; if ( l.row == row ) return l.label ; } return "" ; } protected boolean labelIsDefined( String nm ) { return findLabelByName( nm ) != null ; } private void defineRegName( String nm, int val ) { Label l = new Label( nm, val, true ) ; l.isAbsolute = l.isWhatItIs = true ; labels.put( nm, l ) ; } private Label defineLabel( String nm, int row, boolean resolved ) { Label l ; if ( ( l = findLabelByName( nm ) ) != null ) { if ( ! l.isResolved ) { l.isResolved = true ; l.row = row ; } } else { l = new Label( nm, row, resolved ) ; labels.put( nm, l ) ; } //System.out.println( "defined label " + nm + " row=" + row + " loc=" + codeSupplier.memLocOfRow(row) ) ; return l ; } protected void defineLabel( String nm, int row ) { defineLabel( nm, row, true ) ; } protected int useLabel( String nm, int row, int offset, int pcOffset, boolean isRelative ) { return useLabel( nm, row, offset, pcOffset, true, isRelative) ; } private int useLabel( String nm, int row, int offset, int pcOffset, boolean doAddUnresolved, boolean isRelative ) { int res ; Label l = findLabelByName( nm ) ; if ( l != null && l.isResolved ) { if ( l.isWhatItIs ) { res = l.row ; } else { int labelLoc = codeSupplier.memLocOfRow( l.row ) ; int useLoc = codeSupplier.memLocOfRow( row ) + pcOffset ; res = ( (l.isAbsolute || (! isRelative)) ? labelLoc : labelLoc - useLoc ) ; //System.out.println( "use label " + nm + " res=" + res + " useloc=" + useLoc ) ; } } else { if ( l == null ) { l = defineLabel( nm, 0, false ) ; } if ( doAddUnresolved ) unresolvedUsages.addElement( new UnresolvedLabelUsage( l, row, offset, pcOffset, isRelative ) ) ; res = UNDEFINED ; } return res ; } protected Vector<UnresolvedLabelUsage> resolveUnresolved() { Vector<UnresolvedLabelUsage> stillUnresolved = new Vector<UnresolvedLabelUsage>() ; for ( Enumeration<UnresolvedLabelUsage> ls = unresolvedUsages.elements() ; ls.hasMoreElements() ; ) { UnresolvedLabelUsage ul = ls.nextElement() ; int val = useLabel( ul.label.label, ul.row, ul.insideInstOffset, ul.pcOffset, false, ul.isRelative ) ; if ( val == UNDEFINED ) stillUnresolved.addElement( ul ) ; else codeSupplier.setInstrArgAt( ul.row, ul.insideInstOffset, val ) ; } return stillUnresolved ; } }
\ No newline at end of file
......
This diff is collapsed.
......@@ -82,7 +82,7 @@ public class StepManager
Vector<UndoableEvent> events = history.elementAt( sz-1 ) ;
for ( int i = events.size() - 1 ; i >= 0 ; i-- )
{
UndoableEvent e = (UndoableEvent)events.elementAt( i ) ;
UndoableEvent e = events.elementAt( i ) ;
e.undoModification().modify() ;
}
history.removeElementAt( sz-1 ) ;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment