Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...I have found your site brilliant. What makes it good are the people that contribute to the site..."

Geography

Where in the world do Tek-Tips members come from?

grammar bison(yacc) question

homeless (Programmer)
8 Sep 06 9:12
i try to catch the error position, and give out in an error File:


stmnts:   primary_terminal exp '\n'      {/* read something...*/ }
             | primary_terminal error '\n' {/* give out the eror line for exp */; yyerrok;}
             |  primary_terminal exp error {/* give out the eror line for newline */; yyerrok;}

if i try to give out the errorline for  primary_terminal by adding a new opition: error exp '\n' {/* give out the eror line for primary_terminal */; yyerrok;},
so caused the rule stmnts  conflicts.

how will that be agreed?
xwb (Programmer)
9 Sep 06 9:52
You need to break it down further

CODE

stmnts:   primary_terminal experr '\n'      {/* read something...*/ }

experr: exp |
        error |
        exp error
I'm not sure if that will work - you may need to break that down even further.
homeless (Programmer)
11 Sep 06 9:38
thx xwb,

but this was not the answer of my question. think about an input statement like this one:

CODE

   if(x>y){...}
with the primary_terminal "if" and

CODE

   while(x>y){...}
with the primary_terminal "else"

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close