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

ECE - Evaluate FieldDeclaration and MethodInvocation #19

Merged
merged 23 commits into from
Feb 19, 2024

Conversation

xyliew25
Copy link
Contributor

Check commits.

@xyliew25
Copy link
Contributor Author

xyliew25 commented Feb 18, 2024

@1001mei do you mind reviewing the changes done to ast? I added some tests for the parser too.

Also, I'm so sorry for committing your commits, I must have messed up during rebasing and I'm not sure how to undo...

@xyliew25 xyliew25 self-assigned this Feb 18, 2024
@xyliew25 xyliew25 requested a review from 1001mei February 18, 2024 08:28
@1001mei
Copy link
Contributor

1001mei commented Feb 18, 2024

@1001mei do you mind reviewing the changes done to ast? I added some tests for the parser too.

Also, I'm so sorry for committing your commits, I must have messed up during rebasing and I'm not sure how to undo...

Sure, no worries.

Comment on lines +87 to +91
export type Expression = Primary | BinaryExpression | UnaryExpression | Void;

export interface Void {
kind: "Void";
}
Copy link
Contributor

Choose a reason for hiding this comment

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

By Void, do you mean the void return type in Java? I think it should be under MethodDeclaration -> MethodHeader -> Result instead of Expression.

Copy link
Contributor Author

@xyliew25 xyliew25 Feb 18, 2024

Choose a reason for hiding this comment

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

No, Void here refers to "nothing" which is returned by methods declared void.

I admit that this is a hack to facilitate ECE evaluation as Void is required to be a Node as well.

Copy link
Contributor Author

@xyliew25 xyliew25 Feb 19, 2024

Choose a reason for hiding this comment

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

On second thought, maybe this change is too much as it doesn't really comply with JLS. I shall keep this in mind and perhaps propose an alternate solution that make modifications in the ECE instead in the future.

@xyliew25
Copy link
Contributor Author

@1001mei I understand that there may be unnecessary complexities involved since the different components, i.e., type checker, compiler, ECE, require a simpler/more complicated AST structure. Hope these changes are not too disruptive.

@1001mei
Copy link
Contributor

1001mei commented Feb 18, 2024

Ya, I understand that each component might have different requirements on the AST structure. These changes do not affect the compiler too much, so feel free to merge them, I am totally fine with it.

@xyliew25 xyliew25 merged commit b545a2a into main Feb 19, 2024
2 checks passed
@xyliew25 xyliew25 deleted the cse/field-mtd-inv branch February 20, 2024 03:13
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

Successfully merging this pull request may close these issues.

2 participants