How to create/write a simple XML parser from scratch?

后端 未结 6 918
你的背包
你的背包 2021-02-01 15:44

How to create/write a simple XML parser from scratch?

Rather than code samples, I want to know what are the simplified, basic steps in English.

How is a good par

6条回答
  •  清歌不尽
    2021-02-01 16:28

    Since D is rather closely related to Java, maybe generating an XML parser with ANTLR (since there are most probably XML EBNF grammars for ANTLR already, you could then use these), and then converting the generated Java parser code to D, could be an option? At least that would give you a starting point, and you could then put some efforts in trying optimizing the code specifically for D ...

    At least ANTLR is not at all as hard as many seem to think. I got started after knowing nothing about it, by watching 3-4 of this great set of screencasts on ANTLR.

    Btw, I found ANTLRWorks a breeze to work with (as opposed to the Eclipse plugin used in the screencast ... but the screencast content applies anyway).

    Just my 0.02c.

提交回复
热议问题