Implement the immutable stage of doing semantic analysis of statements. This includes do while, while, for, and switch. This includes binary expressions, initializations, match statements, unary expressions, return statements, and the use of break and continue.
Issue Type
[X] Feature
[ ] Bugfix
[ ] Documentation
[ ] Refactoring
[ ] Other:
Requirements
Binary Expressions
Type Compatibility: Verify that operand types are compatible for the operation.
Divide by zero: Make sure to throw an error if there is an attempt to divide by zero
Assignment
Correct Type: Ensure the assigned value is of the correct type
Symbol Exists: Ensure the value to be assigned exists in SymbolTableStack
Initialization
Type Verification: Check that the variable type matches the initialization expression type.
Scope Insertion: Ensure variable is inserted into the correct scope in SymbolTableStack.
Unary Expressions
Operand Type Verification: Ensure operand type is valid for the unary operator.
Result Type Assignment: Determine the type of the result based on the unary operation.
Return Statements
Return Type Check: Validate that the type of the return expression matches the function's declared return type.
Break Statements
Contextual Validation: Confirm that break is used within a valid loop or switch context.
Continue Statements (sem_continue)**
Contextual Validation: Ensure continue is used within a loop.
Notes
106 is a kind-of a precursor to this issue, though you could do it prior.
Details
Implement the immutable stage of doing semantic analysis of statements. This includes
do while
,while
,for
, andswitch
. This includes binary expressions, initializations, match statements, unary expressions, return statements, and the use of break and continue.Issue Type
Requirements
Binary Expressions
Assignment
SymbolTableStack
Initialization
SymbolTableStack
.Unary Expressions
Return Statements
Break Statements
break
is used within a valid loop or switch context.Continue Statements
(sem_continue
)**continue
is used within a loop.Notes
106 is a kind-of a precursor to this issue, though you could do it prior.