Toggle navigation
Home
Blog
Carnivorous Plants
Critter Camera
Publications
Projects
Project Supervision
Courses
ChagaLite Programming Language
About
ChagaLite is a subset of the
Chaga
programming language.
ChagaLite is an interpreted language.
Language specifications
Backus-Naur Form (BNF) for the ChagaLite programming language
I will be posting the BNF for this language at a future date. It will be a subset of the BNF grammar for the Chaga Programming Language
ChagaLite programming language datatypes
bool
: This datatype stores a TRUE or FALSE Boolean value. The bool datatype can be utilized in an array.
char
: This datatype stores one unsigned byte.
int
: This datatype stores arbitrarily large or small integer values.
ChagaLite programming language metadata datatype attribute
Every datatype in the ChagaLite programming language contains the metadata attribute,
.self
.self
: this attribute refers to a variable's own metadata values.
The
.self
attribute has the following additional values:
.datatype
: this attribute defines the datatype of variables. Possible values are: {bool, char, string, int, float, file, ptr}.
.length
: the length attribute defines the maximum storage length (in bytes) of the datatype. The unary plus, unary minus, and decimal point ARE included in the length calculation for float. The unary plus and unary minus ARE included in the length calculation for integer.
Functions and Procedures
Functions and procedures enable one to modularly break a program into parts.
Functions return a datatype value to the calling program.
Procedures do not return a value to the calling program.
A minimum Chaga program
At a minimum, a ChagaLite program must contain a procedure named "main" defined as
procedure main (void) {}
Optional program statements may be included inside the statement block denoted within the curly braces.
The main procedure may not contain input parameters. It must be be defined with a void parameter.
Example programs
Compute fibonacci sequence
Convert hexadecimal to integer
Determine palindrome
Fizz buzz
Parameter passing string variables
Sum of first n squares
BNF derivations
BNF derivation: Convert hexadecimal to integer
BNF derivation: Determine palindrome
BNF derivation: Parameter passing string variables
BNF derivation: Sum of first n squares
Tentative features to add
Statements
Add support for variable increment statement (postfix), example: i++
Add support for variable increment statement (prefix), example: ++i
Add support for variable decrement statement (postfix), example: i--
Add support for variable decrement statement (prefix), example: --i
Add support for variable increment statement, example: i += 1
Add support for variable decrement statement, example: i -= 1