Click here to Skip to main content
14,452,963 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 14:39
MemberDavid Crow12-Jan-20 14:39 
GeneralRe: Question for iPhone users Pin
KarstenK12-Jan-20 21:20
mveKarstenK12-Jan-20 21:20 
JokeRe: Question for iPhone users Pin
honey the codewitch12-Jan-20 0:21
mvahoney the codewitch12-Jan-20 0:21 
GeneralRe: Question for iPhone users Pin
KarstenK13-Jan-20 7:45
mveKarstenK13-Jan-20 7:45 
AnswerRe: Question for iPhone users Pin
Mark_Wallace12-Jan-20 1:11
MemberMark_Wallace12-Jan-20 1:11 
AnswerRe: Question for iPhone users Pin
Caslen14-Jan-20 10:22
MemberCaslen14-Jan-20 10:22 
GeneralThe aftermath of my coding jag Pin
honey the codewitch11-Jan-20 14:30
mvahoney the codewitch11-Jan-20 14:30 
GeneralRe: The aftermath of my coding jag Pin
Greg Utas11-Jan-20 16:01
professionalGreg Utas11-Jan-20 16: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 16:14
mvahoney the codewitch11-Jan-20 16:14 
GeneralRe: The aftermath of my coding jag Pin
Mark_Wallace11-Jan-20 17:48
MemberMark_Wallace11-Jan-20 17:48 
GeneralRe: The aftermath of my coding jag Pin
honey the codewitch12-Jan-20 0:21
mvahoney the codewitch12-Jan-20 0:21 
GeneralRe: The aftermath of my coding jag Pin
OriginalGriff11-Jan-20 20:58
communityengineerOriginalGriff11-Jan-20 20:58 
GeneralRe: The aftermath of my coding jag Pin
honey the codewitch11-Jan-20 21:12
mvahoney the codewitch11-Jan-20 21:12 
GeneralRe: The aftermath of my coding jag Pin
Greg Utas12-Jan-20 3:25
professionalGreg Utas12-Jan-20 3:25 
NewsRIP Pete Dye Pin
Cp-Coder11-Jan-20 8:53
MemberCp-Coder11-Jan-20 8:53 
GeneralRe: RIP Pete Dye Pin
Maximilien11-Jan-20 12:24
MemberMaximilien11-Jan-20 12:24 
GeneralMini CCCs 161 Pin
Tim Deveaux10-Jan-20 19:12
MemberTim Deveaux10-Jan-20 19:12 
GeneralRe: Mini CCCs 161 Pin
OriginalGriff10-Jan-20 20:56
communityengineerOriginalGriff10-Jan-20 20:56 
GeneralRe: Mini CCCs 161 - Done Pin
Tim Deveaux10-Jan-20 21:04
MemberTim Deveaux10-Jan-20 21:04 
GeneralIn the land of the blind, the one-eyed man is king Pin
CodeWraith10-Jan-20 11:44
MemberCodeWraith10-Jan-20 11:44 
GeneralRe: In the land of the blind, the one-eyed man is king Pin
OriginalGriff10-Jan-20 12:06
communityengineerOriginalGriff10-Jan-20 12:06 
GeneralRe: In the land of the blind, the one-eyed man is king Pin
CodeWraith10-Jan-20 12:14
MemberCodeWraith10-Jan-20 12:14 
GeneralRe: In the land of the blind, the one-eyed man is king Pin
OriginalGriff10-Jan-20 12:20
communityengineerOriginalGriff10-Jan-20 12:20 
GeneralRe: In the land of the blind, the one-eyed man is king Pin
CodeWraith10-Jan-20 13:58
MemberCodeWraith10-Jan-20 13:58 
GeneralRe: In the land of the blind, the one-eyed man is king Pin
Richard MacCutchan10-Jan-20 12:41
communityengineerRichard MacCutchan10-Jan-20 12: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.