Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | StackNum | |||
integer, | intent(in) | :: | LineNum | |||
integer, | intent(in) | :: | Keyword | |||
integer, | intent(in), | optional | :: | Argument1 | ||
integer, | intent(in), | optional | :: | Argument2 |
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
FUNCTION AddInstruction(StackNum, LineNum, Keyword, Argument1, Argument2) RESULT(InstructionNum)
! SUBROUTINE INFORMATION:
! AUTHOR Peter Graham Ellis
! DATE WRITTEN June 2006
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Adds an instruction to a stack.
! METHODOLOGY EMPLOYED:
!
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: StackNum
INTEGER, INTENT(IN) :: LineNum
INTEGER, INTENT(IN) :: Keyword
INTEGER, INTENT(IN), OPTIONAL :: Argument1 ! Erl variable index
INTEGER, INTENT(IN), OPTIONAL :: Argument2
INTEGER :: InstructionNum
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
TYPE(ErlStackType) :: TempStack
! FLOW:
IF (ErlStack(StackNum)%NumInstructions == 0) THEN
ALLOCATE(ErlStack(StackNum)%Instruction(1))
ErlStack(StackNum)%NumInstructions = 1
ELSE
TempStack = ErlStack(StackNum)
DEALLOCATE(ErlStack(StackNum)%Instruction)
ALLOCATE(ErlStack(StackNum)%Instruction(ErlStack(StackNum)%NumInstructions + 1))
ErlStack(StackNum)%Instruction(1:ErlStack(StackNum)%NumInstructions) = &
TempStack%Instruction(1:ErlStack(StackNum)%NumInstructions)
ErlStack(StackNum)%NumInstructions = ErlStack(StackNum)%NumInstructions + 1
END IF
InstructionNum = ErlStack(StackNum)%NumInstructions
ErlStack(StackNum)%Instruction(InstructionNum)%LineNum = LineNum
ErlStack(StackNum)%Instruction(InstructionNum)%Keyword = Keyword
IF (Present(Argument1)) ErlStack(StackNum)%Instruction(InstructionNum)%Argument1 = Argument1
IF (Present(Argument2)) ErlStack(StackNum)%Instruction(InstructionNum)%Argument2 = Argument2
RETURN
END FUNCTION AddInstruction