summaryrefslogtreecommitdiffstats
path: root/usr.bin/mk_cmds
diff options
context:
space:
mode:
authorwollman <wollman@FreeBSD.org>1995-01-19 22:27:58 +0000
committerwollman <wollman@FreeBSD.org>1995-01-19 22:27:58 +0000
commitece7af0e5603381a40bcf88083647e71ec6b9cb4 (patch)
tree2f2fa37babe8cc234209bae0c915a89333031126 /usr.bin/mk_cmds
parent88a4b81c1ed3b6d96c0f5b9dbb81b6e1abc69fa9 (diff)
downloadFreeBSD-src-ece7af0e5603381a40bcf88083647e71ec6b9cb4.zip
FreeBSD-src-ece7af0e5603381a40bcf88083647e71ec6b9cb4.tar.gz
Port to FreeBSD. (Sorry there's no man page yet.)
Diffstat (limited to 'usr.bin/mk_cmds')
-rw-r--r--usr.bin/mk_cmds/Makefile16
-rw-r--r--usr.bin/mk_cmds/cmd_tbl.l58
2 files changed, 44 insertions, 30 deletions
diff --git a/usr.bin/mk_cmds/Makefile b/usr.bin/mk_cmds/Makefile
new file mode 100644
index 0000000..a240c05
--- /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 <bsd.prog.mk>
diff --git a/usr.bin/mk_cmds/cmd_tbl.l b/usr.bin/mk_cmds/cmd_tbl.l
index c4360b3..15b31c6 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 <string.h>
-#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);
+
+%%
+
OpenPOWER on IntegriCloud