|
Will it supports #define #undef #include ?!
|
|
|
|
|
Not exactly. There's no language independent way to do a preprocessor like that.
On the other hand, have you heard of T4 templating?
class foo {
<# foreach(var member in members) {
...
}
#>
}
basically, you can use ASP like context switches with T4 to render the code dynamically.
Sure you could do that with C# too, but it won't generate language agnostic code.
With slang (what i've decided to call it) it will. Ergo, your code generation routines (or more to the point, mine ) don't have to do nasty code dom manipulation. They can just run a template.
I'll be including builtin T4/asp context switching. It's painless to implement and microsofts is annoying.
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.
|
|
|
|
|
I will have let you know that I did T4 templates that did whole project analysis using VS CodeDom!
Can't remember what it was for, haha, but here you go!
|
|
|
|
|
oh the one visual studio exposes is way better than the one they give you. But you can't use it outside of the visual studio design and debug sessions, or without an alternate suitable host.
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.
|
|
|
|
|
Adding, so you know what text templating is. You know you can use it to mess with generating any type of file.
All I've done is made a subset of C# parseable into the CodeDom.
So you do like
CodeExpression expr = Slang.ParseExpression("\"HelloWorld\".ToString()\"");
CodeCompileUnit ccu = Slang.ParseCompileUnit(myEntireSourceCodeFileAsAString);
The tricky thing is I have to visit the tree afterward to "fix it up"
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.
|
|
|
|
|
So far.. I am curious to see what concrete problem you plan to solve with that....
As it is it looks cool but a little vague!
I wonder though, are we on the cusp of a new fast reflection implementation?! Or easy Emit?
|
|
|
|
|
It's not a better emit, but it's more flexible than emit in that it allows to generate code in a high level language rather an IL. Also because it's codegen you can use it to get rid of your reflection. you can just dynamically compile it if you need that.
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.
|
|
|
|
|
My concrete use case is using slang as the code language for my parser's grammar files so that the grammars can have code in them and still be language independent.
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.
|
|
|
|
|
Ooo.. looks interesting!
|
|
|
|
|
We'll see. I've got a number of problems (not bugs, but design challenges) that aren't so easy to fix. I just made a codedom visitor that might help but we'll see how far i get
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.
|
|
|
|
|
|
I assumed many of you wouldn't, but there are some other american coders hereabout, I'm sure.
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.
|
|
|
|
|
honey the codewitch wrote: I assumed many of you wouldn't, but there are some other american coders hereabout, I'm sure. Pretty sure there's American coders in Europe as well; they celebrate, as does the American Embassy. Shops are, ofc, trying to import "Black Friday".
Best wishes are always welcome, even if it's not celebrated. The new year is always later for the Chinese.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Eddy Vluggen wrote: Shops are, ofc, trying to import "Black Friday".
... except without the huge savings.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
They advertise with huge savings, but that's also true for Sinterklaas and Christmas. I see it as an extra tax for those who can't count or believe it
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Would Roslyn[^] not let you do the same thing? Or are you already using it behind the scenes?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Roslyn is only C# and VB.
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.
|
|
|
|
|
For parsing, yet. I was just thinking you might be able to use that to do the parsing, and then convert the returned AST to CodeDom somehow.
But I've not really used it, so maybe this idea is more "CodeDumb".
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I mean, i guess i could do that but i have a feeling translating and transferring from their object model to CodeDOMs would be about as much work as the parsing in the first place.
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.
|
|
|
|
|
Way to lose a location (5)
|
|
|
|
|
Ikea is 4
In Word you can only store 2 bytes. That is why I use Writer.
|
|
|
|
|
|
Nope (answer's up on my profile page if you're stumped)
|
|
|
|
|
I selected VSTS in Tools=>Options=>Source Control=>Plugin
When I attempt to add a solution to VSTS, a Git message pops up. When I go back into the options dialog, Git is selected.
I DON'T WANT GIT.
How can I force Visual Studio to use VSTS???
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
Either:
1) Use your incredible powers of persuasion.
Or
2) Get Luke to do it.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|