The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
Yes, error checking isn't usually added until it starts to "work", so it can cause upheaval. But it's so much easier to debug if the parser--and also what is basically an interpreter, for me--can pinpoint where they failed, with a message that makes sense. And keep going, so that you don't have to uncover one problem at a time.
end is the position of the delimiter where the expression ends. It's found by doing a lookahead for the closing punctuation, which is one of ;},)]:= depending on the context. If something goes wrong while parsing the expression, a log containing the expression is generated and the parse resumes after end. I guess that makes it LL(*) if I remember correctly.
Man are you optimist... I would have said 95-5 or even 98-2
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
Recursive descent parsers are the cat's ass! Others are inscrutable by comparison. In our compiler course, we had a choice of what kind of parser to implement. I was the only one who chose recursive descent. It was easy to enhance, so it ended up handling a larger subset of Algol than the others. But boy, was it slow! It was written in Simula-67, running on a PDP-10, and probably backtracked too much. Adding backtracking statistics would have revealed if it was doing something silly.
As reported in Paging-Mr-Cthulhu[^] I'm dealing with "bad" HTML (not that any HTML is truly good).
The first attempt used a Regular Expression to grab the TH and TD elements (within TR elements of course). Hence the above reference. It works.
The second attempt used HtmlAgilityPack with good results, but I doubt I can get it installed on the server, and it didn't provide as much feedback as I'd like. It works.
Sooo... yesterday and today were spent implementing an HTML-to-XML process. Using a Regular Expression to grab anything which looks roughly like a tag.
Then the process iterates the tags, matching end tags with start tags, and figuring out how to deal with unmatched start and end tags (and firing events for such aberrations).
The result is an XmlDocument, which enforces well-formed XML (but not necessarily valid XHTML).
Programming languages are for nerds like us; HTML makes room for everyone else.
Besides, it's HTML that made the Internet; without HTML there would be no Internet, so it's one of the most important inventions in the entire history of the world.
I just envisioned a dev-only Internet -- CP, SO, 10,000,000 blogs bitching about the latest Star Wars movie, endless rants about preferred coding standards, and everything else about why one programming language is supreme, and the rest are all garbage.
Not a pretty sight...
I wanna be a eunuchs developer! Pass me a bread knife!
Last Visit: 4-Apr-20 6:28 Last Update: 4-Apr-20 6:28