X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;ds=sidebyside;f=language.i4;h=09b4a6120fc6300364a0d3daf146d72c539c621d;hb=9f56f874416db295bdb50d448bd99cdd34db969d;hp=8d4088caa94105c09713c0689a6993c51e0b84d8;hpb=854704a34d6f22e6595b75b934347a2ddb36aee0;p=userv.git diff --git a/language.i4 b/language.i4 index 8d4088c..09b4a61 100644 --- a/language.i4 +++ b/language.i4 @@ -32,19 +32,19 @@ divert(2)dnl format(``%-30s'',`tokv_$1=')`$3|toki_$1', divert(odiv)popdef(`odiv')') -define(`cautotoki',`01') -define(`cautotokt',eval(`010000')) +define(`cautotoki',eval(`0x1')) +define(`cautotokt',eval(`0x1000')) -define(`autovalistype',`hasvalistype(`$1',format(``0%03o'',cautotoki),`$2')`'define(`cautotoki',incr(cautotoki))') +define(`autovalistype',`hasvalistype(`$1',format(``0x%08x'',cautotoki),`$2')`'define(`cautotoki',incr(cautotoki))') define(`autovaldeftype',`pushdef(`odiv',divnum)divert(4)dnl - format(``%-25s'',`tokt_$1=')format(``0%011o'',cautotokt), + format(``%-25s'',`tokt_$1=')format(``0x%08x'',cautotokt), divert(odiv)popdef(`odiv')define(`cautotokt',eval(cautotokt`*2'))') define(`nametypelexpatexec',` autovalistype(`$1',`$2') pushdef(`odiv',divnum)divert(3)dnl -`$3 { $4'`atnewline= 0; return tokv_$1; }' +`$3 { $4'`return tokv_$1; }' divert(odiv)popdef(`odiv')') define(`wordtypelexexec', @@ -67,6 +67,7 @@ autovaldeftype(`string') autovaldeftype(`execmode') autovaldeftype(`ehandlemode') autovaldeftype(`misc') +autovaldeftype(`internal') dnl simple isdirectives define(`isdirectivefn',`dnl @@ -74,7 +75,8 @@ wordtypelexexec(`$1',`tokt_directive$3',`lr_dir= $2; $4')dnl pushdef(`odiv',divnum) divert(odiv)popdef(`odiv')') define(`isdirective',`isdirectivefn(`$1',`df_'makename(`$1'),`$2')') -define(`isdirectiveinternal',`isdirectivefn(`$1',`dfi_'makename(`$1'),`$2')') +define(`isdirectiveinternal',`isdirectivefn(`$1',`dfi_'makename(`$1'), + `|tokt_internal$2')') define(`isexecmode',`isdirective(`$1',`|tokt_execmode')') define(`isehandlemode',`isdirective(`$1',`|tokt_ehandlemode')') define(`isfdwant',`isdirectivefn(`$1',`dfg_fdwant',`', @@ -107,7 +109,7 @@ isdirective(`include-lookup') isdirectivefn(`include-lookup-all',`df_includelookup') isdirective(`include-directory') isdirective(`message') -isdirectivefn(`_include-sysconfig',`df_include') +isdirectivefn(`_include-sysconfig',`df_include',`|tokt_internal') isdirectiveinternal(`_include-user-rcfile') isdirectiveinternal(`_include-client-config') @@ -165,7 +167,7 @@ isloglevellexpat(`warning',`warn(ing)?') isloglevel(`err')dnl also the word error, which has dual meaning (below) isloglevel(`crit') isloglevel(`alert') -isloglevelexpat(`emerg',`emerg|panic') +isloglevellexpat(`emerg',`emerg|panic') dnl syslog facilities define(`islogfacilitylexpat', @@ -196,25 +198,10 @@ wordtypelexexec(`read',`tokt_readwrite',`') wordtypelexexec(`write',`tokt_readwrite',`') dnl small nonnegative integers and fd ranges -dnl some of these have two tokt_ bits set, because they can be several -dnl things. -nametypelexpatexec(`ordinal',`tokt_number|tokt_fdrange|tokr_word',`[0-9]{1,8}', -`{ char *ep; - lr_min=lr_max= (int)strtoul(yytext,&ep,10); - assert(!*ep); }; ') -nametypelexpatexec(`fdrange',`tokt_fdrange|tokr_punct',`[0-9]{1,8}-[0-9]{1,8}', -`{ char *ep; - lr_min=(int)strtoul(yytext,&ep,10); - assert(*ep == HYPHEN); assert(*++ep); - lr_max=(int)strtoul(ep,&ep,10); - if (lr_max < lr_min) { - atnewline= 0; parseerrprint("fd range has min > max"); return tokv_error; - } - assert(!*ep); }; ') -nametypelexpatexec(`fdstoend',`tokt_fdrange|tokr_punct',`[0-9]{1,8}-', -`{ char *ep; - lr_min= (int)strtoul(yytext,&ep,10); lr_max=-1; - assert(*ep == HYPHEN); assert(!*++ep); }; ') +dnl some of these have two tokt_ bits set, because they can be several things. +autovalistype(`ordinal', `tokt_number|tokt_fdrange|tokr_word') +autovalistype(`fdrange', `tokt_fdrange|tokr_punct') +autovalistype(`fdstoend', `tokt_fdrange|tokr_punct') nametypelexpatexec(`dollar',`tokt_misc|tokr_punct',`\$',`') dnl non-word things