New mechanism for building the tokenised version of BBBB under NetBSD. This

saves us having to keep a uuencoded version around.
This commit is contained in:
bjh21 2000-11-21 23:47:37 +00:00
parent 99899665e8
commit 986c78ced4
7 changed files with 378 additions and 321 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.1 2000/05/09 21:55:54 bjh21 Exp $
# $NetBSD: Makefile,v 1.2 2000/11/21 23:47:37 bjh21 Exp $
# Makefile for arm26 tags file and boot blocks
@ -28,6 +28,6 @@ links:
cd $$i && rm -f tags; ln -s ../tags tags; done
SUBDIR= include
SUBDIR= stand include
.include <bsd.subdir.mk>

View File

@ -1,319 +0,0 @@
$NetBSD: BBBB,ffb.uue,v 1.2 2000/07/22 15:36:15 bjh21 Exp $
begin 664 BBBB,ffb
M#0`*"O0^0D)"0@T`%#WT("1.971"4T0Z($)"0D(L9F0Q+'8@,2XR(#(P,#`O
M,#<O,38@,3(Z-#8Z-3`@8FIH,C$@17AP("0-`!X%]`T`*"_T($-O<'ER:6=H
M="`H8RD@,3DY."P@,3DY.2P@,C`P,"!"96X@2&%R<FES#0`R&O0@06QL(')I
M9VAT<R!R97-E<G9E9"X-`#P%]`T`1DCT(%)E9&ES=')I8G5T:6]N(&%N9"!U
M<V4@:6X@<V]U<F-E(&%N9"!B:6YA<GD@9F]R;7,L('=I=&@@;W(@=VET:&]U
M=`T`4$CT(&UO9&EF:6-A=&EO;BP@87)E('!E<FUI='1E9"!P<F]V:61E9"!T
M:&%T('1H92!F;VQL;W=I;F<@8V]N9&ET:6]N<PT`6@[T(&%R92!M970Z#0!D
M1_0@,2X@4F5D:7-T<FEB=71I;VYS(&]F('-O=7)C92!C;V1E(&UU<W0@<F5T
M86EN('1H92!A8F]V92!C;W!Y<FEG:'0-`&Y&]"`@("!N;W1I8V4L('1H:7,@
M;&ES="!O9B!C;VYD:71I;VYS(&%N9"!T:&4@9F]L;&]W:6YG(&1I<V-L86EM
M97(N#0!X2O0@,BX@4F5D:7-T<FEB=71I;VYS(&EN(&)I;F%R>2!F;W)M(&UU
M<W0@<F5P<F]D=6-E('1H92!A8F]V92!C;W!Y<FEG:'0-`(),]"`@("!N;W1I
M8V4L('1H:7,@;&ES="!O9B!C;VYD:71I;VYS(&%N9"!T:&4@9F]L;&]W:6YG
M(&1I<V-L86EM97(@:6X@=&AE#0",3?0@("`@9&]C=6UE;G1A=&EO;B!A;F0O
M;W(@;W1H97(@;6%T97)I86QS('!R;W9I9&5D('=I=&@@=&AE(&1I<W1R:6)U
M=&EO;BX-`)9.]"`S+B!4:&4@;F%M92!O9B!T:&4@875T:&]R(&UA>2!N;W0@
M8F4@=7-E9"!T;R!E;F1O<G-E(&]R('!R;VUO=&4@<')O9'5C=',-`*!.]"`@
M("!D97)I=F5D(&9R;VT@=&AI<R!S;V9T=V%R92!W:71H;W5T('-P96-I9FEC
M('!R:6]R('=R:71T96X@<&5R;6ES<VEO;BX-`*H%]`T`M$KT(%1(25,@4T]&
M5%=!4D4@25,@4%)/5DE$140@0ED@5$A%($%55$A/4B!@8$%3($E3)R<@04Y$
M($%.62!%6%!215-3($]2#0"^3_0@24U03$E%1"!705)204Y42453+"!)3D-,
M541)3D<L($)55"!.3U0@3$E-251%1"!43RP@5$A%($E-4$Q)140@5T%24D%.
M5$E%4PT`R$WT($]&($U%4D-(04Y404))3$E462!!3D0@1DE43D534R!&3U(@
M02!005)424-53$%2(%!54E!/4T4@05)%($1)4T-,04E-140N#0#21O0@24X@
M3D\@159%3E0@4TA!3$P@5$A%($%55$A/4B!"12!,24%"3$4@1D]2($%.62!$
M25)%0U0L($E.1$E214-4+`T`W$[T($E.0TE$14Y404PL(%-014-)04PL($58
M14U03$%262P@3U(@0T].4T51545.5$E!3"!$04U!1T53("A)3D-,541)3D<L
M($)55`T`YD_T($Y/5"!,24U)5$5$(%1/+"!04D]#55)%345.5"!/1B!354)3
M5$E4551%($=/3T13($]2(%-%4E9)0T53.R!,3U-3($]&(%5312P-`/!+]"!$
M051!+"!/4B!04D]&2513.R!/4B!"55-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("!_#0,,,B`@("`@(.<@9FEL920@/#X@(B(@
MC""%(*(@,"P@(E1O;R!M86YY(&9I;&5S(2(-`Q8G("`@("`@R)4@P$$D+"`Q
M*2`\/B`B("(@@""I*$$D*2`^(#`-`R`;("`@("`@("!F:6QE)"`K/2#`020L
M,2D-`RH8("`@("`@("!!)"`](,%!)"P@,BD-`S0+("`@("`@S@T#/@<@(,L-
M`T@%S@T#4B/G(&9I;&4D(#T@(B(@@"`H:&]W=&\E((`@)C`Q*2",#0-<%2`@
MZ"`B8F]O=#H@(F9I;&4D#0-F!<P-`W`E("#G(&9I;&4D(#T@(B(@C"!F:6QE
M)"`](")N971B<V0B#0-Z!<T-`X0U\2`B0F]O=&EN9R`B.R!F:6QE)#L@(B`H
M:&]W=&\@/2`P>"([('YH;W=T;R4[("(I(@T#CA?R;&]A9%]K97)N96PH9FEL
M920I#0.8#=X@4"4@,3`R,PT#H@7T#0.L"UL@3U!4(#(-`[8-("YC;VYF:6<E
M#0/`*"`@15%51"`F.30R0C=$1D4@("`@("`@("`@("`@.R!M86=I8PT#RBH@
M($51540@,"`@("`@("`@("`@("`@("`@("`@(#L@=F5R<VEO;@T#U"P@($51
M540@:&]W=&\E("`@("`@("`@("`@("`@(#L@8F]O=&AO=W1O#0/>*B`@15%5
M1"`P("`@("`@("`@("`@("`@("`@("`@.R!B;V]T9&5V#0/H)R`@15%51"!S
M<WEM)2`@("`@("`@("`@("`@("`@.R!S<WEM#0/R)R`@15%51"!E<WEM)2`@
M("`@("`@("`@("`@("`@.R!E<WEM#0/\)R`@15%51"!N8G!P)2`@("`@("`@
M("`@("`@("`@.R!N8G!P#00&*2`@15%51"!N<&%G97,E("`@("`@("`@("`@
M("`@.R!N<&%G97,-!!`J("!%455$('1X=&)A<V4E("`@("`@("`@("`@("`[
M('1X=&)A<V4-!!HJ("!%455$('1X='-I>F4E("`@("`@("`@("`@("`[('1X
M='-I>F4-!"0K("!%455$(&1A=&%B87-E)2`@("`@("`@("`@("`[(&1A=&%B
M87-E#00N*R`@15%51"!D871A<VEZ924@("`@("`@("`@("`@.R!D871A<VEZ
M90T$."H@($51540@8G-S8F%S924@("`@("`@("`@("`@(#L@8G-S8F%S90T$
M0BH@($51540@8G-S<VEZ924@("`@("`@("`@("`@(#L@8G-S<VEZ90T$3"L@
M($51540@9G)E96)A<V4E("`@("`@("`@("`@(#L@9G)E96)A<V4-!%8I("!%
M455$(*1V9'5?=F%R*#$Q*2`K(#$@("`@(#L@>'!I>&5L<PT$8"D@($51540@
MI'9D=5]V87(H,3(I("L@,2`@("`@.R!Y<&EX96QS#01J)2`@15%51"`Q(#P\
M(*1V9'5?=F%R*#DI("`@("`[(&)P<`T$=$@@($51540@I'9D=5]V87(H,30Y
M*2`K(*1V9'5?=F%R*#$U,"D@+2`F,#(P,#`P,#`@.R!S8W)E96YB87-E("A8
M6%@_*0T$?BP@($51540@I'9D=5]V87(H,34P*2`@("`@("`@.R!S8W)E96YS
M:7IE#02(!5T-!)(?R)D@(D]37T)Y=&4B+"`Q-C4@N"`L+&-R;W<E#02<"UL@
M3U!4(#(-!*8L("!%455$(&-R;W<E("H@I'9D=5]V87(H,3<P*2`[(&-P:7AE
M;')O=PT$L`5=#02Z!`T$Q!CG(*1V9'5?=F%R*#DI(#P^(#,@C`T$SDL@(/$@
M(E=!4DY)3D<Z($-U<G)E;G0@<V-R965N(&UO9&4@:&%S(&9E=V5R('1H86X@
M96EG:'0@8FET<R!P97(@<&EX96PN(@T$V$8@(/$@(B`@("`@("`@($-O;G-O
M;&4@9&ES<&QA>2!M87D@;F]T('=O<FL@8V]R<F5C=&QY("AO<B!A="!A;&PI
M+B(-!.(%S0T$[`0-!.U-]"!4<GD@=&\@96YS=7)E('1H870@=V4@;&5A=F4@
M=&AE('!A9V4@<F5G:7-T97)S(&9O<B!P;V1U;&4@4D]-<R!P;VEN=&EN9PT$
M[D_T(&%T('1H92!P86=E('=I=&@@=&AE($5#240@:6X@:70L('-O('1H870@
M3F5T0E-$(&AA<R!A(&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(F("#>('-H9')S)2!S:&YU;24@*B!S
M:&5N='-I>F4E("T@,0T(_$$@(,B9(")/4U]'0E!"(BP@,RP@9FEL924L('-H
M9')S)2P@<VAN=6TE("H@<VAE;G1S:7IE)2P@<VAO9F8E#0D&%2`@YR!S:&YU
M;24@/#X@,"",#0D0%2`@("!H879E<WEM<R4@/2"C#0D:2"`@("#C('-H)2`]
M('-H9')S)2"X('-H9')S)2`K("AS:&YU;24@+2`Q*2`J('-H96YT<VEZ924@
MB"!S:&5N='-I>F4E#0DD)2`@("`@(.<@<V@E(30@/2`R((P@:&%V97-Y;7,E
M(#T@N0T)+@D@("`@[0T).!4@("`@YR!H879E<WEM<R4@C`T)0AL@("`@("!S
M<WEM)2`](&9R965B87-E)0T)3#`@("`@("#T($9I<G-T+"!W92!H879E('1H
M92!M=6YG960@14Q&(&AE861E<@T)5A$@("`@("#Q("(K6R([#0E@.B`@("`@
M(/)L;V%D7V-H=6YK*&9I;&4E+"`P+"`F,#(P,#`P,#`@*R!S<WEM)2P@-3(L
M(#4R*0T):B,@("`@("#R=W)I=&5?=V]R9"AS<WEM)2LS,BP@-3(I#0ET&2`@
M("`@(&9R965B87-E)2`K/2`U,@T)?BP@("`@("#T('1H96XL('1H92!M=6YG
M960@<V5C=&EO;B!H96%D97)S#0F('2`@("`@(&US:&1R<R4@/2!F<F5E8F%S
M924-"9(0("`@("`@\2`B*R([#0F<8R`@("`@(/)L;V%D7V-H=6YK*&9I;&4E
M+"!S:&]F9B4L("8P,C`P,#`P,"`K(&US:&1R<R4L('-H;G5M)2`J('-H96YT
M<VEZ924L('-H;G5M)2`J('-H96YT<VEZ924I#0FF*B`@("`@(&9R965B87-E
M)2`K/2!S:&YU;24@*B!S:&5N='-I>F4E#0FP2B`@("`@(.,@<V@E(#T@<VAD
M<G,E(+@@<VAD<G,E("L@*'-H;G5M)2`M(#$I("H@<VAE;G1S:7IE)2"(('-H
M96YT<VEZ924-";HE("`@("`@("#G('-H)2$T(#T@,B"$('-H)2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1%(@("`@(%(U+"!R96=S)0T0N!\@("`@("!,1$U)02`@(%(U
M+"![4C$P+5(Q-'T-$,(8("`@("`@34]6("`@("!00RP@4C0-$,P/("`@("`N
M<F5G<R4-$-8O("`@("`@15%51"`@("`F,#(P.#@P,#`[(%(Q,"`M+2!3=&%C
M:R!L:6UI=`T0X$4@("`@("!%455$("`@("8P,#`P,#`P,#L@4C$Q("TM($9R
M86UE('!O:6YT97(@*$Y53$P@:6X@=&AI<R!C87-E*0T0ZD(@("`@("!%455$
M("`@("8P,#`P,#`P,#L@4C$R("TM(%-C<F%T8V@@:6X@;F]N+7)E+65N=')A
M;G0@05!#4PT0]#$@("`@("!%455$("`@("8P,C`Y,#`P,#L@4C$S("TM(%-T
M86-K('!O:6YT97(-$/X[("`@("`@15%51"`@("`F,#,X,#`P,#,[(%(Q-"`M
M+2!2971U<FX@861D<F5S<R!A;F0@;6]D90T1"`\@("`@("YJ=6YK)0T1$@D@
M("`@70T1'`<@(.T-$28,("#6(&%S;24-$3`%X0T1.@0-$406W2"D<W=I7W9A
M;&ED*'-W:20I#1%.#B`@ZB!F;&%G<R4-$5@R("#(F2`B6$]37U-724YU;6)E
M<D9R;VU3=')I;F<B+"QS=VDD(+@@.V9L86=S)0T18A<@(.<@9FQA9W,E((`@
M,2",(#VC#1%L!CVY#1%V!`T1@!3=(*1V9'5?=F%R*'9A<B4I#1&*"B`@ZB!B
M)0T1E`P@(-X@8B4@-PT1GA$@(&(E(3`@/2!V87(E#1&H#R`@8B4A-"`]("TQ
M#1&R)B`@R)D@(D]37U)E86169'5687)I86)L97,B+"!B)2P@8B4-$;P*/2!B
M)2$P#1'&!`T1T!O=(*1R;W5N9'5P*'9A;"4L('-I>F4E*0T1VB<]=F%L)2`K
>("AS:7IE)2`M(#$I((`@K"`H<VEZ924@+2`Q*0W_
`
end

View File

@ -0,0 +1,28 @@
# $NetBSD: Makefile,v 1.1 2000/11/21 23:47:38 bjh21 Exp $
#MAN= BBBB.8
.if !defined(BASTOK)
.ifnmake(print-objdir)
BASTOKDIR!= cd ${.CURDIR}/../bastok; ${MAKE} print-objdir
BASTOK= ${BASTOKDIR}/bastok
BASTOKTARG= ${BASTOK}
${BASTOK}:
(cd ${.CURDIR}/../bastok; ${MAKE})
.endif
.else
BASTOKTARG=
.endif
clean cleandir distclean: bbbbclean
realall: BBBB,ffb
bbbbclean:
rm -f BBBB,ffb
BBBB,ffb: BBBB,fd1 ${BASTOKTARG}
${BASTOK} ${.CURDIR}/BBBB,fd1 > BBBB,ffb
.include <bsd.man.mk>

View File

@ -0,0 +1,5 @@
# $NetBSD: Makefile,v 1.1 2000/11/21 23:47:37 bjh21 Exp $
SUBDIR= bastok BBBB
.include <bsd.subdir.mk>

View File

@ -0,0 +1,11 @@
# $NetBSD: Makefile,v 1.1 2000/11/21 23:47:38 bjh21 Exp $
HOSTPROG=bastok
LDADD+=-ll
DPADD+=${LIBL}
SRCS=bastok.l
.include <bsd.hostprog.mk>

View File

@ -0,0 +1,24 @@
.Dd November 13, 2000
.Dt BASTOK 1
.Os
.Sh NAME
.Nm bastok
.Nd BBC BASIC tokeniser
.Sh SYNOPSIS
.Nm
.Op Ar file
.Sh DESCRIPTION
The
.Nm
utility converts a BBC BASIC program from plain text form into a tokenised
form which can be loaded by the BBC BASIC interpreter. The program is read
from
.Ar file ,
or from standard input if
.Ar file
is not specified.
.Sh BUGS
Abbreviated keywords are not handled.
.Pp
Explicit line numbers, either at the start of a line or in a GOTO or GOSUB
statement, are not handled correctly.

View File

@ -0,0 +1,308 @@
/*-
* Copyright (c) 2000 Ben Harris
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* bastok -- BBC BASIC tokenizer */
/* Not handled:
* - Abbreviated keywords
* - Explicit line numbers
*/
/* In condition COMMENT, we ignore everything except EOL. */
%x COMMENT
/*
* There are a few keywords (PAGE, LOMEM, HIMEM, PTR, TIME)
* which tokenise differently as statements and as functions.
* This is handled by the variable "statement", which is 1
* at the start of a statement and 0 otherwise.
*/
#define p1(x) do { \
thisline[pos++] = x; \
statement = 0; /* by default */ \
} while (0)
#define p2(x, y) do { \
thisline[pos++] = x; \
thisline[pos++] = y; \
statement = 0; \
} while (0)
#define lr(l, r) do { \
if (statement) \
p1(l); \
else \
p1(r); \
} while (0)
char thisline[256];
int statement;
int pos;
int baslinenum = 10;
void linedone(void);
int yylex(void);
%%
pos = 0;
statement = 1;
ABS p1(0x94);
ACS p1(0x95);
ADVAL p1(0x96); /* AD. */
AND p1(0x80); /* A. */
APPEND p2(0xC7, 0x8E); /* AP. */
ASC p1(0x97);
ASN p1(0x98);
ATN p1(0x99);
AUTO p2(0xC7, 0x8F); /* AU. */
BEAT p2(0xC6, 0x8F);
BEATS p2(0xC8, 0x9E); /* BEA. */
BGET p1(0x9A); /* B. */
BPUT p1(0xD5); /* BP. */
CALL p1(0xD6); /* CA. */
CASE p2(0xC8, 0x8E);
CHAIN p1(0xD7); /* CH. */
CHR\$ p1(0xBD);
CIRCLE p2(0xC8, 0x8F); /* CI. */
CLEAR p1(0xD8); /* CL. */
CLG p1(0xDA);
CLOSE p1(0xD9); /* CLO. */
CLS p1(0xDB);
COLOR p1(0xFB); /* C. */
COLOUR p1(0xFB); /* C. */
COS p1(0x9B);
COUNT p1(0x9C); /* COU. */
DATA { p1(0xDC); BEGIN(COMMENT); } /* D. */
DEF p1(0xDD);
DEG p1(0x9D);
DELETE p2(0xC7, 0x90); /* DEL. */
DIM p1(0xDE);
DIV p1(0x81);
DRAW p1(0xDF); /* DR. */
EDIT p2(0xC7, 0x91); /* ED. */
ELLIPSE p2(0xC8, 0x9D); /* ELL. */
ELSE { p1(0xCC); statement = 1; } /* EL. */
END p1(0xE0);
ENDCASE p1(0xCB); /* ENDC. */
ENDIF p1(0xCD);
ENDPROC p1(0xE1); /* E. */
ENDWHILE p1(0xCE); /* ENDW. */
EOF p1(0xC5);
EOR p1(0x82);
ERL p1(0x9E);
ERR p1(0x9F);
ERROR p1(0x85); /* ERR. */
EVAL p1(0xA0); /* EV. */
EXP p1(0xA1);
EXT p1(0xA2);
FALSE p1(0xA3); /* FA. */
FILL p2(0xC8, 0x90); /* FI. */
FN p1(0xA4);
FOR p1(0xE3); /* F. */
GCOL p1(0xE6); /* GC. */
GET p1(0xA5);
GET\$ p1(0xBE); /* GE. */
GOSUB p1(0xE4); /* CONSTA = 1 */ /* GOS. */
GOTO p1(0xE5); /* CONSTA = 1 */ /* G. */
HELP p2(0xC7, 0x92); /* HE. */
HIMEM lr(0xD3, 0x93); /* H. */
IF p1(0xE7);
INKEY p1(0xA6);
INKEY\$ p1(0xBF); /* INK. */
INPUT p1(0xE8); /* I. */
INSTALL p2(0xC8, 0x9A); /* INS. */
INSTR\( p1(0xA7); /* INS. */
INT p1(0xA8);
LEFT\$\( p1(0xC0); /* LE. */
LEN p1(0xA9);
LET p1(0xE9);
LIBRARY p2(0xC8, 0x9B); /* LIB. */
LINE p1(0x86);
LIST p2(0xC7, 0x93); /* L. */
LN p1(0xAA);
LOAD p2(0xC7, 0x94); /* LO. */
LOCAL p1(0xEA);
LOG p1(0xAB);
LOMEM lr(0xD2, 0x92); /* LOM. */
LVAR p2(0xC7, 0x95); /* LV. */
MID\$\( p1(0xC1); /* M. */
MOD p1(0x83);
MODE p1(0xEB); /* MO. */
MOUSE p2(0xC8, 0x97); /* MOU. */
MOVE p1(0xEC);
NEW p2(0xC7, 0x96);
NEXT p1(0xED); /* N. */
NOT p1(0xAC);
OF p1(0xCA);
OFF p1(0x87);
OLD p2(0xC7, 0x97); /* O. */
ON p1(0xEE);
OPENIN p1(0x8E); /* OP. */
OPENOUT p1(0xAE); /* OPENO. */
OPENUP p1(0xAD);
OR p1(0x84);
ORIGIN p2(0xC8, 0x91); /* OR. */
OSCLI p1(0xFF); /* OS. */
OTHERWISE p1(0x7F); /* OT. */
OVERLAY p2(0xC8, 0xA3); /* OV. */
PAGE lr(0xD0, 0x90); /* PA. */
PI p1(0xAF);
PLOT p1(0xF0); /* PL. */
POINT p2(0xC8, 0x92);
POINT\( p1(0xB0); /* PO. */
POS p1(0xB1);
PRINT p1(0xF1); /* P. */
PROC p1(0xF2);
PTR lr(0xCF, 0x8F);
QUIT p2(0xC8, 0x98); /* Q. */
READ p1(0xF3);
RECTANGLE p2(0xC8, 0x93); /* REC. */
REM { p1(0xF4); BEGIN(COMMENT); }
RENUMBER p2(0xC7, 0x98); /* REN. */
REPEAT { p1(0xF5); statement = 1; } /* REP. */
REPORT p1(0xF6); /* REPO. */
RESTORE p1(0xF7); /* RES. */
RETURN p1(0xF8); /* R. */
RIGHT\$\( p1(0xC2); /* RI. */
RND p1(0xB3);
RUN p1(0xF9);
SAVE p2(0xC7, 0x99); /* SA. */
SGN p1(0xB4);
SIN p1(0xB5);
SOUND p1(0xD4); /* SO. */
SPC p1(0x89);
SQR p1(0xB6);
STEP p1(0x88); /* S. */
STEREO p2(0xC8, 0xA2); /* STER. */
STOP p1(0xFA);
STR\$ p1(0xC3);
STRING\$\( p1(0xC4); /* STRI. */
SUM p2(0xC6, 0x8E);
SWAP p2(0xC8, 0x94); /* SW. */
SYS p2(0xC8, 0x99);
TAB\( p1(0x8A);
TAN p1(0xB7); /* T. */
TEMPO p2(0xC8, 0x9F); /* TE. */
THEN { p1(0x8C); statement = 1; } /* TH. */
TIME lr(0xD1, 0x91); /* TI. */
TINT p2(0xC8, 0x9C);
TO p1(0xB8);
TRACE p1(0xFC); /* TR. */
TRUE p1(0xB9);
TWIN p2(0xC7, 0x9A);
TWINO p2(0xC7, 0x9B); /* TW. */
UNTIL p1(0xFD); /* U. */
USR p1(0xBA);
VAL p1(0xBB);
VDU p1(0xEF); /* V. */
VOICE p2(0xC8, 0xA1);
VOICES p2(0xC8, 0xA0); /* VO. */
VPOS p1(0xBC); /* VP. */
WAIT p2(0xC8, 0x96); /* WA. */
WHEN p1(0xC9);
WHILE p2(0xC8, 0x95); /* W. */
WIDTH p1(0xFE); /* WI. */
/* Strings aren't tokenised */
\"[^\"]*\" { memcpy(thisline + pos, yytext, yyleng); pos += yyleng; }
: { p1(':'); BEGIN(INITIAL); }
/* Whitespace doesn't move us into RIGHT */
" " thisline[pos++] = ' ';
/* Other random characters might (e.g. '='). */
<COMMENT,INITIAL>. p1(*yytext);
<COMMENT,INITIAL>\n { linedone(); statement = 1; }
%%
#include <sys/types.h>
#include <err.h>
#include <stdio.h>
#include <unistd.h>
void filedone(void);
void usage(void);
void
linedone()
{
fputc(0x0D, yyout);
fputc(baslinenum >> 8, yyout);
fputc(baslinenum & 0xff, yyout);
fputc(pos + 4, yyout);
fwrite(thisline, 1, pos, yyout);
baslinenum += 10;
pos = 0;
BEGIN(INITIAL);
}
void
filedone()
{
fputs("\x0d\xff", yyout);
}
int
main(int argc, char **argv)
{
int ch;
while ((ch = getopt(argc, argv, "")) != -1)
switch (ch) {
case '?':
default:
usage();
}
argc -= optind;
argv += optind;
if (argc > 1)
usage();
if (*argv != NULL) {
yyin = fopen(*argv, "r");
if (yyin == NULL)
err(1, "%s", *argv);
}
yylex();
filedone();
exit(0);
}
void
usage()
{
fprintf(stderr, "usage: bastok [file]\n");
exit(1);
}