473,395 Members | 1,401 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,395 software developers and data experts.

grammar files for a shell

Hi,

Is any one aware of some link that has the grammar files (yacc and lex
files)
for command interpreter like shell ?

thanks a lot for any pointers ....

Oct 23 '06 #1
4 2773
On 23 Oct 2006 05:43:11 -0700, in comp.lang.c ,
"ju**********@yahoo.co.in" <ju**********@yahoo.co.inwrote:
>Hi,

Is any one aware of some link that has the grammar files (yacc and lex
files) for command interpreter like shell ?
This is not a C question.
>thanks a lot for any pointers ....
www.google.com ?
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Oct 23 '06 #2

<ju**********@yahoo.co.inwrote in message
news:11**********************@m7g2000cwm.googlegro ups.com...
Hi,

Is any one aware of some link that has the grammar files (yacc and lex
files)
for command interpreter like shell ?
No. But, I may have found one for you. I searched the collection I have of
yacc/lex based programs. I have many for programming languages or C tools.
Most of the others you'll find are for regular expressions, REXX, SQL,
ftp/html parsers, or simple calculators.

I searched via Yahoo and found a shell based on Duff's RC (run command)
shell. It has the yacc file (parse.y). But, it is missing the lex file,
although most of it's content is in their man page (rc.1). It appears they
converted the lex file to a dedicated C lexer (lex.c), probably for speed.
However, I think there is enough of the lexer on the man page that you could
recreate or complete a 'lex.l' to work with parse.y.

http://gatekeep.cs.utah.edu/ftp/hpux...c-11.11.tar.gz

Duff wrote the RC version for Plan 9.
http://cm.bell-labs.com/sys/doc/rc.html

It's somewhere, buried here, supposedly... (If you go this route, good
luck!):
http://cm.bell-labs.com/plan9/index.html
I haven't looked at any of the source other standard shells. Some of them,
or early versions of them, may have been lex/yacc based. Another option
would be to scour the pre-94 *nix part of the Internet for "dead" shells:
Decus, gatekeeper, net.sources, comp.sources.misc, comp.sources.unix, etc...
perhaps using Google, Yahoo, or Google's Groups advanced search.
Rod Pemberton
Oct 24 '06 #3


On Oct 25, 3:26 am, "Rod Pemberton" <do_not_h...@bitfoad.cmmwrote:
<junky_fel...@yahoo.co.inwrote in messagenews:11**********************@m7g2000cwm.go oglegroups.com...
Hi,
Is any one aware of some link that has the grammar files (yacc and lex
files)
for command interpreter like shell ?No. But, I may have found one for you. I searched the collection I have of
yacc/lex based programs. I have many for programming languages or C tools.
Most of the others you'll find are for regular expressions, REXX, SQL,
ftp/html parsers, or simple calculators.

I searched via Yahoo and found a shell based on Duff's RC (run command)
shell. It has the yacc file (parse.y). But, it is missing the lex file,
although most of it's content is in their man page (rc.1). It appears they
converted the lex file to a dedicated C lexer (lex.c), probably for speed.
However, I think there is enough of the lexer on the man page that you could
recreate or complete a 'lex.l' to work with parse.y.

http://gatekeep.cs.utah.edu/ftp/hpux...c-1.7.1-src-11....

Duff wrote the RC version for Plan 9.http://cm.bell-labs.com/sys/doc/rc.html

It's somewhere, buried here, supposedly... (If you go this route, good
luck!):http://cm.bell-labs.com/plan9/index.html

I haven't looked at any of the source other standard shells. Some of them,
or early versions of them, may have been lex/yacc based. Another option
would be to scour the pre-94 *nix part of the Internet for "dead" shells:
Decus, gatekeeper, net.sources, comp.sources.misc, comp.sources.unix, etc...
perhaps using Google, Yahoo, or Google's Groups advanced search.
Thanks a lot Rod. The links are really useful and this is what I was
looking for.
thanks again ...

