1
0
Fork 0

raterspec now writes to aux file

master
Mike Gerwitz 2014-05-15 11:46:03 -04:00
commit 385bdbcd4a
4 changed files with 59 additions and 28 deletions

View File

@ -20,6 +20,8 @@
% base class, defaulting to 10pt % base class, defaulting to 10pt
\LoadClass[10pt]{scrreprt} \LoadClass[10pt]{scrreprt}
\RequirePackage{xparse}
\RequirePackage[top=4.5cm,bottom=5cm,width=\textwidth]{geometry} \RequirePackage[top=4.5cm,bottom=5cm,width=\textwidth]{geometry}
\RequirePackage{makeidx} \RequirePackage{makeidx}
\RequirePackage{minitoc} \RequirePackage{minitoc}

View File

@ -69,19 +69,28 @@
% The host environment is the same for all new systems % The host environment is the same for all new systems
% %
\def\@raterspec@input@types{ \let\@@madespec0
\PackageWarning{raterspec}{Missing program-specific input parameter types!
\MessageBreak Define using \protect\inputtypes} \def\@raterspec@mkhook#1#2#3#4{
\todo{No input parameter types have been defined.} \expandafter\gdef\csname @raterspec@#1\endcsname{
\PackageWarning{raterspec}{Missing #2!
\MessageBreak Define using \expandafter\protect\csname#1\endcsname}%
\todo{No #2 have been defined.}%
}%
\expandafter\gdef\csname#1\endcsname##1{%
\expandafter\gdef\csname @raterspec@#1\endcsname{%
#3\input{##1}#4%
}%
}%
} }
\def\@raterspec@input@params{ \def\makespec{
\PackageWarning{raterspec}{Missing input parameters! \ifx\@@madespec1%
\MessageBreak Define using \protect\inputparams} \PackageError{raterspec}{Duplicate call to \protect\makespec}
\todo{No input parameters have been defined.} \fi
}
\global\let\@@madespec1
\def\@lvspec@posttitle{
\pnumoff\part{General System}\pnumon \pnumoff\part{General System}\pnumon
\chapter{Host Environment} \chapter{Host Environment}
@ -95,36 +104,38 @@
\section{Program-Specific Parameter Types} \section{Program-Specific Parameter Types}
\sectiondept{it/uw} \sectiondept{it/uw}
\@raterspec@input@types \@raterspec@inputtypes
\index{input data|)} \index{input data|)}
\chapter{Input Parameters} \chapter{Input Parameters}
\index{input data!parameters|(} \index{input data!parameters|(}
\index{parameter|(} \index{parameter|(}
\input{raterspec/sec/params} \input{raterspec/sec/params}
\@raterspec@input@params \@raterspec@inputparams
\index{input data!parameters|)} \index{input data!parameters|)}
\index{parameter|)} \index{parameter|)}
} }
\def\inputtypes#1{ \@raterspec@mkhook{inputtypes}{input types}
\gdef\@raterspec@input@types{ {%
% can't really include a sigline here because approvial would be global % can't really include a sigline here because approvial would be global
\pnumoff \pnumoff
Parameter types in this section are common to the \@title@short\ program. Parameter types in this section are common to the \@title@short\ program.
\pnumon \pnumon
\index{parameter type|(} \index{parameter type|(}
\input{#1}
\index{parameter type|)}
} }
} {\index{parameter type|)}}
\def\inputparams#1{ \@raterspec@mkhook{inputparams}{input parameters}
\gdef\@raterspec@input@params{ {}
\input{#1} {}
}
\AtEndDocument{
\ifx\@@madespec0
\PackageError{raterspec}{\protect\makespec\space was not called}
\fi
} }

View File

@ -24,6 +24,11 @@
\edef\@root{\@ptype@root#1<||}% \edef\@root{\@ptype@root#1<||}%
\edef\@type{\@ptype@type#1<#1>||}% \edef\@type{\@ptype@type#1<#1>||}%
\expandafter\gdef\csname ptype@#2\endcsname{#3}% \expandafter\gdef\csname ptype@#2\endcsname{#3}%
% place definition into aux file; will be available next pass
\protected@write\@auxout{}{%
\string\expandafter\string\gdef
\string\csname\space ptype@#2\string\endcsname{#3}%
}%
% typeset definition with link % typeset definition with link
\item[% \item[%
\hypertarget{@ptype:#2}{#2}% \hypertarget{@ptype:#2}{#2}%
@ -35,7 +40,7 @@
% ensure that the parent type actually exists % ensure that the parent type actually exists
\ifx\@root\@coreptype\else% \ifx\@root\@coreptype\else%
\expandafter\ifx\csname ptype@\@type\endcsname\relax% \expandafter\ifx\csname ptype@\@type\endcsname\relax%
\errmessage{unknown parent param type `\@type' for `#2'} \PackageWarning{raterspec}{unknown parent param type `\@type' for `#2'}
\fi% \fi%
\fi% \fi%
% process any keywords % process any keywords
@ -76,6 +81,13 @@
% define constant % define constant
\expandafter\gdef\csname const@#2\endcsname{#1}% \expandafter\gdef\csname const@#2\endcsname{#1}%
\expandafter\gdef\csname const@value@#2\endcsname{#3}% \expandafter\gdef\csname const@value@#2\endcsname{#3}%
% place definition into aux file; will be available next pass
\protected@write\@auxout{}{%
\string\expandafter\string\gdef
\string\csname\space const@#2\string\endcsname{#1}%
\string\expandafter\string\gdef
\string\csname\space constvalue@#2\string\endcsname{#3}%
}%
% typeset % typeset
\index{constant!{\tt#2}}% \index{constant!{\tt#2}}%
{\tt\hypertarget{@const:#2}{#2}} & $#3$ & #1 \\ {\tt\hypertarget{@const:#2}{#2}} & $#3$ & #1 \\
@ -99,7 +111,7 @@
\def\unionv#1{% \def\unionv#1{%
% does this type exist? % does this type exist?
\expandafter\ifx\csname ptype@#1\endcsname\relax% \expandafter\ifx\csname ptype@#1\endcsname\relax%
\errmessage{unknown param type `#1' for union} \PackageWarning{raterspec}{unknown param type `#1' for union}
\fi% \fi%
\item{\typeref{#1}} \item{\typeref{#1}}
} }
@ -152,7 +164,7 @@
\def\@type@exists@err#1{{% \def\@type@exists@err#1{{%
\expandafter\let\expandafter\@chk\csname ptype@#1\endcsname \expandafter\let\expandafter\@chk\csname ptype@#1\endcsname
\ifx\@chk\relax \ifx\@chk\relax
\errmessage{parameter `#1' is undefined}% \PackageWarning{raterspec}{parameter `#1' is undefined}%
\fi \fi
}} }}
\def\@const@exists@err#1{{% \def\@const@exists@err#1{{%
@ -160,7 +172,7 @@
\@ifnumeric{#1}\else \@ifnumeric{#1}\else
\expandafter\let\expandafter\@chk\csname const@#1\endcsname \expandafter\let\expandafter\@chk\csname const@#1\endcsname
\ifx\@chk\relax \ifx\@chk\relax
\errmessage{constant `#1' is undefined}% \PackageWarning{raterspec}{constant `#1' is undefined}%
\fi \fi
\fi \fi
}} }}
@ -197,10 +209,15 @@
\edef\@root{\@ptype@root#1<||}% \edef\@root{\@ptype@root#1<||}%
\edef\@type{\@ptype@type#1<#1>||}% \edef\@type{\@ptype@type#1<#1>||}%
\expandafter\gdef\csname param@#2\endcsname{#3}% \expandafter\gdef\csname param@#2\endcsname{#3}%
% place definition into aux file; will be available next pass
\protected@write\@auxout{}{%
\string\expandafter\string\gdef
\string\csname\space param@#2\string\endcsname{#3}%
}%
% does the given type exist (note that this check assumes that the typedef % does the given type exist (note that this check assumes that the typedef
% appears before the param in the specs, as is currently the case) % appears before the param in the specs, as is currently the case)
\expandafter\ifx\csname ptype@\@type\endcsname\relax% \expandafter\ifx\csname ptype@\@type\endcsname\relax%
\errmessage{unknown param type: \@type} \PackageWarning{raterspec}{unknown param type: \@type}
\fi% \fi%
% typeset definition with link % typeset definition with link
\item[% \item[%
@ -240,7 +257,7 @@
\endlinechar-1\relax \endlinechar-1\relax
\expandafter\let\expandafter\@@chk\csname param@#1\endcsname \expandafter\let\expandafter\@@chk\csname param@#1\endcsname
\ifx\@@chk\relax \ifx\@@chk\relax
\PackageError{dwspec}{unknown param: #1} \PackageWarning{raterspec}{unknown param: #1}
\fi \fi
\index{parameter!#1@\texttt{#1}}% \index{parameter!#1@\texttt{#1}}%
\hyperlink{@param:#1}% \hyperlink{@param:#1}%
@ -252,7 +269,7 @@
\def\paramrefd#1{% \def\paramrefd#1{%
\expandafter\let\expandafter\@@pchk\csname param@#1\endcsname \expandafter\let\expandafter\@@pchk\csname param@#1\endcsname
\ifx\@@pchk\empty \ifx\@@pchk\empty
\PackageError{dwspec}{Unknown parameter: #1}% \PackageWarning{raterspec}{Unknown parameter: #1}%
\else \else
% output % output
\@@pchk \@@pchk

View File

@ -76,6 +76,7 @@ parameter types}.
\typedef core int: \typedef core int:
Any signed 32-bit integer Any signed 32-bit integer
\end{description} \end{description}
\index{parameter type|)} \index{parameter type|)}