Document treatment of several Matlab statements in one line.
Manually cherry-picked from 20b51b3c08
.
time-shift
parent
0dfa2546ab
commit
ca9cae7226
|
@ -496,3 +496,10 @@ expect. Hence, it throws an error of the form: ``ERROR: <<file.mod>>:
|
||||||
line 2, cols 0-9: syntax error, unexpected PARAMETERS``. In this case,
|
line 2, cols 0-9: syntax error, unexpected PARAMETERS``. In this case,
|
||||||
you would simply place a semicolon at the end of line one and the
|
you would simply place a semicolon at the end of line one and the
|
||||||
parser would continue processing.
|
parser would continue processing.
|
||||||
|
|
||||||
|
It is also helpful to keep in mind that any piece of code that does not violate
|
||||||
|
Dynare syntax, but at the same time is not recognized by the parser, is interpreted
|
||||||
|
as native Matlab code. This code will be directly passed to the ``driver`` script.
|
||||||
|
Investigating ``driver.m`` file then helps with debugging. Such problems most often
|
||||||
|
occur when defined variable or parameter names have been misspelled so that Dynare's
|
||||||
|
parser is unable to recognize them.
|
||||||
|
|
|
@ -19,6 +19,13 @@ A model file contains a list of commands and of blocks. Each command
|
||||||
and each element of a block is terminated by a semicolon (;). Blocks
|
and each element of a block is terminated by a semicolon (;). Blocks
|
||||||
are terminated by ``end;``.
|
are terminated by ``end;``.
|
||||||
|
|
||||||
|
If Dynare encounters an unknown expression at the beginning of a line
|
||||||
|
or after a semicolon, it will parse the rest of that line as native
|
||||||
|
Matlab code, even if there are more statements separated by semicolons
|
||||||
|
present. To prevent cryptic error messages, it is strongly recommended
|
||||||
|
to always only put one statement/command into each line and start a
|
||||||
|
new line after each semicolon.
|
||||||
|
|
||||||
Most Dynare commands have arguments and several accept options,
|
Most Dynare commands have arguments and several accept options,
|
||||||
indicated in parentheses after the command keyword. Several options
|
indicated in parentheses after the command keyword. Several options
|
||||||
are separated by commas.
|
are separated by commas.
|
||||||
|
@ -424,7 +431,7 @@ symbol name with a vertical line (``|``, pipe character) and either an ``e``, an
|
||||||
``alphaa`` in the model block, you could write ``alphaa|p`` directly in
|
``alphaa`` in the model block, you could write ``alphaa|p`` directly in
|
||||||
an equation where it appears. Similarly, to declare an endogenous variable
|
an equation where it appears. Similarly, to declare an endogenous variable
|
||||||
``c`` in the model block you could write ``c|e``. Note that in-equation
|
``c`` in the model block you could write ``c|e``. Note that in-equation
|
||||||
on-the-fly variable declarations must be made on contemporaneous variables.
|
on-the-fly variable declarations must be made on contemporaneous variables.
|
||||||
|
|
||||||
On-the-fly variable declarations do not have to appear in the first place where
|
On-the-fly variable declarations do not have to appear in the first place where
|
||||||
this variable is encountered.
|
this variable is encountered.
|
||||||
|
|
Loading…
Reference in New Issue