Verb-Noun parser?

Everything else that doesn't fall into one of the other PB categories.
User avatar
TI-994A
Addict
Addict
Posts: 2791
Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore
Contact:

Re: Verb-Noun parser?

Post by TI-994A »

Zach wrote:My main problem is learning to thinking like a CPU I guess, and in very abstract and logical terms.
Computers aren't capable of abstraction - only logic. To think like a CPU, you'd only have one of two thoughts: 1 or 0. :lol:
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel :D
Zach
Addict
Addict
Posts: 1678
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: Verb-Noun parser?

Post by Zach »

yeah but you know what I meant. Things are inherently abstract to a computer. A variable exists, but it doesn't know what it means outside of the context of "This is my value"
User avatar
TI-994A
Addict
Addict
Posts: 2791
Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore
Contact:

Re: Verb-Noun parser?

Post by TI-994A »

Zach wrote:yeah but you know what I meant. Things are inherently abstract to a computer. A variable exists, but it doesn't know what it means outside of the context of "This is my value"
Yes, I do. :P

But even variables are out of its scope of comprehension. It only knows 1's and 0's - or more accurately, on and off.
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel :D
Zach
Addict
Addict
Posts: 1678
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: Verb-Noun parser?

Post by Zach »

Just thinking out loud..

I've been staring at my code for a week, and I think I will attempt a different parsing instead of trying to match multiple grammars to a single command.
It may be easier for me to come up with a reduction based solution. Define a single base grammar for a given command, and then process the string left to right, removing superfluous words, while keeping matched words and proceeding forward in the string. So I guess you either end up with a successful execution, or throw an error.

Of course in hindsight I could probably extend what I have now to do that; I guess there could be room for several grammar types, which would lead to extra processing on the downside (process the string for each definition)

It will still have some caveats I guess, but will probably be the easiest way for me to come up with something.
So we'll see how I do with that :|
Post Reply