For Programmers: Free Programming Magazines  


Home > Archive > Prolog > October 2004 > need urgent help with parser









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author need urgent help with parser
Pro_novice

2004-09-26, 3:56 am

im a beginner in PROLOG.i need urgent help with a simple prolog code.i need
to write a predicate parse/2 that would check the validity of an input
string against the given grammar.for eg.

?- parse(s, [a, b]).
Yes

should be the output.could any one let me know how to write the predicate
for this.

Thanks.

Nick Wedd

2004-10-12, 8:56 am

In message
< 09e77daf92c4fc32d1d852f4f31c72c1@localho
st.talkaboutprogramming.com>,
Pro_novice <cyb014@rediffmail.com> writes
>im a beginner in PROLOG.i need urgent help with a simple prolog code.i need
>to write a predicate parse/2 that would check the validity of an input
>string against the given grammar.for eg.
>
>?- parse(s, [a, b]).
>Yes
>
>should be the output.could any one let me know how to write the predicate
>for this.


I don't understand this. For one thing, it sounds far too hard for a
beginner. For another, you refer to "an input string" and "the given
grammar". But in your sample call parse(s, [a, b]), there is no
string. And is [a, b] in some way a grammar?

Nick
--
Nick Wedd nick@maproom.co.uk
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com