Visit Our UNIX and Linux User Community


Problem with Yacc


 
Thread Tools Search this Thread
Top Forums Programming Problem with Yacc
# 1  
Old 04-27-2011
Problem with Yacc

Hi guys,

I'm struggling with a simple but at the same time complicated problem related to yacc Smilie Maybe someone can help me with this Smilie
I'm working on a big project and it's hard for me to show the problem exactly on my code, but I will give a model of it.
Before I had this kind of grammar:
Code:
R:
   a1 b1 c1 d1
  |a2 b2 c2 d2
  ;

where a1,....d2 are grammar rules described later.
I have done this kind of change
Code:
R:
  new1 c1 d1
 |new2 c2 d2
 ;

new1:
       a1 b1
       ;

new2:
       a2 b2
       ;

After this I don't get any s/r or r/r errors. Everything seems to work perfect, when I run all tests we have, but I have one fail, which is about finding compilation errors in source code which we try to parse with this yacc parser Smilie Smilie

Please tell me what can be a problem related to my change...it seems to be legal but causes a fail.

Thanks.
# 2  
Old 04-27-2011
Not a yacc guru, but does new1: have to be upstream of use, for one pass compile?
# 3  
Old 04-28-2011
Hi DGPickett,

Sorry for my stupid request, but could you please explain what do you mean?
Actually I'm not a master of yacc, maybe that is why I couldn't really understand what you meant to say Smilie

Thanks.

Previous Thread | Next Thread
Test Your Knowledge in Computers #55
Difficulty: Easy
The term UPS stands for 'Universal Power Source'.
True or False?

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

sed Or Grep Problem OR Terminal Problem?

I don't know if you guys get this problem sometimes at Terminal but I had been having this problem since yesterday :( Maybe I overdid the Terminal. Even the codes that used to work doesn't work anymore. Here is what 's happening: * I wanted to remove lines containing digits so I used this... (25 Replies)
Discussion started by: Nexeu
25 Replies

2. Programming

Yacc rogram

hello, actually i want to generate rgram in yacc able to do do several operations separated by ';' and after show all the results separated by ';' again. My code do just one operations and i couldn' t find solution to do several ones separated by ';'. I thought may be i can do a do... while but i... (0 Replies)
Discussion started by: zolafencer
0 Replies

3. IP Networking

Problem with forwarding emails (SPF problem)

Hi, This is rather a question from a "user" than from a sys admin, but I think this forum is apropriate for the question. I have an adress with automatic email forwarding and for some senders (two hietherto), emails are bouncing. This has really created a lot of problems those two time so I... (0 Replies)
Discussion started by: carwe
0 Replies

4. AIX

user login problem & Files listing problem.

1) when user login to the server the session got colosed. How will resolve? 2) While firing the command ls -l we are not able to see the any files in the director. but over all view the file system using the command df -g it is showing 91% used. what will be the problem? Thanks in advance. (1 Reply)
Discussion started by: pernasivam
1 Replies

5. Programming

parsing fixed length field with yacc/bison

How to specify the token length in a yacc file? sample input format <field1,data type ans,fixed length 6> followed by <field2,data type ans,fixed length 3> Example i/p and o/p Sample Input: "ab* d2 9o" O/p : "Field1 Field2 " yacc/bison grammar: record :... (1 Reply)
Discussion started by: sungita
1 Replies

6. Programming

actions before parsing rules in lex n yacc

Hi , We have developed a grammer for our domain language using lex n yacc. I want to know is there any pre defined lex-yacc function which gets call before executing any rule (or rules). Oue requirement is, before processing any rule ,we want to perform some specific actions ? is there... (0 Replies)
Discussion started by: supritjain
0 Replies

7. Programming

How to match n number of newline character(\n) in lex and yacc

Hi , I need to develop a parser which should match something like 1. text a=5 " a=20"; 2. text a=..." a=20"; 3 text a=..." a=20 b=34 c=12 "; I have used this regular expression in my Lex file to generate the tokens: \".\s*.*\s.\" (8 Replies)
Discussion started by: vishwa787
8 Replies

8. Shell Programming and Scripting

ssh script problem problem

Hi Please help me with the following problem with my script. The following block of code is not repeating in the while loop and exiting after searching for first message. input_file ========== host001-01 host001-02 2008-07-23 13:02:04,651 ConnectionFactory - Setting session state... (2 Replies)
Discussion started by: pcjandyala
2 Replies

Featured Tech Videos