Detect and remove unreachable parse tree nodes
In some cases, a nonterminal is used only for syntax, but its contents are irrelevant. In these cases, the parse tree node is unreachable from the root node. Instead of uselessly creating and immediately dropping a parse tree node, we should return unit.
EmitPtree: For this, we need to construct an AST representation on a higher level than the Caml AST we currently produce. A subsequent pass over this AST can remove unreachable types.
PtreeMaker: The module creating parse tree actions may need to know about unreachable types, as well.
Details
Id: | 84838e01a5889270e7b4860e05d2f2c09926e9ae |
Type: | task |
Creation time: | 2012-10-20 07:52 GMT |
Creator: | Pippijn van Steenhoven <pippijn@...> |
Release: | unassigned |
Component: | glr |
Status: | closed: fixed |
Issue log
2012-10-21 06:29 GMT | Pippijn van Steenhoven <pippijn@...> | |
Unreachable parse tree nodes are now no longer emitted and the semantic actions yield unit. | ||
2012-10-20 07:52 GMT | Pippijn van Steenhoven <pippijn@...> | |