Re: [SoundComp-Develop] Language definition wiki page
Status: Pre-Alpha
Brought to you by:
jssr67
|
From: <js...@ya...> - 2010-01-05 18:39:54
|
Rich wrote: --------------- >It looks to me like your "Drafts for language structure" is an initial >stab at a formal grammar for the language. Is this correct? Yes, you are on the right track. >Much of the syntax seems to follow a standard Yacc grammar definition. This is of couse on purpose. SoundComp will use a tool of the yacc family for implementing the parser. By using a representation that is strongly similar to the formal language used there, it should be fairly easy to find the structures that we work out here, again in the source code. >But not all. If this is a formal grammar, why not follow strictly the Yacc grammar syntax and definitions. For example, I'm not sure but it sounds like you are using the term "literal" in the same way that Yacc grammar uses the term "terminal". Is this correct? Sometimes I see a ":" which is the separator between the left and right-hand side of the production rules. There are a few reasons why I do not want the complete yacc source code written in the wiki. First, the yacc definitions also contain the actions of the parser. These do not belong on this wiki page and should be omitted there. Second, it is not sure whether everything that I call a 'literal' will also be a 'terminal' in the parser because some may already lie on the other side of the border between parser and scanner. I do not want to enforce that everyone agrees on that separation at this point in the discussion since it is not yet relevant. Besides that, I am unsure whether everyone (including those that never heard of yacc grammars) has an idea what a 'terminal' would be, but next to everyone should be able to grasp what a 'literal' could be. Third, the wiki formatting options also provide a different (and easier to view) way of representing the grammar than the "unformatted-text-only" way of yacc. This is the reason why I created subparagraphs instead of separating grammar states from their rules with colon. If most of you think it is better to strictly following yacc syntax and terminology, we may do so. You just caught me at an attempt to make it easier for the other members. I hope but am not sure that I am successful in that :-) Jan __________________________________________________ Do You Yahoo!? Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. http://mail.yahoo.com |