flat assembler
Message board for the users of flat assembler.
Index
> Main > Tag parsing |
Author |
|
f0dder 11 May 2005, 17:35
For heavy-duty parsing jobs, you might want to have a look at a parsing engine. It can be beneficial since the grammar you write is sorta like a formal specification of the kind of text you are parsing. If you find the resulting parser is too slow or bloated, you can always then hand-write the parser.
www.goldparser.com looks promising, since it has a decent UI for developing the grammar, and the parser routine and used tables are separata - which means the parser can be used for multiple tables, and a table can be used in multiple languages (unlike stuff like lex/yacc or whatever). I must admit that my experience with such parsing is very limited, but I'm playing around with it a bit currently, as much as my exams allow me (read: not much ). |
|||
11 May 2005, 17:35 |
|
Reverend 11 May 2005, 17:41
f0dder wrote: If you find the resulting parser is too slow or bloated, you can always then hand-write the parser |
|||
11 May 2005, 17:41 |
|
pelaillo 11 May 2005, 18:06
This is a simple and fast html parser I wrote for menuet browser. It will fit well your purposes and is simple to configure to be used for other purposes.
The parser is system independient code. The helper functions are for win32. Madis wrote an improved parser for the browser. Maybe he could post his latest version here.
|
|||||||||||
11 May 2005, 18:06 |
|
Reverend 11 May 2005, 22:08
Very big thx pellailo for sources, but I found an interesting way to achieve my goal. It's so simple, but powerdul I just used stack. When 'exploring' the input when I get to an opening tag I fill a structure with all its info, and push it on a stack. When I find then closing tag I automately pop the stack, and fill rest info (where does it end). It gives you many benefits. Ie. you know after first pass whether all tags were closed (if stack is unormalised, it means not all tags were closed). When poping the stack you already compare an opening and closing tag, so you know if they were used properly. But there are also bad sides of it, as it works only with 100% correct with XML standard tags eg. <b> <i> </b> </i> won't work, becuase youhave to first close <i> tag. Also it makes you create closing tag for every single tag in an input. There can be no sperate tags, without closing one. So I guess these limits won't let you write an html browser (as html pages, are full of incorrect code), but it helped me a lot. Big thanks both f0dder and pellailo.
|
|||
11 May 2005, 22:08 |
|
Madis731 12 May 2005, 11:28
|
|||
12 May 2005, 11:28 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.