diff options
Diffstat (limited to 'language/statements/variables.rst')
-rw-r--r-- | language/statements/variables.rst | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/language/statements/variables.rst b/language/statements/variables.rst new file mode 100644 index 0000000..6bc1a6f --- /dev/null +++ b/language/statements/variables.rst @@ -0,0 +1,24 @@ +Variables +^^^^^^^^^ + +.. crowbar:element:: VariableDeclaration <- Type identifier ';' + + Compile-time Behavior: + + A variable declaration specifies the type and name of a variable but not its initial value. + This is only used in :crowbar:ref:`HeaderFile`\ s as part of API boundaries. + + Runtime Behavior: + + A variable declaration has no runtime behavior. + +.. crowbar:element:: VariableDefinition <- Type identifier '=' Expression ';' + + Compile-time Behavior: + + A variable definition specifies the type, name, and initial value of a variable. + If the expression has a type which is not the type specified for the variable, an error must be emitted. + + Runtime Behavior: + + When a variable definition is executed, the expression is evaluated, and its result is made available with the given name. |