libmya 0.1.0
Library to parse Mya language.
Loading...
Searching...
No Matches
parser.h
Go to the documentation of this file.
1#pragma once
2
3#include "types/err.h"
4#include "types/module.h"
5#include "types/token.h"
6
16unsigned int
18
28unsigned int
30
40unsigned int
42
52unsigned int
54
64unsigned int
66
76unsigned int
78
88unsigned int
90
91
102unsigned int
103parse_size_spec(module_t* module, ast_node_t* parent, token_t* token, const char* example);
104
115unsigned int
117
128unsigned int
130
141unsigned int
142parse_advance(token_t* token, token_type_t* types, size_t ntypes);
unsigned int parse_statement_inst(module_t *module, ast_node_t *parent, token_t *token)
Parse a inst statement adding it as a children on parent AST node.
unsigned int parse_statement_include(module_t *module, ast_node_t *parent, token_t *token)
Parse a include statement adding it as a children on parent AST node.
unsigned int parse_statement_register(module_t *module, ast_node_t *parent, token_t *token)
Parse a register statement adding it as a children on parent AST node.
unsigned int parse_statement_set(module_t *module, ast_node_t *parent, token_t *token)
Parse a set statement adding it as a children on parent AST node.
unsigned int parse_statement_bitfield(module_t *module, ast_node_t *parent, token_t *token)
Parse a bitfield statement adding it as a children on parent AST node.
unsigned int parse_expression(module_t *module, ast_node_t *parent, token_t *token)
Parse a mathematical expression adding it as a children on parent AST node.
unsigned int parse_advance(token_t *token, token_type_t *types, size_t ntypes)
Finds the next token TK_EOF or any of the specified types and then returns the number of tokens trave...
unsigned int parse_size_spec(module_t *module, ast_node_t *parent, token_t *token, const char *example)
Parse a size specification in the format [ EXPRESSION ] adding it as a children on parent AST node.
Definition parse_common.c:7
unsigned int parse_bitfield_spec(module_t *module, ast_node_t *parent, token_t *token)
Parse a bitfield specification in the format Bitfield { FIELD_LIST } or Bitfield { EXPRESSION }...
unsigned int parse_fieldlist_spec(module_t *module, ast_node_t *parent, token_t *token)
Parse a field list specification in the format field = EXPRESSION, ... adding it as a children on par...
unsigned int parse_statement(module_t *module, ast_node_t *parent, token_t *token)
Parse a statement adding it as a children on parent AST node.
Struct that represents a Mya module.
Definition module.h:34
Struct for a Mya token.
Definition token.h:34
struct ast_node ast_node_t
struct module module_t
Struct that represents a Mya module.
enum token_type token_type_t
Enumeration of token types.
struct token token_t
Struct for a Mya token.