We need a parser that will output the data available in the AstLayer.kt file.
It needs to:
Be resilient to errors - autocomplete will only work if errors don't cause the whole thing to fall apart.
Track text ranges as metadata
It would be nice if:
The syntax allowed for brace elision (see Koka)
I imagine that brace elision is only possible if we write our own parser rather than use some kind of BNF generator (like ANTLR). PushbackReader allows you to do some pretty funky stuff.
Don't hesitate to add new kinds of elements to AstLayer.kt. At a minimum, we are going to need a AstError for indicating some kind of messed up or incomplete syntax in some position.
Perhaps it might be good to start with a BNF though because I have no idea what this language should actually look like at the syntax layer at the moment. We'll need to answer a few open questions still too.
We need a parser that will output the data available in the
AstLayer.kt
file.It needs to:
It would be nice if:
I imagine that brace elision is only possible if we write our own parser rather than use some kind of BNF generator (like ANTLR).
PushbackReader
allows you to do some pretty funky stuff.Don't hesitate to add new kinds of elements to
AstLayer.kt
. At a minimum, we are going to need aAstError
for indicating some kind of messed up or incomplete syntax in some position.