Open
Description
Beyond tooling issues, we also need to deal with paradigms that cannot work with WebAssembly.
In the current runtime, the Lexer is an abstract class, and the generated actual XXXLexer inherits from it.
This paradigm won't work with WebAssembly, especially not across language targets.
Looking at a generated XXXLexer, it doesn't provide behavior, rather it provides data that the runtime Lexer will use.
Therefore an idea that comes to mind is to evolve the design as follows:
- the generated XXXLexer becomes a standalone class that:
- provides data to a runtime Lexer instance
- forwards calls such as nextToken to that Lexer instance
- the data itself sits in a LexerData record (data class in Kotlin)
- the runtime Lexer becomes a concrete class that requires a LexerData record when instantiated
My plan is to first make the above work in Kotlin, then compile to Wasm.
Your comments on the proposed design are welcome.
Metadata
Metadata
Assignees
Labels
No labels