From 56a8633bc6f4ec685fc3874b35f1e19d8b841eb3 Mon Sep 17 00:00:00 2001 From: wollman Date: Thu, 19 Jan 1995 22:27:58 +0000 Subject: [PATCH] Port to FreeBSD. (Sorry there's no man page yet.) --- usr.bin/mk_cmds/Makefile | 16 +++++++++++ usr.bin/mk_cmds/cmd_tbl.l | 58 +++++++++++++++++++-------------------- 2 files changed, 44 insertions(+), 30 deletions(-) create mode 100644 usr.bin/mk_cmds/Makefile diff --git a/usr.bin/mk_cmds/Makefile b/usr.bin/mk_cmds/Makefile new file mode 100644 index 000000000000..a240c05b1fa5 --- /dev/null +++ b/usr.bin/mk_cmds/Makefile @@ -0,0 +1,16 @@ +# $Id$ + +PROG= mk_cmds +# +# NB: ct.c must come before cmd_tbl.c so that y.tab.h will be generated. +# +SRCS= mk_cmds.c options.c utils.c ct.c cmd_tbl.c +CFLAGS+= -I. -I${.CURDIR}/../../lib/libss -DIN_MK_CMDS +LFLAGS= -l +CLEANFILES+= y.tab.c y.tab.h lex.yy.c cmd_tbl.c ct.c +NOMAN= # XXX + +LDADD+= -ll +DPADD+= ${LIBL} + +.include diff --git a/usr.bin/mk_cmds/cmd_tbl.l b/usr.bin/mk_cmds/cmd_tbl.l index c4360b34cb8f..15b31c6792c2 100644 --- a/usr.bin/mk_cmds/cmd_tbl.l +++ b/usr.bin/mk_cmds/cmd_tbl.l @@ -1,40 +1,12 @@ -N [0-9] -PC [^\"] -AN [A-Z_a-z0-9] -%% - -command_table return l_command_table(); -request return l_request(); -unimplemented return l_unimplemented(); -end return l_end(); - -[\t\n ] ; - -\"{PC}*\" return l_quoted_string(); - -{AN}* return l_string(); - -#.*\n ; - -. return (*yytext); - -%% - +%{ /* - * User-subroutines section. - * - * Have to put all this stuff here so that the include file - * from YACC output can be included, since LEX doesn't allow - * an include file before the code it generates for the above - * rules. - * * Copyright 1987, 1988 by MIT Student Information Processing Board. * * For copyright info, see copyright.h. */ #include -#include "ct.tab.h" +#include "y.tab.h" #include "copyright.h" extern char *last_token, *ds(); @@ -79,3 +51,29 @@ static l_string() last_token = ds(yylval.dynstr); return STRING; } + + +%} + +N [0-9] +PC [^\"] +AN [A-Z_a-z0-9] +%% + +command_table return l_command_table(); +request return l_request(); +unimplemented return l_unimplemented(); +end return l_end(); + +[\t\n ] ; + +\"{PC}*\" return l_quoted_string(); + +{AN}* return l_string(); + +#.*\n ; + +. return (*yytext); + +%% +