TyOverby / Pipe

Mozilla Public License 2.0
21 stars 1 forks source link

AST for documents #45

Open meyerkizner opened 10 years ago

meyerkizner commented 10 years ago

Currently the document compiler uses a hierarchy of Block instances as an intermediate representation, which is best described as a concrete syntax tree. I think parsing to a proper AST would be a more robust design, because as things stand there's lots of functionality in the code generator that in principle shouldn't be there. This is especially true for more complex BlockGenerators like those for lists and tables. Parsing to an AST would allow us to implement this functionality with AST walkers/visitors instead.

TyOverby commented 10 years ago

Yeah, I agree, this needs to happen. There was a reason for the current design, but it turns out it was mostly unfounded.

On Jun 6, 2014, at 12:05 AM, meyerkizner notifications@github.com wrote:

Currently the document compiler uses a hierarchy of Block instances as an intermediate representation, which is best described as a concrete syntax tree. I think parsing to a proper AST would be a more robust design, because as things stand there's lots of functionality in the code generator that in principle shouldn't be there. This is especially true for more complex BlockGenerators like those for lists and tables. Parsing to an AST would allow us to implement this functionality with AST walkers/visitors instead.

— Reply to this email directly or view it on GitHub.