Adaptive Framework
0.9.0
|
Files | |
file | afw_compile_internal.h |
Adaptive Framework Compiler Internal. | |
Data Structures | |
struct | afw_compile_internal_shared_s |
Resources that can be shared by multiple compiles. More... | |
struct | afw_compile_internal_token_s |
struct | afw_compile_internal_value_contextual_s |
Contextual information provided in some values. More... | |
struct | afw_compile_internal_parser_s |
struct | afw_compile_internal_assignment_target_s |
struct | afw_compile_internal_list_destructure_s |
struct | afw_compile_assignment_element_s |
struct | afw_compile_internal_assignment_property_s |
struct | afw_compile_internal_object_destructure_s |
Macros | |
#define | AFW_COMPILE_MAX_TOKENS 5 |
#define | AFW_COMPILE_INTERNAL_ASSIGNMENT_TYPE_MAP(XX) |
Assignment type Map. More... | |
#define | AFW_COMPILE_INTERNAL_ASSIGNMENT_TARGET_TYPE_MAP(XX) |
Assignment target type Map. More... | |
#define | afw_value_contextual_resolve_value_source(value_source, contextual) |
#define | afw_compile_token_is(token_type) (parser->token->type == afw_compile_token_type_##token_type) |
#define | afw_compile_token_is_unqualified_identifier() |
#define | afw_compile_token_is_name(string) |
#define | afw_compile_token_is_name_z(string_z) |
#define | afw_compile_is_at_eof() (parser->last_octet_eof) |
#define | afw_compile_next_is_at_eof() |
#define | afw_compile_peek_next_token() afw_compile_peek_next_token_impl(parser) |
#define | afw_compile_peek_next_token_is(token_type) |
#define | afw_compile_set_contextual() |
#define | AFW_COMPILE_THROW_ERROR_Z(message_z) |
#define | AFW_COMPILE_THROW_ERROR_FZ(format_z, ...) |
#define | AFW_COMPILE_EOF_IS_ERROR() |
#define | afw_compile_get_code_point() afw_compile_get_code_point_impl(parser) |
#define | afw_compile_get_unescaped_code_point() afw_compile_get_unescaped_code_point_impl(parser) |
#define | afw_compile_next_raw_starts_with(s) afw_compile_next_raw_starts_with_impl(parser, s) |
#define | afw_compile_next_raw_starts_with_z(s_z) afw_compile_next_raw_starts_with_z_impl(parser, s_z) |
#define | afw_compile_get_raw_line(line) afw_compile_get_raw_line_impl(parser, line) |
#define | afw_compile_get_token() afw_compile_get_token_impl(parser) |
#define | afw_compile_get_token_before_eol() |
#define | afw_compile_save_offset(save) save = parser->token->token_source_offset |
#define | afw_compile_get_token_and_save_offset(save) |
#define | afw_compile_next_can_be_operator() parser->next_can_be_nonunary_operator = true |
#define | afw_compile_next_can_be_template_string() parser->next_can_be_template_string = true |
#define | afw_compile_next_identifier_is_not_special_literal() parser->next_identifier_is_not_special_literal = true |
#define | afw_compile_reuse_token() afw_compile_reuse_token_impl(parser) |
#define | afw_compile_save_cursor(save) save = parser->cursor |
#define | afw_compile_restore_cursor(save) |
#define | afw_compile_cursor_equal(save) (parser->cursor == save) |
#define | afw_compile_source_buffer_at(save) (parser->full_source->s + save) |
#define | afw_compile_source_buffer_length_from(save) (parser->cursor - save) |
#define | afw_compile_create_contextual_to_cursor(start_offset) |
#define | afw_compile_create_source_location(start_offset) |
#define | afw_compile_parse_pop_value_block(parser) |
#define | afw_compile_args_create(parser) |
#define | afw_compile_args_add_value(args, value) afw_stack_push(args, (parser)->xctx) = value |
#define | afw_compile_args_finalize(args, argc, argv) |
#define | AFW_COMPILE_THROW_EXPECTING_SEMICOLON AFW_COMPILE_THROW_ERROR_Z("Expecting statement terminator ';'") |
#define | AFW_COMPILE_ASSERT_TOKEN_IS_SEMICOLON |
#define | AFW_COMPILE_ASSERT_NEXT_TOKEN_IS_SEMICOLON |
Enumerations | |
enum | afw_compile_internal_token_type_t { afw_compile_token_type_invalid , afw_compile_token_type_end , afw_compile_token_type_raw_line , afw_compile_token_type_eol , afw_compile_token_type_boolean , afw_compile_token_type_identifier , afw_compile_token_type_integer , afw_compile_token_type_number , afw_compile_token_type_binary_string , afw_compile_token_type_utf8_string , afw_compile_token_type_template_string , afw_compile_token_type_null , afw_compile_token_type_undefined , afw_compile_token_type_ampersand , afw_compile_token_type_back_slash , afw_compile_token_type_caret , afw_compile_token_type_colon , afw_compile_token_type_comma , afw_compile_token_type_dollar_sign , afw_compile_token_type_ellipsis , afw_compile_token_type_fat_arrow , afw_compile_token_type_grave , afw_compile_token_type_nullish_coalescing , afw_compile_token_type_optional_chaining , afw_compile_token_type_optional_chaining_thin_arrow , afw_compile_token_type_percent , afw_compile_token_type_period , afw_compile_token_type_question_mark , afw_compile_token_type_semicolon , afw_compile_token_type_slash , afw_compile_token_type_thin_arrow , afw_compile_token_type_tilde , afw_compile_token_type_substitute_start , afw_compile_token_type_vertical_bar , afw_compile_token_type_unary_plus , afw_compile_token_type_unary_minus , afw_compile_token_type_unary_not , afw_compile_token_type_open_brace , afw_compile_token_type_close_brace , afw_compile_token_type_open_parenthesis , afw_compile_token_type_close_parenthesis , afw_compile_token_type_open_bracket , afw_compile_token_type_close_bracket , afw_compile_token_type_open_angle_bracket , afw_compile_token_type_close_angle_bracket , afw_compile_token_type_add , afw_compile_token_type_subtract , afw_compile_token_type_multiply , afw_compile_token_type_divide , afw_compile_token_type_modulus , afw_compile_token_type_exponentiation , afw_compile_token_type_increment , afw_compile_token_type_decrement , afw_compile_token_type_and , afw_compile_token_type_or , afw_compile_token_type_equal , afw_compile_token_type_plus_equal , afw_compile_token_type_minus_equal , afw_compile_token_type_multiply_equal , afw_compile_token_type_divide_equal , afw_compile_token_type_modulus_equal , afw_compile_token_type_exponentiation_equal , afw_compile_token_type_and_equal , afw_compile_token_type_or_equal , afw_compile_token_type_nullish_equal , afw_compile_token_type_equal_to , afw_compile_token_type_equal_value_and_type , afw_compile_token_type_not_equal_to , afw_compile_token_type_not_equal_value_and_type , afw_compile_token_type_less_than , afw_compile_token_type_less_than_or_equal_to , afw_compile_token_type_greater_than , afw_compile_token_type_greater_than_or_equal_to } |
enum | afw_compile_internal_assignment_type_t { afw_compile_assignment_type_max_type } |
Enum for assignment types. | |
enum | afw_compile_assignment_target_type_t { afw_compile_assignment_target_type_max_type } |
Enum for assignment target types. | |
Functions | |
afw_compile_internal_token_type_t | afw_compile_peek_next_token_impl (afw_compile_parser_t *parser) |
afw_compile_get_code_point_impl (afw_compile_parser_t *parser) | |
afw_compile_get_unescaped_code_point_impl (afw_compile_parser_t *parser) | |
afw_compile_is_reserved_word (afw_compile_parser_t *parser, const afw_utf8_t *s) | |
afw_compile_next_raw_starts_with_impl (afw_compile_parser_t *parser, const afw_utf8_t *s) | |
afw_compile_next_raw_starts_with_z_impl (afw_compile_parser_t *parser, const afw_utf8_z_t *s_z) | |
afw_compile_parse_list_of_statements (afw_compile_parser_t *parser, afw_boolean_t end_is_close_brace, afw_boolean_t can_be_single_return_expression) | |
afw_compile_get_raw_line_impl (afw_compile_parser_t *parser, afw_utf8_t *line) | |
afw_compile_current_raw_token (afw_compile_parser_t *parser) | |
afw_compile_get_string_literal (afw_compile_parser_t *parser, const afw_utf8_octet_t *s, afw_size_t len) | |
afw_compile_get_token_impl (afw_compile_parser_t *parser) | |
void | afw_compile_reuse_token_impl (afw_compile_parser_t *parser) |
afw_compile_create_contextual (afw_compile_parser_t *parser, afw_size_t start_offset, afw_size_t size) | |
afw_compile_create_source_location_impl (afw_compile_parser_t *parser, afw_size_t start_offset) | |
afw_code_point_t | afw_compile_peek_code_point (afw_compile_parser_t *parser) |
afw_compile_internal_s_push_code_point (afw_compile_parser_t *parser, afw_code_point_t cp) | |
afw_compile_parse_set_error_z (afw_compile_parser_t *parser, const afw_utf8_z_t *source_z, const afw_utf8_z_t *message_z) | |
afw_compile_parse_set_error_fz (afw_compile_parser_t *parser, const afw_utf8_z_t *source_z, const afw_utf8_z_t *format_z,...) | |
afw_compile_parse_get_symbol_entry (afw_compile_parser_t *parser, const afw_utf8_t *name) | |
afw_compile_parse_get_local_symbol_entry (afw_compile_parser_t *parser, const afw_utf8_t *name) | |
afw_compile_parse_add_symbol_entry (afw_compile_parser_t *parser, const afw_utf8_t *name) | |
afw_compile_parse_link_new_value_block (afw_compile_parser_t *parser, afw_size_t start_offset) | |
afw_compile_parse_reference_create (afw_compile_parser_t *parser, const afw_compile_value_contextual_t *contextual, const afw_utf8_t *identifier) | |
afw_compile_parse_check_symbol (afw_compile_parser_t *parser, const afw_utf8_t *name, const afw_value_t *value, afw_compile_internal_assignment_type_t assignment_type, afw_size_t symbol_cursor) | |
afw_compile_parse_Assignment (afw_compile_parser_t *parser, afw_boolean_t *was_expression) | |
afw_compile_parse_AssignmentBindingTarget (afw_compile_parser_t *parser, afw_compile_internal_assignment_type_t assignment_type, const afw_value_type_t **type, const afw_value_t **value) | |
afw_compile_parse_AssignmentListDestructureTarget (afw_compile_parser_t *parser, afw_compile_internal_assignment_type_t assignment_type) | |
afw_compile_parse_AssignmentElement (afw_compile_parser_t *parser, afw_compile_internal_assignment_type_t assignment_type) | |
afw_compile_parse_AssignmentExpression (afw_compile_parser_t *parser) | |
afw_compile_parse_AssignmentObjectDestructureTarget (afw_compile_parser_t *parser, afw_compile_internal_assignment_type_t assignment_type) | |
afw_compile_parse_AssignmentProperty (afw_compile_parser_t *parser, afw_compile_internal_assignment_type_t assignment_type) | |
afw_compile_parse_AssignmentStatement (afw_compile_parser_t *parser, afw_boolean_t *was_expression) | |
afw_compile_parse_AssignmentTarget (afw_compile_parser_t *parser, afw_compile_internal_assignment_type_t assignment_type) | |
afw_compile_parse_Comparison (afw_compile_parser_t *parser) | |
afw_compile_parse_EntryFunctionLambdaOrVariableReference (afw_compile_parser_t *parser) | |
afw_compile_parse_Equality (afw_compile_parser_t *parser) | |
afw_compile_parse_Exponentiation (afw_compile_parser_t *parser) | |
afw_compile_parse_Evaluation (afw_compile_parser_t *parser) | |
afw_compile_parse_Expression (afw_compile_parser_t *parser) | |
afw_compile_parse_ExpressionTuple (afw_compile_parser_t *parser) | |
afw_compile_parse_ExpressionTupleAnnotation (afw_compile_parser_t *parser) | |
afw_compile_parse_ExpressionTupleOperation (afw_compile_parser_t *parser) | |
afw_compile_parse_ExpressionTupleParameter (afw_compile_parser_t *parser) | |
afw_compile_parse_Factor (afw_compile_parser_t *parser) | |
afw_compile_parse_FunctionSignature (afw_compile_parser_t *parser, const afw_value_block_t **block) | |
afw_compile_parse_FunctionSignatureAndBody (afw_compile_parser_t *parser) | |
afw_compile_parse_Json (afw_compile_parser_t *parser) | |
afw_compile_parse_Literal (afw_compile_parser_t *parser, afw_boolean_t *is_Literal, afw_boolean_t must_be_literal, afw_boolean_t scalar_only) | |
afw_compile_parse_Lambda (afw_compile_parser_t *parser) | |
afw_compile_parse_List (afw_compile_parser_t *parser, afw_boolean_t allow_expression, afw_boolean_t allow_enhanced_literals) | |
afw_compile_parse_LogicalExpression (afw_compile_parser_t *parser) | |
afw_compile_parse_LogicalAnd (afw_compile_parser_t *parser) | |
afw_compile_parse_NullishCoalescing (afw_compile_parser_t *parser) | |
afw_compile_parse_Object (afw_compile_parser_t *parser, afw_boolean_t allow_expression, afw_boolean_t allow_enhanced_literals) | |
afw_compile_parse_OptionalDefineAssignment (afw_compile_parser_t *parser) | |
afw_compile_parse_OptionalDefineTarget (afw_compile_parser_t *parser) | |
afw_compile_parse_OptionalType (afw_compile_parser_t *parser, afw_boolean_t is_return) | |
afw_compile_parse_Parameters (afw_compile_parser_t *parser, afw_compile_args_t *args) | |
afw_compile_parse_ParenthesizedExpression (afw_compile_parser_t *parser) | |
afw_compile_parse_Prefixed (afw_compile_parser_t *parser) | |
afw_compile_parse_Reference (afw_compile_parser_t *parser) | |
afw_compile_parse_Script (afw_compile_parser_t *parser) | |
afw_compile_parse_Statement (afw_compile_parser_t *parser, afw_boolean_t *was_expression) | |
afw_compile_parse_Substitution (afw_compile_parser_t *parser) | |
afw_compile_parse_Template (afw_compile_parser_t *parser) | |
afw_compile_parse_TemplateString (afw_compile_parser_t *parser) | |
afw_compile_parse_Term (afw_compile_parser_t *parser) | |
afw_compile_parse_TestScript (afw_compile_parser_t *parser) | |
afw_compile_parse_Type (afw_compile_parser_t *parser) | |
afw_compile_parse_Value (afw_compile_parser_t *parser) | |
afw_compile_parse_Hybrid (afw_compile_parser_t *parser) | |
afw_compile_parse_variable_reference_create (afw_compile_parser_t *parser, const afw_compile_value_contextual_t *contextual, afw_compile_internal_assignment_type_t assignment_type, const afw_utf8_t *identifier) | |
afw_compile_skip_ws (afw_compile_parser_t *parser) | |
afw_compile_check_for_residual (afw_compile_parser_t *parser) | |
AFW_STACK_STRUCT (afw_compile_internal_args_s, const afw_value_t *) | |
afw_compile_lexical_parser_create (const afw_utf8_t *source, afw_utf8_octet_get_cb_t callback, void *callback_data, const afw_utf8_t *source_location, afw_compile_type_t compile_type, afw_compile_residual_check_t residual_check, afw_boolean_t cede_p, const afw_value_compiled_value_t *parent, const afw_compile_shared_t *shared, const afw_pool_t *p, afw_xctx_t *xctx) | |
afw_compile_lexical_parser_finish_and_release (afw_compile_parser_t *parser, afw_xctx_t *xctx) | |
Internal compile API.
#define afw_compile_args_create | ( | parser | ) |
Definition at line 1228 of file afw_compile_internal.h.
#define afw_compile_args_finalize | ( | args, | |
argc, | |||
argv | |||
) |
Definition at line 1241 of file afw_compile_internal.h.
#define AFW_COMPILE_ASSERT_NEXT_TOKEN_IS_SEMICOLON |
Definition at line 1287 of file afw_compile_internal.h.
#define AFW_COMPILE_ASSERT_TOKEN_IS_SEMICOLON |
Definition at line 1281 of file afw_compile_internal.h.
#define afw_compile_create_contextual_to_cursor | ( | start_offset | ) |
Definition at line 818 of file afw_compile_internal.h.
#define afw_compile_create_source_location | ( | start_offset | ) |
Definition at line 831 of file afw_compile_internal.h.
#define AFW_COMPILE_EOF_IS_ERROR | ( | ) |
Definition at line 631 of file afw_compile_internal.h.
#define afw_compile_get_token_and_save_offset | ( | save | ) |
Definition at line 738 of file afw_compile_internal.h.
#define afw_compile_get_token_before_eol | ( | ) |
Definition at line 727 of file afw_compile_internal.h.
#define AFW_COMPILE_INTERNAL_ASSIGNMENT_TARGET_TYPE_MAP | ( | XX | ) |
Assignment target type Map.
id | of assignment target type |
description | of this assignment target type |
Definition at line 443 of file afw_compile_internal.h.
#define AFW_COMPILE_INTERNAL_ASSIGNMENT_TYPE_MAP | ( | XX | ) |
Assignment type Map.
id | of assignment type |
description | of this assignment type |
Definition at line 404 of file afw_compile_internal.h.
#define afw_compile_next_is_at_eof | ( | ) |
Definition at line 584 of file afw_compile_internal.h.
#define afw_compile_parse_pop_value_block | ( | parser | ) |
Definition at line 903 of file afw_compile_internal.h.
#define afw_compile_peek_next_token_is | ( | token_type | ) |
Definition at line 595 of file afw_compile_internal.h.
#define afw_compile_restore_cursor | ( | save | ) |
Definition at line 788 of file afw_compile_internal.h.
#define afw_compile_set_contextual | ( | ) |
Definition at line 601 of file afw_compile_internal.h.
#define AFW_COMPILE_THROW_ERROR_FZ | ( | format_z, | |
... | |||
) |
Definition at line 620 of file afw_compile_internal.h.
#define AFW_COMPILE_THROW_ERROR_Z | ( | message_z | ) |
FIXME: parser->contextual.value_source.s = parser->c;
FIXME: parser->contextual.value_source.len = 0;
Definition at line 610 of file afw_compile_internal.h.
#define afw_compile_token_is_name | ( | string | ) |
Definition at line 563 of file afw_compile_internal.h.
#define afw_compile_token_is_name_z | ( | string_z | ) |
Definition at line 569 of file afw_compile_internal.h.
#define afw_compile_token_is_unqualified_identifier | ( | ) |
Definition at line 557 of file afw_compile_internal.h.
#define afw_value_contextual_resolve_value_source | ( | value_source, | |
contextual | |||
) |
Definition at line 535 of file afw_compile_internal.h.
afw_compile_parse_OptionalType | ( | afw_compile_parser_t * | parser, |
afw_boolean_t | is_return | ||
) |
Definition at line 929 of file afw_compile_parse_expression.c.