|
If your goal is to make it work, I strongly suggest a simple recursive descent parse (hand rolled)
Your grammar is tiny, man. And dice roll syntax is not going to change. It's not a programming language - there's nothing to evolve. So maintenance wise, as a former software architect by trade, I'd advise against employing said tool.
The rationale being it's at least as, if not easier to write the parser by hand rather than complicate your build process (even slightly)
But if your goal is to learn how to use a parser generator than keep going this route.
Either way, I'll continue to help. But i could have written that recursive descent dice parser 6 times over by now. =)
Your dice grammar is a keeper in any case, as i like things that break my code.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
I want a RPG player to type it, not a programmer to carefully enter it...
TinyPG work already! :P
Just trying your syntax out of curiosity!
|
|
|
|
|
ah, well if you have TryParse already built, then you're done. My code is too broken right now for me to be much help. It's the error reporting that isn't working, but it's necessary. It's also somewhat mroe difficult than I had expected.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
Don't stress it...
I am using your parser out of curiosity, not necessity!
I am glad it helps you, and I am curious to know when it (will) work.
Meanwhile I am doing some totally different things and I am not even block in anyway, I already have another (working) implementation, if it were needed!
|
|
|
|
|
Cool. Yeah it parses okay. It's problem is it used to throw on the first error (easy)
I extended it to be able to error and continue. That made it brittle.
So basically i need to start that part over, and work error and continue in from the jump.
The other issue was it wasn't doing all the factoring it needed to, but that wasn't a problem here really. However, it did set me back some since I needed to add that in before i got too deep in reworking the parser. It gave me an opportunity to verify the parse table construction and conflict detection as well, which was a good thing, although it worked fine before.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
All the way you have to come to be here!
Nice keep up the good work! ^_^
|
|
|
|
|
I found the bug!
Well at least I found a clear cut critical bug.
The data structure is ... in need of change, that's gonna be some work... :/
Oh well.. maybe it will work after that?!
|
|
|
|
|
It's a slog man.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
also it's easy to make a recursive descent parser handle errors. my regexlib does that with regex expressions. matches parens and all that.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
To give you an idea of where i draw the line in terms of when I'll bring in the big guns - aka a parser generator:
When a grammar is more complex than say, JSON or regex.
Each of which I can write a recursive descent parser for in under an hour without rushing.
Your dice grammar is less complex than either by a significant margin, which is why i've wondered why you're using a generator for this.
It's a bit heavy handed.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
well.. I was wondering how to parse all those dice expression, in any order, with space and ambiguous syntax.
parser generator seemed like the easiest solution.
from start, to reading about the syntax, to test, to finish took me one hour.
One hour well spent if you ask me!
|
|
|
|
|
But you haven't parsed it into the tree, and the way the tree is looking that's going to be a bear.
Your tree doesn't quite look like what you need it too. Esp when I load into my grammar the diceExprs should usually be diceSets but when i try to build the grammar that way i get an LL(1) conflict.
I don't know what the trees look like in TinyPG.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
I've been reading an excellent book (ok, imo), Possible Minds.
The book offers 25 thoughtful perspectives concerning AI and the impacts it could have on humanity.
There are two camps:
1) AI is a potential existential threat.
2) AI is nothing to worry about; we know what we're doing and we can control it.
It seems like we are in a moment similar to the one just after the Manhattan Project produced the first nuclear bombs - humans were in possession of and using a power we really didn't fully understand.
We create something that kind of feels like 1), but then we collectively act like it's 2).
From your perspective as a software developer, what camp do you fall in? If neither, define your own.
Cheers,
Mike Fidler
"I intend to live forever - so far, so good." Steven Wright
"I almost had a psychic girlfriend but she left me before we met." Also Steven Wright
"I'm addicted to placebos. I could quit, but it wouldn't matter." Steven Wright yet again.
|
|
|
|
|
It's not the AI that worries me, it's the people creating the AI and influencing them in their decision making. Remember GIGO!
- I would love to change the world, but they won’t give me the source code.
|
|
|
|
|
Forogar wrote: It's not the AI that worries me, it's the people creating the AI and influencing them in their decision making. Remember GIGO QA!
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Forogar wrote: Remember GIGO! Wasn't that a Madonna movie?
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
Can you imagine if Clippy had become self-aware?
'Nuff said.
The Beer Prayer - Our lager, which art in barrels, hallowed be thy drink. Thy will be drunk, I will be drunk, at home as it is in the tavern. Give us this day our foamy head, and forgive us our spillage as we forgive those who spill against us. And lead us not to incarceration, but deliver us from hangovers. For thine is the beer, the bitter and the lager, for ever and ever. Barmen.
|
|
|
|
|
Quote: Can you imagine if Clippy had become self-aware? "It looks like you are attempting to destroy all life on Earth. Let me do that for you."
- I would love to change the world, but they won’t give me the source code.
|
|
|
|
|
In my student days, I bought a book for one single reason - its title: "Machines who think".
Considering how long ago that is, I am not holding my breath while waiting for the self-aware machines.
If you really want to loose your sleep over such issues: Pick up some of the SciFi novels by James P. Hogan, such as "The two faces of tomorrow" or "Realtime interrupt". "Two faces" is from my student days as well ("Realtime" is more recent), but Hogan had the top AI experts at C-M and MIT review his manuscripts: Even today they hold water, seen from a professional perspective. Obviously, we have extended our understanding since the books were written, but the knowledge on which the books are built is essentially still "correct". Both books are higly recommended.
|
|
|
|
|
MikeTheFid wrote: It seems like we are in a moment similar to the one just after the Manhattan Project produced the first nuclear bombs
And that's the difference. We had nuclear bombs.
AI? Give me a break. Show me something that actually can be described as artificial intelligence --
something that can perceive the world, contemplate an action, and have the means to interact with the physical world to implement that action. And implement it in a way poses a threat to anything (but you won't get past the first condition.)
What, are all those self-driving cars going to suddenly join Lyft and go on strike?
Even the tragic Boeing crashes are not an AI running amok but a poorly programmed expert system. As in, some intelligence on the plane didn't suddenly say, "hey, let's go kill some people."
There is no AI. There is no "Intelligence" - sure, we have extremely limited systems that can learn and adapt, that require huge training sets that result in a complex weighted network. You call that thinking? You call that intelligence? A worm is smarter.
Latest Article - A 4-Stack rPI Cluster with WiFi-Ethernet Bridging
Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny
Artificial intelligence is the only remedy for natural stupidity. - CDP1802
|
|
|
|
|
Marc Clifton wrote: There is no AI.
Exactly. The majority of people on earth do not understand this.
|
|
|
|
|
If I'm reading this I'm asking me: Is there intelligence at all?
It does not solve my Problem, but it answers my question
modified 19-Jan-21 21:04pm.
|
|
|
|
|
Slacker007 wrote: The majority of people on earth do not understand this.
Sadly, the majority of people on earth lack the intelligence to understand this. How ironic.
Latest Article - A 4-Stack rPI Cluster with WiFi-Ethernet Bridging
Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny
Artificial intelligence is the only remedy for natural stupidity. - CDP1802
|
|
|
|
|
The thing a lot of people forget is that we are machines ourselves. We're (very complex) multi-celled organisms, that at some point got our "singularity" and became self-aware.
At some point, that will happen to the very advanced AI, whether we like/believe it or not. And I have a feeling it's not going to be pretty.
|
|
|
|
|
Computers only do EXACTLY what they are told to do. So, no, there is no threat unless a programmer programs it to make poor choices.
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|