PNF: Result is 0
I am creating a language in C++. It is called PNF (Portable Numbers Format). It is pretty well developed. Except for because I was creating a new language on top of it, called PNFHA (Portable Numbers Format High Level Language A), I needed new features in PNF, and therefore also PNFASM (Portable Numbers Format Assembler). I needed some new instructions and entirely new features.
I needed Ranges, Enums, and Arrays. I am working on Arrays right now. I am on the other instructions needed for Arrays. I am trying to load and store to/from an Array.
The problem is that whatever I store in it, the result comes back binary 0 (as far as binary 0 is concerned in this language). The type of the variable is TVOID, and that is why the result is 0.
There are 5 basic types in PNF. They are:
TVOID
TBOOLEAN
TNUMBER
TCHARACTER
TSTRING
It "should" come back as whatever type I try to put in it, and whatever value I try to put in it.
I think I know WHAT the problem is, but I don't know where it is. The problem is probably that somewhere the PNF_Variable uses the default constructor to construct it, and then is left alone. Whatever constructor it uses, it should NOT be left alone. It should be filled with the appropriate values. Somehow, this is giving the result as above.
How can I use the write technique to isolate where this is going wrong? Or are there any better debugging strategies I can use? If so, what are they and how do you go about them?
If you think you know where the problem is, please also post that. Note that this is a very large and complicated program by now. It was created by just me, but it is very large and complicated. Thanks in advance!
|