Click here to Skip to main content
15,892,839 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.

 
GeneralRe: CCC - 2020-01-30 - Solution Pin
OriginalGriff30-Jan-20 3:59
mveOriginalGriff30-Jan-20 3:59 
GeneralRe: CCC - 2020-01-30 - Solution Pin
Abbas A. Ali30-Jan-20 18:45
professionalAbbas A. Ali30-Jan-20 18:45 
GeneralRe: CCC - 2020-01-30 - Solution Pin
Formerly 11521271 Member30-Jan-20 3:00
professionalFormerly 11521271 Member30-Jan-20 3:00 
GeneralRe: CCC - 2020-01-30 - Solution Pin
Formerly 11521271 Member30-Jan-20 3:01
professionalFormerly 11521271 Member30-Jan-20 3:01 
GeneralRe: CCC - 2020-01-30 - Solution Pin
Abbas A. Ali30-Jan-20 18:45
professionalAbbas A. Ali30-Jan-20 18:45 
GeneralBuzzword Bingo! Pin
Super Lloyd29-Jan-20 17:41
Super Lloyd29-Jan-20 17:41 
GeneralRe: Buzzword Bingo! Pin
Mark_Wallace29-Jan-20 21:46
Mark_Wallace29-Jan-20 21:46 
Rantoh what a mess I've gotten myself into Pin
honey the codewitch29-Jan-20 8:51
mvahoney the codewitch29-Jan-20 8:51 
So this is the kind of code I have to completely remake.

This is part of convoluted parser that's not even recursive descent, so it's next to impossible to debug. It's generated and table driven, calling helper methods like this ugly thing below:

C#
internal static RuleDesc MkDummyRuleDesc( LexCategory cat, AAST aast ) {
    RuleDesc result = new RuleDesc();
    result.pSpan = null;
    result.aSpan = aast.AtStart;
    result.isBarAction = false;
    result.isPredDummyRule = true;
    result.pattern = String.Format( CultureInfo.InvariantCulture, "{{{0}}}", cat.Name );
    result.list = new List<StartState>();
    result.ParseRE( aast );
    result.list.Add( aast.StartStateValue( cat.PredDummyName ) );
    return result;
}


I've included all the comments.

I have no idea what this does, or why dummy rules would have to be made in the first place. I'm not even clear on what a rule is, although I have a vague idea.

This code has no documentation. At best, it's mostly a reimplementation of lex in C#, so I kind of know what inputs it accepts from the lex man pages. It has flex extensions too though but not all of them. Who knows what it supports? I'm not even sure the original author does and the primary engine hasn't been updated in 6 years.

Sigh | :sigh:

Even if i get this working how I want it will probably always be C# only unless i want to debug slang enough to get it to work with it or retool all of the code generation to use the codedom by hand. Ugh.

And that's not even the worst bit.

I have half a mind to leave the parser in place, preparse my desired document format, and then write out a document to this parser spec format in memory and then feed it to it that way, but what a nasty mess!
Real programmers use butterflies

GeneralRe: oh what a mess I've gotten myself into Pin
Greg Utas29-Jan-20 14:49
professionalGreg Utas29-Jan-20 14:49 
GeneralRe: oh what a mess I've gotten myself into Pin
honey the codewitch29-Jan-20 15:43
mvahoney the codewitch29-Jan-20 15:43 
GeneralRe: oh what a mess I've gotten myself into Pin
RugbyLeague29-Jan-20 21:24
RugbyLeague29-Jan-20 21:24 
GeneralRe: oh what a mess I've gotten myself into Pin
honey the codewitch29-Jan-20 21:41
mvahoney the codewitch29-Jan-20 21:41 
GeneralRe: oh what a mess I've gotten myself into Pin
RugbyLeague30-Jan-20 0:24
RugbyLeague30-Jan-20 0:24 
GeneralRe: oh what a mess I've gotten myself into Pin
honey the codewitch30-Jan-20 4:34
mvahoney the codewitch30-Jan-20 4:34 
Generalcodepen.io has jokes PinPopular
ZurdoDev29-Jan-20 5:13
professionalZurdoDev29-Jan-20 5:13 
GeneralRe: codepen.io has jokes Pin
Maximilien29-Jan-20 6:09
Maximilien29-Jan-20 6:09 
PraiseRe: codepen.io has jokes Pin
Slacker00729-Jan-20 6:19
professionalSlacker00729-Jan-20 6:19 
GeneralRe: codepen.io has jokes Pin
ZurdoDev29-Jan-20 6:21
professionalZurdoDev29-Jan-20 6:21 
GeneralRe: codepen.io has jokes Pin
Jacquers29-Jan-20 17:26
Jacquers29-Jan-20 17:26 
GeneralRe: codepen.io has jokes Pin
Nelek29-Jan-20 12:45
protectorNelek29-Jan-20 12:45 
GeneralRe: codepen.io has jokes Pin
Mark_Wallace29-Jan-20 21:48
Mark_Wallace29-Jan-20 21:48 
GeneralThought of the Day Pin
OriginalGriff29-Jan-20 4:47
mveOriginalGriff29-Jan-20 4:47 
GeneralRe: Thought of the Day Pin
phil.o29-Jan-20 4:57
professionalphil.o29-Jan-20 4:57 
RantRe: Thought of the Day Pin
lopatir29-Jan-20 5:01
lopatir29-Jan-20 5:01 
GeneralRe: Thought of the Day Pin
Daniel Pfeffer29-Jan-20 5:09
professionalDaniel Pfeffer29-Jan-20 5:09 

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.