From 5af481d62df80d8be3f5835042d30372ef9cbe04 Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Sat, 31 Oct 2020 21:59:00 -0600 Subject: define and annotate some language elements --- language/source-file.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 language/source-file.rst (limited to 'language/source-file.rst') diff --git a/language/source-file.rst b/language/source-file.rst new file mode 100644 index 0000000..6522ea8 --- /dev/null +++ b/language/source-file.rst @@ -0,0 +1,17 @@ +Source Files +------------ + +.. crowbar:element:: HeaderFile <- IncludeStatement* HeaderFileElement+ +.. crowbar:element:: HeaderFileElement <- TypeDefinition / FunctionDeclaration / ConstantDefinition / UninitializedVariableDeclaration + + A Crowbar header file defines an API boundary, either at the surface of a library or between pieces of a library or application. + :crowbar:ref:`IncludeStatement`\ s can only appear at the beginning of the header file, and header files cannot define behavior directly. + Conventionally, a header file has a ``.hro`` file extension. + +.. crowbar:element:: ImplementationFile <- IncludeStatement* ImplementationFileElement+ +.. crowbar:element:: ImplementationFileElement <- TypeDefinition / VariableDefinition / FunctionDefinition + + A Crowbar implementation file defines the actual behavior of some piece of a library or application. + It can also define internal types, functions, and variables. + :crowbar:ref:`IncludeStatement`\ s can only appear at the beginning of the implementation file. + Conventionally, an implementation file has a ``.cro`` file extension. -- cgit v1.2.3