#include <stdlib.h>
#include <stdio.h>
#include <inttypes.h>
#include <stdint.h>
#include <math.h>
#include <limits.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
#include <stdarg.h>
#include <arpa/inet.h>
#include <yyast/leaf.h>
#include <yyast/count.h>
#include <yyast/utils.h>
#include <yyast/error.h>
Go to the source code of this file.
Data Structures | |
union | translate_t |
Defines | |
#define | _GNU_SOURCE |
Functions | |
ya_t | ya_literal (const char *restrict name, ya_type_t type, const void *restrict buf, size_t buf_size) |
Create an literal node. | |
ya_t | ya_binary_float (const char *restrict name, const char *restrict buf, size_t buf_size __attribute__((unused)), int base __attribute__((unused)), int nr_bits __attribute__((unused))) |
ya_t | ya_integer (const char *restrict name, ya_type_t type, const char *restrict buf, size_t buf_size, int base) |
Create literal from an integer literal string. | |
ya_t | ya_text (const char *restrict name, const char *restrict buf, size_t buf_size) |
Create text literal node for a string literal. | |
ya_t | ya_leaf (const char *restrict name) |
Leaf node, does not contain data or children. | |
ya_t | ya_null (void) |
Null node, unused child entry. | |
ya_t | ya_positive_integer (const char *restrict name, const char *restrict buf, size_t buf_size, int base) |
Create literal from an positive integer literal string. | |
ya_t | ya_negative_integer (const char *restrict name, const char *restrict buf, size_t buf_size, int base) |
Create literal from an negative integer literal string. |
ya_t ya_binary_float | ( | const char *restrict | name, | |
const char *restrict | buf, | |||
size_t buf_size | __attribute__(unused), | |||
int base | __attribute__(unused), | |||
int nr_bits | __attribute__(unused) | |||
) |
Definition at line 75 of file leaf.c.
References translate_t::d, translate_t::u, ya_error(), ya_literal(), and YA_NODE_TYPE_BINARY_FLOAT.
ya_t ya_integer | ( | const char *restrict | name, | |
ya_type_t | type, | |||
const char *restrict | buf, | |||
size_t | buf_size, | |||
int | base | |||
) |
Create literal from an integer literal string.
The RFC 4648 is used as a guide for encoding integers.
name | name of the node. | |
type | type of node, should be either YA_NODE_TYPE_POSITIVE_INTEGER or YA_NODE_TYPE_NEGATIVE_INTEGER. | |
buf | Literal as string. | |
buf_size | String size. | |
base | The base of the literal. 0-64 |
Definition at line 97 of file leaf.c.
References ya_error(), and ya_literal().
Referenced by ya_negative_integer(), and ya_positive_integer().
ya_t ya_leaf | ( | const char *restrict | name | ) |
Leaf node, does not contain data or children.
Definition at line 162 of file leaf.c.
References ya_literal(), and YA_NODE_TYPE_LEAF.
ya_t ya_literal | ( | const char *restrict | name, | |
ya_type_t | type, | |||
const void *restrict | buf, | |||
size_t | buf_size | |||
) |
Create an literal node.
name | name of the node. | |
type | type of leaf node. | |
buf | The memory which needs to be copied. | |
buf_size | The amount of memory to be copied. |
Definition at line 42 of file leaf.c.
References ya_position_s::column, ya_node_s::data, ya_position_s::file, ya_position_s::line, ya_node_s::name, ya_t::node, ya_t::position, ya_node_s::position, ya_node_s::size, ya_t::size, ya_t::type, ya_node_s::type, and ya_previous_position.
Referenced by ya_binary_float(), ya_integer(), ya_leaf(), ya_null(), and ya_text().
ya_t ya_negative_integer | ( | const char *restrict | name, | |
const char *restrict | buf, | |||
size_t | buf_size, | |||
int | base | |||
) |
Create literal from an negative integer literal string.
The RFC 4648 is used as a guide for encoding integers. The integer literal should be passed without the base prefix (0x) or suffix (h). The integer literal should be passed without the negative sign (-).
name | name of the node. | |
buf | Literal as string. | |
buf_size | String size. | |
base | The base of the literal. 0-64 |
Definition at line 177 of file leaf.c.
References ya_integer(), and YA_NODE_TYPE_NEGATIVE_INTEGER.
ya_t ya_null | ( | void | ) |
Null node, unused child entry.
Definition at line 167 of file leaf.c.
References ya_literal(), and YA_NODE_TYPE_NULL.
ya_t ya_positive_integer | ( | const char *restrict | name, | |
const char *restrict | buf, | |||
size_t | buf_size, | |||
int | base | |||
) |
Create literal from an positive integer literal string.
The RFC 4648 is used as a guide for encoding integers. The integer literal should be passed without the base prefix (0x) or suffix (h).
name | name of the node. | |
buf | Literal as string. | |
buf_size | String size. | |
base | The base of the literal. 0-64 |
Definition at line 172 of file leaf.c.
References ya_integer(), and YA_NODE_TYPE_POSITIVE_INTEGER.
ya_t ya_text | ( | const char *restrict | name, | |
const char *restrict | buf, | |||
size_t | buf_size | |||
) |
Create text literal node for a string literal.
name | name of the node. | |
buf | Literal as string. | |
buf_size | String size. |
Definition at line 157 of file leaf.c.
References ya_literal(), and YA_NODE_TYPE_TEXT.
Referenced by ya_get_filenames().