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

Use bison for ilasm parser generator #101415

Merged
merged 2 commits into from
May 14, 2024
Merged

Use bison for ilasm parser generator #101415

merged 2 commits into from
May 14, 2024

Conversation

hez2010
Copy link
Contributor

@hez2010 hez2010 commented Apr 23, 2024

Supersedes #89704. Fixes #4776.

Bison for Windows: https://github.com/lexxmark/winflexbison
For other platforms: https://www.gnu.org/software/bison

To generate the asmparse.cpp: yacc asmparse.y -o asmparse.cpp (or win_bison asmparse.y -o asmparse.cpp)

/cc: @TIHan @JulieLeeMSFT

@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Apr 23, 2024
@TIHan
Copy link
Contributor

TIHan commented Apr 26, 2024

Thank you @hez2010 ! Will review this soon.

Copy link
Contributor

@TIHan TIHan left a comment

Choose a reason for hiding this comment

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

So far this looks good. Going to look at it a bit deeper.

@TIHan
Copy link
Contributor

TIHan commented May 13, 2024

/azp run runtime-coreclr ilasm

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@AaronRobinsonMSFT
Copy link
Member

AaronRobinsonMSFT commented May 13, 2024

I have deleted the asmparse.grammar file as it's no longer being maintained since 2021.

I question this is no longer being maintained. What IL grammar changes have we introduced since 2021 that haven't made it in?

@hez2010
Copy link
Contributor Author

hez2010 commented May 13, 2024

What IL grammar changes have we introduced since 2021 that haven't made it in?

For example, byreflike on generics.

@AaronRobinsonMSFT
Copy link
Member

What IL grammar changes have we introduced since 2021 that haven't made it in?

For example, byreflike on generics.

I wrote that feature and it was updated. See byreflike under typarAttrib.

@hez2010
Copy link
Contributor Author

hez2010 commented May 13, 2024

I wrote that feature and it was updated. See byreflike under typarAttrib.

Okay I see, sorry for missed that. I can bring it back but note that there's no public tool that can auto generate the asmparser.grammar file now.

Copy link
Contributor

@TIHan TIHan left a comment

Choose a reason for hiding this comment

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

Thanks for your work @hez2010 ! Glad to see this be done.

I'll make a follow-up PR that adds a small README.md on how to generate the parser.

@TIHan TIHan merged commit 714a442 into dotnet:main May 14, 2024
87 checks passed
Ruihan-Yin pushed a commit to Ruihan-Yin/runtime that referenced this pull request May 30, 2024
* Use bison for ilasm parser generator

* Bring back asmparse.grammar
@github-actions github-actions bot locked and limited conversation to collaborators Jun 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-ILTools-coreclr community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generate asmparse.c using a standard bison/yacc
3 participants