LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 06-06-2002, 04:18 PM   #1
JMC
Member
 
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!
 
  


Reply


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 08:24 AM
Help with grammar Mr. New General 3 06-09-2005 07:16 AM
Grammar Check TuxFreak Linux - Software 2 12-27-2004 09:58 AM
Grammar Check neranjana Linux - Software 14 08-30-2004 04:53 PM
Proper grammar questions. randyriver10 General 17 08-17-2004 04:14 PM


All times are GMT -5. The time now is 06:35 PM.

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