|
hey, thanks!
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'm working on a parser generator that is LL(k) which should be suitable for really complex grammars. Probably even C#7 (I hope - Microsoft's C# parser is hand rolled recursive descent IIRC, not generated)
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.
|
|
|
|
|
Overall, SW development must have much more silent masterpieces than modern art.
|
|
|
|
|
Welcome to CodeProject.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
back in my really young uni days I used to hand roll not so much parsers but tokenisers using a finite state machine (in C). used it for some advanced comp.sci projects
.
was about 20 lines of code (for everything), and a hand rolled a table.
tokenising a programming language such as C the table was maybe 30 rows.
handled all the language foibles (unary operators, ++, --, * as pointer vs multiplication, &...
this was when machines were pretty slow and system memory ws measured in kilobytes - this method blew away anything else in both speed and size.
kept a [hard]copy for years but eventually lost it quite some time ago.
After uni it was one of those really great tools only used once in a blue moon - (like that fancy german brand jigsaw in the tool box - bought for a project and it did the job really well but now rarely seen outside of it's box.)
OTOH I do find myself often analysing [programming] data flow/processing as sort-of finite state doodles on scrap paper.
Message Signature
(Click to edit ->)
|
|
|
|
|
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.
|
|
|
|
|