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
base: main
Are you sure you want to change the base?
Conversation
@@ -42,13 +42,13 @@ | |||
}; | |||
|
|||
/* These are returned by the LEXER and have values */ | |||
%token ERROR_ BAD_COMMENT_ BAD_LITERAL_ /* bad strings, */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ERROR_
has been defined multiple times, so remove it here.
@@ -96,7 +96,7 @@ | |||
%token _CLASS _NAMESPACE _METHOD _FIELD _DATA _THIS _BASE _NESTER | |||
%token _EMITBYTE _TRY _MAXSTACK _LOCALS _ENTRYPOINT _ZEROINIT | |||
%token _EVENT _ADDON _REMOVEON _FIRE _OTHER | |||
%token _PROPERTY _SET _GET DEFAULT_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DEFAULT_
has been defined multiple times, so remove it here.
%token <int32> INT32_V /* 3425 0x34FA 0352 */ | ||
%token <int64> INT64_V /* 342534523534534 0x34FA434644554 */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are conflicting with INT32
and INT64
typedef, so rename them.
Thank you @hez2010 ! Will review this soon. |
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
(orwin_bison asmparse.y -o asmparse.cpp
)I have deleted the
asmparse.grammar
file as it's no longer being maintained since 2021./cc: @TIHan @JulieLeeMSFT