Click here to Skip to main content
15,909,091 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: 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 
GeneralRe: The aftermath of my coding jag Pin
Greg Utas11-Jan-20 15:01
professionalGreg Utas11-Jan-20 15:01 
I was about to pack it in for the night when I saw this. I don't know how to alert someone on these boards either, so that makes two of us.

Much like you do with C#, I parse the subset of C++ that I use. I don't know much about C#, but are you actually saying that a new language kept this preprocessor excrement? The first thing that comes to mind is Monty Python and finding a dull spoon to geld those who were responsible.

My problem is twofold. First, I don't know where to get the BNF for C++. I'm sure it exists, but it must be worse than a dog's breakfast. Second, I "interpret" the code after parsing it. It's the only way to support some of the "Scott Myers code inspection" capabilities. So if I went with a generated parser, I'd have to modify generated code to support the interpreter phase. From the bloat that you've described, I'll pass.

With regard to the preprocessor, I support some things in my single-pass compiler, and a few other things should be added. But it's exactly as you say: to support all of it, a true preprocessor phase is needed. But I have no intention of supporting all of it. If someone else is willing, great. But there are some things that I find repugnant and won't countenance: stringification (#), concatenation (##), function macros, and code fragment aliases. If someone wants to use the tool but their code contains these things, they'd have to rework them, and I'd be doing the world a favor. Another one is #undef, which is tricky when all the code is compiled together, without any notion of "translation units". It could probably be supported, but would it be worth it?

Another reason I don't want a preprocessing phase is that I have an editor that can interactively fix about half of those Scott Myers recommendations. With a preprocessor phase, you get two versions of the code. There's probably a way to deal with this, but my initial reaction is, "Will the real source code please stand up!"

I wonder if a generated lexer would help. Mine isn't very large and was repeatedly refactored to keep the parser code tight. The debug version of my "compiler" is about the same speed as MSFT's real compiler, so I'm not losing sleep. Of course, it's not a true apples-to-apples comparison, but it does what it needs to do.
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 
GeneralRe: In the land of the blind, the one-eyed man is king Pin
Richard MacCutchan10-Jan-20 11:41
mveRichard MacCutchan10-Jan-20 11:41 

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.