token_list_t Derived Type

type, public :: token_list_t

The tokens of a source text, in source order.


Inherits

type~~token_list_t~~InheritsGraph type~token_list_t token_list_t type~token_t token_t type~token_list_t->type~token_t tok

Inherited by

type~~token_list_t~~InheritedByGraph type~token_list_t token_list_t type~source_t source_t type~source_t->type~token_list_t tokens

Components

Type Visibility Attributes Name Initial
integer, public :: n = 0

number of tokens

type(token_t), public, allocatable :: tok(:)

storage; only tok(1:n) is in use


Type-Bound Procedures

procedure, public :: push

append a token

  • private subroutine push(self, t)

    Append token t, growing the storage as needed.

    Arguments

    Type IntentOptional Attributes Name
    class(token_list_t), intent(inout) :: self

    the token list

    type(token_t), intent(in) :: t

    token to append

Source Code

type, public :: token_list_t
    !! The tokens of a source text, in source order.
    type(token_t), allocatable :: tok(:)   !! storage; only `tok(1:n)` is in use
    integer :: n = 0                       !! number of tokens
contains
    procedure :: push                      !! append a token
end type token_list_t