Stage 65
Posted: Sun Nov 21, 2021 6:05 pm
The SharpBASIC compiler is in its early stages and not yet ready for custom testing. Currently, string manipulation is being implemented and there is good news on this front: three string types are supported, constant and variable strings, which are null-terminated, and fixed length strings, which are not null-terminated. Variable and fixed length strings have a descriptor in the format [addr-size] whereby the size of variable length strings is always set to null and the size of fixed length strings is the actual length as declared in the dim-statement.
The development of the compiler took off in early 2020 (stages 1-64) with the development of the tokenizer, the lexer, the parser and the assembly emitter. The numeric expression parser, including type checking, was developed at the same time. From June 2020 to October 2021 the development was paused due to the corona crisis.
Code: Select all
const con = "hello"; ' null terminated, no descriptor
dim var: string = "Sharp"; ' null terminated and descriptor [addr:0]
dim fix: string*5 = "BASIC"; ' not null terminated and descriptor [addr:5]