Click here to Skip to main content
14,699,669 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: To all those who may be lonely on this day Pin
Eddy Vluggen27-Dec-19 10:44
professionalEddy Vluggen27-Dec-19 10:44 
GeneralRe: To all those who may be lonely on this day Pin
Cp-Coder27-Dec-19 16:25
MemberCp-Coder27-Dec-19 16:25 
GeneralThis Christmas I give you... Pin
Super Lloyd25-Dec-19 4:03
MemberSuper Lloyd25-Dec-19 4:03 
Questionanyone have any ideas for this problem? Pin
honey the codewitch25-Dec-19 2:35
mvahoney the codewitch25-Dec-19 2:35 
AnswerRe: anyone have any ideas for this problem? Pin
Daniel Pfeffer25-Dec-19 2:51
professionalDaniel Pfeffer25-Dec-19 2:51 
GeneralRe: anyone have any ideas for this problem? Pin
honey the codewitch25-Dec-19 2:53
mvahoney the codewitch25-Dec-19 2:53 
AnswerRe: anyone have any ideas for this problem? Pin
Greg Utas25-Dec-19 3:18
professionalGreg Utas25-Dec-19 3:18 
GeneralRe: anyone have any ideas for this problem? Pin
honey the codewitch25-Dec-19 3:25
mvahoney the codewitch25-Dec-19 3:25 
Greg Utas wrote:
my guess is that you haven't yet found a division of responsibilities that yields good encapsulation. And it might just be that there isn't one.


Yes to this. I'd divide the labor more, but again, the variation and amount of state involved in the generation process makes that so cumbersome as to be more trouble than it solves.


Greg Utas wrote:
When I parse C++ to do static analysis, I also "execute" it using operand and operator stacks, which can emit a sort of stack machine pseudo-code to verify that the code was properly understood.


Slang does something very similar. It has to go and turn a parse tree into an abstract syntax tree of code using type resolution. That requires some level of evaluation. For example, I have a routine called GetTypeOfExpression(expr) that lets you retrieve the type of any expression you get, including method return values, and such.

Because of metadata I don't have to evaluate as much as you do. I just have to find types. All of that is nicely encapsulated in CodeDomResolver and CodeDomBinder. Still, it makes Slang take awhile to process.

But I use those ASTs when I go to generate code. I modify them, a pick parts out of them (for reasons - maintainability elsewhere- this allows me to "template" parts of the code)

And I also use things like parse tables.

I've been generating code for decades. It's kind of my thing. The code i generate has come from more and more complex sources.

It's why I'm generating a backtracking parser with syntax directed actions and semantic constraints in a language independent manner right now.

It's very challenging. For both me and my CPU!
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: anyone have any ideas for this problem? Pin
Greg Utas25-Dec-19 3:45
professionalGreg Utas25-Dec-19 3:45 
GeneralRe: anyone have any ideas for this problem? Pin
honey the codewitch25-Dec-19 3:46
mvahoney the codewitch25-Dec-19 3:46 
GeneralRe: anyone have any ideas for this problem? Pin
honey the codewitch25-Dec-19 3:51
mvahoney the codewitch25-Dec-19 3:51 
GeneralRe: anyone have any ideas for this problem? Pin
Greg Utas25-Dec-19 4:09
professionalGreg Utas25-Dec-19 4:09 
GeneralRe: anyone have any ideas for this problem? Pin
honey the codewitch25-Dec-19 4:12
mvahoney the codewitch25-Dec-19 4:12 
AnswerRe: anyone have any ideas for this problem? Pin
Super Lloyd25-Dec-19 4:00
MemberSuper Lloyd25-Dec-19 4:00 
GeneralRe: anyone have any ideas for this problem? Pin
honey the codewitch25-Dec-19 4:03
mvahoney the codewitch25-Dec-19 4:03 
GeneralRe: anyone have any ideas for this problem? Pin
Super Lloyd25-Dec-19 4:12
MemberSuper Lloyd25-Dec-19 4:12 
GeneralRe: anyone have any ideas for this problem? Pin
honey the codewitch25-Dec-19 4:14
mvahoney the codewitch25-Dec-19 4:14 
AnswerRe: anyone have any ideas for this problem? Pin
0x01AA25-Dec-19 4:36
mve0x01AA25-Dec-19 4:36 
AnswerRe: anyone have any ideas for this problem? Pin
PIEBALDconsult25-Dec-19 6:41
professionalPIEBALDconsult25-Dec-19 6:41 
AnswerRe: anyone have any ideas for this problem? Pin
Jon McKee25-Dec-19 20:28
professionalJon McKee25-Dec-19 20:28 
GeneralRe: anyone have any ideas for this problem? Pin
honey the codewitch25-Dec-19 20:51
mvahoney the codewitch25-Dec-19 20:51 
AnswerRe: anyone have any ideas for this problem? Pin
Dan Sutton27-Dec-19 10:19
MemberDan Sutton27-Dec-19 10:19 
GeneralRe: anyone have any ideas for this problem? Pin
honey the codewitch28-Dec-19 1:02
mvahoney the codewitch28-Dec-19 1:02 
AnswerRe: anyone have any ideas for this problem? Pin
MikeCO1028-Dec-19 4:47
MemberMikeCO1028-Dec-19 4:47 
GeneralRe: anyone have any ideas for this problem? Pin
honey the codewitch28-Dec-19 4:57
mvahoney the codewitch28-Dec-19 4:57 

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.