summary refs log tree commit diff
path: root/src/nodetypes
blob: 17a7b3c8315d40c6212401e6139e1939c6491f39 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# Copyright (c) 1991, 1993
#	The Regents of the University of California.  All rights reserved.
# Copyright (c) 1997-2005
#	Herbert Xu <herbert@gondor.apana.org.au>.  All rights reserved.
#
# This code is derived from software contributed to Berkeley by
# Kenneth Almquist.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
# 3. Neither the name of the University nor the names of its contributors
#    may be used to endorse or promote products derived from this software
#    without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
#	@(#)nodetypes	8.2 (Berkeley) 5/4/95

# This file describes the nodes used in parse trees.  Unindented lines
# contain a node type followed by a structure tag.  Subsequent indented
# lines specify the fields of the structure.  Several node types can share
# the same structure, in which case the fields of the structure should be
# specified only once.
#
# A field of a structure is described by the name of the field followed
# by a type.  The currently implemented types are:
#	nodeptr - a pointer to a node
#	nodelist - a pointer to a list of nodes
#	string - a pointer to a nul terminated string
#	int - an integer
#	other - any type that can be copied by assignment
#	temp - a field that doesn't have to be copied when the node is copied
# The last two types should be followed by the text of a C declaration for
# the field.

NCMD ncmd			# a simple command
	type	  int
	assign    nodeptr		# variable assignments
	args	  nodeptr		# the arguments
	redirect  nodeptr		# list of file redirections

NPIPE npipe			# a pipeline
	type	  int
	backgnd	  int			# set to run pipeline in background
	cmdlist	  nodelist		# the commands in the pipeline

NREDIR nredir			# redirection (of a complex command)
	type	  int
	n	  nodeptr		# the command
	redirect  nodeptr		# list of file redirections

NBACKGND nredir			# run command in background
NSUBSHELL nredir		# run command in a subshell

NAND nbinary			# the && operator
NOR nbinary			# the || operator

NSEMI nbinary			# two commands separated by a semicolon
	type	  int
	ch1	  nodeptr		# the first child
	ch2	  nodeptr		# the second child

NIF nif				# the if statement.  Elif clauses are handled
	type	  int		    # using multiple if nodes.
	test	  nodeptr		# if test
	ifpart	  nodeptr		# then ifpart
	elsepart  nodeptr		# else elsepart

NWHILE nbinary			# the while statement.  First child is the test
NUNTIL nbinary			# the until statement

NFOR nfor			# the for statement
	type	  int
	args	  nodeptr		# for var in args
	body	  nodeptr		# do body; done
	var	  string		# the for variable

NCASE ncase			# a case statement
	type	  int
	expr	  nodeptr		# the word to switch on
	cases	  nodeptr		# the list of cases (NCLIST nodes)

NCLIST nclist			# a case
	type	  int
	next	  nodeptr		# the next case in list
	pattern	  nodeptr		# list of patterns for this case
	body	  nodeptr		# code to execute for this case


NDEFUN narg			# define a function.  The "next" field contains
				# the body of the function.

NARG narg			# represents a word
	type	  int
	next	  nodeptr		# next word in list
	text	  string		# the text of the word
	backquote nodelist		# list of commands in back quotes

NTO nfile			# fd> fname
NCLOBBER nfile			# fd>| fname
NFROM nfile			# fd< fname
NFROMTO nfile			# fd<> fname
NAPPEND nfile			# fd>> fname
	type	  int
	next	  nodeptr		# next redirection in list
	fd	  int			# file descriptor being redirected
	fname	  nodeptr		# file name, in a NARG node
	expfname  temp	char *expfname	# actual file name

NTOFD ndup			# fd<&dupfd
NFROMFD ndup			# fd>&dupfd
	type	  int
	next	  nodeptr		# next redirection in list
	fd	  int			# file descriptor being redirected
	dupfd	  int			# file descriptor to duplicate
	vname	  nodeptr		# file name if fd>&$var


NHERE nhere			# fd<<\!
NXHERE nhere			# fd<<!
	type	  int
	next	  nodeptr		# next redirection in list
	fd	  int			# file descriptor being redirected
	doc	  nodeptr		# input to command (NARG node)

NNOT nnot			# ! command  (actually pipeline)
	type	int
	com	nodeptr
r class='logheader'>2014-01-10ui-snapshot.c: Do not reinvent suffixcmp()Lukas Fleischer Use suffixcmp() from Git instead of reimplementing it. This is a preparation for moving to ends_with() in Git 1.8.6. Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de> 2014-01-10Refactor cgit_parse_snapshots_mask()Lukas Fleischer Use Git string lists instead of str{spn,cspn,ncmp}() magic. This significantly improves readability. Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de> 2014-01-10Disallow use of undocumented snapshot delimitersLukas Fleischer Since the introduction of selective snapshot format configuration in dc3c9b5 (allow selective enabling of snapshots, 2007-07-21), we allowed seven different delimiters for snapshot formats, while the documentation has always been clear about spaces being the only valid delimiter: The value is a space-separated list of zero or more of the values "tar", "tar.gz", "tar.bz2", "tar.xz" and "zip". Supporting the undocumented delimiters makes the code unnecessarily complex. Remove them. Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de> 2014-01-10Replace most uses of strncmp() with prefixcmp()Lukas Fleischer This is a preparation for replacing all prefix checks with either strip_prefix() or starts_with() when Git 1.8.6 is released. Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de> 2014-01-09README: Fix dependenciesLukas Fleischer * Remove the dependency on Git (which can be obtained automatically when building, using either the Git submodule or `make get-git`). * Use proper upstream names of dependencies. Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de> 2014-01-08README: Spelling and formatting fixesLukas Fleischer * Several small spelling and capitalization fixes. * Use consistent and better-looking formatting that is compatible with AsciiDoc (and partly compatible with RST). Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de> 2014-01-08Fix UTF-8 with syntax-highlighting.pyPřemysl Janouch Previously the script tried to encode output from Pygments with the ASCII codec, which failed. Signed-off-by: Přemysl Janouch <p.janouch@gmail.com> 2014-01-08Add a suggestion to the manpagePřemysl Janouch So that people wishing to use "enable-http-clone" don't have to find out the correct settings on their own. Signed-off-by: Přemysl Janouch <p.janouch@gmail.com> 2014-01-08Fix the example configurationPřemysl Janouch "enable-git-clone" doesn't exist, replaced with "enable-http-clone". Signed-off-by: Přemysl Janouch <p.janouch@gmail.com> 2014-01-08Fix about-formatting.shPřemysl Janouch dash failed to parse the script. Signed-off-by: Přemysl Janouch <p.janouch@gmail.com> 2014-01-08Fix some spelling errorsPřemysl Janouch Signed-off-by: Přemysl Janouch <p.janouch@gmail.com> 2014-01-08filters: highlight.sh: add css comments for highlight 2.6 and 3.8Ferry Huberts