-
Notifications
You must be signed in to change notification settings - Fork 16
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
V3 Extended: Arithmetic Expressions #194
Merged
Merged
Conversation
This file contains 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
FetchContent func-gen/v1x_and_v3x_generators branch.
Update to the latest version of func-gen/v1x_and_v3x_generators branch.
Add expression arithmetic to the parser. Float literals can end with a dot. Add expression arithmetic visitor methods to BuildTreeGenAstVisitor. Update res/v3x/parsing files. Due to changes in the lexer and the parser. Update antlr4-cppruntime Conan package version. We have to add 'Wno-error=unused-parameter' to the Clang compilation. As CqasmParser::expressionSempred defined _localctx parameter but does not use it.
Add expression arithmetic to the parser. Float literals can end with a dot. Add expression arithmetic visitor methods to BuildTreeGenAstVisitor. Update res/v3x/parsing files. Due to changes in the lexer and the parser. Update antlr4-cppruntime Conan package version. We have to add 'Wno-error=unused-parameter' to the Clang compilation. As CqasmParser::expressionSempred defined _localctx parameter but does not use it.
…ns' into v3-extended-arithmetic_expressions # Conflicts: # src/v3x/CqasmParser.g4
Implement BuildTreeGenAstVisitor visitor methods for the syntactic AST. Update to the latest version of func-gen.
… operators. Update to the latest version of func-gen/v1x_and_v3x_generators.
Which changes constinit const variables from std::string to std::string_view.
Which changes constinit const variables from std::string to std::string_view.
Due to changes in the lexer and the parser.
rturrado
changed the title
V3 Extended: Arithmetic Expressons
V3 Extended: Arithmetic Expressions
Jan 23, 2024
pablolh
reviewed
Jan 23, 2024
Update to the latest version of func-gen.
pablolh
previously approved these changes
Jan 23, 2024
Add cqasm-functions files with the current code generated by func-gen. Add some initial unit tests for AnalyzeTreeGenAstVisitor::visit_function_call(name, arguments). Add MockAnalyzer. Add ValuesEqMatcher. Change src/v3x/Analyzer class methods to virtual. So that we can mock this class. TODO: reimplement cqasm-functions using templated code. TODO: add integration tests. TODO: add unit tests for cqasm-functions.
TODO: add integration tests. TODO: add unit tests for cqasm-functions.
Since they are not really needed and make the code less legible.
The errors were mainly coming from the change done to the parser grammar file.
So that tests can be written in a less verbose way.
I prefer to leave the rest of the dynamic_cast's, because using dynamic_pointer_cast makes the code less readable (in my opinion).
pablolh
previously approved these changes
Jan 30, 2024
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.
no problem for me, just nitpicking
pablolh
approved these changes
Jan 31, 2024
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.
Add arithmetic expressions.
These include unary, binary, and ternary operators, as well as a set of default functions (e.g.
sin
,cos
and so on).