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

SymbolTable.py Currclass function #1

Open
Rag1 opened this issue Nov 6, 2016 · 4 comments
Open

SymbolTable.py Currclass function #1

Rag1 opened this issue Nov 6, 2016 · 4 comments

Comments

@Rag1
Copy link
Collaborator

Rag1 commented Nov 6, 2016

Why do we need a currclass function? And 'class' will never be an element in values since the type is the class name which will be an identifier.

@jahnvi12
Copy link
Owner

jahnvi12 commented Nov 6, 2016

We need to insert the class name in the symbol table so that the constructor return type and variables of type class can be checked. And the functions in vm should be named as classname$functionName so we need access to the class name.

@SilverSoldier
Copy link
Collaborator

SilverSoldier commented Nov 9, 2016

We need currclass function for function calls of method within class subroutine.
ex- do fn()
we do not know what the class name of fn is

@Rag1
Copy link
Collaborator Author

Rag1 commented Nov 9, 2016

Arent we keeping track of what file we are reading? That will be the current class? We can add currclass as a parameter in the symbol table instead of being a part of symbol table if need be

@SilverSoldier
Copy link
Collaborator

Fine. Will do.

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

No branches or pull requests

3 participants