Or if you prefer inheritance, you can extend the inheritance tree:
type
Node = ref object of RootObj
LitOrOp = ref object of Node
Number = object of LitOrOp
value: int
BinOp = object of LitOrOp
left: LitOrOp
op: string
right: LitOrOp
Run
- Best way to represent AST i_am_hal
- Re: Best way to represent AST Araq
- Re: Best way to represent AST bluenote
- Re: Best way to represent AST i_am_hal
- Re: Best way to represent AST mratsim
