Okay, let's say I want to write some Pop-11 code to learn more about
the langauge. Now, as I recall, Pop-11 follows an open-stack model.
So if I wanted to implement a parser for the following language:
Sentence <- NounPhrase VerbPhrase Adverb
Sentence <- NounPhrase VerbPhrase PrepostionalPhrase
And I wanted to do this as a recursive descent parser that backtracks,
how would I code it?
Note: I have three goals with this question:
1) I want to see some sample Pop-11 code
2) I want to see a code fragment that implements a recursive descent parser
3) I want to see how to implement backtracking (a la Prolog) in a system
that doesn't provide it 'under the covers'
Hopefully, someone might know?
David
|