Prism Ruby parser
Loading...
Searching...
No Matches
Functions
serialize.h File Reference

The functions related to serializing the AST to a binary format. More...

#include "prism/excludes.h"
#include "prism/compiler/exported.h"
#include "prism/compiler/nonnull.h"
#include "prism/buffer.h"
#include "prism/parser.h"
#include "prism/source.h"
#include "prism/stream.h"
Include dependency graph for serialize.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

PRISM_EXPORTED_FUNCTION void pm_serialize (pm_parser_t *parser, pm_node_t *node, pm_buffer_t *buffer) PRISM_NONNULL(1
 Serialize the AST represented by the given node to the given buffer.
 
PRISM_EXPORTED_FUNCTION void PRISM_EXPORTED_FUNCTION void pm_serialize_parse (pm_buffer_t *buffer, const uint8_t *source, size_t size, const char *data) PRISM_NONNULL(1
 Parse the given source to the AST and dump the AST to the given buffer.
 
PRISM_EXPORTED_FUNCTION void PRISM_EXPORTED_FUNCTION void PRISM_EXPORTED_FUNCTION void pm_serialize_parse_stream (pm_buffer_t *buffer, pm_source_t *source, const char *data) PRISM_NONNULL(1
 Parse and serialize the AST represented by the given source into the given buffer.
 
PRISM_EXPORTED_FUNCTION void PRISM_EXPORTED_FUNCTION void PRISM_EXPORTED_FUNCTION void PRISM_EXPORTED_FUNCTION void pm_serialize_parse_comments (pm_buffer_t *buffer, const uint8_t *source, size_t size, const char *data) PRISM_NONNULL(1
 Parse and serialize the comments in the given source to the given buffer.
 
PRISM_EXPORTED_FUNCTION void PRISM_EXPORTED_FUNCTION void PRISM_EXPORTED_FUNCTION void PRISM_EXPORTED_FUNCTION void PRISM_EXPORTED_FUNCTION void pm_serialize_lex (pm_buffer_t *buffer, const uint8_t *source, size_t size, const char *data) PRISM_NONNULL(1
 Lex the given source and serialize to the given buffer.
 
PRISM_EXPORTED_FUNCTION void PRISM_EXPORTED_FUNCTION void PRISM_EXPORTED_FUNCTION void PRISM_EXPORTED_FUNCTION void PRISM_EXPORTED_FUNCTION void PRISM_EXPORTED_FUNCTION void pm_serialize_parse_lex (pm_buffer_t *buffer, const uint8_t *source, size_t size, const char *data) PRISM_NONNULL(1
 Parse and serialize both the AST and the tokens represented by the given source to the given buffer.
 
PRISM_EXPORTED_FUNCTION void PRISM_EXPORTED_FUNCTION void PRISM_EXPORTED_FUNCTION void PRISM_EXPORTED_FUNCTION void PRISM_EXPORTED_FUNCTION void PRISM_EXPORTED_FUNCTION void PRISM_EXPORTED_FUNCTION bool pm_serialize_parse_success_p (const uint8_t *source, size_t size, const char *data) PRISM_NONNULL(1)
 Parse the source and return true if it parses without errors or warnings.
 

Detailed Description

The functions related to serializing the AST to a binary format.

Function Documentation

◆ pm_serialize()

PRISM_EXPORTED_FUNCTION void pm_serialize ( pm_parser_t parser,
pm_node_t node,
pm_buffer_t buffer 
)

Serialize the AST represented by the given node to the given buffer.

Parameters
parserThe parser to serialize.
nodeThe node to serialize.
bufferThe buffer to serialize to.

◆ pm_serialize_parse()

PRISM_EXPORTED_FUNCTION void PRISM_EXPORTED_FUNCTION void pm_serialize_parse ( pm_buffer_t buffer,
const uint8_t *  source,
size_t  size,
const char *  data 
)

Parse the given source to the AST and dump the AST to the given buffer.

Parameters
bufferThe buffer to serialize to.
sourceThe source to parse.
sizeThe size of the source.
dataThe optional data to pass to the parser.

◆ pm_serialize_parse_stream()

PRISM_EXPORTED_FUNCTION void PRISM_EXPORTED_FUNCTION void PRISM_EXPORTED_FUNCTION void pm_serialize_parse_stream ( pm_buffer_t buffer,
pm_source_t source,
const char *  data 
)

Parse and serialize the AST represented by the given source into the given buffer.

Parameters
bufferThe buffer to serialize to.
sourceThe source to parse.
dataThe optional data to pass to the parser.

◆ pm_serialize_parse_comments()

PRISM_EXPORTED_FUNCTION void PRISM_EXPORTED_FUNCTION void PRISM_EXPORTED_FUNCTION void PRISM_EXPORTED_FUNCTION void pm_serialize_parse_comments ( pm_buffer_t buffer,
const uint8_t *  source,
size_t  size,
const char *  data 
)

Parse and serialize the comments in the given source to the given buffer.

Parameters
bufferThe buffer to serialize to.
sourceThe source to parse.
sizeThe size of the source.
dataThe optional data to pass to the parser.

◆ pm_serialize_lex()

PRISM_EXPORTED_FUNCTION void PRISM_EXPORTED_FUNCTION void PRISM_EXPORTED_FUNCTION void PRISM_EXPORTED_FUNCTION void PRISM_EXPORTED_FUNCTION void pm_serialize_lex ( pm_buffer_t buffer,
const uint8_t *  source,
size_t  size,
const char *  data 
)

Lex the given source and serialize to the given buffer.

Parameters
sourceThe source to lex.
sizeThe size of the source.
bufferThe buffer to serialize to.
dataThe optional data to pass to the lexer.

◆ pm_serialize_parse_lex()

PRISM_EXPORTED_FUNCTION void PRISM_EXPORTED_FUNCTION void PRISM_EXPORTED_FUNCTION void PRISM_EXPORTED_FUNCTION void PRISM_EXPORTED_FUNCTION void PRISM_EXPORTED_FUNCTION void pm_serialize_parse_lex ( pm_buffer_t buffer,
const uint8_t *  source,
size_t  size,
const char *  data 
)

Parse and serialize both the AST and the tokens represented by the given source to the given buffer.

Parameters
bufferThe buffer to serialize to.
sourceThe source to parse.
sizeThe size of the source.
dataThe optional data to pass to the parser.

◆ pm_serialize_parse_success_p()

PRISM_EXPORTED_FUNCTION void PRISM_EXPORTED_FUNCTION void PRISM_EXPORTED_FUNCTION void PRISM_EXPORTED_FUNCTION void PRISM_EXPORTED_FUNCTION void PRISM_EXPORTED_FUNCTION void PRISM_EXPORTED_FUNCTION bool pm_serialize_parse_success_p ( const uint8_t *  source,
size_t  size,
const char *  data 
)

Parse the source and return true if it parses without errors or warnings.

Parameters
sourceThe source to parse.
sizeThe size of the source.
dataThe optional data to pass to the parser.
Returns
True if the source parses without errors or warnings.