libmya 0.1.0
Library to parse Mya language.
Loading...
Searching...
No Matches
ast.h
Go to the documentation of this file.
1#pragma once
2
3#include <stdio.h>
4
5#include "types/ast.h"
6
15void
17
23void
25
37
50
57void
58ast_copy(ast_node_t* destiny, ast_node_t* source);
59
66void
67ast_to_json(ast_node_t* root, FILE* file);
void ast_node_init(ast_node_t *node, ast_node_t *parent, node_type_t type, token_t *token)
Initializes an AST node.
Definition ast.c:17
void ast_copy(ast_node_t *destiny, ast_node_t *source)
Copies the content of source to destinty AST nodes.
Definition ast.c:64
void ast_close(ast_node_t *root)
Closes the given AST root node and all children.
Definition ast.c:29
ast_node_t * ast_insert_children(ast_node_t *parent, ast_node_t *child)
Insert a exitent AST node as children of the given parent node.
Definition ast.c:51
void ast_to_json(ast_node_t *root, FILE *file)
Reads the AST and converts it to JSON, writting on the given file stream.
Definition ast.c:70
ast_node_t * ast_add_children(ast_node_t *parent, node_type_t type, token_t *token)
Add a new children for the given AST node.
Definition ast.c:40
Struct for a Mya token.
Definition token.h:32
enum node_type node_type_t
struct ast_node ast_node_t
struct token token_t
Struct for a Mya token.