Moves source to ports tree, no code change (sorry Marco). Okay? -Ray-
Index: Makefile =================================================================== RCS file: /cvs/ports/math/moo/Makefile,v retrieving revision 1.2 diff -u -p -r1.2 Makefile --- Makefile 6 Mar 2006 14:41:56 -0000 1.2 +++ Makefile 10 Mar 2006 20:10:41 -0000 @@ -2,14 +2,13 @@ COMMENT= "Marco's Object Oriented calculator" -DISTNAME= moo-1.1 +PKGNAME= moo-1.2 CATEGORIES= math +DISTFILES= MAINTAINER= Raymond Lai <[EMAIL PROTECTED]> HOMEPAGE= http://cyth.net/~ray/moo/ -MASTER_SITES= ${HOMEPAGE} -EXTRACT_SUFX= .tgz # Public domain PERMIT_PACKAGE_CDROM= Yes @@ -18,5 +17,10 @@ PERMIT_DISTFILES_CDROM= Yes PERMIT_DISTFILES_FTP= Yes WANTLIB= c + +NO_CHECKSUM= Yes + +post-extract: + @lndir ${.CURDIR}/src ${WRKDIR} .include <bsd.port.mk> Index: distinfo =================================================================== RCS file: distinfo diff -N distinfo --- distinfo 6 Mar 2006 14:41:56 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,4 +0,0 @@ -MD5 (moo-1.1.tgz) = 565a355a015a5954b6841aef77fcd603 -RMD160 (moo-1.1.tgz) = 8fef129b5234fbbdb5c057c692afbeed7ac3151a -SHA1 (moo-1.1.tgz) = 0aba9925cb982fdd186efd5a69bd3f0d42e37bbe -SIZE (moo-1.1.tgz) = 6963 Index: src/Makefile =================================================================== RCS file: src/Makefile diff -N src/Makefile --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/Makefile 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1,16 @@ +# $Id: Makefile,v 1.8 2006/03/06 06:40:59 ray Exp $ + +PROG= moo +SRCS= moo.c scan.c +CPPFLAGS+= -I${.CURDIR} +COPTS+= -Wall -W -Wno-unused -Wshadow -pedantic +CLEANFILES+= moo.c y.tab.h scan.c lex.yy.c + +LOCALBASE?=/usr/local +BINDIR=${LOCALBASE}/bin +MANDIR=${LOCALBASE}/man/cat + +regress:: + cd ${.CURDIR}/regress && ${MAKE} MOO=${.OBJDIR}/moo + +.include <bsd.prog.mk> Index: src/extern.h =================================================================== RCS file: src/extern.h diff -N src/extern.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/extern.h 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1,9 @@ +/* $Id: extern.h,v 1.2 2006/03/04 04:39:13 ray Exp $ */ + +/* + * Written by Raymond Lai <[EMAIL PROTECTED]>. + * Public domain. + */ + +int getbin(const char *); +int getnum(const char *); Index: src/moo.1 =================================================================== RCS file: src/moo.1 diff -N src/moo.1 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/moo.1 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1,83 @@ +.\" $Id: moo.1,v 1.6 2006/03/04 10:02:34 ray Exp $ +.\" +.\" Written by Raymond Lai <[EMAIL PROTECTED]>. +.\" Public domain. +.\" +.Dd March 2, 2006 +.Dt MOO 1 +.Os +.Sh NAME +.Nm moo +.Nd Marco's Object Oriented calculator +.Sh SYNOPSIS +.Nm +.Op Fl su +.Op Fl b Ar base +.Op Ar expr +.Op Ar ... +.Sh DESCRIPTION +A simple calculator that accepts C-like syntax as input. +Calculations are done on +.Ar expr , +if given. +Otherwise, the standard input is used. +.Pp +Numbers can be entered in hexadecimal (0xbeef), +decimal (1984), +octal (007), +and binary (0b1001). +All numerical operators (+, -, *, /, %), +bit operators (|, ^, &, ~, <<, >>), +and logical operators (==, !=, <, >, <=, >=, !, &&, ||) +are supported. +.Pp +Output will be in the same bases as the input, +unless a different base was specified +(see +.Fl b +flag below). +.Pp +The options are: +.Bl -tag -width Ds +.It Fl b Ar base +Output numbers in +.Ar base +format. +.Ar base +can be 2, 8, 10, 16, or `all'. +Multiple bases may be specified by giving the +.Fl b +flag multiple times. +.It Fl s +Output base 10 numbers as signed. +.It Fl u +Output base 10 numbers as unsigned. +.El +.Sh ENVIRONMENT +.Bl -tag -width Ds +.It Ev TMPDIR +Specifies a directory for temporary files to be created. +The default is +.Pa /tmp . +.El +.Sh SEE ALSO +.Xr bc 1 , +.Xr dc 1 , +.Xr expr 1 +.Sh AUTHORS +.Nm +was written for the public domain by +.An Ray Lai Aq [EMAIL PROTECTED] +after much whining by Marco Peereboom. +.Sh CAVEATS +Integer overflows are not checked. +Marco says, +``I don't think you should call the integer overflows a bug but a feature. +You can use it to test signed unsigned issues.'' +.Sh BUGS +Calculations are limited to the size of an integer. +.Pp +Like +.Xr bc 1 , +.Nm +parses ``3--2'' without error. Index: src/moo.y =================================================================== RCS file: src/moo.y diff -N src/moo.y --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/moo.y 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1,347 @@ +%{ +/* $Id: moo.y,v 1.9 2006/03/05 20:16:27 ray Exp $ */ + +/* + * Written by Raymond Lai <[EMAIL PROTECTED]>. + * Public domain. + */ + +#include <sys/cdefs.h> + +#include <ctype.h> +#include <err.h> +#include <errno.h> +#include <limits.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> + +#include "extern.h" + +extern FILE *yyin; +static int bflag; +static int print_hex; +static int print_dec; +static int print_oct; +static int print_bin; +static int print_signed; +static int print_unsigned; +static int used_bin; +static int used_dec; +static int used_hex; +static int used_oct; + +static void printnum(int); +__dead static void usage(void); +void yyerror(char *); +int yylex(void); +int yyparse(void); +%} + +%token INTEGER EQ NEQ LS RS +%left LOR +%left LAND +%left '|' +%left '^' +%left '&' +%left EQ NEQ +%left LT GT LE GE +%left LS RS +%left '+' '-' +%left '*' '/' '%' +%right '!' '~' + +%% +program: + program expr '\n' { + printnum($2); + used_hex = used_dec = used_oct = + used_bin = 0; + } + | + | error '\n' { yyerrok; } + ; + +expr: + INTEGER { $$ = $1; } + | expr '+' expr { $$ = $1 + $3; } + | expr '-' expr { $$ = $1 - $3; } + | expr '*' expr { $$ = $1 * $3; } + | expr '/' expr { $$ = $1 / $3; } + | expr '%' expr { $$ = $1 % $3; } + | expr '&' expr { $$ = $1 & $3; } + | expr '^' expr { $$ = $1 ^ $3; } + | expr '|' expr { $$ = $1 | $3; } + | expr LAND expr { $$ = $1 && $3; } + | expr LOR expr { $$ = $1 || $3; } + | expr EQ expr { $$ = $1 == $3; } + | expr NEQ expr { $$ = $1 != $3; } + | expr LT expr { $$ = $1 < $3; } + | expr GT expr { $$ = $1 > $3; } + | expr LE expr { $$ = $1 <= $3; } + | expr GE expr { $$ = $1 >= $3; } + | expr LS expr { $$ = $1 << $3; } + | expr RS expr { $$ = $1 >> $3; } + | '~' expr { $$ = ~$2; } + | '!' expr { $$ = !$2; } + | '-' expr %prec '*' { $$ = -$2; } + | '(' expr ')' { $$ = $2; } + ; +%% + +void +yyerror(char *s) +{ + fprintf(stderr, "%s\n", s); +} + +/* + * Print numbers in bases that were input or in bases that were specified. + */ +static void +printnum(int num) +{ + int printed; + +/* Print tabs between numbers as necessary. */ +#define printspace() do { \ + if (printed++) \ + printf("\t"); \ +} while (0) + + printed = 0; + /* If no bases were specified, print the ones that were input. */ + if (!bflag) { + /* Reset print flags. */ + print_hex = print_dec = print_oct = print_bin = 0; + if (used_hex) + print_hex = 1; + if (used_dec) + print_dec = 1; + if (used_oct) + print_oct = 1; + if (used_bin) + print_bin = 1; + /* Reset used flags. */ + used_hex = used_dec = used_oct = used_bin = 0; + } + + if (print_hex) { + printspace(); + printf("0x%x", num); + } + if (print_dec) { + if (print_unsigned) { + printspace(); + printf("%uu", num); + } + if (print_signed) { + printspace(); + printf("%d", num); + } + } + if (print_oct) { + printspace(); + printf("0%o", num); + } + if (print_bin) { + int bit, printed_bit; + + printed_bit = 0; + + printspace(); + printf("0b"); + for (bit = sizeof(num) * 8; bit > 0; --bit) + if (num & (1 << (bit - 1))) { + printf("1"); + ++printed_bit; + /* Print leading zeroes if any bits were printed. */ + } else { + if (printed_bit) { + printf("0"); + ++printed_bit; + } + } + /* + * If no bits were printed out (num == 0) then print a 0 + * so we don't just print ``0b''. + */ + if (!printed_bit) + printf("0"); + } + + printf("\n"); + return; + +TOOLONG: + errx(1, "format string too long"); +} + +/* + * Read binary number string and convert to int. + */ +int +getbin(const char *nptr) +{ + int num; + const char *p; + + used_bin = 1; + + if (strncmp("0b", nptr, 2) != 0) + errx(2, "not a binary number: %s", nptr); + + /* XXX - buffer overflow */ + for (p = nptr + 2, num = 0; *p != '\0'; ++p) { + num <<= 1; + + switch (*p) { + case '1': + ++num; + /* FALLTHROUGH */ + case '0': + break; + default: + errx(2, "not a binary number: %s", nptr); + } + } + + return (num); +} + +/* + * Accept hex, decimal, and octal integers. + */ +int +getnum(const char *nptr) +{ + int num; + char *ep; + long lval; + + errno = 0; + lval = strtol(nptr, &ep, 0); + if (*nptr == '\0' || *ep != '\0') + errx(1, "invalid number: %s", nptr); + if ((errno == ERANGE && (lval == LONG_MAX || lval == LONG_MIN)) || + (lval > INT_MAX || lval < INT_MIN)) + errx(1, "out of range: %s", nptr); + num = lval; + + if (strncmp(nptr, "0x", 2) == 0) + used_hex = 1; + else if (nptr[0] == '0' && nptr[1] != '\0') + used_oct = 1; + else + used_dec = 1; + + return (num); +} + +int +main(int argc, char *argv[]) +{ + int ch; + + while ((ch = getopt(argc, argv, "0123456789b:suw:")) != -1) + switch (ch) { + /* + * If we get a numerical flag it may be a negative + * number, so pop the argument back in and let the + * argument parser handle it. + */ + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + --optind; + goto DONEPARSING; + case 'b': + bflag = 1; + if (optarg[0] == 'a') { + print_hex = print_dec = print_oct = + print_bin = 1; + break; + } + /* Only allow certain bases to be printed. */ + switch (getnum(optarg)) { + case 16: + print_hex = 1; + break; + case 10: + print_dec = 1; + break; + case 8: + print_oct = 1; + break; + case 2: + print_bin = 1; + break; + default: + errx(1, "invalid base: %s", optarg); + /* NOTREACHED */ + } + break; + case 's': + print_signed = 1; + break; + case 'u': + print_unsigned = 1; + break; + default: + usage(); + /* NOTREACHED */ + } +DONEPARSING: + argc -= optind; + argv += optind; + + /* Print signed decimal numbers by default. */ + if (!(print_signed || print_unsigned)) + print_signed = 1; + + /* If arguments were given calculate arguments instead of stdin. */ + if (argc > 0) { + FILE *sfp; + int fd, i; + char *sfn; + + if (asprintf(&sfn, "%s/moo.XXXXXXXXXX", + getenv("TMPDIR") ? getenv("TMPDIR") : "/tmp") == -1) + err(1, "asprintf"); + if ((fd = mkstemp(sfn)) == -1 || + (sfp = fdopen(fd, "w+")) == NULL) { + warn("%s", sfn); + if (fd != -1) + unlink(sfn); + exit(1); + } + if (unlink(sfn) == -1) + warn("%s", sfn); + + /* Copy arguments to temp file. */ + for (i = 0; i < argc; ++i) + if (fputs(argv[i], sfp)) + err(1, "error writing %s", sfn); + /* Parser needs a newline at end. */ + if (fputs("\n", sfp)) + err(1, "error writing %s", sfn); + free(sfn); + + rewind(sfp); + yyin = sfp; + } + + yyparse(); + + return (0); +} + +void +usage(void) +{ + extern char *__progname; + + fprintf(stderr, "usage: %s [-su] [-b base] expr\n", + __progname); + exit(1); +} Index: src/scan.l =================================================================== RCS file: src/scan.l diff -N src/scan.l --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/scan.l 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1,61 @@ +%{ +/* $Id: scan.l,v 1.3 2006/03/04 07:12:52 ray Exp $ */ + +/* + * Written by Raymond Lai <[EMAIL PROTECTED]>. + * Public domain. + */ + +#include <stdlib.h> + +#include "extern.h" +#include "y.tab.h" + +/* + * XXX - Some code on the internet suggested I put this: + * extern YYSTYPE yylval; + * but that doesn't work. Otto's code doesn't need this, why does mine? + */ +extern int yylval; + +%} + +%% + +[0-9]+ { + yylval = getnum(yytext); + return (INTEGER); +} + +0x[0-9a-fA-F]+ { + yylval = getnum(yytext); + return (INTEGER); +} + +0b[01]+ { + yylval = getbin(yytext); + return (INTEGER); +} + +"<" return (LT); +">" return (GT); +"<=" return (LE); +">=" return (GE); +"==" return (EQ); +"!=" return (NEQ); +"<<" return (LS); +">>" return (RS); +"||" return (LOR); +"&&" return (LAND); + +[-+*/%()^|!~&\n] return (*yytext); + +[ \t] ; /* skip whitespace */ + +. ; /* skip everything else */ + +%% + +int yywrap(void) { + return (1); +} Index: src/regress/Makefile =================================================================== RCS file: src/regress/Makefile diff -N src/regress/Makefile --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/Makefile 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1,70 @@ +# $Id: Makefile,v 1.3 2006/03/06 06:18:07 ray Exp $ + +MOO?= moo +CLEANFILES+= moo.out +REGRESS_TARGETS= t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 +REGRESS_TARGETS+= t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 +REGRESS_TARGETS+= t21 t22 t23 + +# t1: + +# t2: - +# t3: * +# t4: / +# t5: % +# t6: ! +# t7: ~ +# t8: unary - +# t9: << +# t10: >> +# t11: < +# t12: <= +# t13: > +# t14: >= +# t15: == +# t16: != +# t17: & +# t18: ^ +# t19: | +# t20: && +# t21: || +# t22: precedence +# t23: () + +.SUFFIXES: .in + +.in: + @# Default (base ten) + @${MOO} < $< > moo.out + @cut -f2 ${.CURDIR}/[EMAIL PROTECTED] | diff -u - moo.out + @# Hexadecimal + @#${MOO} -b 16 < $< > moo.out + @#cut -f1 ${.CURDIR}/[EMAIL PROTECTED] | diff -u - moo.out + @# Explicit base ten + @${MOO} -b 10 < $< > moo.out + @cut -f2 ${.CURDIR}/[EMAIL PROTECTED] | diff -u - moo.out + @# Octal + @#${MOO} -b 8 < $< > moo.out + @#cut -f3 ${.CURDIR}/[EMAIL PROTECTED] | diff -u - moo.out + @# Binary + @#${MOO} -b 2 < $< > moo.out + @#cut -f4 ${.CURDIR}/[EMAIL PROTECTED] | diff -u - moo.out + @# Hex and dec + @#${MOO} -b 16 -b 10 < $< > moo.out + @#cut -f1,2 ${.CURDIR}/[EMAIL PROTECTED] | diff -u - moo.out + @# Hex and oct + @#${MOO} -b 16 -b 8 < $< > moo.out + @#cut -f1,3 ${.CURDIR}/[EMAIL PROTECTED] | diff -u - moo.out + @# Hex and bin + @#${MOO} -b 16 -b 2 < $< > moo.out + @#cut -f1,4 ${.CURDIR}/[EMAIL PROTECTED] | diff -u - moo.out + @# Dec and oct + @#${MOO} -b 10 -b 8 < $< > moo.out + @#cut -f2,3 ${.CURDIR}/[EMAIL PROTECTED] | diff -u - moo.out + @# Dec and bin + @#${MOO} -b 10 -b 2 < $< > moo.out + @#cut -f2,4 ${.CURDIR}/[EMAIL PROTECTED] | diff -u - moo.out + @# Oct and bin + @#${MOO} -b 8 -b 2 < $< > moo.out + @#cut -f3,4 ${.CURDIR}/[EMAIL PROTECTED] | diff -u - moo.out + +.include <bsd.regress.mk> Index: src/regress/t1.in =================================================================== RCS file: src/regress/t1.in diff -N src/regress/t1.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t1.in 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1 @@ +1 + 2 Index: src/regress/t1.out =================================================================== RCS file: src/regress/t1.out diff -N src/regress/t1.out --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t1.out 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1 @@ +0x3 3 03 0b11 Index: src/regress/t10.in =================================================================== RCS file: src/regress/t10.in diff -N src/regress/t10.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t10.in 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1,32 @@ +1073741824 >> 0 +1073741824 >> 1 +1073741824 >> 2 +1073741824 >> 3 +1073741824 >> 4 +1073741824 >> 5 +1073741824 >> 6 +1073741824 >> 7 +1073741824 >> 8 +1073741824 >> 9 +1073741824 >> 10 +1073741824 >> 11 +1073741824 >> 12 +1073741824 >> 13 +1073741824 >> 14 +1073741824 >> 15 +1073741824 >> 16 +1073741824 >> 17 +1073741824 >> 18 +1073741824 >> 19 +1073741824 >> 20 +1073741824 >> 21 +1073741824 >> 22 +1073741824 >> 23 +1073741824 >> 24 +1073741824 >> 25 +1073741824 >> 26 +1073741824 >> 27 +1073741824 >> 28 +1073741824 >> 29 +1073741824 >> 30 +1073741824 >> 31 Index: src/regress/t10.out =================================================================== RCS file: src/regress/t10.out diff -N src/regress/t10.out --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t10.out 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1,32 @@ +0x40000000 1073741824 010000000000 0b1000000000000000000000000000000 +0x20000000 536870912 04000000000 0b100000000000000000000000000000 +0x10000000 268435456 02000000000 0b10000000000000000000000000000 +0x8000000 134217728 01000000000 0b1000000000000000000000000000 +0x4000000 67108864 0400000000 0b100000000000000000000000000 +0x2000000 33554432 0200000000 0b10000000000000000000000000 +0x1000000 16777216 0100000000 0b1000000000000000000000000 +0x800000 8388608 040000000 0b100000000000000000000000 +0x400000 4194304 020000000 0b10000000000000000000000 +0x200000 2097152 010000000 0b1000000000000000000000 +0x100000 1048576 04000000 0b100000000000000000000 +0x80000 524288 02000000 0b10000000000000000000 +0x40000 262144 01000000 0b1000000000000000000 +0x20000 131072 0400000 0b100000000000000000 +0x10000 65536 0200000 0b10000000000000000 +0x8000 32768 0100000 0b1000000000000000 +0x4000 16384 040000 0b100000000000000 +0x2000 8192 020000 0b10000000000000 +0x1000 4096 010000 0b1000000000000 +0x800 2048 04000 0b100000000000 +0x400 1024 02000 0b10000000000 +0x200 512 01000 0b1000000000 +0x100 256 0400 0b100000000 +0x80 128 0200 0b10000000 +0x40 64 0100 0b1000000 +0x20 32 040 0b100000 +0x10 16 020 0b10000 +0x8 8 010 0b1000 +0x4 4 04 0b100 +0x2 2 02 0b10 +0x1 1 01 0b1 +0x0 0 00 0b0 Index: src/regress/t11.in =================================================================== RCS file: src/regress/t11.in diff -N src/regress/t11.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t11.in 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1,7 @@ +1 < 0 +0 < 1 +0 < -1 +-1 < 0 +0 < 0 +-1 < -1 +1 < 1 Index: src/regress/t11.out =================================================================== RCS file: src/regress/t11.out diff -N src/regress/t11.out --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t11.out 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1,7 @@ +0x0 0 00 0b0 +0x1 1 01 0b1 +0x0 0 00 0b0 +0x1 1 01 0b1 +0x0 0 00 0b0 +0x0 0 00 0b0 +0x0 0 00 0b0 Index: src/regress/t12.in =================================================================== RCS file: src/regress/t12.in diff -N src/regress/t12.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t12.in 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1,7 @@ +1 <= 0 +0 <= 1 +0 <= -1 +-1 <= 0 +0 <= 0 +-1 <= -1 +1 <= 1 Index: src/regress/t12.out =================================================================== RCS file: src/regress/t12.out diff -N src/regress/t12.out --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t12.out 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1,7 @@ +0x0 0 00 0b0 +0x1 1 01 0b1 +0x0 0 00 0b0 +0x1 1 01 0b1 +0x1 1 01 0b1 +0x1 1 01 0b1 +0x1 1 01 0b1 Index: src/regress/t13.in =================================================================== RCS file: src/regress/t13.in diff -N src/regress/t13.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t13.in 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1,7 @@ +1 > 0 +0 > 1 +0 > -1 +-1 > 0 +0 > 0 +-1 > -1 +1 > 1 Index: src/regress/t13.out =================================================================== RCS file: src/regress/t13.out diff -N src/regress/t13.out --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t13.out 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1,7 @@ +0x1 1 01 0b1 +0x0 0 00 0b0 +0x1 1 01 0b1 +0x0 0 00 0b0 +0x0 0 00 0b0 +0x0 0 00 0b0 +0x0 0 00 0b0 Index: src/regress/t14.in =================================================================== RCS file: src/regress/t14.in diff -N src/regress/t14.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t14.in 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1,7 @@ +1 >= 0 +0 >= 1 +0 >= -1 +-1 >= 0 +0 >= 0 +-1 >= -1 +1 >= 1 Index: src/regress/t14.out =================================================================== RCS file: src/regress/t14.out diff -N src/regress/t14.out --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t14.out 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1,7 @@ +0x1 1 01 0b1 +0x0 0 00 0b0 +0x1 1 01 0b1 +0x0 0 00 0b0 +0x1 1 01 0b1 +0x1 1 01 0b1 +0x1 1 01 0b1 Index: src/regress/t15.in =================================================================== RCS file: src/regress/t15.in diff -N src/regress/t15.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t15.in 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1,10 @@ +0 == 0 +1 == 1 +-1 == -1 +-0 == -0 +-0 == 0 +0 == -1 +1 == 0 +0 == 1 +-1 == 1 +1 == -1 Index: src/regress/t15.out =================================================================== RCS file: src/regress/t15.out diff -N src/regress/t15.out --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t15.out 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1,10 @@ +0x1 1 01 0b1 +0x1 1 01 0b1 +0x1 1 01 0b1 +0x1 1 01 0b1 +0x1 1 01 0b1 +0x0 0 00 0b0 +0x0 0 00 0b0 +0x0 0 00 0b0 +0x0 0 00 0b0 +0x0 0 00 0b0 Index: src/regress/t16.in =================================================================== RCS file: src/regress/t16.in diff -N src/regress/t16.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t16.in 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1,10 @@ +0 != 0 +1 != 1 +-1 != -1 +-0 != -0 +-0 != 0 +0 != -1 +1 != 0 +0 != 1 +-1 != 1 +1 != -1 Index: src/regress/t16.out =================================================================== RCS file: src/regress/t16.out diff -N src/regress/t16.out --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t16.out 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1,10 @@ +0x0 0 00 0b0 +0x0 0 00 0b0 +0x0 0 00 0b0 +0x0 0 00 0b0 +0x0 0 00 0b0 +0x1 1 01 0b1 +0x1 1 01 0b1 +0x1 1 01 0b1 +0x1 1 01 0b1 +0x1 1 01 0b1 Index: src/regress/t17.in =================================================================== RCS file: src/regress/t17.in diff -N src/regress/t17.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t17.in 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1,4 @@ +1 & 0 +0 & 1 +0 & 0 +1 & 1 Index: src/regress/t17.out =================================================================== RCS file: src/regress/t17.out diff -N src/regress/t17.out --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t17.out 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1,4 @@ +0x0 0 00 0b0 +0x0 0 00 0b0 +0x0 0 00 0b0 +0x1 1 01 0b1 Index: src/regress/t18.in =================================================================== RCS file: src/regress/t18.in diff -N src/regress/t18.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t18.in 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1,4 @@ +0 ^ 0 +1 ^ 0 +0 ^ 1 +1 ^ 1 Index: src/regress/t18.out =================================================================== RCS file: src/regress/t18.out diff -N src/regress/t18.out --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t18.out 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1,4 @@ +0x0 0 00 0b0 +0x1 1 01 0b1 +0x1 1 01 0b1 +0x0 0 00 0b0 Index: src/regress/t19.in =================================================================== RCS file: src/regress/t19.in diff -N src/regress/t19.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t19.in 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1,4 @@ +0 | 0 +1 | 0 +0 | 1 +1 | 1 Index: src/regress/t19.out =================================================================== RCS file: src/regress/t19.out diff -N src/regress/t19.out --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t19.out 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1,4 @@ +0x0 0 00 0b0 +0x1 1 01 0b1 +0x1 1 01 0b1 +0x1 1 01 0b1 Index: src/regress/t2.in =================================================================== RCS file: src/regress/t2.in diff -N src/regress/t2.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t2.in 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1 @@ +3 - 2 Index: src/regress/t2.out =================================================================== RCS file: src/regress/t2.out diff -N src/regress/t2.out --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t2.out 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1 @@ +0x1 1 01 0b1 Index: src/regress/t20.in =================================================================== RCS file: src/regress/t20.in diff -N src/regress/t20.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t20.in 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1,4 @@ +0 && 0 +0 && 1 +1 && 0 +1 && 1 Index: src/regress/t20.out =================================================================== RCS file: src/regress/t20.out diff -N src/regress/t20.out --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t20.out 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1,4 @@ +0x0 0 00 0b0 +0x0 0 00 0b0 +0x0 0 00 0b0 +0x1 1 01 0b1 Index: src/regress/t21.in =================================================================== RCS file: src/regress/t21.in diff -N src/regress/t21.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t21.in 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1,4 @@ +0 || 0 +0 || 1 +1 || 0 +1 || 1 Index: src/regress/t21.out =================================================================== RCS file: src/regress/t21.out diff -N src/regress/t21.out --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t21.out 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1,4 @@ +0x0 0 00 0b0 +0x1 1 01 0b1 +0x1 1 01 0b1 +0x1 1 01 0b1 Index: src/regress/t22.in =================================================================== RCS file: src/regress/t22.in diff -N src/regress/t22.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t22.in 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1,9 @@ +-3 + 2 +10 / 5 - 3 +2 - 1 << 3 +1 << 2 < 1 +1 < 0 == 0 +0 == 0 & 0 +0 & 0 | 1 +1 | 1 && 0 +0 && 0 || 1 Index: src/regress/t22.out =================================================================== RCS file: src/regress/t22.out diff -N src/regress/t22.out --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t22.out 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1,9 @@ +0xffffffff -1 037777777777 0b11111111111111111111111111111111 +0xffffffff -1 037777777777 0b11111111111111111111111111111111 +0x8 8 010 0b1000 +0x0 0 00 0b0 +0x1 1 01 0b1 +0x0 0 00 0b0 +0x1 1 01 0b1 +0x0 0 00 0b0 +0x1 1 01 0b1 Index: src/regress/t23.in =================================================================== RCS file: src/regress/t23.in diff -N src/regress/t23.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t23.in 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1,9 @@ +-(3 + 2) +10 / (5 - 3) +2 - (1 << 3) +1 << (2 < 1) +1 < (0 == 0) +0 == (0 & 0) +0 & (0 | 1) +1 | (1 && 0) +0 && (0 || 1) Index: src/regress/t23.out =================================================================== RCS file: src/regress/t23.out diff -N src/regress/t23.out --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t23.out 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1,9 @@ +0xfffffffb -5 037777777773 0b11111111111111111111111111111011 +0x5 5 05 0b101 +0xfffffffa -6 037777777772 0b11111111111111111111111111111010 +0x1 1 01 0b1 +0x0 0 00 0b0 +0x1 1 01 0b1 +0x0 0 00 0b0 +0x1 1 01 0b1 +0x0 0 00 0b0 Index: src/regress/t3.in =================================================================== RCS file: src/regress/t3.in diff -N src/regress/t3.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t3.in 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1 @@ +2 * 3 Index: src/regress/t3.out =================================================================== RCS file: src/regress/t3.out diff -N src/regress/t3.out --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t3.out 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1 @@ +0x6 6 06 0b110 Index: src/regress/t4.in =================================================================== RCS file: src/regress/t4.in diff -N src/regress/t4.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t4.in 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1 @@ +6 / 3 Index: src/regress/t4.out =================================================================== RCS file: src/regress/t4.out diff -N src/regress/t4.out --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t4.out 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1 @@ +0x2 2 02 0b10 Index: src/regress/t5.in =================================================================== RCS file: src/regress/t5.in diff -N src/regress/t5.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t5.in 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1 @@ +5 % 3 Index: src/regress/t5.out =================================================================== RCS file: src/regress/t5.out diff -N src/regress/t5.out --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t5.out 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1 @@ +0x2 2 02 0b10 Index: src/regress/t6.in =================================================================== RCS file: src/regress/t6.in diff -N src/regress/t6.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t6.in 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1,2 @@ +!1 +!0 Index: src/regress/t6.out =================================================================== RCS file: src/regress/t6.out diff -N src/regress/t6.out --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t6.out 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1,2 @@ +0x0 0 00 0b0 +0x1 1 01 0b1 Index: src/regress/t7.in =================================================================== RCS file: src/regress/t7.in diff -N src/regress/t7.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t7.in 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1,3 @@ +~0 +~1 +~-1 Index: src/regress/t7.out =================================================================== RCS file: src/regress/t7.out diff -N src/regress/t7.out --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t7.out 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1,3 @@ +0xffffffff -1 037777777777 0b11111111111111111111111111111111 +0xfffffffe -2 037777777776 0b11111111111111111111111111111110 +0x0 0 00 0b0 Index: src/regress/t8.in =================================================================== RCS file: src/regress/t8.in diff -N src/regress/t8.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t8.in 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1,2 @@ +-1 +-0 Index: src/regress/t8.out =================================================================== RCS file: src/regress/t8.out diff -N src/regress/t8.out --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t8.out 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1,2 @@ +0xffffffff -1 037777777777 0b11111111111111111111111111111111 +0x0 0 00 0b0 Index: src/regress/t9.in =================================================================== RCS file: src/regress/t9.in diff -N src/regress/t9.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t9.in 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1,31 @@ +1 << 0 +1 << 1 +1 << 2 +1 << 3 +1 << 4 +1 << 5 +1 << 6 +1 << 7 +1 << 8 +1 << 9 +1 << 10 +1 << 11 +1 << 12 +1 << 13 +1 << 14 +1 << 15 +1 << 16 +1 << 17 +1 << 18 +1 << 19 +1 << 20 +1 << 21 +1 << 22 +1 << 23 +1 << 24 +1 << 25 +1 << 26 +1 << 27 +1 << 28 +1 << 29 +1 << 30 Index: src/regress/t9.out =================================================================== RCS file: src/regress/t9.out diff -N src/regress/t9.out --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/regress/t9.out 10 Mar 2006 20:10:41 -0000 @@ -0,0 +1,31 @@ +0x1 1 01 0b1 +0x2 2 02 0b10 +0x4 4 04 0b100 +0x8 8 010 0b1000 +0x10 16 020 0b10000 +0x20 32 040 0b100000 +0x40 64 0100 0b1000000 +0x80 128 0200 0b10000000 +0x100 256 0400 0b100000000 +0x200 512 01000 0b1000000000 +0x400 1024 02000 0b10000000000 +0x800 2048 04000 0b100000000000 +0x1000 4096 010000 0b1000000000000 +0x2000 8192 020000 0b10000000000000 +0x4000 16384 040000 0b100000000000000 +0x8000 32768 0100000 0b1000000000000000 +0x10000 65536 0200000 0b10000000000000000 +0x20000 131072 0400000 0b100000000000000000 +0x40000 262144 01000000 0b1000000000000000000 +0x80000 524288 02000000 0b10000000000000000000 +0x100000 1048576 04000000 0b100000000000000000000 +0x200000 2097152 010000000 0b1000000000000000000000 +0x400000 4194304 020000000 0b10000000000000000000000 +0x800000 8388608 040000000 0b100000000000000000000000 +0x1000000 16777216 0100000000 0b1000000000000000000000000 +0x2000000 33554432 0200000000 0b10000000000000000000000000 +0x4000000 67108864 0400000000 0b100000000000000000000000000 +0x8000000 134217728 01000000000 0b1000000000000000000000000000 +0x10000000 268435456 02000000000 0b10000000000000000000000000000 +0x20000000 536870912 04000000000 0b100000000000000000000000000000 +0x40000000 1073741824 010000000000 0b1000000000000000000000000000000