-
Notifications
You must be signed in to change notification settings - Fork 0
The basics
The syntax is really easy to grasp (for the most part) let's see a line with a more.... natural language to represent the syntax
PRINT ( ADD ( 1 2 3 ) );
So each line is an instruction, for this line the main instruction is PRINT
which is... yeah it prints the arguments must be between parenthesis each separated by a blank character, the argument(s) for this instruction is ADD ( 1 2 3 )
which is another instruction !
Because yeah of course for it to be a proper language instructions must be allowed to be passed as arguments of another instruction, the instruction add, add the value of the number inside, now please note that the distinction between integers ( like 1 ) and floats ( like 1.3 ) do exists because of the distinction existing in OCaml but the Baguette# interpreter does not care about the difference, the result is automatically converted to the most appropriate data type which is int if the number is whole ( like 1, or 34. ) and float if the number is not ( like 3.14 ). The result of the ADD
instruction is 6
which is then printed so the result of the line is the value 6 being printed.
Please note that only the parenthesis and quotes are check pre-compilation ( or pre-interpretation ) you'll receive errors at runtime.
Since the last update keywords were added for labels, gotos, and if ( and only in these situations !) and adopt the following syntax:
LABEL "name"
BEGIN
..
..
..
END;
GOTO "name";
and
IF <condition>
THEN BEGIN
...
...
END;
Now it would be utterly uninteresting if the language was just that ( well it would be exactly the same for me but it would be a lot less funnier for you ! ) so for the basic here is the table for the base of the language, pages will be uploaded ( and updated ) later to describe instructions by topic
- The
(
isCHOUQUETTE
- The
)
isCLAFOUTIS
- The
"
arePARISBREST
- The
;
is of courseBAGUETTE
- The
[
isBABAAURHUM
- The
]
isCHARLOTTEAUXFRAISES
- The
{
isCRUMBLE
- The
}
isSCHNECKENKUCHEN
- Keyword
BEGIN
isMUFFIN
- Keyword
END
isCOOKIES
- Keyword
LABEL
isICECREAM
- Keyword
IF
isSABLE
- Keyword
THEN
isFRAMBOISIER
- Keyword
GOTO
isPAINVIENNOIS