3 ms·
> Huh? Parse tree for assembly? Why not? The structure you need to represent something like lea eax, [eax + eax * 4] is tree-shaped. It's not as general
by tom_mellior 6y ago
> Huh? Parse tree for assembly?
Why not? The structure you need to represent something like
lea eax, [eax + eax * 4]
is tree-shaped. It's not as general as many other parse trees, since you don't have arbitrary nesting. But it is a tree-shaped thing that represents a parse, and if you need a name for it, "parse tree" is reasonable. The list containing all the labels/instructions/whatnot in the program is also a trivial tree.
(I'm aware that RISC-V addressing modes are probably simpler than the x86 example above.)