News for hackers. Stuff that matters.
Re:A Brutal Look at Balanced Parentheses, Computing Machines... by seanmcdirmid on Friday February 22, 2019 @06:37PM (#19230222)
> If you're using it to broach a conversation on automata, regular expressions, and context free languages well yeah delving into that is bad unless you're writing real parsers/compilers at this gig.

If it is a compiler gig, I don't think we can get much mileage out out of the balance parentheses problem. Language implementors either just deal with paren balancing as part of the parser or, if they want better error recovery, write a simple paren balancer as a separate pass between lexing and real parsing. In the latter case, implementors will just go with the most simplest solution available and won't bother with a PDA (since it really isn't necessary).

If you really want to test a language implementor, ask them how they would implement a parser for a language that allows < and > to be used as both comparison operators and generic type parentheses.

There are no comments on this comment yet.