How to implement syntactic analysis of Simple Precedence

Discussion of Common Lisp

How to implement syntactic analysis of Simple Precedence

Postby halastoi » Thu May 03, 2012 12:51 am

I have to do in lisp, algorithm of simple preceding.
Here I found some links with information about Simple Precedence Grammars, but I do not understand how to do this in CLISP.

Here's a link

Here's another link

May you have some ideas how to do this in CLISP, even in pseudocode.
Thanks in advance!
halastoi
 
Posts: 3
Joined: Wed Apr 25, 2012 12:36 am

Re: How to implement syntactic analysis of Simple Precedence

Postby wvxvw » Thu May 03, 2012 3:16 am

What exactly are you trying to do? Are you trying to write a parser or a parser generator? Or do you need to assert whether the supplied input could be, in theory, be a product of a simple precedence formal grammar?
wvxvw
 
Posts: 127
Joined: Sat Mar 26, 2011 6:23 am

Re: How to implement syntactic analysis of Simple Precedence

Postby wvxvw » Thu May 03, 2012 4:38 am

It is probably best to have this conversation public, because if you solve the problem, then whoever reads this forum may benefit from that too - that's a purpose of the forum.

Besides, it would be much better if you could show what you already tried. Once you can show a practical problem, it's easier to tell you how to fix it. I still don't understand what exactly you are trying to do. Every non-trivial program reads input and writes output by some "rules", but this doesn't answer my question about what you want the program to do. The task implies you might have a grammar defined and you want to implement it in code, or, you may write a program, that given any grammar that fits the definition will generate the parser. Or you can process the product of the grammar, assuming it was written by some set of rules, which adhere to the definition of the grammar (this grammar is by definition reversible) and try to restore the set of rules used to generate the grammar. One more possibility is that you want to generate all grammar products for any given grammar if it is a simple precedence grammar (sounds a bit wasteful, but who knows...)
wvxvw
 
Posts: 127
Joined: Sat Mar 26, 2011 6:23 am


Return to Common Lisp

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 6 guests

cron