Skip to content
Authors

File resolution_machine.c

FileList > resolution_machine > src > resolution_machine.c

Go to the source code of this file

Handle the production of a word in a language configured into a production store. More...

  • #include "resolution_machine.h"
  • #include "production_store.h"
  • #include <stdio.h>
  • #include <string.h>
  • #include <pdgl_defs.h>

Public Functions

Type Name
STATIC_INLINE const prodstr_obj_t * get_next_production (resmach_partial_t * partial, const prodstr_store_t * store, FILE * stream)
Identify the next production in the current partial.
uint8_t resmach_execute (const prodstr_store_t * store, resmach_stack_t * stack, FILE * stream)
Execute the production of a word in the language found in the production store.

Detailed Description

Author:

Joe Starr

Public Functions Documentation

function get_next_production

Identify the next production in the current partial.

STATIC_INLINE const prodstr_obj_t * get_next_production (
    resmach_partial_t * partial,
    const prodstr_store_t * store,
    FILE * stream
) 

Parse the partial string from the current location printing as the partial is consumed. When a production is found report that production to the calling function. If none is found report NULL.

Parameters:

  • partial The partial to consume.
  • store The store to search for productions in.
  • stream The stream to print to.

Returns:

A pointer to the next production or NULL if partial is complete.


function resmach_execute

Execute the production of a word in the language found in the production store.

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

Utilizing the given stack execute the production of a word in the language configured in the production store. Output the results of the execution to the configured stream.

Parameters:

  • store A production store containing a DGL
  • stack A stack of partial resolutions.
  • stream An output stream.

Returns:

A status flag indicating success.



The documentation for this class was generated from the following file source/resolution_machine/src/resolution_machine.c