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

10 parser design a context free grammar for boolean expressions #31

Merged

Conversation

timoslater
Copy link
Collaborator

@timoslater timoslater commented Jul 15, 2024

Summary

Closes #10

  • Created Classes for each note in the abstract syntax tree

New Classes

  • Var
  • VarExpr
  • ParenExpr
  • NotExpr
  • AndExpr
  • OrExpr

Manual Tests

Screenshot 2024-07-16 at 10 20 41 PM

Screenshot 2024-07-16 at 10 28 22 PM

@timoslater timoslater linked an issue Jul 15, 2024 that may be closed by this pull request
3 tasks
Copy link
Owner

@bliutech bliutech left a comment

Choose a reason for hiding this comment

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

Overall, great job! I think we were discussing using individual classes to represent certain node types which might make some more sense rather than have strange conflicting field types.

parser/README.md Outdated Show resolved Hide resolved
parser/ast.py Outdated Show resolved Hide resolved
parser/ast.py Outdated Show resolved Hide resolved
parser/ast.py Outdated Show resolved Hide resolved
@timoslater timoslater requested a review from bliutech July 16, 2024 05:38
Copy link
Owner

@bliutech bliutech left a comment

Choose a reason for hiding this comment

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

See the comments. You can most likely also delete some of these comments as well to simplify.

parser/ast.py Outdated Show resolved Hide resolved
parser/ast.py Outdated Show resolved Hide resolved
parser/ast.py Outdated Show resolved Hide resolved
parser/ast.py Outdated Show resolved Hide resolved
parser/README.md Outdated Show resolved Hide resolved
parser/README.md Outdated Show resolved Hide resolved
parser/ast.py Show resolved Hide resolved
@timoslater timoslater requested a review from bliutech July 17, 2024 02:27
Copy link
Owner

@bliutech bliutech left a comment

Choose a reason for hiding this comment

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

Overall, great work! Thanks for putting so much effort into figuring this out! 😄 I'll make some small fixes and then merge in a few minutes to main. Good job!

@bliutech bliutech closed this Jul 17, 2024
@bliutech bliutech reopened this Jul 17, 2024
@bliutech bliutech merged commit c5877aa into main Jul 17, 2024
3 checks passed
@bliutech bliutech deleted the 10-parser-design-a-context-free-grammar-for-boolean-expressions branch July 17, 2024 04: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.

Parser: Design a Context-Free Grammar for Boolean Expressions
2 participants