473,386 Members | 1,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How to define a Grammar for a Language

Steel546
The question I'm working on has to do with defining a grammar set for a language. There is no defined set to use, it just needs to be made up.

The language is { a*b^n*c | n = 0, 1, 2, 3...}.

I understand I need the start symbol S, with vocabulary of non-terminals and terminals. I just don't understand how to get down to the a*b^n*c part. Any help understanding this would be appreciated. :)
May 12 '10 #1
1 1237
What you're listing looks just like the core idea for the pumping lemma from automata theory, except they use uvw instead of abc, and uvw can be sequences of any length.

Can you provide more detail? I'm not sure what you're really trying to do.

In addition to more description, can you provide some examples of what's in the language. I think it may be:

ac
abc
abbc
abbbc
abb...bbc

If that's the case, then you don't need a grammar to define this. You only need a regular expression, which is kind of what you have already, or a finite automaton to declare it.

NOTE: Regular expressions are proper subsets of BNF grammers. That is, you can always define a BNF grammar that satisfies a regular expression, but you can't reverse it the other way. Is that the crux of what you're trying to do?
May 14 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

33
by: Quest Master | last post by:
I am interested in developing an application where the user has an ample amount of power to customize the application to their needs, and I feel this would best be accomplished if a scripting...
70
by: KingIshu | last post by:
Hi All, I am developing an object oriented OS code-named "ikbocs". 1) What are the pros and cons of the following languages interms of Effectiveness on System Programming, Object Orientedness etc...
8
by: Hermawih | last post by:
Hello , I want your opinion about this . In order to say it clearly , I think I have to describe it in long sentences . I could consider myself as Intermediate/Advance Access Developer ;...
2
by: Peter Rilling | last post by:
I am written a program that will be used to parse the lexical syntax of code files. I would like to generalize the grammar logic so that I don't hardcode any specific grammar in my program. ...
6
by: james | last post by:
Here is an interesting article from WinInfo that I thought folks here might like to comment on. james Just What We Need--Another Programming Language I hope you've have mastered C# because...
3
by: mcse4u | last post by:
I would like to be able to add a hyperlink to the posted form below that automatically creates a hyperlink of the email address of the person submitting the form. Can someone please help me with...
10
by: verukins | last post by:
Hi, Im a sysadmin/consultant around the microsoft suite of server products and do quite a bit of vbscripting to manipulate AD/Exchange. I'd like to start doing a little more, specifically...
10
by: Immortalist | last post by:
Various aquisition devices that guide learning along particular pathways towards human biases. And as E.O. Wilson might say mental development appears to be genetically constrained. (1) Language...
4
by: skotl | last post by:
Hi all, I'm writing an application that will allow users to specify their own rules to match against certain patterns. Initially I figured that I would offer my own interpreter (byte == 7 &&...
5
by: inungh | last post by:
I need select a language when I create the ASP.NET. It seems that one web page I can only use one language. Am I rgiht? I just wonder the select list only VB and C#. Does ASP.NET support any...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.