VirtualBox

source: kBuild/trunk/src/kash/nodetypes@ 3449

Last change on this file since 3449 was 3449, checked in by bird, 5 years ago

kash: Eliminate the 'temp' node field in nfile so we can share node trees later.

  • Property svn:eol-style set to LF
File size: 5.1 KB
Line 
1# $NetBSD: nodetypes,v 1.12 2003/08/22 11:22:23 agc Exp $
2# Copyright (c) 1991, 1993
3# The Regents of the University of California. All rights reserved.
4#
5# This code is derived from software contributed to Berkeley by
6# Kenneth Almquist.
7#
8# Redistribution and use in source and binary forms, with or without
9# modification, are permitted provided that the following conditions
10# are met:
11# 1. Redistributions of source code must retain the above copyright
12# notice, this list of conditions and the following disclaimer.
13# 2. Redistributions in binary form must reproduce the above copyright
14# notice, this list of conditions and the following disclaimer in the
15# documentation and/or other materials provided with the distribution.
16# 3. Neither the name of the University nor the names of its contributors
17# may be used to endorse or promote products derived from this software
18# without specific prior written permission.
19#
20# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30# SUCH DAMAGE.
31#
32# @(#)nodetypes 8.2 (Berkeley) 5/4/95
33
34# This file describes the nodes used in parse trees. Unindented lines
35# contain a node type followed by a structure tag. Subsequent indented
36# lines specify the fields of the structure. Several node types can share
37# the same structure, in which case the fields of the structure should be
38# specified only once.
39#
40# A field of a structure is described by the name of the field followed
41# by a type. The currently implemented types are:
42# nodeptr - a pointer to a node
43# nodelist - a pointer to a list of nodes
44# string - a pointer to a nul terminated string
45# int - an integer
46# other - any type that can be copied by assignment
47# The last two types should be followed by the text of a C declaration for
48# the field.
49
50NSEMI nbinary # two commands separated by a semicolon
51 type int
52 ch1 nodeptr # the first child
53 ch2 nodeptr # the second child
54
55NCMD ncmd # a simple command
56 type int
57 backgnd int # set to run command in background
58 args nodeptr # the arguments
59 redirect nodeptr # list of file redirections
60
61NPIPE npipe # a pipeline
62 type int
63 backgnd int # set to run pipeline in background
64 cmdlist nodelist # the commands in the pipeline
65
66NREDIR nredir # redirection (of a complex command)
67 type int
68 n nodeptr # the command
69 redirect nodeptr # list of file redirections
70
71NBACKGND nredir # run command in background
72NSUBSHELL nredir # run command in a subshell
73
74NAND nbinary # the && operator
75NOR nbinary # the || operator
76
77NIF nif # the if statement. Elif clauses are handled
78 type int # using multiple if nodes.
79 test nodeptr # if test
80 ifpart nodeptr # then ifpart
81 elsepart nodeptr # else elsepart
82
83NWHILE nbinary # the while statement. First child is the test
84NUNTIL nbinary # the until statement
85
86NFOR nfor # the for statement
87 type int
88 args nodeptr # for var in args
89 body nodeptr # do body; done
90 var string # the for variable
91
92NCASE ncase # a case statement
93 type int
94 expr nodeptr # the word to switch on
95 cases nodeptr # the list of cases (NCLIST nodes)
96
97NCLIST nclist # a case
98 type int
99 next nodeptr # the next case in list
100 pattern nodeptr # list of patterns for this case
101 body nodeptr # code to execute for this case
102
103
104NDEFUN narg # define a function. The "next" field contains
105 # the body of the function.
106
107NARG narg # represents a word
108 type int
109 next nodeptr # next word in list
110 text string # the text of the word
111 backquote nodelist # list of commands in back quotes
112
113NTO nfile # fd> fname
114NCLOBBER nfile # fd>| fname
115NFROM nfile # fd< fname
116NFROMTO nfile # fd<> fname
117NAPPEND nfile # fd>> fname
118 type int
119 fd int # file descriptor being redirected (must match ndup)
120 next nodeptr # next redirection in list (must match ndup)
121 fname nodeptr # file name, in a NARG node
122
123NTOFD ndup # fd<&dupfd
124NFROMFD ndup # fd>&dupfd
125 type int
126 fd int # file descriptor being redirected (must match nfile)
127 next nodeptr # next redirection in list (must match nfile)
128 dupfd int # file descriptor to duplicate
129 vname nodeptr # file name if fd>&$var
130
131
132NHERE nhere # fd<<\!
133NXHERE nhere # fd<<!
134 type int
135 fd int # file descriptor being redirected (must match nfile)
136 next nodeptr # next redirection in list (must match nfile)
137 doc nodeptr # input to command (NARG node)
138
139NNOT nnot # ! command (actually pipeline)
140 type int
141 com nodeptr
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette