Re: Parsing
- Posted by Lucius L Hilley III <luciuslhilleyiii at JUNO.COM> Apr 08, 1997
- 800 views
On Tue, 8 Apr 1997 16:59:46 -0400 The Reaper <reaper at LOKI.ATCON.COM> writes: >At 05:33 PM 4/7/97 PST, you wrote: >>Joe wrote: >>> I should know how to do this, but I don't. Could some one show me >an >>> example of parsing stuff read in from a file. For example sake an >>> HTML file, and reading any <P>, <BR>, or <B> tags. Thanks. >>Here's a program that will read an HTML file, and return a sequence >of token >>in the form: ><code> >Unfortunatly, with both of the code supplied, you are forgeting the >fact >that the "<" and ">" symbols can be used without starting a tag and >that an >end-of-line CAN be inside them. You'd have to make a program that >checks for >the key words as well as the symbols. >=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= >The Reaper (J. Lays) My CODE did take into account <end-of-line> inside. and I don't plan to spend the time to create a HTML reader. < and > will show if the character following < is not a letter or an (!) exclamation point. The proper way to show < is with < and > with > meaning LessThan and GreaterThan. You are suppose to follow < with the semicolon. To show & you are suppose to use & which means Ampersand. <dummy> and <I have created a dummy > <! This is a HTML comment> This is an Euphoria list it should not have turned into a HTML lesson. I and my Parsing accomplice where trying to show how Parsing would be handled. We had no intentions in creating a full blown parser for HTML files. (well at least I didn't :] ) But of course Reaper is right. We should have mentioned that we had not handled all the details of HTML. My apologizes for not making that clear. --Lucius Lamar Hilley III -- E-mail at luciuslhilleyiii at juno.com -- I support transferring of files less than 60K. -- I can Decode both UU and Base64 format.