|
Cool. I wrote similar in C#
Here: A Regular Expression Engine in C#[^]
and here: How to Make an LL(1) Parser: Lesson 2[^]
The latter one is really barebones. The former one, especially with graphviz installed, pretty much rocks.
It does non-backtracking regex primarily used for tokenizers. The API is *very* full featured, almost to the point of being confusing in the same way that an airplane cockpit is confusing.
It does runtime and compile time code generation (both array based and jump table based switches)
The latter link is just enough to illustrate the principles of one.
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.
|
|
|
|
|
They might not like your bracing and indent styles.
|
|
|
|
|
Ctrl-A, Ctrl-K, Ctrl-D reformats a code document in visual studio
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 dont like your formatting like multiple cases in one line, or missing braces and new lines.
Yesterday I discussed on work that the 100% correct solution isnt the optimal solution, because it may take too much time and so block more important jobs.
Life is too short too waiste it
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
I mean, Ctrl-A,Ctrl-K,Ctrl-D will fix that in visual studio (there's similar in Monodevelop i think)
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.
|
|
|
|
|
leavings some "ToDo" in released code is bad style
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
meh. the todos aren't important. i'll probably implement them in a future release
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.
|
|
|
|
|
Just wondering if you've played with System.IO.Pipelines at all?
cheers
Chris Maunder
|
|
|
|
|
I had similar experiences, and as a result I'm not too keen anymore to write articles.
But good things take time, and now your article score doesn't look that bad I think at 4.97 points average
|
|
|
|
|
i wasn't fishing for votes but i guess griping helped. haha
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 wouldnt call that article "great" all.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
at least no one wrote .."I copy pasted this and now visual studio is giving error please fix it!!"
Caveat Emptor.
"Progress doesn't come from early risers – progress is made by lazy men looking for easier ways to do things." Lazarus Long
|
|
|
|
|
so true. Although I can't really judge because I cribbed from coding magazines back in the 1980s when those still existed.
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: Not 5 stars like my parser generator articles. No sir. I get not even 4. It has since garnered a measly 4.97.
/ravi
|
|
|
|
|
I honestly should update it if there's genuine interest. I think I've made some minor revisions to the code since i posted it (it's part of a much larger framework of code i keep around)
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.
|
|
|
|
|
Update, update! I (and others) love to learn cool s--- by reading articles at CP, even though I may not be directly using the discussed technology at this very moment.
/ravi
|
|
|
|
|
most of my attention right now is focused on my parser generators.
I think I have an LL(*) parser. If so, that's super cool. It means it can parse any LL grammar (and that's a lot of grammars)
Pretty much it means you can parse stuff like C# and SQL and javascript with 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: to develop for really simple parses, up to the roughly the complexity of parsing regex I've never actually written a parser, but I can only imagine it would be easier than to write the simple regex it would parse
|
|
|
|
|
lol regex used to look like gibberish to me but eventually i found it intuitive
the only operations you need are () | and *
the rest of them, like +, [], and ? are built on those primaries.
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.
|
|
|
|
|
|
LOL I have a visual studio integrated toolkit (primarily for code generation - i'm *really* lazy) and I named it Cauldron
my core source library (doesn't everyone have one?) is called Grimoire
i *am* a witch.
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: my core source library (doesn't everyone have one?) Nope
Sometimes a little witchcraft is necessary to get your code working straight.
Been doing some WCF development (a.k.a. The Black Arts) this week and it didn't work until I held a Black Mass to please the Dark Lord.
We should be having coding covens (rolls nice off the tongue as well!)
|
|
|
|
|
I've not begun to touch WCF. I stopped doing bizdev after i retired from software dev and i don't write a lot of application level code so I have not had much need.
If you keep a dead chicken around, I've found it helps. Just wave it over the computer periodically and it will banish a few of the worst bugs.
These days i just hack. I've been hacking my way through LL(*) parsing because there's no reasonable documentation on doing it. Mostly just a lot math and theoretical whitepapers on different parsing techniques, so a lot I'm just figuring out as I go.
I like to challenge myself.
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: If you keep a dead chicken around That kind of goes against my vegetarian beliefs
I probably shouldn't mention this WCF service is for a butcher...
codewitch honey crisis wrote: Mostly just a lot math and theoretical whitepapers BURN THE WITCH!!!... I'm getting déjà-vus here...
codewitch honey crisis wrote: I like to challenge myself. That is fun though, I might just read your LL(1) articles some day (I just read the introduction and already learned some stuff).
Sometimes it's really nice to know why code works the way it works.
I've once begun to learn some IL (the result[^]) and it really did change my perspective on coding.
Learning how to write a parser may actually prove useful one day
|
|
|
|
|
Sander Rossel wrote: That kind of goes against my vegetarian beliefs
Even if the chicken died of natural causes?
Sander Rossel wrote: I've once begun to learn some IL (the result[^])
Cool. I'm reading it now. I know *old* IL pretty well (about .net 2.0 days) but I haven't seen some of the newer things, like the new ref types or how lambdas resolve (although i have an idea) so some of this is new territory for me.
Sander Rossel wrote: Sometimes it's really nice to know why code works the way it works.
Yeah. The main reason I put it here is I had such a hard time finding this stuff and putting it together from the information that I could find I thought it was a shame.
I may do something similar with my "LL regular" parsing if I ever complete it. It works a bit like ANTLR4 but with better grammar syntax
One of the reasons i write all this crap is most of the parser generators out there are in java and that irks me. The other reason is that they're very confining in some ways in terms of what you can do with them. Most of them for example, cannot parse purely streaming data without loading the *entire* stream contents into memory first, which is nonsense.
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.
|
|
|
|