D.2 Grammar

The grammar in EBNF for Camille (version 4.0) is given in Figure D.1. Comments in Camille programs begin with three consecutive dashes (i.e., ---) and continue to the end of the line. Multi-line comments are not supported. Comments are ignored by the Camille scanner. Camille can be used for functional or imperative programming, or both. To use it for functional programming, use the <program> ::= <eχpression> grammar rule; to use it for imperative programming, use the <program> ::= <statement> rule. User-defined functions are first-class entities in Camille. This means that a function can be the return value of an expression (i.e., an expressed value), can be bound to an identifier and stored in the environment of the interpreter (i.e., a denoted value), and can be passed as an argument to a function. As the production rules in Figure D.1 indicate, Camille supports side effect (through variable assignment) and arrays. The primitives array, arrayreference, and arrayassign create an array, dereference an array, and update an array, respectively. While we have multiple versions of Camille, each supporting varying concepts, in version 4.0

A table of the grammar in E B N F for the Camille programming language.

Figure D.1 The grammar in EBNF for the Camille programming language (Perugini and Watkin 2018).

Description
Two equations. Expressed value equals integer union string union closure. Denoted value equals reference to an expressed value.

Thus, akin to Java or Scheme, all denoted values are references, but are implicitly dereferenced. For more details of the language, we refer the reader to Perugini and Watkin (2018). See Appendix E for the individual grammars for the progressive versions of Camille.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.219.228.88