From c63fa2bbbdde21fb45ea98e3c69bbddbf25097a5 Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Thu, 29 Oct 2020 17:26:20 -0600 Subject: start to elaborate on syntax --- language/index.rst | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 language/index.rst (limited to 'language/index.rst') 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 -- cgit v1.2.3