Package it.unive.lisa.program
Class ProgramUnit
- java.lang.Object
-
- it.unive.lisa.program.Unit
-
- it.unive.lisa.program.ProgramUnit
-
- All Implemented Interfaces:
CodeElement
- Direct Known Subclasses:
CodeUnit
,CompilationUnit
public abstract class ProgramUnit extends Unit implements CodeElement
A unit that is part of a LiSAProgram
.
-
-
Constructor Summary
Constructors Constructor Description ProgramUnit(CodeLocation location, Program program, java.lang.String name)
Builds a unit, defined at the given location.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CodeLocation
getLocation()
Yields the location where this code element appears in the program.Program
getProgram()
Yields theProgram
where this unit is defined.-
Methods inherited from class it.unive.lisa.program.Unit
addCodeMember, addGlobal, canBeInstantiated, getCodeMember, getCodeMembers, getCodeMembersByName, getCodeMembersRecursively, getGlobal, getGlobals, getGlobalsRecursively, getMatchingCodeMember, getName, toString
-
-
-
-
Constructor Detail
-
ProgramUnit
public ProgramUnit(CodeLocation location, Program program, java.lang.String name)
Builds a unit, defined at the given location.- Parameters:
location
- the location where the unit is define within the source fileprogram
- the program where this unit is definedname
- the name of the unit
-
-
Method Detail
-
getLocation
public CodeLocation getLocation()
Description copied from interface:CodeElement
Yields the location where this code element appears in the program.- Specified by:
getLocation
in interfaceCodeElement
- Returns:
- the location where this code element appears in the program
-
getProgram
public Program getProgram()
Description copied from class:Unit
Yields theProgram
where this unit is defined.- Specified by:
getProgram
in classUnit
- Returns:
- the program
-
-