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

  • Home
  • SEARCH
  • 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 8464941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:54:02+00:00 2026-06-10T14:54:02+00:00

I want to make a parser for a language that has left recursion and

  • 0

I want to make a parser for a language that has left recursion and I don’t know what to do.
The only experience I have with parsing is with ll(1).

For example having the following bnf definition

cqlQuery    ::=     prefixAssignment cqlQuery
| scopedClause
prefixAssignment    ::=     '>' prefix '=' uri
| '>' uri
scopedClause    ::=     scopedClause booleanGroup searchClause
| searchClause
booleanGroup    ::=     boolean [modifierList]
boolean     ::=     'and' | 'or' | 'not' | 'prox'
searchClause    ::=     '(' cqlQuery ')'
| index relation searchTerm
| searchTerm
relation    ::=     comparitor [modifierList]
comparitor  ::=     comparitorSymbol | namedComparitor
comparitorSymbol    ::=     '=' | '>' | '<' | '>=' | '<=' | '<>' | '=='
namedComparitor     ::=     identifier
modifierList    ::=     modifierList modifier | modifier
modifier    ::=     '/' modifierName [comparitorSymbol modifierValue]
prefix, uri, modifierName, modifierValue, searchTerm, index     ::=     term
term    ::=     identifier | 'and' | 'or' | 'not' | 'prox' | 'sortby'
identifier  ::=     charString1 | charString2

Do I have to convert the left recursion or do something else to avoid it?

Please don’t give me links for translators cause I want to do it manually and not use a program to do the parsing.

  • 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-06-10T14:54:03+00:00Added an answer on June 10, 2026 at 2:54 pm

    If you take a look at modifierList it is essentially requiring at least one modifier. We don’t have to do much to get rid of the left recursion.

    modifierList ::= modifier [ modifierList ] 
    

    Now scopedClause is a bit trickier but if we break out a second production it works out.
    It will always need at least one searchClause and can have many booleanGroup searchClause.

    scopedClauseTail ::= booleanGroup searchClause [ scopedClauseTail ] 
    scopedClause ::= searchClause [ scopedClauseTail ] 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have link for example domain.com/de/controler/action?param=value and I want make actionlink to keep same
I've been trying to make a parser for a (very) simple language that looks
I want to make a log parser for for an Asterisk PBX, but don't
Let's say I want to make a parser for a programming language (EBNF already
I want to make one project that parse wiki pages and get needed information
I have style sheet with a class name changebackgroundcolor i want make change in
Hello I want to make something like a meta language which gets parsed and
I don't want to make holywar on any reason, just to get advice and
I want make datetimepicker in my project. Using jquery how it is possible? I
I want make a bash script which returns the position of an element from

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.