(no title)
lignuist | 11 years ago
When it comes to parsing, the thing is that you usually have to make some assumptions about the document structure.
lignuist | 11 years ago
When it comes to parsing, the thing is that you usually have to make some assumptions about the document structure.
zAy0LfpBZLC8mAC|11 years ago
Yes, the assumption you have to make is called the grammar, and you better have a parser that always does what the grammar says, and global text replacement is a technique that is easy to get wrong, difficult to prove correct, and completely unnecessary at that.
lignuist|11 years ago
What should happen? Since #COMMA is not #COMMA#, it gets not replaced, because it does not match.
Please keep in mind, that I replied to suni's very specific question and did not try to start a discussion about general parser theory. In practice, we find a lot of files that do not respect the grammar, but still need to find a way to make the data accessible.