António José (ajose) wrote,
António José

  • Mood:
  • Music:

Document compilation....

I've been thinking a lot about the way I sould handle the parsing of the SGML files.
I don't have the time necessary to make and debug a generic SGML parser, that would read the document's DTD and would validate it and compiled it into a data structure.
So, I'll go for specific parsers, one for each SGML DTD (there aren't a large number of them, right now, and also they are prety simple....).

But wat's the best way to handle them?
So far I think that the best way is to interpret them, having at the time as CURRENT dictionary, one with the words that are the tags, all of them IMMEDIATE.
In this way I can either INCLUDE it (and parse it in the process, compiling the resulting data structure in a target dictionary) or EVALUATE the string which has the document, which, will result in the same action.

After the parsing, I'll have in the target dictionary words that will give me each TAG contents and, thus, it will be quite easy to build then the necessary PHP code that I have to return....

And, doing this, this way, I also gain a valuable experience and a number of words that will be valuable after, when building the generic SGML code generator and the generic SGML code parser....

And the final test, then, it will be to pick up the HTML or the XML DTDs and see the code work as intended!

Well, that will be certainly in a near tomorrow, but today I must finish these specific parsers, so I can move tomorrow to continue building the HTML pages for the application interface and the application logic behind them!.....

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded