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 CodeLocationgetLocation()Yields the location where this code element appears in the program.ProgramgetProgram()Yields theProgramwhere 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:CodeElementYields the location where this code element appears in the program.- Specified by:
getLocationin interfaceCodeElement- Returns:
- the location where this code element appears in the program
-
getProgram
public Program getProgram()
Description copied from class:UnitYields theProgramwhere this unit is defined.- Specified by:
getProgramin classUnit- Returns:
- the program
-
-