Click here to Skip to main content
15,897,226 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
AnswerRe: Question for iPhone users Pin
KarstenK11-Jan-20 22:27
mveKarstenK11-Jan-20 22:27 
GeneralRe: Question for iPhone users Pin
David Crow12-Jan-20 13:39
David Crow12-Jan-20 13:39 
GeneralRe: Question for iPhone users Pin
KarstenK12-Jan-20 20:20
mveKarstenK12-Jan-20 20:20 
JokeRe: Question for iPhone users Pin
honey the codewitch11-Jan-20 23:21
mvahoney the codewitch11-Jan-20 23:21 
GeneralRe: Question for iPhone users Pin
KarstenK13-Jan-20 6:45
mveKarstenK13-Jan-20 6:45 
AnswerRe: Question for iPhone users Pin
Mark_Wallace12-Jan-20 0:11
Mark_Wallace12-Jan-20 0:11 
AnswerRe: Question for iPhone users Pin
Caslen14-Jan-20 9:22
Caslen14-Jan-20 9:22 
GeneralThe aftermath of my coding jag Pin
honey the codewitch11-Jan-20 13:30
mvahoney the codewitch11-Jan-20 13:30 
Greg Utas in particular, you may find this of interest. Sorry I forgot how to tag. Someone explained it once.

To recap, Slang is a subset of C# that is CodeDOM compliant. It's maybe 60-70% of the language.

So I originally was parsing Slang by hand.

I wrote the Parsley parser generator so I could write a grammar and generate a parser to parse Slang that way instead.

My generated parser was 939k vs about 100k for my initial hand rolled parser, and was about twice as slow, and took at least twice as much memory to execute, by my back of the napkin estimations. Still, it was fine for this scenario.

The trouble is, and Greg, as per our earlier exchanges, you may want to know this - the out of band "preprocessor directives" and comments - skipping them entirely is easy, but conditionally ignoring them is much more challenging for the generated parser.

In the end, I couldn't make the generated parser handle it. I tried skip lists and it didn't work, as it was eating trailings - I'm going to write an article that covers this in detail. Greg I think it's not feasible. You need an explicit preproc step.

In the end I decided to go back to a hand written parsing method, but I still had the problem of maintenance and intelligibility.

Well, fortunately, I have this generated parser with a grammar that goes with it. So I added a /noparser option to Parsley which goes through all the steps of processing the grammar, and generating any associated lexers and constants, but skips the actual parser generation.

Now I'm coding by hand, but to the grammar I made before which makes it much easier to understand where i am and what I'm doing.

I'm testing my parser *against the generated parser* woo! which really helps.

And so there it is. I've mitigated some of my hand rolled headaches by generating a parser even though I won't use that parser in production.

And I think Parsley won me a prize here so it isn't a failure scenario at all.

Greg, you might want to consider this approach in building your parsers, as having your grammar in front of you in a BNF variant form plus making that available as documentation can really help both you and whomever uses your parser.

Plus definitely using a lexer would cut your effort and make your error handling more robust, i pretty much guarantee you - that's why almost everyone does it. Big Grin | :-D

Anyway, yay Parsley, even though I didn't use it for production code.
hack everything.

GeneralRe: The aftermath of my coding jag Pin
Greg Utas11-Jan-20 15:01
professionalGreg Utas11-Jan-20 15:01 
GeneralRe: The aftermath of my coding jag Pin
honey the codewitch11-Jan-20 15:14
mvahoney the codewitch11-Jan-20 15:14 
GeneralRe: The aftermath of my coding jag Pin
Mark_Wallace11-Jan-20 16:48
Mark_Wallace11-Jan-20 16:48 
GeneralRe: The aftermath of my coding jag Pin
honey the codewitch11-Jan-20 23:21
mvahoney the codewitch11-Jan-20 23:21 
GeneralRe: The aftermath of my coding jag Pin
OriginalGriff11-Jan-20 19:58
mveOriginalGriff11-Jan-20 19:58 
GeneralRe: The aftermath of my coding jag Pin
honey the codewitch11-Jan-20 20:12
mvahoney the codewitch11-Jan-20 20:12 
GeneralRe: The aftermath of my coding jag Pin
Greg Utas12-Jan-20 2:25
professionalGreg Utas12-Jan-20 2:25 
NewsRIP Pete Dye Pin
Cp-Coder11-Jan-20 7:53
Cp-Coder11-Jan-20 7:53 
GeneralRe: RIP Pete Dye Pin
Maximilien11-Jan-20 11:24
Maximilien11-Jan-20 11:24 
GeneralMini CCCs 161 Pin
Tim Deveaux10-Jan-20 18:12
Tim Deveaux10-Jan-20 18:12 
GeneralRe: Mini CCCs 161 Pin
OriginalGriff10-Jan-20 19:56
mveOriginalGriff10-Jan-20 19:56 
GeneralRe: Mini CCCs 161 - Done Pin
Tim Deveaux10-Jan-20 20:04
Tim Deveaux10-Jan-20 20:04 
GeneralIn the land of the blind, the one-eyed man is king Pin
CodeWraith10-Jan-20 10:44
CodeWraith10-Jan-20 10:44 
GeneralRe: In the land of the blind, the one-eyed man is king Pin
OriginalGriff10-Jan-20 11:06
mveOriginalGriff10-Jan-20 11:06 
GeneralRe: In the land of the blind, the one-eyed man is king Pin
CodeWraith10-Jan-20 11:14
CodeWraith10-Jan-20 11:14 
GeneralRe: In the land of the blind, the one-eyed man is king Pin
OriginalGriff10-Jan-20 11:20
mveOriginalGriff10-Jan-20 11:20 
GeneralRe: In the land of the blind, the one-eyed man is king Pin
CodeWraith10-Jan-20 12:58
CodeWraith10-Jan-20 12:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Straw Poll

Were you affected by the geomagnetic storms this past weekend?
Communication disruptions, electrified pipes, random unexplained blue-screens in Windows - the list of effects is terrifying.
  Results   20 votes