G'day all

I'm struggling with yacc. Any insight please ...

This file and this grammar work perfectly:

---- file
[host]
   HVAL = hsomething
   ANOTHER = "another Thing"

[notme]
   HVAL = nothing
   ANOTHER = "not another Thing"  # comment

----- grammar
%token DFLT
%token KEY
%token ID
%token EQ
%token STRING
%token SLASH

%%
Sections :
        | Section Sections

Section : KEY Lines       
        | DFLT Lines
                
Lines   : 
        | Line Lines

Line    : ID EQ arg
     
arg     : ID 
        | STRING
%%

Now I'm trying to extend the grammar to include a non section line ie

---- file

VAL = something

[host]
   HVAL = hsomething
   ANOTHER = "another Thing"

[notme]
   HVAL = nothing
   ANOTHER = "not another Thing"  # comment

say by grammar ...
Sections :
        | Section Sections
        | Lines

And am struggling terribly ...
[haycorn] /home/jam/getcfg [1995]% yacc -d getcfg.y
conflicts: 3 shift/reduce, 2 reduce/reduce

Anyhelp from anyone ... thanks
James
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to