Home | Notes | Languages | Programs | Homework |
Re: question abt project2, please help |
Aaron Pieper (apieper@VT.EDU)
Sun, 18 Mar 2001 12:52:17 -0500
Message-ID: <000b01c0afd4$2c50e340$c73a52c6@apieper> Date: Sun, 18 Mar 2001 12:52:17 -0500 From: Aaron Pieper <apieper@VT.EDU> Subject: Re: question abt project2, please help
I think you're worried about ambiguous grammars, yes? The possibility that something could belong to either the end of <non-terminal2> or the beginning of <non-terminal3> But I don't think we really have to worry about them in this project. For example, a noun phrase will obviously end when you read in a verb, and an adjective phrase will end when you read in a non-adjective. A verb phrase will never, for example, begin with a preposition, although if it could, then we would not really know where a verb phrase began for sure.
So in other words, just keep on assuming that words belong to <non-terminal2>, until you read in a word which can't belong in <non-terminal2>. Then you keep on assuming the next words in the sentence belong to <non-terminal3> until you read in a word which can't belong in <non-terminal3>. Because of the way this grammar is set up, this technique will always work, because the grammar is non-ambiguous.
hi guys,
i have a question of concept question abt the project,
lets say <non-terminal1> = <non-terminal2> <non-terminal3> <non-terminal4>
given a list of elements, in imperative langauge, we can just call 3 recursive functions and things r done by calling the next-lexical to get the next element to process
but in scheme, how do we know from which element to which element is <non-terminal2> and from which element to which element is <non-terminal3> and so on?
cuz the given list is a big long list without sublist
plz help
Home | Notes | Languages | Programs | Homework |