| 1 |
/* |
| 2 |
* FCML - Free Code Manipulation Library. |
| 3 |
* Copyright (C) 2010-2020 Slawomir Wojtasiak |
| 4 |
* |
| 5 |
* This library is free software; you can redistribute it and/or |
| 6 |
* modify it under the terms of the GNU Lesser General Public |
| 7 |
* License as published by the Free Software Foundation; either |
| 8 |
* version 2.1 of the License, or (at your option) any later version. |
| 9 |
* |
| 10 |
* This library is distributed in the hope that it will be useful, |
| 11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 |
* Lesser General Public License for more details. |
| 14 |
* |
| 15 |
* You should have received a copy of the GNU Lesser General Public |
| 16 |
* License along with this library; if not, write to the Free Software |
| 17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 18 |
*/ |
| 19 |
|
| 20 |
#ifndef FCML_PARSER_INT_H_ |
| 21 |
#define FCML_PARSER_INT_H_ |
| 22 |
|
| 23 |
#include <fcml_parser.h> |
| 24 |
|
| 25 |
#include "fcml_apc_ast.h" |
| 26 |
#include "fcml_coll.h" |
| 27 |
#include "fcml_ceh.h" |
| 28 |
|
| 29 |
typedef struct fcml_st_parser_ast { |
| 30 |
/* Defined symbol. */ |
| 31 |
fcml_st_symbol *symbol; |
| 32 |
/* Abstract syntax tree of parsed instruction. */ |
| 33 |
fcml_st_ast_node *tree; |
| 34 |
/* All potential errors going here. */ |
| 35 |
fcml_st_ceh_error_container errors; |
| 36 |
} fcml_st_parser_ast; |
| 37 |
|
| 38 |
fcml_ceh_error fcml_fn_parse_to_cif(fcml_st_parser_context *context, |
| 39 |
const fcml_string instruction, fcml_st_parser_result *result_out); |
| 40 |
|
| 41 |
fcml_ceh_error fcml_fn_parse_to_ast(fcml_st_parser_context *context, |
| 42 |
const fcml_string instruction, fcml_st_parser_ast *ast_out); |
| 43 |
|
| 44 |
fcml_ceh_error fcml_fn_parser_add_symbol_to_symbol_table( |
| 45 |
fcml_st_ceh_error_container *errors, fcml_st_symbol_table symbol_table, |
| 46 |
fcml_st_symbol *symbol, fcml_bool allow_override); |
| 47 |
|
| 48 |
void fcml_fn_parser_free_ast(fcml_st_parser_ast *ast); |
| 49 |
|
| 50 |
void fcml_fn_parser_free_symbol(fcml_st_symbol *symbol); |
| 51 |
|
| 52 |
#endif /* FCML_PARSER_INT_H_ */ |