-
Notifications
You must be signed in to change notification settings - Fork 0
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
Validation of AST #25
Labels
enhancement
New feature or request
Milestone
Comments
Gashmob
added a commit
that referenced
this issue
Aug 23, 2024
Part of #25 This validator does nothing for now, it just throw for each expression.
Merged
Merged
Gashmob
added a commit
that referenced
this issue
Aug 23, 2024
Part of #25 This validator does nothing for now, it just throw for each expression.
Gashmob
added a commit
that referenced
this issue
Aug 28, 2024
Part of #25 It will be used to store context of ValidationVisitor easily. Instead of creating a new member each time, just store it directly in the context. The stack/unstack allow to have a different context if we need it
Gashmob
added a commit
that referenced
this issue
Sep 1, 2024
Part of #25 It will help to show understandable message
Gashmob
added a commit
that referenced
this issue
Sep 1, 2024
Part of #25 It helps to format message shown to user
Gashmob
added a commit
that referenced
this issue
Sep 1, 2024
Part of #25 Show a warning if value not used
Gashmob
added a commit
that referenced
this issue
Sep 1, 2024
Part of #25 Instead of using a pointer to parent, use std::stack of map. There is at least one map in the stack (unstack cannot pop last map).
Gashmob
added a commit
that referenced
this issue
Sep 8, 2024
Part of #25 It set type of expressions (just literals for now) and check that last expression is an int (return type of program)
Gashmob
added a commit
that referenced
this issue
Sep 12, 2024
Part of #25 - Check constant has a value - Check declared type (if exists) - Check assigned value (if exists) - Check assigned value == declared type (if exists) - Check existence of at least type or value
Gashmob
added a commit
that referenced
this issue
Sep 15, 2024
Part of #25 - check name exists - check it's not a constant - check type equality
Gashmob
added a commit
that referenced
this issue
Sep 19, 2024
Part of #25 - check left operand - check right operand - check calcul can be done between types Also add early return when type given by sub-expression is nullptr: it means there is an error, so no need to go further in this expression
Gashmob
added a commit
that referenced
this issue
Sep 19, 2024
Part of #25 It ease the dump of types when it's aliased types
Gashmob
added a commit
that referenced
this issue
Sep 22, 2024
Part of #25 All cases are covered (at least all I can think of)
Gashmob
added a commit
that referenced
this issue
Sep 22, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
User code cannot be fully trusted as good, it can contains error and they should be catched. So the AST must be validated. Using the previously created visitor structure we can check the whole structure.
The text was updated successfully, but these errors were encountered: