# Copyright 1989 by David Love, SERC Daresbury Laboratory
# (love@daresbury.ac.uk)
# under the same conditions as the SPIDER distribution.
# For more information, see file COPYRIGHT in the parent directory

language PostScript extension ps

comment begin <"%"> end newline
macros begin
\def\commentbegin{\%}
\let\&=\\ % don't want bold reserved words (only begin, end, def used anyway)
\def\ps{\sc PostScript}
macros end

line begin <"%"> end <"">

default translation <*> mathness yes

module definition math use math

token identifier category math mathness yes
token number category number mathness yes
token newline category newline translation <> mathness maybe
token pseudo_semi category ignore_scrap mathness no translation <opt-0>

token [ category open translation <break_space-*>
token ] category close translation <break_space-*>
token { translation <"\\{"> category open
token } translation <"\\}"> category close
token < category open translation <break_space-*>
token > category close translation <break_space-*>
token # category hash translation <"\\#">
# use mathness no here to avoid extra space after /
token / category slash tangleto <space-"/"> mathness no
token = category math
token == category math

# a frig to allow user to indent/outdent as required
# => and <= can't be used as PostScript names!
# this would be better done with new WEB control sequences
token => category dent translation <indent> tangleto <"">
token <= category dent translation <outdent> tangleto <"">

ilk def_like category def mathness yes
reserved def ilk def_like
ilk begin_like category begin mathness yes
reserved begin ilk begin_like
ilk end_like category end mathness yes
reserved end ilk end_like

# index def'd things with underline
slashed_math <break_space> math --> slashed_math 
slashed_math* <break_space> def --> math
[ slashed_math ] (close|end) --> math (close|end)

<big_force> newline newline --> ignore_scrap
<force> newline --> ignore_scrap

# want indent inside open/close pairs
open <indent> math <outdent> close --> math
# could have empty procedure
open close --> math

slash math --> slashed_math

number hash number --> math
number --> math
math <break_space> math --> math

begin <indent> --> math
<outdent> end --> math

dent --> ignore_scrap

ignore_scrap math --> math

? ignore_scrap --> #1