LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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, 03: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



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

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:43 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration