Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

Abgabe Gruppe 8 #53

Closed
wants to merge 0 commits into from
Closed

Conversation

MargotGeisbauer
Copy link
Contributor

No description provided.

Copy link
Owner

@marcauberer marcauberer left a comment

Choose a reason for hiding this comment

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

Tests are missing and coding needs to be improved before merging in your own interest.


import java.util.Stack;

public class AtomicExprSymbolTable extends SymbolTableBuilder{
Copy link
Owner

Choose a reason for hiding this comment

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

Please do not create an own class, but use the SymbolTableBuilder class.

Stack<Scope> currentScopes = new Stack<>();

@Override
public Void visitEntry(ASTEntryNode node) {
Copy link
Owner

Choose a reason for hiding this comment

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

Please use your own visit method, not visitEntry

visitChildren(node);


if (rootScope.lookupSymbol("identifier") == null)
Copy link
Owner

Choose a reason for hiding this comment

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

You are always searching for "identifier" whenever a variable is referenced. This is not what should be done. Please fix.



if (rootScope.lookupSymbol("identifier") == null)
throw new SemaError("No identifier found");
Copy link
Owner

Choose a reason for hiding this comment

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

Please print a better error message, that includes the name of the referenced variable


@Override
public Void visitEntry(ASTEntryNode node) {
Scope rootScope = new Scope();
Copy link
Owner

Choose a reason for hiding this comment

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

You don't need any scopes-related boilerplate coding for your AtomicExprNode.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants