sdf2 question

"Robert Shelton" <rshelton@students.cs.mu.oz.au>
6 Nov 2002 11:45:06 -0500

          From comp.compilers

Related articles
sdf2 question rshelton@students.cs.mu.oz.au (Robert Shelton) (2002-11-06)
| List of all articles for this month |

From: "Robert Shelton" <rshelton@students.cs.mu.oz.au>
Newsgroups: comp.compilers
Date: 6 Nov 2002 11:45:06 -0500
Organization: Computer Science, University of Melbourne
Keywords: parse, question
Posted-Date: 06 Nov 2002 11:45:05 EST

I'm developing using sdf2 and sglr and now trying to
understand the abiguities in my grammar. At the moment
I'm trying to understand the output of the Vis-amb tool.


I'm getting lines like:


N(cf(opt(layout)),[])
N(lit("#include"),[])


I understand this is completely out of context, but I get
the feeling that I'm inserting empty layout rules in various
places and this is cause ambiguities. My Layout rules are
defined as:


[\059] ~[\n\013]* [\n\013] -> LAYOUT
[\ \t\n\013] -> LAYOUT


which with ascii codes replaced looks like:


[;] ~[\n\r]* [\n\r] -> LAYOUT
[\ \t\n\r] -> LAYOUT


I also set the lexical restrictions (ascii replace):


lexical restrictions
IntConst NumConst -/- [0-9]
Ident -/- [a-zA-Z\_0-9]
LAYOUT? -/- [\ \t\n\r]


The line beginning with ";" determines a comment in the csound language and I
include '\r' and '\n' to handle dos files. I'm really new to this but
interested in what anyone has to say.


Thanks all (and sorry about the long post)


rob


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.