The final countdown - #3
Merged
Merged
Conversation
Implement parse_call and export it in parser.h; integrate call parsing into parse_value and instruction detection. Improve instruction classification to detect declarations, assignments and calls. Fix code generation bugs: evaluate operands in correct order, handle division (clear rdx before div), use leave for function epilogue, and use consistent EGEN error codes. Correct stack/variable handling: strdup variable names, adjust offset calculation, initialize declared variables, and emit proper memory address formatting. Misc parser and test cleanup and debugging prints added
Handle parentheses depth when scanning expressions and detect whether a sized expression contains operators to choose operator vs value parsing. Implement gen_call (header + source) and wire NODE_CALL into expression generation. Simplify missing-semicolon error reporting.
Rename stack_data_t to variable_t and remove stack_t. Replace gen->stack->variables with gen->variables and update get_offset/ create_variable calls. Allocate gen->variables in gen_function and free it after generating the function. Remove stack management code and some unused includes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.