Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7049875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:04:28+00:00 2026-05-28T03:04:28+00:00

The goal of my application is to validate an sql code and generate,in the

  • 0

The goal of my application is to validate an sql code and generate,in the mean time, from that code a formatted one with some modification.
For example this where clause :

where
e.student_name= c.contact_name and ( c.address = ” nefta”
or c.address=” tozeur “) and
e.age <18

we will have as formatted output something like that :

where e.student_name= c.contact_name
and (c.address=trim(“nefta”)

or c.address=trim(“tozeur”) )
and e.age <18

I hope I’ve explained my aim well


The problem is grammars may contain recursive rules which make the rewrite task unreliable ; for instance in my sql grammar i have this :

search_condition         : search_condition OR search_condition{clbck_or}
                         | search_condition AND search_condition{clbck_and}
                         | NOT search_condition {clbck_not}
                         | '(' search_condition ')'{clbck__}
                         | predicate {clbck_pre}
                         ;

Knowing that I specified a precedence priority to solve shift reduce problems

%left OR
%left AND
%left NOT

So back on the last example ; my clause where will be consumed this way:

c.address=”nefta”or c.address=”tozeur” -> search_condition

(c.address=”nefta”or c.address=”tozeur”)->search_condition
e.student_name= c.contact_name and (c.address=”nefta”or c.address=”tozeur”)-> search_condition
… and e.age<18-> search_condition

You can by the way understand that it’s tough to rebuild the input stream referring to callbacks triggered by each reduction cause the order is not the same.

Any help for this problem ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T03:04:29+00:00Added an answer on May 28, 2026 at 3:04 am

    Your question is a bit vague, so I’m guessing that you actually print in your clbck_or (), etc. The “common” way to which wildplasser has alluded is to use “semantic values”, i. e. (untested):

    search_condition         : search_condition OR search_condition{$$ = clbck_or($1, $3);}
                             | search_condition AND search_condition{$$ = clbck_and($1, $3);}
                             | NOT search_condition {$$ = clbck_not($2);}
                             | '(' search_condition ')'{$$ = clbck__($2);}
                             | predicate {$$ = clbck_pre($1);}
                             ;
    

    If you’re using Bison, the manual has a fine example in the section “Infix Notation Calculator: `calc'”. With strings and C, you will have to add some memory handling.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My goal is to control an application from VB.NET . There is no API,
We're using the Maven exec:java goal to run a custom java application that configures
I would like that my Spring-based web application were able to validate its configuration
My goal is to delete a user from the user list in my application.But
We have a GAE application that notifies users of sports goal changes and we
I'm developing an application that uses Qt 4.7 with the goal of creating a
Goal of the application is get latest post from facebook, it is possible if
The goal is to display the information that the application is working. So I'm
High Level Goal: Create a single Maven Web Application project that can be used
Goal: Display a picture, that is saved inside of my application, in my document.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.