dcsimg
Extend HTML.g or start fresh?
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Monday, December 8, 2003 12:31 PM

Suppose I have a bunch of HTML tables of different types and I want to verify their structure. Their types differ in the number of rows each contains and I'd like to validate different tables against different expected types. IOW, parsing table1 I find two rows, good that table is of type TABLES_WITH_TWO_ROWS and I was expecting a table with two rows as the first table in the table order. Then parsing table2, I'm expecting another table with two rows, but I find a table of type TABLES_WITH_THREE_ROWS, so I signal by throwing an exception or something. I'm quite sure that this is a job for ANTLR, but I'm not    More>>

Suppose I have a bunch of HTML tables of different
types and I want to verify their structure. Their
types differ in the number of rows each contains
and I'd like to validate different tables against
different expected types.


IOW, parsing table1 I find two rows, good that
table is of type TABLES_WITH_TWO_ROWS and
I was expecting a table with two rows as the first
table in the table order. Then parsing table2, I'm expecting another
table with two rows, but I find a table of type
TABLES_WITH_THREE_ROWS, so I signal by
throwing an exception or something.




I'm quite sure that this is a job for ANTLR, but
I'm not sure if I should use HTML.g grammer or
simply write my own grammer.




  • If I were to use the HTML.g grammer, then
    would my task be to create an extension to this
    grammer by extending it (by overriding somehow?)
    to include my rules on what tables of different
    types look like? Or...

  • Should I leave HTML.g out of the picture and
    simply write a small grammer to handle just the
    tasks I need like defining the following:




    TABLES_WITH_TWO_ROWS: TR
    TR

    TABLES_WITH_THREE_ROWS:
    TR TR TR

    TR: ... etc. etc.


I have a feeling that I should make use of the
already written HTML.g grammer, but I'm not sure.
If so, then do I extend it somehow?

   <<Less
About | Sitemap | Contact