Add the ability to parse types.

This ability is not integrated with the rest of the parser - in fact, the grammar for things like function declarations (where type declarations are necessary) is not yet determined.
This commit is contained in:
2018-03-06 16:47:11 -08:00
parent 45d955b8bd
commit 2487cdebe0
4 changed files with 178 additions and 11 deletions

View File

@@ -62,6 +62,7 @@ enum libab_lexer_token_e {
TOKEN_KW_ELSE,
TOKEN_KW_WHILE,
TOKEN_KW_DO,
TOKEN_KW_ARROW,
TOKEN_LAST
};

View File

@@ -4,6 +4,7 @@
#include "table.h"
#include "ll.h"
#include "tree.h"
#include "parsetype.h"
/**
* The parser that is used by libabacus
@@ -31,6 +32,8 @@ void libab_parser_init(libab_parser* parser, libab_table* table);
*/
libab_result libab_parser_parse(libab_parser* parser, ll* tokens,
const char* string, libab_tree** store_into);
libab_result libab_parser_parse_type(libab_parser* parser, ll* tokens,
const char* string, libab_parsetype** store_into);
/**
* Releases the resources allocated by the parser.
* @param parser the parser to release.