Gentoo Archives: gentoo-portage-dev

From: Sebastian Pipping <sping@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] Google Summer of Code: Bash AST and grammar
Date: Wed, 21 Jul 2010 15:06:52
Message-Id: 4C470ABA.4090501@gentoo.org
In Reply to: [gentoo-portage-dev] Google Summer of Code: Bash AST and grammar by Nathan Eloe
1 On 07/21/10 15:49, Nathan Eloe wrote:
2 > -----BEGIN PGP SIGNED MESSAGE-----
3 > Hash: SHA1
4 >
5 > Hello portage developers
6 >
7 > My name is Nathan Eloe, and I'm working on a Google Summer of Code
8 > project in which I'm writing a library that will create an Abstract
9 > Syntax Tree of the bash grammar. In essence I am recreating the bash
10 > grammar and structuring it as an AST.
11 >
12 > I am writing to you because you have shown interest in
13 > this project. I have attached a bash script which demonstrates the
14 > supported functionality of the grammar thus far and the resulting AST.
15
16 Nice, you have covered quite a few constructs alraedy.
17
18
19 > I would greatly appreciate input on the tree
20
21 I'm unsure if such a big file and tree is good to handle.
22 I propose to split this test suite to many small cases.
23
24
25 > as well as insight into
26 > missing functionality you might see.
27
28 A few things I haven't seen, yet:
29
30 # Adjacent changes in quotation
31 echo "abc"'"'"def" # Makes abc"def
32
33 # Escape sequences like ..
34 echo "abc\"def"
35
36 # Invocation from ibnside strings
37 echo "foo $(echo foo), bar `echo bar`"
38
39 # Heredocs (and their variations ..)
40 cat <<EOF >/dev/stdout
41 1
42 2
43 EOF
44
45 # Construct of $((..))
46 # Refs to variable withzout "$" upfront
47 z=3; echo $((z+3))
48
49 Best,
50
51
52
53 Sebastian

Replies

Subject Author
Re: [gentoo-portage-dev] Google Summer of Code: Bash AST and grammar Sebastian Pipping <sping@g.o>