Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assembly statement parsing #499

Merged
merged 6 commits into from
Sep 1, 2023
Merged

Assembly statement parsing #499

merged 6 commits into from
Sep 1, 2023

Conversation

ehaas
Copy link
Collaborator

@ehaas ehaas commented Aug 30, 2023

Primary thing here is adding support for GNU inline assembly statements. Currently it just parses the statement, no attempt is made to validate it. There's also the question of how it should be added to the AST - any thought about how to structure that? There's a lot of data - the assembly template string, volatile flag, inputs, output, and label expressions, constraints, clobbers...

src/Parser.zig Outdated Show resolved Hide resolved
src/Parser.zig Outdated Show resolved Hide resolved
Copy link
Owner

@Vexu Vexu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks! Could you add comments on the grammar? I always forget how these work.

src/Parser.zig Outdated Show resolved Hide resolved
src/Parser.zig Outdated Show resolved Hide resolved
@ehaas
Copy link
Collaborator Author

ehaas commented Aug 31, 2023

Added grammar comments, let me know if they should be more detailed - right now it's just the syntax; would it be helpful to explain e.g. that the first asmOperand is inputs, second is outputs, etc.?

@Vexu
Copy link
Owner

Vexu commented Sep 1, 2023

The grammar combined with reading the comments in the function is good enough for me and gnu has this documented online if needed.

@Vexu Vexu merged commit f87b79d into Vexu:master Sep 1, 2023
3 checks passed
@ehaas ehaas deleted the assembly-statement branch September 1, 2023 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants