Thread: Recursive Decent Parsing
-
February 4th, 2009, 06:48 PM #1
Recursive Decent Parsing
If anyone can help, I am writing a recursive decent parser for a particular grammar in JAVA. I have already written much of it, i am just lost on one thing: When the grammar has a non terminal that then points to one of three non-terminal characters (In BNF roughly... S::= a<A> | a<B> | a<C>). The parser takes in tokens from a lexical analyzer, and basically just validates the input and builds a parse tree. How do you handle such a case recusively?
My only thought is to make an abstract class with methods common to all non-terminals, and then extend that in three sub-classes, which are chosen once it gets to the next token. For some reason I keep thinking there should be a batter way. Any clues? Sorry if I am not so clear on this . . .been bashing my brain on this for days.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
parsing a string in C#
By ShuckyD in forum Webmastering and ProgrammingReplies: 3Last Post: April 6th, 2009, 04:23 AM -
C# parsing not getting the right output
By ShuckyD in forum Webmastering and ProgrammingReplies: 6Last Post: April 18th, 2006, 09:27 PM -
C++ Data Parsing
By FatalException in forum Webmastering and ProgrammingReplies: 13Last Post: March 8th, 2006, 01:52 PM -
Knapsack problem recursive algorithm
By YottaHertz in forum Webmastering and ProgrammingReplies: 7Last Post: February 19th, 2006, 10:22 PM -
Biostar M7VKG? Is it pretty decent? Is Km133A decent chip?
By John Prophet in forum MotherboardsReplies: 6Last Post: December 19th, 2002, 09:26 PM



LinkBack URL
About LinkBacks



Reply With Quote

A good old-fashioned sitcom Watch The Hangover Part 3 Online While these little tidbits probably only begin to scratch the surface of what Season 3 of the Showtime drama will have to offer, they...
A good old-fashioned sitcom