aboutsummaryrefslogtreecommitdiff
path: root/language/index.rst
blob: 79702c52756e165bae4a8b6b4d63dabc2d67af49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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