Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: recursive descent parser

  1. #1
    Junior Member
    Join Date
    Mar 2010
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default recursive descent parser

    anyone have a RDP program that can handle the following grammar?

    <elist>  ->  <elist>,<e>|<e>      
    <e>      ->   <n>^<e>|<n>
    <n>     ->    <n><d>|<d>
    <d>    ->    0|1|2|3|4|5|6|7|8|9

    in case you were wondering, this grammar says that something like the following can be taken as an input string.

    2^2^3,15,20^2


  2. #2
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,896
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: recursive descent parser

    There's the JavaCC, which takes in a grammar like you have and generates Java source-code for a compiler. I believe the algorithm they use is a Recursive Decent Parser, but because of their implementation, left recursion is not allowed.

  3. #3
    Member Darryl.Burke's Avatar
    Join Date
    Mar 2010
    Location
    Madgaon, Goa, India
    Posts
    495
    Thanks
    8
    Thanked 48 Times in 46 Posts

    Default Re: recursive descent parser

    Cross post:
    recursive descent parser - Java Forums

    db

    edit And
    Java Programming - recursive descent parser

    edit2 It called me a loser on the Sun/Oracle forums
    Last edited by Darryl.Burke; March 20th, 2010 at 01:49 PM.

  4. #4
    Member Darryl.Burke's Avatar
    Join Date
    Mar 2010
    Location
    Madgaon, Goa, India
    Posts
    495
    Thanks
    8
    Thanked 48 Times in 46 Posts

    Default Re: recursive descent parser

    From the Sun forums:
    Now appearing at codeguru.com, cplusplus.com, dreamincode.net

    Links:
    recursive decent parser - CodeGuru Forums
    recursive descent parser - C++ Forums
    Recursive Descent Parser - C And C++ | Dream.In.Code

    db
    Last edited by Darryl.Burke; March 20th, 2010 at 11:13 PM.

  5. #5
    Member Darryl.Burke's Avatar
    Join Date
    Mar 2010
    Location
    Madgaon, Goa, India
    Posts
    495
    Thanks
    8
    Thanked 48 Times in 46 Posts

    Default Re: recursive descent parser

    Now also on the Ranch as a thread hijack:
    Recursive Descent Parser Question (Java in General forum at JavaRanch)

    db
    Last edited by Darryl.Burke; March 21st, 2010 at 03:52 AM.

Similar Threads

  1. Enforce DTD on DomParser - Make Parser fall over if error detected
    By toriacht in forum What's Wrong With My Code?
    Replies: 0
    Last Post: March 18th, 2010, 05:28 PM
  2. Problem with Recursive code
    By Shadow703793 in forum Algorithms & Recursion
    Replies: 4
    Last Post: February 22nd, 2010, 08:36 PM
  3. [SOLVED] Recursive Sentence Finder
    By raphytaffy in forum Algorithms & Recursion
    Replies: 4
    Last Post: February 21st, 2010, 01:46 PM
  4. where can i get a Dom Parser jar ?
    By chinni in forum File I/O & Other I/O Streams
    Replies: 3
    Last Post: November 26th, 2009, 02:41 AM
  5. Infix to Prefix parser
    By r2ro_serolf in forum Java Theory & Questions
    Replies: 1
    Last Post: November 8th, 2009, 12:11 AM