Package com.grammatech.gtirb
Class IR
- java.lang.Object
-
- com.grammatech.gtirb.Node
-
- com.grammatech.gtirb.AuxDataContainer
-
- com.grammatech.gtirb.IR
-
public class IR extends AuxDataContainer
A complete internal representation. IR describes the internal representation of a software artifact.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.grammatech.gtirb.AuxDataContainer
AuxDataContainer.AuxData
-
-
Field Summary
-
Fields inherited from class com.grammatech.gtirb.AuxDataContainer
auxDataMap
-
-
Constructor Summary
Constructors Constructor Description IR()Default class constructor for IR.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddModule(Module module)Add a module to thisIR.voidaddModules(java.util.List<Module> modules)Add a list of modules to thisIR.java.util.List<Module>findModules(java.lang.String name)Find modules by name.CFGgetCfg()Get the CFG belonging to thisIR.java.util.List<Module>getModules()Get the list of modules belonging to thisIR.intgetVersion()Get the protobuf version of thisIR.static IRloadFile(java.io.InputStream fileIn)Load IR from a protobuf file stream.static IRloadFile(java.lang.String fileInName)Load IR from a protobuf file.booleanremoveModule(Module module)Remove a module from thisIR.voidsaveFile(java.io.OutputStream fileOut)Save IR to a protobuf file stream.voidsaveFile(java.lang.String fileOutName)Save IR to a protobuf file.voidsetCfg(CFG cfg)Set the CFG belonging to thisIR.voidsetVersion(int version)Set the protobuf version of thisIR.com.grammatech.gtirb.proto.IROuterClass.IR.BuildertoProtobuf()Serialize this IR into a protobuf.-
Methods inherited from class com.grammatech.gtirb.AuxDataContainer
clearAuxData, getAuxData, getAuxDataMap, putAuxData, removeAuxData, removeAuxData
-
-
-
-
Method Detail
-
loadFile
public static IR loadFile(java.io.InputStream fileIn)
Load IR from a protobuf file stream.- Returns:
- IR if load is successful, null otherwise.
-
loadFile
public static IR loadFile(java.lang.String fileInName)
Load IR from a protobuf file.- Returns:
- IR if load is successful, null otherwise.
-
findModules
public java.util.List<Module> findModules(java.lang.String name)
Find modules by name.
-
addModule
public void addModule(Module module)
Add a module to thisIR.- Parameters:
module-Moduleto add.
-
addModules
public void addModules(java.util.List<Module> modules)
Add a list of modules to thisIR.- Parameters:
modules- Modules to add.
-
removeModule
public boolean removeModule(Module module)
Remove a module from thisIR.- Parameters:
module-Moduleto remove.- Returns:
- boolean true if the IR contained the module and it was removed.
-
getVersion
public int getVersion()
Get the protobuf version of thisIR.- Returns:
- Protobuf version.
-
setVersion
public void setVersion(int version)
Set the protobuf version of thisIR.- Parameters:
version- Protobuf version.
-
toProtobuf
public com.grammatech.gtirb.proto.IROuterClass.IR.Builder toProtobuf()
Serialize this IR into a protobuf.- Returns:
- IR protocol buffer.
-
saveFile
public void saveFile(java.io.OutputStream fileOut) throws java.io.IOExceptionSave IR to a protobuf file stream.- Throws:
java.io.IOException
-
saveFile
public void saveFile(java.lang.String fileOutName) throws java.io.IOExceptionSave IR to a protobuf file.- Throws:
java.io.IOException
-
-