Hi,
I'm working on a markup language and would like to parse the input to first generate an AST, then generate output from it.
I'm sure thousands of people have already done something similar and that libraries exist.
Would anyone be able to recommend a good approach for generating an AST from parsing input?
Thank you
yc
I usually use something like this:
type
NodeKind = enum
text, italics, bold, paragraph, list
Node = ref object
case k: NodeKind
of text: s: string
of italics, bold, paragraph:
child: Node
of list:
children: seq[Node]