forgex_syntax_tree_graph_m Module



Derived Types

type, public ::  tree_t

Components

Type Visibility Attributes Name Initial
type(tree_node_t), public, allocatable :: nodes(:)
integer, public :: num_alloc = 0
type(tape_t), public :: tape
integer, public :: top = INVALID_INDEX

Type-Bound Procedures

procedure, public :: build => tree_graph__build_syntax_tree
procedure, public :: caret_dollar => tree_graph__make_tree_caret_dollar
procedure, public :: char_class => tree_graph__char_class
procedure, public :: connect_left => tree_graph__connect_left
procedure, public :: connect_right => tree_graph__connect_right
procedure, public :: crlf => tree_graph__make_tree_crlf
procedure, public :: deallocate => tree_graph__deallocate
procedure, public :: get_top => tree_graph__get_top
procedure, public :: primary => tree_graph__primary
procedure, public :: print => print_tree_wrap
procedure, public :: range => tree_graph__range
procedure, public :: reallocate => tree_graph__reallocate
procedure, public :: regex => tree_graph__regex
procedure, public :: register => tree_graph__register_node
procedure, public :: register_connector => tree_graph__register_connector
procedure, public :: shorthand => tree_graph__shorthand
procedure, public :: suffix_op => tree_graph__suffix_op
procedure, public :: term => tree_graph__term

Functions

private function print_class_simplify(tree, root_i) result(str)

Arguments

Type IntentOptional Attributes Name
type(tree_node_t), intent(in) :: tree(:)
integer(kind=int32) :: root_i

Return Value character(len=:), allocatable

private pure function tree_graph__get_top(self) result(node)

Arguments

Type IntentOptional Attributes Name
class(tree_t), intent(in) :: self

Return Value type(tree_node_t)


Subroutines

public subroutine dump_tree_table(tree)

Arguments

Type IntentOptional Attributes Name
class(tree_node_t), intent(in) :: tree(:)

private recursive subroutine print_tree_internal(tree, node_i, uni)

Arguments

Type IntentOptional Attributes Name
type(tree_node_t), intent(in) :: tree(:)
integer, intent(in) :: node_i
integer, intent(in) :: uni

private subroutine print_tree_wrap(self, uni)

Arguments

Type IntentOptional Attributes Name
class(tree_t), intent(in) :: self
integer, intent(in) :: uni

private pure subroutine tree_graph__build_syntax_tree(self, pattern)

Arguments

Type IntentOptional Attributes Name
class(tree_t), intent(inout) :: self
character(len=*), intent(in) :: pattern

private pure subroutine tree_graph__char_class(self)

Arguments

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

private pure subroutine tree_graph__connect_left(self, parent, child)

Arguments

Type IntentOptional Attributes Name
class(tree_t), intent(inout) :: self
integer, intent(in) :: parent
integer, intent(in) :: child

private pure subroutine tree_graph__connect_right(self, parent, child)

Arguments

Type IntentOptional Attributes Name
class(tree_t), intent(inout) :: self
integer, intent(in) :: parent
integer, intent(in) :: child

private pure subroutine tree_graph__deallocate(self)

Arguments

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

private pure subroutine tree_graph__make_tree_caret_dollar(self)

This function constructs a tree node for carriage return (CR) and line feed (LF) characters.

Arguments

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

private pure subroutine tree_graph__make_tree_crlf(self)

Arguments

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

private pure recursive subroutine tree_graph__primary(self)

Arguments

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

private pure subroutine tree_graph__range(self)

Arguments

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

private pure subroutine tree_graph__reallocate(self)

Arguments

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

private pure recursive subroutine tree_graph__regex(self)

Arguments

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

private pure subroutine tree_graph__register_connector(self, node, left, right)

Arguments

Type IntentOptional Attributes Name
class(tree_t), intent(inout) :: self
type(tree_node_t), intent(inout) :: node
type(tree_node_t), intent(in) :: left
type(tree_node_t), intent(in) :: right

private pure subroutine tree_graph__register_node(self, node)

Arguments

Type IntentOptional Attributes Name
class(tree_t), intent(inout) :: self
type(tree_node_t), intent(inout) :: node

private pure subroutine tree_graph__shorthand(self)

This function handles shorthand escape sequences (\t, \n, \r, \d, \D, \w, \W, \s, \S).

Arguments

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

private pure recursive subroutine tree_graph__suffix_op(self)

Arguments

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

private pure recursive subroutine tree_graph__term(self)

Arguments

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