Open atjn opened 1 year ago
The way to make the grammar work with this change would probably be replacing the above mentioned CFG rule: https://github.com/AlbertHald/Minecraft-Turtle-Language/blob/86822fd7fd9f15561bc3d3411ad1815215b49824/src/main/antlr4/dk/aau/p4/abaaja/mctl.g4#L65
With the following line
| expression DOT ID LPAR (actualParameters)? RPAR #varMethodInvoke
This change will still require significant changes in the type checker and minor changes in the astbuilder (And possibly interpreter?).
We currently only allow method expressions on ID's or string literals. This is an unnecessary limitation, but one we made to speed up our initial development of the feature.
We should remove this limitation, but be aware it could amount to significant work especially in the type checker. The related CFG rule is here: https://github.com/AlbertHald/Minecraft-Turtle-Language/blob/86822fd7fd9f15561bc3d3411ad1815215b49824/src/main/antlr4/dk/aau/p4/abaaja/mctl.g4#L65