Computers aren't capable of abstraction - only logic. To think like a CPU, you'd only have one of two thoughts: 1 or 0.Zach wrote:My main problem is learning to thinking like a CPU I guess, and in very abstract and logical terms.
Verb-Noun parser?
Re: Verb-Noun parser?
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 
-
Zach
- Addict

- Posts: 1678
- Joined: Sun Dec 12, 2010 12:36 am
- Location: Somewhere in the midwest
- Contact:
Re: Verb-Noun parser?
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"
Re: Verb-Noun parser?
Yes, I do.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"
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 
-
Zach
- Addict

- Posts: 1678
- Joined: Sun Dec 12, 2010 12:36 am
- Location: Somewhere in the midwest
- Contact:
Re: Verb-Noun parser?
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
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