-
In my ArabicBASIC interpreter I started out with a single symbol table which actually performed several roles: storing symbols and their associated values. The first role is indeed the symbol table’s role, but the second really belongs to the concept of scope. Scope not only keeps track of a symbol’s value, it also tracks where
-
In the middle of writing my interpreter for ArabicBASIC, I was testing the expression grammar. I accidentally forgot a parenthesis which gave me an expression like “LET A = ((2 + 3) * 4“. Notice how the parentheses are mismatched: the final one after the 4 is missing. This should have provoked an error, but
-
I was adding to my list of prior art for my ArabicBASIC project last week when I encountered a new-to-me project which implements a Javascript-like language in Pakistan’s national language, Urdu. This immediately caught my attention because Urdu is traditionally written in a modified Arabic alphabet. This language is appropriately called UrduScript and it runs
-
Writing grammars in BNF is actually kind of fun! Conforming to specifications is not. Let me explain: It’s possible to write grammars with trees of rules, some of which don’t actually do much other than to eventually create grouping nodes in the parse tree. ECMA-116 is just one such rabbit-hole grammar, I’d say: That’s very
-
Last time I promised that I would reveal my interpreter’s implementation language. And, here it is: Java. I chose Java for several reasons. The first reason is because Java is what ANTLR4 itself is written in. Secondly, the Java runtime library used by the generated tokenizer and parser gets new features first. I get the
-
I have to retool my Arabic BASIC interpreter, but in which compilable language should I use to implement the lexer, tokenizer and parser?
-
Internally, it’s called PyList_Append and it returns an integer, which is used as a success vs. failure flag. But for now, let’s skip going down that rabbit hole, and instead focus on how it adds an element to a List. We can see that the real work seems to be done by app1() (1) which
-
I’ve used Strawberry Perl on my Windows XP and Windows 7 dev rigs for several years now. It includes MingW to compile C code in any CPAN modules which use it for speedups. Some CPAN modules will not install without it if they do not have pure-Perl (PP) versions. Now, about Python. Recently, I began
-
First Try I started with a simple while loop: Surely, this is non-optimal: how many times will this loop run? 1000? Surely we can reduce it! Possible optimizations include: Start at 3 instead of 0! Surely we can skip numbers if we do find a multiple of 3 or 5? That is, keep adding 3
-
Here I am coding up some exercises in my first love of a language, Perl (Its the CPAN, I tell you). In my console, I kept getting a strange result: Hi Fred! You are the first one here! 1 Hi Barney! I’ve also seen Fred here! 2 Hi Wilma! I’ve also seen Fredand Barney here!