static void _syx_parser_parse_block (SyxParser *self) { SyxOop closure; SyxOop old_method = self->method; SyxBytecode *old_bytecode = self->bytecode; syx_bool block_state = self->_in_block; syx_token_free (syx_lexer_get_last_token (self->lexer)); self->method = syx_block_new (); self->bytecode = syx_bytecode_new (); self->_in_block = TRUE; self->_temporary_scopes_top++; self->_argument_scopes_top++; syx_parser_parse (self, FALSE); closure = syx_block_closure_new (self->method); self->method = old_method; syx_bytecode_free (self->bytecode); self->bytecode = old_bytecode; self->_in_block = block_state; self->_temporary_scopes_top--; self->_argument_scopes_top--; syx_bytecode_push_block_closure (self->bytecode, closure); }
/*! Free all memory used by the parser. \param free_segment TRUE frees the instance_names (not its contents) and the lexer */ void syx_parser_free (SyxParser *self, syx_bool free_segment) { syx_bytecode_free (self->bytecode); if (free_segment) { if (self->instance_names) syx_free (self->instance_names); syx_lexer_free (self->lexer, TRUE); } syx_free (self); }
/*! Free all memory used by the parser. \param free_segment TRUE frees the instance_names (not its contents) and the lexer */ void syx_parser_free (SyxParser *self, syx_bool free_segment) { syx_size i; syx_bytecode_free (self->bytecode); for (i=0; i < self->_temporary_names_top; i++) syx_free (self->_temporary_names[i]); for (i=0; i < self->_argument_names_top; i++) syx_free (self->_argument_names[i]); if (free_segment) { if (self->instance_names) syx_free (self->instance_names); syx_lexer_free (self->lexer, TRUE); } syx_free (self); }