X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;f=language.i4;h=753b441c173da5746eced8abc1476a4273d98ab0;hb=HEAD;hp=8857c2f22cee20f0c6c26fccd539bfa0bf6840dd;hpb=464d71c37246e556de9ec05f7b97af834a5224ee;p=userv.git
diff --git a/language.i4 b/language.i4
index 8857c2f..753b441 100644
--- a/language.i4
+++ b/language.i4
@@ -1,21 +1,21 @@
dnl userv - language.i4
dnl definition of the configuration language, used for tokens.h and lexer.l
dnl
-dnl Copyright (C)1996-1997 Ian Jackson
-dnl
+dnl userv is copyright Ian Jackson and other contributors.
+dnl See README for full authorship information.
+dnl
dnl This is free software; you can redistribute it and/or modify it
dnl under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation; either version 2 of the License, or
+dnl the Free Software Foundation; either version 3 of the License, or
dnl (at your option) any later version.
-dnl
+dnl
dnl This program is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl General Public License for more details.
-dnl
+dnl
dnl You should have received a copy of the GNU General Public License
-dnl along with userv; if not, write to the Free Software
-dnl Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+dnl along with this program. If not, see .
dnl Diversions are
dnl 1,2,4: sections of token enum list
@@ -66,6 +66,7 @@ autovaldeftype(`readwrite')
autovaldeftype(`string')
autovaldeftype(`execmode')
autovaldeftype(`ehandlemode')
+autovaldeftype(`lookupquotemode')
autovaldeftype(`builtinservice')
autovaldeftype(`misc')
autovaldeftype(`internal')
@@ -80,6 +81,8 @@ define(`isdirectiveinternal',`isdirectivefn(`$1',`dfi_'makename(`$1'),
`|tokt_internal$2')')
define(`isexecmode',`isdirective(`$1',`|tokt_execmode')')
define(`isehandlemode',`isdirective(`$1',`|tokt_ehandlemode')')
+define(`islookupquotemode',`isdirectivefn(`$1',`dfg_lookupquotemode',
+ `|tokt_lookupquotemode')')
define(`isfdwant',`isdirectivefn(`$1',`dfg_fdwant',`',
`lr_fdwant_readwrite=$2; ')')
define(`isflagpair',`isdirectivefn(`$1',`dfg_setflag',`',
@@ -95,6 +98,8 @@ isexecmode(`execute-builtin')
isehandlemode(`errors-to-stderr')
isehandlemode(`errors-to-syslog')
isehandlemode(`errors-to-file')
+islookupquotemode(`include-lookup-quote-old')
+islookupquotemode(`include-lookup-quote-new')
isfdwant(`require-fd',`1')
isfdwant(`allow-fd',`0')
isfdwant(`null-fd',`0')
@@ -146,22 +151,33 @@ isparmcondition(`glob')
isparmcondition(`range')
isparmcondition(`grep')
+
+define(`builtininlist',`
+pushdef(`odiv',divnum)divert(5)dnl
+ `"$1$2"',
+divert(odiv)popdef(`odiv')')
+
dnl builtin services
-define(`isbuiltinservice',`wordtypelexexec(`$1',`tokt_builtinservice',
- `lr_bispa= bispa_'makename(`$2')`; lr_bisexec= bisexec_'makename(`$1')`; ')')
+define(`isbuiltinservice',
+ `wordtypelexexec(`$1',`tokt_builtinservice$3',
+ `lr_bispa= bispa_'makename(`$2')`; lr_bisexec= bisexec_'makename(`$1')`; $5')
+ builtininlist(`$1',`$4')')
isbuiltinservice(`environment',`none')
-isbuiltinservice(`parameter',`parameter')
+isbuiltinservice(`parameter',`parameter',`',` ')
isbuiltinservice(`version',`none')
isbuiltinservice(`toplevel',`none')
isbuiltinservice(`override',`none')
+isbuiltinservice(`shutdown',`none')
dnl builtin services that are also directive names
define(`isdirectivebuiltinservice',
- `wordtypelexexec(`$1',`tokt_directive|tokt_builtinservice$3',
- `lr_dir= df_'makename(`$1')`; lr_bispa= bispa_'makename(`$2')`; lr_bisexec= bisexec_'makename(`$1')`; ')')
+ `isbuiltinservice(`$1',`$2',`|tokt_directive$3',`$4',
+ `lr_dir= df_'makename(`$1')`; ')')
isdirectivebuiltinservice(`reset',`none')
isdirectivebuiltinservice(`execute',`none',`|tokt_execmode')
+isbuiltinservice(`help',`none')
+
dnl parameters
define(`isparameter',`wordtypelexexec(`$1',`tokt_parameter',
`lr_parameter= pf_'makename(`$1')`; ')')
@@ -222,6 +238,12 @@ autovalistype(`fdrange', `tokt_fdrange|tokr_punct')
autovalistype(`fdstoend', `tokt_fdrange|tokr_punct')
nametypelexpatexec(`dollar',`tokt_misc|tokr_punct',`\$',`')
+define(singlefd,`
+wordtypelexexec(`$1',`tokt_fdrange',` lr_max= lr_min= $2; ')')
+singlefd(`stdin',`0');
+singlefd(`stdout',`1');
+singlefd(`stderr',`2');
+
dnl non-word things
autovalistype(`lwsp', `tokt_misc|tokr_nonstring')
autovalistype(`newline', `tokt_misc|tokr_nonstring')