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

Additional Content #16

Open
2 of 4 tasks
JakubSchwenkbeck opened this issue Jan 20, 2025 · 1 comment
Open
2 of 4 tasks

Additional Content #16

JakubSchwenkbeck opened this issue Jan 20, 2025 · 1 comment

Comments

@JakubSchwenkbeck
Copy link
Collaborator

JakubSchwenkbeck commented Jan 20, 2025

Motivation

As we have implemented most of the basics in our Java subset, I would suggest we collect additions which we might add to our Compiler:)

Possible Additions (ticks speak for the Parser!)

  • Real support of for loops
  • Interfaces
  • abstract classes
  • Type casting
@Brofian
Copy link
Owner

Brofian commented Jan 26, 2025

Interfaces would be a necessary addition to the compiler, as many of the predefined classes use them a lot. This would require a new field interfaces: List[String]in the ClassDecl and either a new node InterfaceDecl or an additional parameter isInterface on the ClassDecl (for comparison: Java Reflections use the isInterface parameter). Method bodies are already optional, so the abstraction could be ensured in the semantic check.

One example could be: class java.lang.String extends Object implements [...], CharSequence, which implements the method public boolean contains(CharSequence)

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

2 participants