-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
- Extract ExpressionExtractor
- Extract ExpressionStatement (Assignment and MethodInvocation) - Extract Statement (ExpressionStatement and ReturnStatement) - Change MethodInvocation identifier from Identifier to MethodName - Use ExpressionExtractor in BlockStatementExtractor - Return Void Expression
@1001mei do you mind reviewing the changes done to 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. |
export type Expression = Primary | BinaryExpression | UnaryExpression | Void; | ||
|
||
export interface Void { | ||
kind: "Void"; | ||
} |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
@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. |
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. |
Check commits.