diff options
Diffstat (limited to 'src/cmd/5a')
-rw-r--r-- | src/cmd/5a/Makefile | 25 | ||||
-rw-r--r-- | src/cmd/5a/a.h | 5 | ||||
-rw-r--r-- | src/cmd/5a/a.y | 8 | ||||
-rw-r--r-- | src/cmd/5a/lex.c | 10 |
4 files changed, 19 insertions, 29 deletions
diff --git a/src/cmd/5a/Makefile b/src/cmd/5a/Makefile index f01b017da..f4463c97b 100644 --- a/src/cmd/5a/Makefile +++ b/src/cmd/5a/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=\ - 5a\ +TARG=5a HFILES=\ a.h\ @@ -15,26 +15,11 @@ HFILES=\ OFILES=\ y.tab.$O\ lex.$O\ -# ../5l/enam.$O\ + ../5l/enam.$O\ 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) *.5 enam.c 5.out a.out y.tab.h y.tab.c - -install: $(TARG) - cp $(TARG) "$(GOBIN)"/$(TARG) diff --git a/src/cmd/5a/a.h b/src/cmd/5a/a.h index 6cd5af8c6..bc4f433e1 100644 --- a/src/cmd/5a/a.h +++ b/src/cmd/5a/a.h @@ -1,7 +1,7 @@ // Inferno utils/5a/a.h // http://code.google.com/p/inferno-os/source/browse/utils/5a/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) @@ -148,6 +148,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; @@ -157,7 +158,7 @@ EXTERN Biobuf obuf; 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/5a/a.y b/src/cmd/5a/a.y index bb30ac698..b39c916ab 100644 --- a/src/cmd/5a/a.y +++ b/src/cmd/5a/a.y @@ -1,7 +1,7 @@ // Inferno utils/5a/a.y // http://code.google.com/p/inferno-os/source/browse/utils/5a/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) @@ -63,7 +63,11 @@ %type <gen> imm ximm name oreg ireg nireg ioreg imsr %% prog: -| prog line +| prog + { + stmtline = lineno; + } + line line: LLAB ':' diff --git a/src/cmd/5a/lex.c b/src/cmd/5a/lex.c index 2cc0993e4..b36094a78 100644 --- a/src/cmd/5a/lex.c +++ b/src/cmd/5a/lex.c @@ -1,7 +1,7 @@ // Inferno utils/5a/lex.c // http://code.google.com/p/inferno-os/source/browse/utils/5a/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) @@ -658,10 +658,10 @@ jackpot: Bputc(&obuf, a); Bputc(&obuf, scond); Bputc(&obuf, reg); - 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(g1, sf); zaddr(g2, st); |