- Up - | Next >> |
Last week we discussed bottom-up parsing/recognition, and implemented a simple bottom up recognizer called bureg/1
. Unfortunately, bureg/1
was very inefficient, and its inefficiency had two sources. First the implementation used, which was based on heavy use of append/3
to split lists up into all possible sequences of three sublists, was highly inefficient. Second, the algorithm was naive. That is, it did not make use of a chart to record what has already been discovered about the syntactic structure.
This week we discuss top-down parsing, and we will take care to remove the implementational inefficiency: we won't use append/3
, but will work with difference lists instead. As we shall see, this makes a huge difference to the performance. Whereas bureg/1
is unusable for anything except very small sentences and grammars, today's parser and recognizer will easily handle examples that bureg/1
finds difficult.
However we won't remove the deeper algorithmic inefficiency. Today's top-down algorithms are still naive: they don't make use of a chart.
- Up - | Next >> |