aboutsummaryrefslogtreecommitdiff
path: root/language/index.rst
diff options
context:
space:
mode:
authorMelody Horn <melody@boringcactus.com>2020-10-29 17:26:20 -0600
committerMelody Horn <melody@boringcactus.com>2020-10-29 17:26:20 -0600
commitc63fa2bbbdde21fb45ea98e3c69bbddbf25097a5 (patch)
treecb353675f554c67bacc8461f2dc0cb2ff9fac875 /language/index.rst
parent09d5c19296d6a1c7e58f995c5647500720b0a8e2 (diff)
downloadspec-c63fa2bbbdde21fb45ea98e3c69bbddbf25097a5.tar.gz
spec-c63fa2bbbdde21fb45ea98e3c69bbddbf25097a5.zip
start to elaborate on syntax
Diffstat (limited to 'language/index.rst')
-rw-r--r--language/index.rst26
1 files changed, 26 insertions, 0 deletions
diff --git a/language/index.rst b/language/index.rst
new file mode 100644
index 0000000..79702c5
--- /dev/null
+++ b/language/index.rst
@@ -0,0 +1,26 @@
+Language
+========
+
+The syntax of Crowbar is designed to be similar to the syntax of C.
+
+A Crowbar source file is UTF-8.
+Crowbar source files can come in two varieties:
+
+.. glossary::
+
+ header file
+ A Crowbar source file declaring types and functions.
+ Can be intended for internal use within a project, or to define the public API of a library.
+ Conventionally has the ``.hro`` file extension.
+
+ implementation file
+ A Crowbar source file providing function definitions, and sometimes its own type declarations.
+ Conventionally has the ``.cro`` file extension.
+
+A Crowbar source file is read into memory in two phases: *scanning* (which converts text into an unstructured sequence of tokens) and *parsing* (which converts an unstructured sequence of tokens into a parse tree).
+
+.. toctree::
+ :maxdepth: 1
+
+ scanning
+ flow-control