Share your knowledge at the LQ Wiki.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 06-06-2002, 03:18 PM   #1
Registered: Apr 2002
Distribution: Mandrake 8.2
Posts: 43

Rep: Reputation: 15
Grammar/ Parser questions?

I just coded a recursive decent parser for my compiler class however, I think my grammer needs a little help. This is the grammar used:

s --> [ A S ] | ( B ) S | Nothing
A --> A#A | a
B --> ?S, | .S | b

Terminals are [ ] ( ) # ? , .

I figured out that I have to get rid of the left recursion where A is defined and I've discovered the re-write rule to get rid of it. However, the examples I have are pretty trivial.

This is what I think the new correct grammar should be:

S --> [ A S ] | ( B ) S | Nothing
A --> aT
T --> #AT | Nothing
B --> ?S, | .S | b

Do this grammer look correct to you? Thanks for any tips or suggestions!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
checking for XML::Parser... configure: error: XML::Parser perl module is required for kornerr Linux - General 11 11-16-2008 07:24 AM
Help with grammar Mr. New General 3 06-09-2005 06:16 AM
Grammar Check TuxFreak Linux - Software 2 12-27-2004 08:58 AM
Grammar Check neranjana Linux - Software 14 08-30-2004 03:53 PM
Proper grammar questions. randyriver10 General 17 08-17-2004 03:14 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:46 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration