Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
preprocessor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dynare
preprocessor
Commits
09a9a4e9
Commit
09a9a4e9
authored
1 year ago
by
Johannes Pfeifer
Browse files
Options
Downloads
Patches
Plain Diff
preprocessor.tex: add slides on verbatim block and command line options
parent
1ad7dd96
Branches
Branches containing commit
No related tags found
1 merge request
!94
preprocessor.tex: add slides on verbatim block and command line options
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/preprocessor/preprocessor.tex
+53
-0
53 additions, 0 deletions
doc/preprocessor/preprocessor.tex
with
53 additions
and
0 deletions
doc/preprocessor/preprocessor.tex
+
53
−
0
View file @
09a9a4e9
...
@@ -107,6 +107,26 @@
...
@@ -107,6 +107,26 @@
\end{witemize}
\end{witemize}
\end{frame}
\end{frame}
\begin{frame}
[fragile]
\frametitle
{
Command line options in the mod-file
}
\begin{witemize}
\item
Command line options can alternatively be defined in the first line of the .mod file
\item
Avoids to always have to invoke an option at the command line
\\
$
\rightarrow
$
particularly useful for the
\texttt
{
nostrict
}
option during the development phase of a model
\item
Definition must be
\begin{itemize}
\item
a one-line Dynare comment, i.e. begin //
\item
the options must be enclosed in
\texttt
{
----+ options:
}
and
\texttt
{
+----
}
and must be whitespace separated
\item
As in the command line, if an option admits a value, the equal symbol must not be surrounded by spaces
\end{itemize}
\begin{block}
{
Example
}
\begin{verbatim}
// --+ options: json=compute, stochastic, nostrict +--
\end{verbatim}
\end{block}
\end{witemize}
\end{frame}
\section
{
Macro processing
}
\section
{
Macro processing
}
\begin{frame}
\begin{frame}
...
@@ -136,6 +156,39 @@
...
@@ -136,6 +156,39 @@
\end{witemize}
\end{witemize}
\end{frame}
\end{frame}
\begin{frame}
[fragile]
\frametitle
{
Undesired Parsing
}
\begin{witemize}
\item
Dynare will try to parse all tokens it recognizes
\item
Code not recognized by the parser is directly passed to the preprocessor output
\\
$
\rightarrow
$
allows using MATLAB/Octave commands directly in the mod-file
\item
Causes problems when one wants to invoke commands containing recognized tokens
\end{witemize}
\end{frame}
\begin{frame}
[fragile]
\frametitle
{
Bypassing the parsing
}
\begin{witemize}
\item
The
\texttt
{
verbatim
}
block instructs Dynare not to parse text contained in it
\item
In the following example,
\texttt
{
stoch
\_
simul
}
would otherwise be recognized as a Dynare command during parsing
\end{witemize}
\begin{block}
{
Verbatim example
}
\begin{verbatim}
verbatim;
rhos = [ 0.8, 0.9, 1];
for iter = 1:length(rhos)
set
_
param
_
value('rho',rhos(iter));
[info, oo
_
, options
_
, M
_
] = stoch
_
simul(M
_
, options
_
, oo
_
, var
_
list
_
)
if info(1)~=0
error('Simulation failed for parameter draw')
end
end
end;
\end{verbatim}
\end{block}
\end{frame}
\begin{frame}
\begin{frame}
\frametitle
{
1.
\
Lexical analysis
}
\frametitle
{
1.
\
Lexical analysis
}
\begin{witemize}
\begin{witemize}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment