aot_path_module Module

The aot_path can be used to track the position of a Lua entity in nested tables.

Warning

This is obsolete! Use aot_references_module instead. Please note that this module might be removed in future versions of Aotus.

The idea is to initialize the path in the very beginning and then append a node whenever a table is opened. Thus you pass down the growing path object and store at in the level, to which you might need to return later.


Uses

  • module~~aot_path_module~~UsesGraph module~aot_path_module aot_path_module module~aot_fun_module aot_fun_module module~aot_path_module->module~aot_fun_module module~aot_table_module aot_table_module module~aot_path_module->module~aot_table_module module~aotus_module aotus_module module~aot_path_module->module~aotus_module module~flu_binding flu_binding module~aot_path_module->module~flu_binding module~aot_fun_module->module~aot_table_module module~aot_fun_module->module~flu_binding module~aot_extdouble_fun_module aot_extdouble_fun_module module~aot_fun_module->module~aot_extdouble_fun_module module~aot_fun_declaration_module aot_fun_declaration_module module~aot_fun_module->module~aot_fun_declaration_module module~aot_quadruple_fun_module aot_quadruple_fun_module module~aot_fun_module->module~aot_quadruple_fun_module module~aot_references_module aot_references_module module~aot_fun_module->module~aot_references_module module~aot_top_module aot_top_module module~aot_fun_module->module~aot_top_module module~flu_kinds_module flu_kinds_module module~aot_fun_module->module~flu_kinds_module module~aot_table_module->module~flu_binding module~aot_err_module aot_err_module module~aot_table_module->module~aot_err_module module~aot_extdouble_table_module aot_extdouble_table_module module~aot_table_module->module~aot_extdouble_table_module module~aot_quadruple_table_module aot_quadruple_table_module module~aot_table_module->module~aot_quadruple_table_module module~aot_table_ops_module aot_table_ops_module module~aot_table_module->module~aot_table_ops_module module~aot_table_module->module~aot_top_module module~aot_table_module->module~flu_kinds_module module~aotus_module->module~aot_table_module module~aotus_module->module~flu_binding module~aotus_module->module~aot_top_module module~aot_vector_module aot_vector_module module~aotus_module->module~aot_vector_module module~aotus_module->module~flu_kinds_module iso_c_binding iso_c_binding module~flu_binding->iso_c_binding module~dump_lua_fif_module dump_lua_fif_module module~flu_binding->module~dump_lua_fif_module module~flu_binding->module~flu_kinds_module module~lua_fif lua_fif module~flu_binding->module~lua_fif module~lua_parameters lua_parameters module~flu_binding->module~lua_parameters module~aot_err_module->module~flu_binding module~aot_extdouble_fun_module->module~aot_table_module module~aot_extdouble_fun_module->module~flu_binding module~aot_extdouble_fun_module->module~aot_fun_declaration_module module~aot_extdouble_fun_module->module~flu_kinds_module module~aot_extdouble_top_module aot_extdouble_top_module module~aot_extdouble_fun_module->module~aot_extdouble_top_module module~aot_extdouble_table_module->module~flu_binding module~aot_extdouble_table_module->module~aot_err_module module~aot_extdouble_table_module->module~aot_table_ops_module module~aot_extdouble_table_module->module~aot_top_module module~aot_extdouble_table_module->module~flu_kinds_module module~aot_extdouble_table_module->module~aot_extdouble_top_module module~aot_fun_declaration_module->module~flu_kinds_module module~aot_quadruple_fun_module->module~aot_table_module module~aot_quadruple_fun_module->module~flu_binding module~aot_quadruple_fun_module->module~aot_fun_declaration_module module~aot_quadruple_fun_module->module~flu_kinds_module module~aot_quadruple_top_module aot_quadruple_top_module module~aot_quadruple_fun_module->module~aot_quadruple_top_module module~aot_quadruple_table_module->module~flu_binding module~aot_quadruple_table_module->module~aot_err_module module~aot_quadruple_table_module->module~aot_table_ops_module module~aot_quadruple_table_module->module~aot_top_module module~aot_quadruple_table_module->module~flu_kinds_module module~aot_quadruple_table_module->module~aot_quadruple_top_module module~aot_references_module->module~flu_binding module~aot_references_module->module~aot_table_ops_module module~aot_references_module->module~lua_parameters module~aot_table_ops_module->module~flu_binding module~aot_table_ops_module->module~aot_top_module module~aot_table_ops_module->module~flu_kinds_module module~aot_top_module->module~flu_binding module~aot_top_module->module~aot_err_module module~aot_top_module->module~flu_kinds_module module~aot_top_module->module~aot_extdouble_top_module module~aot_top_module->module~aot_quadruple_top_module module~aot_vector_module->module~flu_binding module~aot_vector_module->module~aot_table_ops_module module~aot_vector_module->module~aot_top_module module~aot_vector_module->module~flu_kinds_module module~aot_extdouble_vector_module aot_extdouble_vector_module module~aot_vector_module->module~aot_extdouble_vector_module module~aot_quadruple_vector_module aot_quadruple_vector_module module~aot_vector_module->module~aot_quadruple_vector_module module~dump_lua_fif_module->iso_c_binding module~lua_fif->iso_c_binding module~lua_fif->module~lua_parameters module~lua_parameters->iso_c_binding module~aot_extdouble_top_module->module~flu_binding module~aot_extdouble_top_module->module~aot_err_module module~aot_extdouble_vector_module->module~flu_binding module~aot_extdouble_vector_module->module~aot_table_ops_module module~aot_extdouble_vector_module->module~aot_top_module module~aot_extdouble_vector_module->module~aot_extdouble_top_module module~aot_quadruple_top_module->module~flu_binding module~aot_quadruple_top_module->module~aot_err_module module~aot_quadruple_vector_module->module~flu_binding module~aot_quadruple_vector_module->module~aot_table_ops_module module~aot_quadruple_vector_module->module~aot_top_module module~aot_quadruple_vector_module->module~aot_quadruple_top_module

