home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1998 April A
/
Pcwk4a98.iso
/
Wtestowe
/
OnNet16
/
CCONV.STP
< prev
next >
Wrap
Text File
|
1997-02-13
|
7KB
|
256 lines
:(o,,**************************************************************************
CCONV.STP TRAC Script to Convert COMSCRPT Scripts to SLANG Scripts
-- written 30-Mar-1994 by Craig Lennox
******************************************************************************)
:(s,c.)
:(mm,c.Version,3.00 <* Version String for Converter *> )
:(mm,c.lp,:(bxo,28) <* left paren *> )
:(mm,c.rp,:(bxo,29) <* right paren *> )
:(s,c.crstr,:(bxo,28)cr:(bxo,29))
:(s,c.lfstr,:(bxo,28)lf:(bxo,29))
:(s,c.tabstr,:(bxo,9))
:(mm,c.nl,(
) <* New Line String *> )
:(s,c.names,(pause,send,changemode,poll,;))
:(mm,c.actions,(
( <* pause *>
:(s,c.outstr,:(ri,c.pause))
),( <* send *>
:(s,c.outstr,:(ri,c.send))
),( <* changemode *>
:(s,c.outstr,:(ri,c.changemode))
),( <* poll *>
:(s,c.outstr,
:(r,c.lp)
(poll, )
:(s,c.arg,:(tn,c.instr,1))
:(ei,:(r,c.arg),,
(:(s,c.warning,
(invalid poll command: no layer specified)
)
:(s,c.outstr,)
)
,
(:(ei,:(r,c.arg),p,
((physical, )
:(tsd,c.instr,,( ))
:(s,c.arg,:(tn,c.instr,1))
)
,
(:(ei,:(r,c.arg),l,
((lcp, )
:(tsd,c.instr,,( ))
:(s,c.arg,:(tn,c.instr,1))
)
,
(:(ei,:(r,c.arg),i,
((ipcp, )
:(tsd,c.instr,,( ))
:(s,c.arg,:(tn,c.instr,1))
)
,
(:(s,c.warning,
(invalid layer: specify physical, lcp or ipcp)
)
:(s,c.outstr,)
:(s,c.arg,( ))
)
))
))
))
)
:(ei,:(r,c.arg),,(:(s,c.warning,
( invalid poll command: need to specify open or closed ))
:(s,c.outstr,)),
(:(ei,:(r,c.arg),o,open,
(:(ei,:(r,c.arg),c,closed,
(:(ei,:(r,c.arg),( ),,
(:(s,c.warning,
(invalid poll command: need to specify open or closed))
:(s,c.outstr,)))))))))
:(r,c.rp))
),( <* comment *>
:(s,c.thisisacomment,yup)
:(s,c.outstr,:(r,c.lp)(comment, {):(ts,c.instr,,)}:(r,c.rp):(r,c.nl))
)
))
:(mm,c.which?,(
:(ms,<1>,<2>)
:(mw,<1>)
:(ri,<1>,<3>)
))
:(mm,##,(
:(pc,(
:(fo1,<1>,(:(o,(Can't open comscrpt file "<1>", aborting conversion.)):(px)))
:(fg2,<2>)
:(ri,pp.out,:(ri,c.banner,<1p>,<2p>)) <* DEBUG *>
:(pc,(
:(d,c.warning,c.comment,c.outstr)
:(s,c.instr,:(fr1,(
),,(:(px))))
:(tra,c.instr,:(tca,11),( ))
:(s,c.op,:(ts,c.instr,,( )))
:(s,c.tmpop,:(r,c.op))
:(ri,c.which?,c.tmpop,:(r,c.names),:(r,c.actions))
:(mhi,c.thisisacomment,
(
:(ri,pp.out,:(r,c.outstr))
:(d,c.thisisacomment)
),
(
:(ri,pp.doline,:(r,c.outstr),:(r,c.instr),:(r,c.warning))
))
),(-1),)
),1)
:(fc):(fc2)
))
:(mm,c.mkcomment,(
:(bxo,3c)*<2p><1p><2p>*>(
)))
:(mm,c.banner,(
:(ri,c.mkcomment,
(************************** language=slang ***********************************
*
* This File Converted From COMSCRPT Script Language TO SLANG Script Language
*
* COMSCRPT (source) file: <1p>
* SLANG (destination) file: <2p>
* Conversion done on: ):(xcf)(
* Converter Version: v):(r,c.Version)(
*
******************************************************************************))))
:(mm,c.mkstmt,(
:(r,c.lp)<1p>:(r,c.rp)
))
:(mm,c.send,(
:(s,c.tmp,:(tpe,c.instr))
:(tra,c.tmp,(\r),}:(r,c.crstr){)
:(tra,c.tmp,(\n),}:(r,c.lfstr){)
:(tra,c.tmp,(\t),:(r,c.tabstr))
:(ri,c.mkstmt,(send, {):(r,c.tmp)})
))
:(mm,c.changemode,(
:(ri,c.mkstmt,
(changemode, )
:(s,c.arg,:(tn,c.instr,1))
:(ei,:(r,c.arg),,
(:(s,c.warning,
(No argument to changemode, assuming "packet"))
)
)
:(e,:(r,c.arg),c,char,packet)
)
))
:(mm,c.pause,(
:(ri,c.mkstmt,
(pause, )
:(s,c.arg,:(ts,c.instr,,( )))
:(ei,:(r,c.arg),,
(1000:(s,c.warning, <* no argument *>
(No argument to pause, using 1 second)))
,
(:(r,c.arg):(e,:(tn,c.instr,1),m,,000,)) <* there is an arg *>
)
)
))
:(o,,**************************************************************************
included from:
PP.STP pretty print routines.
-clennox, 30-Mar-1994
******************************************************************************)
:(s,pp.)
:(o,,
<* pp - pretty print a line of text in columns. *>
)
:(mm,pp.lc, <* left comment bracket *>
( :(bxo,3c)(* ))
)
:(mm,pp.rc, <* right comment bracket *>
((*):(bxo,3e)))
:(mm,pp.sp, <* spaces *>
( :(agi,<1>,0,
( :(pc,(( )),<1>,,)))))
:(mm,pp.nl, <* newline *>
((
)))
:(s,pp.cw,24) :(o,, <* comment width *> )
:(s,pp.col3,50) :(o,, <* start of column three *> )
:(s,pp.col2,21) :(o,, <* start of column two *> )
:(s,pp.ecol2,:(as,:(r,pp.col3),1))
:(o,, <* end of column two *> )
:(mm,pp.c, <* commentize *>
( :(s,pp.x1,<1p>)
:(s,pp.x2,:(tl,pp.x1))
:(s,pp.x1,:(tn,pp.x1,:(r,pp.x2),))
:(s,pp.x2,:(as,:(r,pp.cw),:(r,pp.x2)))
:(s,pp.x3,:(agi,:(r,pp.x2),0,(:(pc,(( )),:(r,pp.x2),,),,)))
:(ri,pp.lc):(r,pp.x1):(r,pp.x3):(ri,pp.rc))
)
:(mm,pp.pp, <* pretty print *>
( :(s,pp.in,<1p>) <* save incoming to a var *>
:(ei,:(r,pp.in),,(:(ri,pp.out,:(ri,pp.nl))),
(
:(s,pp.line,)
:(pc,
( :(s,pp.tmp,:(ts,pp.in,,( ),(:(px)))) <* get next word *>
:(agi,:(aa,:(tl,pp.line),:(tl,pp.tmp)),:(r,pp.cw),
( :(ri,pp.out,:(ri,pp.c,:(r,pp.line)):(ri,pp.nl):(ri,pp.sp,:(r,pp.col3)))
:(s,pp.line,)
),,)
:(s,pp.line,:(r,pp.line):(r,pp.tmp)( ))
),-1,,)
:(ei,pp.line,,,(:(ri,pp.out,:(ri,pp.c,:(r,pp.line)):(ri,pp.nl))))
))
))
:(mm,pp.out,
( :(fw2,<1p>)))
:(mm,pp.doline,
( :(s,pp.part1,<1p>( ))
:(s,pp.part2,<2p>( ))
:(s,pp.part3,<3p>)
:(ri,pp.out,:(ri,pp.nl):(r,pp.part1))
:(s,pp.cp,:(tl,pp.part1))
:(agi,:(tl,pp.part2),:(r,pp.ecol2),
( :(ri,pp.out,:(ri,pp.nl):(ri,pp.sp,8):(ri,pp.c,:(r,pp.part2))
:(ri,pp.nl))
:(s,pp.cp,0)
),
( :(ri,pp.out,:(ri,pp.nl):(ri,pp.sp,8):(ri,pp.c,:(r,pp.part2))
:(ri,pp.nl))
:(s,pp.cp,0)
),
( :(s,pp.cp2,:(as,:(r,pp.ecol2),:(tl,pp.part2)))
:(agi,:(r,pp.cp2),:(r,pp.col2),(:(s,pp.cp2,:(r,pp.col2))),,)
:(agi,:(r,pp.cp),:(r,pp.cp2),
( :(ri,pp.out,:(ri,pp.nl))
:(s,pp.cp,0)),,)
:(ri,pp.out,:(ri,pp.sp,:(as,:(r,pp.cp2),:(r,pp.cp))))
:(ri,pp.out,:(ri,pp.c,:(r,pp.part2)))
) )
:(ri,pp.pp,:(r,pp.part3))
))