Re:Let's write a compiler, part 3: A parser
by rightbyte on Monday August 16, 2021 @02:28PM
(#28201230)
Isn't the context sensitivity handled when you build an AST with the action statements in Yacc?
[ Parent
| on HN ]
Re:Let's write a compiler, part 3: A parser
by chrisseaton on Monday August 16, 2021 @02:32PM
(#28201274)
Yes - so straight away you have to leave the DSL and bypass the formal mode of Yacc. At which point why bother with it? If the first thing you need to do with your tool is hack around it, maybe the tool isn’t so well-designed?
And actions often do things like side-effect changes to the lexer state, so it gets worse from there.