Interfaces

public interface assignment(=)

Taking care of the linked list in a copying routine for the assignment of aot_path_type.

  • private subroutine aot_path_copy(left, right)

    Copy a given path object, this is the implementation of the assignment left = right.

    Arguments

    Type IntentOptional Attributes Name
    type(aot_path_type), intent(inout) :: left

    Object to assign a path to

    type(aot_path_type), intent(in) :: right

    Path to be copied

public interface aot_path_open

Re-open a previously recorded path through nested Lua tables.

This opens all the tables recursively down to the last node in the path. It might be used to open a table, or a function.

  • private subroutine aot_path_open_fun(me, conf, fun, openLua)

    This subroutine opens all the tables on the way to the final head node, which ought to be a function.

    The given fun object is then filled by an aot_fun_open on the head of the given path. The handle can be either passed in, to be used for the look up of the path, or, when specifying the optional openLua argument as true, it will return the handle to the newly opened Lua script.

    Arguments

    Type IntentOptional Attributes Name
    type(aot_path_type), intent(inout) :: me

    The path object to open as a function

    type(flu_State) :: conf

    The flu_state handle, which is either opened according to the path, or used to open the path in.

    type(aot_fun_type), intent(out) :: fun

    The opened function

    logical, intent(in), optional :: openLua

    A flag to indicate, wether to open the Lua script, default is false, in which case the conf argument has to link to an actual Lua state handle.

  • private subroutine aot_path_open_table(me, conf, thandle, openLua)

    This subroutine opens all the tables on the way to the final head node of the given path.

    The handle can be either passed in, to be used for the look up of the path, or, when specifying the optional openLua argument as true, it will return the handle to the newly opened Lua script.

    Arguments

    Type IntentOptional Attributes Name
    type(aot_path_type), intent(inout) :: me

    The path object to open as a function

    type(flu_State) :: conf

    The flu_state handle, which is either opened according to the path, or used to open the path in.

    integer, intent(out) :: thandle

    return handle of the last opened table

    logical, intent(in), optional :: openLua

    A flag to indicate, wether to open the Lua script, default is false, in which case the conf argument has to link to an actual Lua state handle.

public interface aot_path_close

  • private subroutine aot_path_close_fun(me, conf, fun, closeLua)

    This routine closes function and all other tables opened along the path.

    Arguments

    Type IntentOptional Attributes Name
    type(aot_path_type), intent(inout) :: me

    The path object to open as a function

    type(flu_State) :: conf

    The flu_state handle, which is either opened according to the path, or used to open the path in.

    type(aot_fun_type), intent(inout) :: fun

    The opened function

    logical, intent(in), optional :: closeLua

    A flag to indicate, wether to close the Lua script, default is false.

  • private subroutine aot_path_close_table(me, conf, closeLua)

    This routine closes all the table opened in aot_path_open_table.

    Arguments

    Type IntentOptional Attributes Name
    type(aot_path_type), intent(inout) :: me

    The path object to open as a function

    type(flu_State) :: conf

    The flu_state handle, which is either opened according to the path, or used to open the path in.

    logical, intent(in), optional :: closeLua

    A flag to indicate, wether to close the Lua script, default is false.


Derived Types

type, public ::  aot_path_type

This type is the main data structure of the module and describes the path.

Read more…

Components

Type Visibility Attributes Name Initial
character(len=256), private :: LuaFilename

Name of the file where this path object is found in.

integer, private :: rootHandle

Handle to the topmost table opened for the path.

type(aot_path_node_type), private, pointer :: GlobalNode => NULL()

Entry level of the path on the global scope of the Lua script.

type(aot_path_node_type), private, pointer :: head => NULL()

