diff options
Diffstat (limited to 'src/cmd/8a')
-rw-r--r-- | src/cmd/8a/Makefile | 23 | ||||
-rw-r--r-- | src/cmd/8a/a.h | 9 | ||||
-rw-r--r-- | src/cmd/8a/a.y | 8 | ||||
-rw-r--r-- | src/cmd/8a/lex.c | 10 |
4 files changed, 20 insertions, 30 deletions
diff --git a/src/cmd/8a/Makefile b/src/cmd/8a/Makefile index beb575544..78d361dbd 100644 --- a/src/cmd/8a/Makefile +++ b/src/cmd/8a/Makefile @@ -2,10 +2,10 @@ # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. -include ../../Make.conf +include ../../Make.inc +O:=$(HOST_O) -TARG=\ - 8a\ +TARG=8a HFILES=\ a.h\ @@ -20,21 +20,6 @@ OFILES=\ YFILES=\ a.y\ -$(TARG): $(OFILES) - $(LD) -o $(TARG) -L"$(GOROOT)"/lib $(OFILES) -lbio -l9 - -$(OFILES): $(HFILES) +include ../../Make.ccmd lex.$O: ../cc/macbody ../cc/lexbody - -y.tab.h: $(YFILES) - bison -y $(YFLAGS) $(YFILES) - -y.tab.c: y.tab.h - test -f y.tab.c && touch y.tab.c - -clean: - rm -f *.$O $(TARG) *.6 enam.c 6.out a.out y.tab.h y.tab.c - -install: $(TARG) - cp $(TARG) "$(GOBIN)"/$(TARG) diff --git a/src/cmd/8a/a.h b/src/cmd/8a/a.h index 035db2551..fe6b17280 100644 --- a/src/cmd/8a/a.h +++ b/src/cmd/8a/a.h @@ -1,7 +1,7 @@ // Inferno utils/8a/a.h // http://code.google.com/p/inferno-os/source/browse/utils/8a/a.h // -// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. // Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) // Portions Copyright © 1997-1999 Vita Nuova Limited // Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) @@ -50,7 +50,7 @@ typedef struct Ref Ref; typedef struct Gen Gen; typedef struct Io Io; typedef struct Hist Hist; -typedef struct Gen2 Gen2; +typedef struct Gen2 Gen2; #define MAXALIGN 7 #define FPCHIP 1 @@ -162,6 +162,7 @@ EXTERN int pass; EXTERN char* pathname; EXTERN int32 pc; EXTERN int peekc; +EXTERN int32 stmtline; EXTERN int sym; EXTERN char* symb; EXTERN int thechar; @@ -169,9 +170,9 @@ EXTERN char* thestring; EXTERN int32 thunk; EXTERN Biobuf obuf; -void* alloc(int32); +void* alloc(int32); void* allocn(void*, int32, int32); -void ensuresymb(int32); +void ensuresymb(int32); void errorexit(void); void pushio(void); void newio(void); diff --git a/src/cmd/8a/a.y b/src/cmd/8a/a.y index 8bc96cce5..04662f83d 100644 --- a/src/cmd/8a/a.y +++ b/src/cmd/8a/a.y @@ -1,7 +1,7 @@ // Inferno utils/8a/a.y // http://code.google.com/p/inferno-os/source/browse/utils/8a/a.y // -// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. // Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) // Portions Copyright © 1997-1999 Vita Nuova Limited // Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) @@ -64,7 +64,11 @@ %type <gen2> spec1 spec2 spec3 spec4 spec5 spec6 spec7 spec8 %% prog: -| prog line +| prog + { + stmtline = lineno; + } + line line: LLAB ':' diff --git a/src/cmd/8a/lex.c b/src/cmd/8a/lex.c index c8127bde9..bf298b266 100644 --- a/src/cmd/8a/lex.c +++ b/src/cmd/8a/lex.c @@ -1,7 +1,7 @@ // Inferno utils/8a/lex.c // http://code.google.com/p/inferno-os/source/browse/utils/8a/lex.c // -// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. // Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) // Portions Copyright © 1997-1999 Vita Nuova Limited // Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) @@ -925,10 +925,10 @@ jackpot: } Bputc(&obuf, a); Bputc(&obuf, a>>8); - Bputc(&obuf, lineno); - Bputc(&obuf, lineno>>8); - Bputc(&obuf, lineno>>16); - Bputc(&obuf, lineno>>24); + Bputc(&obuf, stmtline); + Bputc(&obuf, stmtline>>8); + Bputc(&obuf, stmtline>>16); + Bputc(&obuf, stmtline>>24); zaddr(&g2->from, sf); zaddr(&g2->to, st); |