libsapling  0.8.0
Typedefs | Functions
lr0_item.h File Reference

LR(0) item implementation. More...

#include "libsapling/cc/production.h"

Go to the source code of this file.

Typedefs

typedef struct lr0_item * lr0_item_t
 

Functions

lr0_item_t new_lr0_item (production_t production, int cursor)
 Allocates a new LR(0) item on the heap. More...
 
void delete_lr0_item (lr0_item_t item)
 Frees the memory previously allocated on the heap for an LR(0) item with new_lr0_item.
 
production_t lr0_item__production (lr0_item_t item)
 Returns the LR(0) item's production. More...
 
int lr0_item__cursor (lr0_item_t item)
 Returns the LR(0) item's cursor position. More...
 
int lr0_item__equals (const void *a, const void *b)
 
void lr0_item__print (FILE *stream, const void *data)
 

Detailed Description

LR(0) item implementation.

Function Documentation

◆ lr0_item__cursor()

int lr0_item__cursor ( lr0_item_t  item)

Returns the LR(0) item's cursor position.

Returns
the LR(0) item's cursor position.

◆ lr0_item__production()

production_t lr0_item__production ( lr0_item_t  item)

Returns the LR(0) item's production.

Returns
the LR(0) item's production.

◆ new_lr0_item()

lr0_item_t new_lr0_item ( production_t  production,
int  cursor 
)

Allocates a new LR(0) item on the heap.

Returns
pointer to the allocated grammar.