Moving head through the linked list of path nodes.

type, private ::  aot_path_node_type

This data structure describes a node in the path through nested tables.

Components

Type Visibility Attributes Name Initial
character(len=16), public :: NodeType

What type of node is this? Currently supported are function and table

character(len=16), public :: ID_kind

How to look up this node, by key or position?

character(len=80), public :: key

Identifying key

integer, public :: pos

Identifying position

type(aot_path_node_type), public, pointer :: child => NULL()

Link to possible child of this node


Subroutines

public subroutine aot_init_path(me, Filename)

This subroutine initializes a path object.

Read more…

Arguments

Type IntentOptional Attributes Name
type(aot_path_type), intent(out) :: me

Path object to initialize

character(len=*), intent(in), optional :: Filename

Filename of the Lua script, this path is located in

public subroutine aot_fin_path(me)

This subroutine finalizes a path object and deallocates all its nodes.

Arguments

Type IntentOptional Attributes Name
type(aot_path_type), intent(inout) :: me

Path to destroy

public subroutine aot_path_addNode(me, NodeType, pos, key)

With this subroutine a node is appended to the end of the list of nodes of the given path.

Read more…

Arguments

Type IntentOptional Attributes Name
type(aot_path_type), intent(inout) :: me

Path to append the node to

character(len=*), intent(in) :: NodeType

Type of the node (table of function)

integer, intent(in), optional :: pos

Position in the parenting table

character(len=*), intent(in), optional :: key

Key within the parenting table

public subroutine aot_path_delNode(me, isEmpty)

The delNode removes the last node from the list of nodes of the given path.

Read more…

Arguments

Type IntentOptional Attributes Name
type(aot_path_type), intent(inout) :: me

Path to delet the last node from

logical, intent(out), optional :: isEmpty

Flag, if resulting path is empty (contains no nodes anymore)

public subroutine aot_path_toString(path, pathAsString)

Dumps the complete path into a string.

Read more…

Arguments

Type IntentOptional Attributes Name
type(aot_path_type), intent(in) :: path

The path which information should be printed

character(len=*), intent(out) :: pathAsString

The path represented as string

public subroutine aot_path_dump(path, outputUnit)

Dumps the complete path to the given output unit.

Read more…

Arguments

Type IntentOptional Attributes Name
type(aot_path_type), intent(in) :: path

The path which information should be printed

integer, intent(in) :: outputUnit

The unit to use to write the path data

private subroutine aot_path_copy(left, right)

Copy a given path object, this is the implementation of the assignment left = right.

Arguments

Type IntentOptional Attributes Name
type(aot_path_type), intent(inout) :: left

Object to assign a path to

type(aot_path_type), intent(in) :: right

Path to be copied

private subroutine aot_path_open_fun(me, conf, fun, openLua)

This subroutine opens all the tables on the way to the final head node, which ought to be a function.

Read more…

Arguments

Type IntentOptional Attributes Name
type(aot_path_type), intent(inout) :: me

The path object to open as a function

type(flu_State) :: conf

The flu_state handle, which is either opened according to the path, or used to open the path in.

type(aot_fun_type), intent(out) :: fun

The opened function

logical, intent(in), optional :: openLua

A flag to indicate, wether to open the Lua script, default is false, in which case the conf argument has to link to an actual Lua state handle.

private subroutine aot_path_open_table(me, conf, thandle, openLua)

This subroutine opens all the tables on the way to the final head node of the given path.

Read more…

Arguments

Type IntentOptional Attributes Name
type(aot_path_type), intent(inout) :: me

The path object to open as a function

type(flu_State) :: conf

The flu_state handle, which is either opened according to the path, or used to open the path in.

integer, intent(out) :: thandle

return handle of the last opened table

logical, intent(in), optional :: openLua

A flag to indicate, wether to open the Lua script, default is false, in which case the conf argument has to link to an actual Lua state handle.

private subroutine aot_path_close_fun(me, conf, fun, closeLua)

This routine closes function and all other tables opened along the path.

Arguments

Type IntentOptional Attributes Name
type(aot_path_type), intent(inout) :: me

The path object to open as a function

type(flu_State) :: conf

The flu_state handle, which is either opened according to the path, or used to open the path in.

type(aot_fun_type), intent(inout) :: fun

The opened function

logical, intent(in), optional :: closeLua

A flag to indicate, wether to close the Lua script, default is false.

private subroutine aot_path_close_table(me, conf, closeLua)

This routine closes all the table opened in aot_path_open_table.

Arguments

Type IntentOptional Attributes Name
type(aot_path_type), intent(inout) :: me

The path object to open as a function

type(flu_State) :: conf

The flu_state handle, which is either opened according to the path, or used to open the path in.

logical, intent(in), optional :: closeLua

A flag to indicate, wether to close the Lua script, default is false.