|
|
I figured out an abbreviated way I think, to compute a k value for a given grammar, without computing the k for every rule.
This is important because it makes lookahead computation for a grammar much more realistic in terms of resources used.
Now, I'm not the only one to come up with an optimization to the general LL(k) algorithm. A lot of people have come up with their own. This is part of mine.
What's interesting here is, if it works, and right now I assume it will, then I will have a viable LL(k) parser.
What's more interesting is the math here. I never got taught formally, but so many people with so many optimizations suggests there's an underlying "better way" to compute all this.
And given all the evolution of the subfield since Wirth, it wouldn't surprise me. As math goes, it moves pretty rapidly in terms of advancement. Over the last several decades the math of parsing has gotten more sophisticated and more realistic at the same time, although the underlying problem domain is unchanged.
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.
|
|
|
|
|
codewitch honey crisis wrote: I figured out an abbreviated way I think
I first read that as you had figured out an abbreviated way to think!
I'm curious, knowing absolutely nothing about your field but read your posts with interest, is there a mathematical way to prove that algorithm is better? Or, probably more importantly, is actually sound?
|
|
|
|
|
yes, but it's above my paygrade. My education is spotty. I was a homeless teen before landing at microsoft at 18 so I never got a formal education in maths.
There are holes in my knowledge. So I can tell you for sure, that yes there's a mathematical way to prove that it works, and to prove that it's "better" (more efficient) but I couldn't tell you what it was beyond maybe some vague notion.
I'm ordering The Dragon Book right now, and hopefully that will help me with some of the math I need.
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.
|
|
|
|
|
You will want to look into Big O Notation - that should be more helpful for analysis of algorithms than the Dragon Book. Wikipedia's entry should get you started.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
i'm familiarish with it. I'm more interested in the hows. I can glean the complexity from that pretty easily.
The problem I've had learning parsing is my lack of formal computer science and math training.
A lot of course material and lecture notes go over my head sometimes, and while the Dragon Book is no different, it's at least the material all of this stuff cites, so if I need to decode something, it may as well be that.
material like this on the other hand: Translating mathematics into code: Examples in Java, Python, Haskell and Racket[^]
has been immensely helpful and I wish there were more of it. Maybe when i've mastered it some myself I'll write an article here expanding on the subject.
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.
|
|
|
|
|
The Dragon Book is a good start on Compilers, but tends to concentrate on LALR parsers. Nonetheless, much of the material will still be helpful. Good luck.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
hmm. i already do know how to build LALR parsers. I just don't like LR parsing. But I do need to know more about viable prefix computation anyway so the $4.95 was well spent. LOL
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 accidentally got sent an auto termination letter for job abandonment for a job i hadn't heard from since the interview.
yay HR software.
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.
|
|
|
|
|
Maybe they think they hired you and forgot to tell you about it.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
I called them. It was a glitch. I was like "I abandoned a job? It said I missed 3 scheduled days."
It took them a minute to realize who I was and then apologize for the mix up.
Strange either way. I feel like I just succeeded at failing and it kind of balanced out in the end.
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 assume you got paid for those three days work?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
lol
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.
|
|
|
|
|
Reply with a demand for the holiday money you haven't yet been paid.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Oh...
You should reply and complain that you didn't get paid at all! Ask for compensation money!
|
|
|
|
|
or I could just reply to *you* and tell you to check your email
I sent you a link to a github with LL on it.
LL is usable now. And I've worked out the kink with the { } repeat construct so it doesn't introduce conflicts.
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.
|
|
|
|
|
Nice!
Will check that tonight.
Doing mundane work at work right now!
|
|
|
|
|
You haven't lived until you've convinced your manager you need a parser generator for your project.
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.
|
|
|
|
|
Been there, done that!
In 2005 I had to Parse ObjectiveC header to generated C++/CLI code that can interface with GNUstep!
Used ANTLR back then.
|
|
|
|
|
Well, let's look at your options:
1. Claim unemployment
2. Sue them for wrongful termination
3. Tell them you await your unused vacation time check
There's probably more flippant ideas, but when I think about it, there might actually be concern that this somehow shows up in your job history by one of those companies that tracks this stuff. Could be the making of another Netflix Black Mirror episode.
|
|
|
|
|
I thought about that which is why I called them. They assured me it wouldn't, but I don't trust they'd actually know.
It doesn't matter though. I'm crazy as in official and certifiable and it shows, so I don't think job history is the first thing a potential employer looks at where I'm concerned. More they're probably wondering why I'm rocking myself.
one of the few upsides of being mad is I don't have to keep up appearances.
Still, I work because I can't stand not to, but I'm not very employable these days.
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.
modified 26-Jul-19 8:37am.
|
|
|
|
|
Ask them when you can expect to get your severance pay.
|
|
|
|
|
It's the coolest thing. It's like one of those electronics experimenting kits you had when you were little except for parsers.
I badly want to post it but it's thousands and thousands of lines of code and I don't know if I have the stamina to write an article for it.
I don't know. My other parsing articles tend to be well received but this one would dwarf them and I don't even know if there's a lot of interest for something like this. I could spend a week doing nothing but writing about it.
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.
|
|
|
|
|
codewitch honey crisis wrote: I badly want to post it but it's thousands and thousands of lines of code My suggestion would be to first upload (well-documented) code to Github, and then write one or more articles. Start with a small .md , then expand that as time permits. But yes, it does require a time commitment, which is precisely why I haven't (yet) open sourced several of my large (and extensively used) apps.
/ravi
|
|
|
|
|
I'm busy doing my initial commit.
It's taking some time because the VSIX project is huge (hate that!)
That's a good idea to use the github README.md to flesh it out. I think I'll do 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.
|
|
|
|