Sponsored Content
Top Forums Shell Programming and Scripting Is Rule 7 of POSIX shell grammar rules written correctly? Post 302978867 by Mark_Galeck on Friday 5th of August 2016 02:54:13 AM
Old 08-05-2016
Thank you bakunin for your reply, but your reply is not relevant to my question. I spent a lot of time writing the question and I guess you did not have time to read it as carefully as I had wrote it.

However, your reply did help, in that, while thinking whether it is relevant or not, I finally understood the whole thing.

For the benefit of newbies, I will post my understanding and answers here:

1 and 2. Yes. Of course these labels are misleading, and make the grammar hard to understand for newbies.

3. No. Instead, it is best to apply Rule 7b also to the 2 productions in the grammar, that reduce cmd_prefix to ASSIGNMENT_WORD.

4. No. I misunderstood here how the "rules" are applied. I thought, you first perform the reduction, then somehow apply the rule (which makes no sense). Instead, you use the rule first, in order to allow the reduction.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Simple shell script to be written

There are 2 shell script files sh1 and sh2. sh2 contains records such as 01 02 03 on different lines. In sh1, I would like to read each record of sh2 till end of file, concatenate them with a comma(,) and store in a variable. Can somebody please help me with the sh1 script? Thanks in... (2 Replies)
Discussion started by: shsandeep
2 Replies

2. Shell Programming and Scripting

Simple shell script to be written

There are 2 shell script files sh1 and sh2. sh2 contains records such as 01 02 03 on different lines. In sh1, I would like to read each record of sh2 till end of file, concatenate them with a comma(,) and store in a variable. Can somebody please help me with the sh1 script? Thanks in... (6 Replies)
Discussion started by: shsandeep
6 Replies

3. Shell Programming and Scripting

what's the largest shell script you've ever written?

I've just written a test harness using ksh. One of scripts weighed in at 1206 lines. I came across Eric Raymonds 'Art of Unix programming' on line and he advises against excessively large scripts. I am very interested to hear people's opinions on this and any experiences they have had. (2 Replies)
Discussion started by: OFFSIHR
2 Replies

4. UNIX for Dummies Questions & Answers

can a korn shell script be written on HP-UNIX?

Is HP UNIX and Korn different flavours of unix? can a korn shell script be written on HP Unix? (4 Replies)
Discussion started by: soujanya_srk
4 Replies

5. Solaris

Jumpstart -- Warning: Could not find matching rule in rules.ok

I just setup a new jumpstart server, and I'm having problems with rules.ok errors. I'm coming up blank after many Google searches, forum searches, etc..... This is the error I receive: Skipped interface e1000g1 Attempting to configure interface e1000g0... Configured interface e1000g0... (0 Replies)
Discussion started by: christr
0 Replies

6. Programming

How could I interact with shell script from webportal written in php?

Hello, I am new on PHP scripting .I have shell scripts which I an running currently from linux server but now I want to make a web portal from where I will run all my scripts but the problem is all my scripts ask for parameters so I am getting confused how could I run my shell script from web... (2 Replies)
Discussion started by: anuragpgtgerman
2 Replies

7. Shell Programming and Scripting

Shell grammar question: logical OR in test

Hi, I am trying to check if two input files exist before the rest of the scripts is run. Following is the code that I have but it gives me syntax error. if then echo "File not found" else echo "File found" fi (3 Replies)
Discussion started by: nua7
3 Replies

8. Shell Programming and Scripting

Pure POSIX shell scripting...

Hi all... This is more of a concensus question than help... As many of you know I am experimenting with the limitations of Pure POSIX shell scripting. Q: Is the directory /bin considered part of the Pure POSIX shell or must I stick entirely with the builtins only? The reason is I... (2 Replies)
Discussion started by: wisecracker
2 Replies

9. Shell Programming and Scripting

Equivalent to let command in POSIX shell

Hi all, I am learning POSIX shell programming, and the book I read, uses the let command for integer arithmetic. I have downloaded and use the shellcheck program on Linux. This programs says: In POSIX sh, 'let' is undefined. See the screenshot attached. What is the POSIX... (1 Reply)
Discussion started by: johnprogrammer
1 Replies
GraphViz::Parse::RecDescent(3pm)			User Contributed Perl Documentation			  GraphViz::Parse::RecDescent(3pm)

NAME
GraphViz::Parse::RecDescent - Visualise grammars SYNOPSIS
use GraphViz::Parse::RecDescent; # Either pass in the grammar my $graph = GraphViz::Parse::RecDescent->new($grammar); print $g->as_png; # or a Parse::RecDescent parser object my $graph = GraphViz::Parse::RecDescent->new($parser); print $g->as_ps; DESCRIPTION
This module makes it easy to visualise Parse::RecDescent grammars. Writing Parse::RecDescent grammars is tricky at the best of times, and grammars almost always evolve in ways unforseen at the start. This module aims to visualise a grammar as a graph in order to make the structure clear and aid in understanding the grammar. Rules are represented as nodes, which have their name on the left of the node and their productions on the right of the node. The subrules present in the productions are represented by edges to the subrule nodes. Thus, every node (rule) should be connected to the graph - otherwise a rule is not part of the grammar. This uses the GraphViz module to draw the graph. Thanks to Damian Conway for the idea. Note that the Parse::RecDescent module should be installed. METHODS
new This is the constructor. It takes one mandatory argument, which can either be the grammar text or a Parse::RecDescent parser object of the grammar to be visualised. A GraphViz object is returned. # Either pass in the grammar my $graph = GraphViz::Parse::RecDescent->new($grammar); # or a Parse::RecDescent parser object my $graph = GraphViz::Parse::RecDescent->new($parser); as_* The grammar can be visualised in a number of different graphical formats. Methods include as_ps, as_hpgl, as_pcl, as_mif, as_pic, as_gd, as_gd2, as_gif, as_jpeg, as_png, as_wbmp, as_ismap, as_imap, as_vrml, as_vtx, as_mp, as_fig, as_svg. See the GraphViz documentation for more information. The two most common methods are: # Print out a PNG-format file print $g->as_png; # Print out a PostScript-format file print $g->as_ps; BUGS
Translating the grammar to a graph is accomplished by peeking inside the internals of a parser object, which is a tad scary. A new version of Parse::RecDescent with different internals may break this module. At the moment, almost all Parse::RecDescent directives are supported. If you find one that has been missed - let me know! Unfortunately, alternations (such as the following) do not produce very pretty graphs, due to the fact that they are implicit (unamed) rules and are implemented by new long-named subrules. character: 'the' ( good | bad | ugly ) /dude/ Hopefully Parse::FastDescent will make this all much easier. AUTHOR
Leon Brocard <acme@astray.com> COPYRIGHT
Copyright (C) 2001, Leon Brocard This module is free software; you can redistribute it or modify it under the same terms as Perl itself. perl v5.14.2 2012-04-02 GraphViz::Parse::RecDescent(3pm)
All times are GMT -4. The time now is 02:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy