From 8868b5fa2e8b9f40a31035c51519cce40e73f079 Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Mon, 2 Nov 2020 13:37:32 -0700 Subject: define compile-time vs runtime behavior --- language/statements/variables.rst | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 language/statements/variables.rst (limited to 'language/statements/variables.rst') 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. -- cgit v1.2.3