PNF: Calling Method After Extending Object Causes Crash


Joined
Sep 14, 2022
Messages
17
Reaction score
0
Im not on my computer now, but my phone. Forgive me. Im working on a language tool set. Im adding objects to it, like in C++.

When i call a method, after i publicly inherit from another class, i cant call an inherited method, without a crash. This only happens when i make an instance of the class.

Error is function not found. It happens in my ICLASSMETHODECALL instruction.

Im guessing that function_stack::find is broken?

You can see code at www.github.com/smileynet000/PNF

Also, example i used is in bin directory. Might need linux to run.
 
Ad

Advertisements

Joined
Sep 14, 2022
Messages
17
Reaction score
0
Forgot to specify. The code that crashes, is in the language being defined, not C++, which it's written in. The error causing it, is in C++, as that's the language the program is written in. The file the instruction is in, is pnf.hpp, located in the source directory, and LINUX. It compiles under g++. Don't know if it would compile in Microsoft C++ or not, but it probably will with a few minor changes if any.

It is one of my controlled crashes. Only its not supposed to crash with that input, it's supposed to print "Hello World!" on the screen again. Thus far, I'm stumped. I've added some output for troubleshooting.
 
Joined
Sep 14, 2022
Messages
17
Reaction score
0
I fixed a bug in the READ instruction. I'd broke it. Now it's working again. But it requires asking for the newest version in order for it to work though...

I'm going to continue adding some stuff to this release. I'm adding actual loops to the lower levels now.

I haven't decided yet, but I MAY, release without fixing this issue, and just have it be a known bug, that objects don't work. There's lots of features that will work, so it "could" be good.
 
Joined
Sep 21, 2022
Messages
39
Reaction score
4
Why continue to use C++?

The PNF interpreter exists, the PNFASM assembler exists.

Why not write the PNFHA compiler, and all future programs, in PNFASM?

Or, write a simple version of the compiler in PNFASM, then use that to write the full version.
 
Ad

Advertisements

Joined
Sep 14, 2022
Messages
17
Reaction score
0
Why continue to use C++?

The PNF interpreter exists, the PNFASM assembler exists.

Why not write the PNFHA compiler, and all future programs, in PNFASM?

Or, write a simple version of the compiler in PNFASM, then use that to write the full version.

I want to get to that point, and I'm close to having enough features to do so. To start with, when it's ready, my plan will be to keep the other source code, just in case, however, restart PNF in PNFHA.

To start with though, PNFHA needs to be updated first. I don't think it yet has all relevant features in PNF (and also PNFASM). I need to add those first.

Second, one other reason I'm close, but not yet doing it: Objects. C++ has the class, while mine is only beginning to get the class. I know of a way to kludge the C language, and consequently, the PNF language, if I first fix PNFHA. Unfortunately, it's more error prone. Structs cannot contain methods in my language either. They are not meant to. And they can't do inheritance. At the very least, it would work better if I could do those things first. It's pretty close.

Once I can do those things, and have an object or two in my languages, and maybe my feeling feature as well, I'll be ready to do it. Just not quite yet. First, I have a few bugs to finish before it's a good idea. By the way, my bugs would carry over to the language, so if READ doesn't work, it won't work when I try to use my language either. Like I said, pretty close though.

Eventually, I want to see about modifying gcc/g++, to be able to generate my language, when told to. Then, I have a choice of languages as well as PNFHA. However, some stuff, like PNFHA, are really difficult to write without a compiler compiler, which mine is not. I can get to the point where I write one of those too, but now is not when. By the way, for those, I can start to use biflex, though, which is something else I've written. I just haven't took the time to work on that yet, but I will.

It's a long way from ALL future things, but some I can use my language for, and more when I finish this process. When it's rewritten, possibly, as much as C++ and some of the ones that java can be used for.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top