Oct 25 '06 #4

<ju**********@yahoo.co.inwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
>

On Oct 25, 3:26 am, "Rod Pemberton" <do_not_h...@bitfoad.cmmwrote:
<junky_fel...@yahoo.co.inwrote in
messagenews:11**********************@m7g2000cwm.go oglegroups.com...
Hi,
Is any one aware of some link that has the grammar files (yacc and
lex
files)
for command interpreter like shell ?No. But, I may have found one for
you. I searched the collection I have of
yacc/lex based programs. I have many for programming languages or C
tools.
Most of the others you'll find are for regular expressions, REXX, SQL,
ftp/html parsers, or simple calculators.

I searched via Yahoo and found a shell based on Duff's RC (run command)
shell. It has the yacc file (parse.y). But, it is missing the lex
file,
although most of it's content is in their man page (rc.1). It appears
they
converted the lex file to a dedicated C lexer (lex.c), probably for
speed.
However, I think there is enough of the lexer on the man page that you
could
recreate or complete a 'lex.l' to work with parse.y.

http://gatekeep.cs.utah.edu/ftp/hpux...c-1.7.1-src-11....

Duff wrote the RC version for Plan
9.http://cm.bell-labs.com/sys/doc/rc.html

It's somewhere, buried here, supposedly... (If you go this route, good
luck!):http://cm.bell-labs.com/plan9/index.html

I haven't looked at any of the source other standard shells. Some of
them,
or early versions of them, may have been lex/yacc based. Another option
would be to scour the pre-94 *nix part of the Internet for "dead"
shells:
Decus, gatekeeper, net.sources, comp.sources.misc, comp.sources.unix,
etc...
perhaps using Google, Yahoo, or Google's Groups advanced search.

Thanks a lot Rod. The links are really useful and this is what I was
looking for.
thanks again ...
You're welcome.

I only have a modest amount of experience with flex & bison, but, if your
having problems with the lex grammar, just ask. If I don't know, I can
probably still point you to working flex/lex code or one of twenty or so
webpages on flex/bison/lex/yacc with the information you need. Although I
haven't read it in a while, the moderated newsgroup comp.compilers (requires
a valid email account to post) discusses grammars much more than here. It
also has a small file archive with some very simple grammars:
ftp://ftp.iecc.com/pub/file/ .

If you didn't know, you can search comp.compilers or the others I mentioned
here: http://groups.google.com/advanced_search?hl=en
Rod Pemberton
Oct 25 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Rosa | last post by:
Hi, I'm trying to clear the TIF on Windows XP programmatically with the below code. This code works fine on any folder but the TIF. For some reason the atEnd() statements always defaults to true...
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. ...
5
by: gwarning! | last post by:
Goal: Have multiple text files, each of various lengths, be concatenated together into one final consolidated text file. Problem: Since the names of the files to be concatenated can change from...
3
by: junky_fellow | last post by:
I got one link to the ANSI C Grammar http://www.lysator.liu.se/c/ANSI-C-grammar-y.html However, I don't know how to understand this grammar. I am not a Computer Science Guy. Can anybody please...
14
by: Magius | last post by:
Hello, I have a question about the correctness of the language grammar for the C# 2.0 specification. I am working with the grammar specified in the June 2005 ECMA-334 standard. Basically, a...
4
by: Rob Meade | last post by:
Hi all, I have just put together our organisations 'template' for our web applications and have created 7 .ascx files which when dropped into my template file work perfectly...however, I have a...
15
by: leorulez | last post by:
Is there any way to read multiple files (more than 1000 files) and then write into one single output file using C? Right now in my program, I have a loop which asks for the filename and writes into...
10
by: MBR | last post by:
Hello... I'm using the grammar at: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csspec/html/vclrfcsharpspec_c.asp as a reference in creating my own C# parser using a custom...
1
by: giddy | last post by:
Hi , I've read this a long time ago , read it again:...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.