Skip to content
Authors

File resolution_machine.h

File List > resolution_machine > src > resolution_machine.h

Go to the documentation of this file

#ifndef RESOLUTION_MACHINE_H
#define RESOLUTION_MACHINE_H

/*************************************************************************************************/
/*************************** Includes ************************************************************/
/*************************************************************************************************/
#include <production_store.h>
#include <pdgl_defs.h>
#include <stdio.h>

/*************************************************************************************************/
/*************************** Defines *************************************************************/
/*************************************************************************************************/

/*************************** Execute Flags *******************************************************/

#define RESMACH_EXECUTE_SUCCESS        (0x0u)

#define RESMACH_EXECUTE_FAIL           (0x1u)

#define RESMACH_EXECUTE_NO_ENTRY       (0x1u << 0x1u)

#define RESMACH_EXECUTE_NULL_STORE     (0x1u << 0x2u)

#define RESMACH_EXECUTE_NULL_STACK     (0x1u << 0x3u)

#define RESMACH_EXECUTE_NULL_STREAM    (0x1u << 0x4u)

/*************************************************************************************************/
/*************************** Typedefs ************************************************************/
/*************************************************************************************************/
#ifdef __cplusplus
extern "C"
{
#endif

typedef struct {
    char *      partial_ptr; 
    const char *buff;        
} resmach_partial_t;

typedef struct {
    resmach_partial_t *partials;  
    size_t             stack_len; 
} resmach_stack_t;


#ifdef __cplusplus
}
#endif


/*************************************************************************************************/
/*************************** Public Function Declarations ****************************************/
/*************************************************************************************************/

#ifdef __cplusplus
extern "C"
{
#endif

uint8_t resmach_execute(const prodstr_store_t *store,
                        resmach_stack_t *stack,
                        FILE *stream);


#ifdef __cplusplus
}
#endif

#endif /* end RESOLUTION_MACHINE_H*/