com.joanju.cg.bytecode
Class ScriptValsInstr

java.lang.Object
  extended by com.joanju.cg.bytecode.Bytecode
      extended by com.joanju.cg.bytecode.ScriptValsInstr

public class ScriptValsInstr
extends Bytecode

Procedure names or handle values from a user script.

Because many kinds of expressions and data-driven calls cannot be resolved by Callgraph, user scripts may be used to supplement Callgraph.

These values are never recalculated - the script is only run once for the call at build time.


Field Summary
 
Fields inherited from class com.joanju.cg.bytecode.Bytecode
address, cuid, instrSet, nodeNum, xrefs
 
Constructor Summary
ScriptValsInstr()
           
ScriptValsInstr(int cuid, int address)
           
ScriptValsInstr(int cuid, int address, java.util.Collection<java.lang.String> stringVals)
          Create with values.
 
Method Summary
 void calcValueSets()
          No-op.
 Opcode getOpcode()
           
 java.util.HashSet<java.lang.Integer> getValues()
          Get the set of values for this instruction.
protected  void setValuesFromByteStream(java.io.DataInputStream in)
           
 java.lang.String toStringFromData()
          All Bytecode instruction subclasses should override this eventually.
protected  void writeValuesToByteStream(java.io.DataOutputStream out)
           
 
Methods inherited from class com.joanju.cg.bytecode.Bytecode
addSource, addWhereUsed, beforeWrite, calcValuesAgain, compareTo, equals, fetchBytesFromDB, fetchInCu, generateDataForDB, getAddress, getCuID, getNodeNum, getSources, getValuesCalcLocal, getWhereUsed, getXrefs, hashCode, initData, isDataModified, isFromDB, setAddress, setCuID, setDataBytesFromDB, setDataModified, setFromDB, setInstructionSet, setNodeNum, shouldLoadData, sourcesForXrefTarget, storeIfModified, toString, toStringFromComments, toStringFromName, toStringFromSet
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ScriptValsInstr

public ScriptValsInstr()

ScriptValsInstr

public ScriptValsInstr(int cuid,
                       int address)

ScriptValsInstr

public ScriptValsInstr(int cuid,
                       int address,
                       java.util.Collection<java.lang.String> stringVals)
                throws java.sql.SQLException
Create with values. If the collection is non-null, then the string ID for each entry is added to the values for this instruction. If there are any nulls in the collection, then UNRESOLVED_VALUE is added.

Throws:
java.sql.SQLException
Method Detail

calcValueSets

public void calcValueSets()
                   throws java.sql.SQLException,
                          java.io.IOException
No-op.

Specified by:
calcValueSets in class Bytecode
Throws:
java.sql.SQLException
java.io.IOException

getOpcode

public Opcode getOpcode()
Specified by:
getOpcode in class Bytecode

getValues

public java.util.HashSet<java.lang.Integer> getValues()
                                               throws java.sql.SQLException,
                                                      java.io.IOException
Description copied from class: Bytecode
Get the set of values for this instruction. Should be overridden by most subclasses. This default implementation returns a set containing one Layout.UNRESOLVED_VALUE.

Overrides:
getValues in class Bytecode
Throws:
java.sql.SQLException
java.io.IOException

setValuesFromByteStream

protected void setValuesFromByteStream(java.io.DataInputStream in)
                                throws java.io.IOException
Specified by:
setValuesFromByteStream in class Bytecode
Throws:
java.io.IOException

toStringFromData

public java.lang.String toStringFromData()
Description copied from class: Bytecode
All Bytecode instruction subclasses should override this eventually.

Overrides:
toStringFromData in class Bytecode
Returns:
"" if not overridden.

writeValuesToByteStream

protected void writeValuesToByteStream(java.io.DataOutputStream out)
                                throws java.io.IOException
Specified by:
writeValuesToByteStream in class Bytecode
Throws:
java.io.IOException


Copyright © 2008 Joanju Software. All Rights Reserved.