Click here to Skip to main content
14,494,494 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: Managers... Pin
Sander Rossel2-Dec-19 1:27
professionalSander Rossel2-Dec-19 1:27 
GeneralRe: Managers... Pin
CodeWraith2-Dec-19 2:24
MemberCodeWraith2-Dec-19 2:24 
GeneralCcc Pin
Pompey 31-Dec-19 21:56
MemberPompey 31-Dec-19 21:56 
GeneralRe: Ccc Pin
OriginalGriff1-Dec-19 22:15
mveOriginalGriff1-Dec-19 22:15 
GeneralRe: Ccc Pin
Pompey 31-Dec-19 22:24
MemberPompey 31-Dec-19 22:24 
GeneralRe: Ccc Pin
OriginalGriff1-Dec-19 22:35
mveOriginalGriff1-Dec-19 22:35 
GeneralRe: Ccc Pin
super1-Dec-19 22:17
professionalsuper1-Dec-19 22:17 
GeneralI am beating this thing! Pin
honey the codewitch1-Dec-19 21:15
mvahoney the codewitch1-Dec-19 21:15 
So distinguishing between a cast expression and a standard parenthesized subexpression in C# requires backtracking!

I whipped up a backtracking IEnumerator<T> class, ironed out the kinks with that, and then stuck that under my input to incorporate backtracking it into my parse. Whammo, now it can handle these stupid expressions, and any future backtracking requirements that crop up.

I now have a backtracking hand rolled recursive descent parser a lot like what C# uses (aside from the research compiler that was GLR based)

C#'s language structure looks deceptively clean. There's a reason it requires very modern parser and compiler technology to operate though. The grammar itself is very ambiguous. It doesn't seem like it is. It's not Perl after all, but it is actually pretty damned hard to parse without type information.

I'm using a similar approach that Microsoft's GLR C# research parser project took, and basically coding in possible alternate structures so when i parse, the parse tree i get back can reflect all of those multiple different possible constructs, but my mechanism is more hard coded and rudimentary than theirs was. Fortunately there's a limited number of cases where this has to happen.

Either way, I'm proud of what I've managed to pull off so far. This is turning out to be pretty cool.
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.

GeneralRe: I am beating this thing! Pin
pkfox1-Dec-19 21:26
professionalpkfox1-Dec-19 21:26 
GeneralRe: I am beating this thing! Pin
honey the codewitch1-Dec-19 21:39
mvahoney the codewitch1-Dec-19 21:39 
GeneralRe: I am beating this thing! Pin
Tim Deveaux1-Dec-19 21:38
MemberTim Deveaux1-Dec-19 21:38 
GeneralRe: I am beating this thing! Pin
honey the codewitch1-Dec-19 21:40
mvahoney the codewitch1-Dec-19 21:40 
GeneralRe: I am beating this thing! Pin
OriginalGriff1-Dec-19 21:44
mveOriginalGriff1-Dec-19 21:44 
GeneralIt is a hint? Pin
Kornfeld Eliyahu Peter1-Dec-19 18:35
mveKornfeld Eliyahu Peter1-Dec-19 18:35 
GeneralRe: It is a hint? Pin
Amarnath S1-Dec-19 18:44
professionalAmarnath S1-Dec-19 18:44 
GeneralRe: It is a hint? Pin
the goat in your machine1-Dec-19 19:22
Memberthe goat in your machine1-Dec-19 19:22 
GeneralRe: It is a hint? Pin
Jörgen Andersson1-Dec-19 19:54
professionalJörgen Andersson1-Dec-19 19:54 
GeneralRe: It is a hint? Pin
Kornfeld Eliyahu Peter1-Dec-19 20:00
mveKornfeld Eliyahu Peter1-Dec-19 20:00 
GeneralSome coding style weirdness, Is and Has Pin
honey the codewitch1-Dec-19 14:59
mvahoney the codewitch1-Dec-19 14:59 
GeneralRe: Some coding style weirdness, Is and Has Pin
Ravi Bhavnani1-Dec-19 16:14
professionalRavi Bhavnani1-Dec-19 16:14 
GeneralRe: Some coding style weirdness, Is and Has Pin
honey the codewitch1-Dec-19 16:18
mvahoney the codewitch1-Dec-19 16:18 
GeneralRe: Some coding style weirdness, Is and Has Pin
Super Lloyd1-Dec-19 18:15
MemberSuper Lloyd1-Dec-19 18:15 
GeneralRe: Some coding style weirdness, Is and Has Pin
Jörgen Andersson1-Dec-19 20:13
professionalJörgen Andersson1-Dec-19 20:13 
GeneralRe: Some coding style weirdness, Is and Has Pin
honey the codewitch1-Dec-19 20:16
mvahoney the codewitch1-Dec-19 20:16 
GeneralRe: Some coding style weirdness, Is and Has Pin
OriginalGriff1-Dec-19 21:12
mveOriginalGriff1-Dec-19 21:12 

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.