#include <string.h>
#include "module.h"
#include "parser.h"
#include "types/keywords.h"
Go to the source code of this file.
◆ parse_statement()
Parse a statement adding it as a children on parent
AST node.
- Parameters
-
module | The module where the AST is. |
parent | The AST node parent for the statement. |
token | The token where to start parsing the statement. |
- Returns
- The number of tokens used on the statement.
Definition at line 8 of file parse_statement.c.
9{
16 "This token is unexpected here. It's expected to be a valid statement keyword.\n"
17 );
18
19 return 1;
20 }
21
27 default:
28 return 1;
29 }
30}
void module_add_error(module_t *module, unsigned int line, unsigned int column, unsigned int length, const char *message)
Add error for the given module.
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_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 length
The length of the string.
Struct that represents a Mya module.
long long int value
Integer value of the token on TK_NUMBER tokens.
token_type_t type
Token type.
dstring_t lexeme
Lexeme of the token.
unsigned int line
Token line inside the module.
unsigned int column
Column of the token position on the line.