Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/xlint/lint1 generate ops table dynamically. Will mov...
details: https://anonhg.NetBSD.org/src/rev/199c71ff2ef6
branches: trunk
changeset: 761676:199c71ff2ef6
user: christos <christos%NetBSD.org@localhost>
date: Fri Feb 04 23:32:44 2011 +0000
description:
generate ops table dynamically. Will move the other table from tree.c there
too.
diffstat:
usr.bin/xlint/lint1/Makefile | 5 ++-
usr.bin/xlint/lint1/Makefile.ops-c | 9 +++++
usr.bin/xlint/lint1/Makefile.ops-h | 10 +++++
usr.bin/xlint/lint1/op.h | 68 +------------------------------------
usr.bin/xlint/lint1/ops.def | 62 ++++++++++++++++++++++++++++++++++
5 files changed, 87 insertions(+), 67 deletions(-)
diffs (189 lines):
diff -r cfb616acd3ee -r 199c71ff2ef6 usr.bin/xlint/lint1/Makefile
--- a/usr.bin/xlint/lint1/Makefile Fri Feb 04 23:31:23 2011 +0000
+++ b/usr.bin/xlint/lint1/Makefile Fri Feb 04 23:32:44 2011 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.45 2010/07/11 12:07:32 mrg Exp $
+# $NetBSD: Makefile,v 1.46 2011/02/04 23:32:44 christos Exp $
.include <bsd.own.mk>
@@ -34,4 +34,7 @@
DPADD+= ${LIBL}
.endif
+.include "Makefile.ops-h"
+.include "Makefile.ops-c"
+
.include <bsd.prog.mk>
diff -r cfb616acd3ee -r 199c71ff2ef6 usr.bin/xlint/lint1/Makefile.ops-c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/xlint/lint1/Makefile.ops-c Fri Feb 04 23:32:44 2011 +0000
@@ -0,0 +1,9 @@
+# $NetBSD: Makefile.ops-c,v 1.1 2011/02/04 23:32:44 christos Exp $
+
+ops.c: ops.def
+ ${_MKTARGET_CREATE}
+ AWK=${TOOL_AWK:Q} ${HOST_SH} ${.CURDIR}/mkops -c ${.ALLSRC} > ${.TARGET}
+
+SRCS+= ops.c
+CLEANFILES+= ops.c
+DPSRCS+= ops.c
diff -r cfb616acd3ee -r 199c71ff2ef6 usr.bin/xlint/lint1/Makefile.ops-h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/xlint/lint1/Makefile.ops-h Fri Feb 04 23:32:44 2011 +0000
@@ -0,0 +1,10 @@
+# $NetBSD: Makefile.ops-h,v 1.1 2011/02/04 23:32:44 christos Exp $
+
+ops.h: ops.def
+ ${_MKTARGET_CREATE}
+ AWK=${TOOL_AWK:Q} ${HOST_SH} ${.CURDIR}/mkops -h ${.ALLSRC} > ${.TARGET}
+
+CLEANFILES+= ops.h
+
+op.h: ops.h
+.BEGIN: ops.h
diff -r cfb616acd3ee -r 199c71ff2ef6 usr.bin/xlint/lint1/op.h
--- a/usr.bin/xlint/lint1/op.h Fri Feb 04 23:31:23 2011 +0000
+++ b/usr.bin/xlint/lint1/op.h Fri Feb 04 23:32:44 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: op.h,v 1.4 2008/04/25 22:18:34 christos Exp $ */
+/* $NetBSD: op.h,v 1.5 2011/02/04 23:32:44 christos Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -56,68 +56,4 @@
const char *m_name; /* name of op. */
} mod_t;
-typedef enum {
- NOOP = 0,
- ARROW,
- POINT,
- NOT,
- COMPL,
- INC,
- DEC,
- INCBEF,
- DECBEF,
- INCAFT,
- DECAFT,
- UPLUS,
- UMINUS,
- STAR,
- AMPER,
- MULT,
- DIV,
- MOD,
- PLUS,
- MINUS,
- SHL,
- SHR,
- LT,
- LE,
- GT,
- GE,
- EQ,
- NE,
- AND,
- XOR,
- OR,
- LOGAND,
- LOGOR,
- QUEST,
- COLON,
- ASSIGN,
- MULASS,
- DIVASS,
- MODASS,
- ADDASS,
- SUBASS,
- SHLASS,
- SHRASS,
- ANDASS,
- XORASS,
- ORASS,
- NAME,
- CON,
- STRING,
- FSEL,
- CALL,
- COMMA,
- CVT,
- ICALL,
- LOAD,
- PUSH,
- RETURN,
- REAL,
- IMAG,
- INIT, /* pseudo op, not used in trees */
- CASE, /* pseudo op, not used in trees */
- FARG /* pseudo op, not used in trees */
-#define NOPS ((int)FARG + 1)
-} op_t;
+#include "ops.h"
diff -r cfb616acd3ee -r 199c71ff2ef6 usr.bin/xlint/lint1/ops.def
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/xlint/lint1/ops.def Fri Feb 04 23:32:44 2011 +0000
@@ -0,0 +1,62 @@
+no-op NOOP
+-> ARROW
+. POINT
+! NOT
+~ COMPL
+p + 1 INC
+p - 1 DEC
+++p INCBEF
+--p DECBEF
+p++ INCAFT
+p-- DECAFT
++p UPLUS
+-p UMINUS
+*p STAR
+& AMPER
+p * p MULT
+p / p DIV
+p % p MOD
+p + p PLUS
+p - p MINUS
+p << p SHL
+p >> p SHR
+p < p LT
+p <= p LE
+p > p GT
+p >= p GE
+p == p EQ
+p != p NE
+p & p AND
+p ^ p XOR
+p | p OR
+p && p LOGAND
+p || p LOGOR
+? QUEST
+: COLON
+p = p ASSIGN
+p *= p MULASS
+p /= p DIVASS
+p %= p MODASS
+p += p ADDASS
+p -= p SUBASS
+p << p SHLASS
+p >> p SHRASS
+p &= p ANDASS
+p ^= p XORASS
+p |= p ORASS
+n NAME
+const CON
+char * STRING
+fsel FSEL
+p() CALL
+, COMMA
+(cast)p CVT
+icall ICALL
+load LOAD
+push PUSH
+return RETURN
+p.re REAL
+p.im IMAG
+p = {} INIT /* pseudo op not used in trees */
+case CASE /* pseudo op not used in trees */
+f(p) FARG /* pseudo op not used in trees */
Home |
Main Index |
Thread Index |
Old Index