|
|
|
|
|
(in-package cl-user)
|
|
|
|
|
|
(defpackage :txt2web.js)
|
|
|
|
|
|
(defpackage :txt2web.main
|
|
|
(:use :cl :ps :txt2web.js)
|
|
|
(:export #:api-call #:by-id
|
|
|
#:has
|
|
|
|
|
|
#:*globals #:*objs #:*current-location
|
|
|
#:*started-at #:*timer-interval #:*timer-obj #:*loaded-games
|
|
|
|
|
|
#:*acts #:*state-stash #:*playing #:*locals
|
|
|
|
|
|
#:*games #:*main-game #:*locs #:*menu-resume
|
|
|
))
|
|
|
|
|
|
(defpackage :code-walker
|
|
|
(:use :cl)
|
|
|
(:export #:deftransform
|
|
|
#:deftransform-stop
|
|
|
#:walk
|
|
|
#:whole
|
|
|
#:walk-continue))
|
|
|
|
|
|
;;; API functions
|
|
|
(defpackage :txt2web.api
|
|
|
(:use :cl :ps :txt2web.main :txt2web.js)
|
|
|
(:export #:with-frame #:with-call-args
|
|
|
#:stash-state
|
|
|
|
|
|
#:report-error #:sleep #:init-dom #:call-serv-loc #:*serv-vars*
|
|
|
#:newline #:clear-id #:prepare-contents #:get-id #:set-id #:append-id
|
|
|
#:init-args #:get-result #:call-loc #:call-act
|
|
|
#:get-frame #:add-text #:get-text #:clear-text #:enable-frame
|
|
|
#:add-act #:del-act #:clear-act #:update-acts
|
|
|
#:set-str-element #:set-any-element #:set-serv-var
|
|
|
#:*var #:new-value #:index-num #:get #:set #:kill
|
|
|
#:var-real-name #:ensure-var #:var-ref #:get-var #:set-var
|
|
|
#:get-array #:set-array #:kill-var #:array-size
|
|
|
#:push-local-frame #:pop-local-frame #:current-local-frame #:new-local
|
|
|
#:update-objs
|
|
|
#:menu
|
|
|
#:clean-audio
|
|
|
#:show-image
|
|
|
#:opengame #:savegame
|
|
|
))
|
|
|
|
|
|
;;; QSP library functions and macros
|
|
|
(defpackage :txt2web.lib
|
|
|
(:use :cl :ps :txt2web.main :txt2web.js)
|
|
|
(:local-nicknames (#:api :txt2web.api)
|
|
|
(#:walker :code-walker))
|
|
|
(:export #:str #:exec #:qspblock #:qsploop #:game #:location
|
|
|
#:qspcond #:qspvar #:set #:local #:jump
|
|
|
|
|
|
#:killvar #:killall
|
|
|
#:obj #:loc #:no
|
|
|
#:qspver #:curloc
|
|
|
#:rnd #:qspmax #:qspmin
|
|
|
#:arrsize #:len
|
|
|
#:mid #:ucase #:lcase #:trim #:replace #:val #:qspstr
|
|
|
#:exit #:desc
|
|
|
#:showstat #:msg
|
|
|
#:showacts #:delact #:cla
|
|
|
#:showobjs #:countobj #:getobj
|
|
|
#:isplay
|
|
|
#:view
|
|
|
#:showinput
|
|
|
#:wait #:settimer
|
|
|
#:local
|
|
|
#:opengame #:savegame
|
|
|
|
|
|
#:goto #:xgoto
|
|
|
#:rand
|
|
|
#:copyarr #:arrpos #:arrcomp
|
|
|
#:instr #:isnum #:strcomp #:strfind #:strpos
|
|
|
#:iif
|
|
|
#:gosub #:func
|
|
|
#:dynamic #:dyneval
|
|
|
#:main-p #:main-pl #:main-nl #:maintxt #:desc #:main-clear
|
|
|
#:stat-p #:stat-pl #:stat-nl #:stattxt #:stat-clear #:cls
|
|
|
#:curacts
|
|
|
#:addobj #:delobj #:killobj
|
|
|
#:menu
|
|
|
#:play #:close #:closeall
|
|
|
#:refint
|
|
|
#:usertxt #:cmdclear #:input
|
|
|
#:msecscount
|
|
|
#:rgb
|
|
|
#:openqst #:addqst #:killqst
|
|
|
))
|
|
|
|
|
|
(setf (ps:ps-package-prefix "TXT2WEB.MAIN") "qsp_")
|
|
|
(setf (ps:ps-package-prefix "TXT2WEB.API") "qsp_api_")
|
|
|
(setf (ps:ps-package-prefix "TXT2WEB.LIB") "qsp_lib_")
|
|
|
|
|
|
;;; The compiler
|
|
|
(defpackage :txt2web
|
|
|
(:use :cl)
|
|
|
(:local-nicknames (#:p #:esrap)
|
|
|
(#:lib :txt2web.lib)
|
|
|
(#:api :txt2web.api)
|
|
|
(#:main :txt2web.main)
|
|
|
(#:walker :code-walker))
|
|
|
(:export #:parse-file #:entry-point))
|
|
|
|
|
|
|