Hello again, Im building an HTML5 Parser in smalltalk. Im building it according to the pseudo code provided by WHATWG mainly these: Tokenization: http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.htm... Tree Construction: http://www.whatwg.org/specs/web-apps/current-work/multipage/tree-constructio... Im still in the Tokenization phase. The spec defines a state machine. It describes what has to be done when we reach a certain state. My approach to building the tokenizer is by representing each state as a method. Each method does some operations ( calling other methods to represent changing state or returning tokens etc..) I will be translating the pseudo code provided as is to Smalltalk. I am not sure if this is the best approach to do things especially that I am still new to Smalltalk. I was told by Stephane Ducasse to use PetitParser. Doing a quick reading I noticed that it is used when grammars are available. In my case I don't have a grammar but pseudo-code of a parser. Can I know if anyone has any suggestions for such a project or any comments on the approach I am aiming to follow ? Thanks in advance, Mohammad
Learn petit parser way of doing things. It takes a while to grok. Well, at least, there is still a ton to learn AFAIAC But it is very powerful. Phil 2013/3/11 Mohammad Al Houssami (Alumni) <mha53@mail.aub.edu>:
Hello again,
Im building an HTML5 Parser in smalltalk. Im building it according to the pseudo code provided by WHATWG mainly these:
Tokenization: http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.htm...
Tree Construction: http://www.whatwg.org/specs/web-apps/current-work/multipage/tree-constructio...
Im still in the Tokenization phase. The spec defines a state machine. It describes what has to be done when we reach a certain state.
My approach to building the tokenizer is by representing each state as a method.
Each method does some operations ( calling other methods to represent changing state or returning tokens etc..)
I will be translating the pseudo code provided as is to Smalltalk.
I am not sure if this is the best approach to do things especially that I am still new to Smalltalk.
I was told by Stephane Ducasse to use PetitParser.
Doing a quick reading I noticed that it is used when grammars are available. In my case I donât have a grammar but pseudo-code of a parser. Can I know if anyone has any suggestions for such a project or any comments on the approach I am aiming to follow ?
Thanks in advance,
Mohammad
participants (2)
-
Mohammad Al Houssami (Alumni) -
phil@highoctane.be