Re: [ADVANCED-DOTNET] ILASM support lib

2004-08-10 Thread Robin Debreuil
> 3. Is there a managed code tool for parser generator (like yacc/bison) ? > (The generated parser is preferrably in C#). Antlr has a C# version, works great... I used it to build a C# compiler [1], though it emits to swf rather than .Net. It parses into a graph structure similar to the CodeDom, b

Re: [ADVANCED-DOTNET] escaped string to char

2004-07-05 Thread Robin Debreuil
I think things are a bit murky there in the spec and implementation here. Any number above 0x isn't supported in the long \U tag style, eg: char c1 = '\U'; // ok char c2= '\U0001'; // error CS1012: Too many characters in character literal Chars are stored as 16 bit l

Re: [ADVANCED-DOTNET] escaped string to char

2004-07-05 Thread Robin Debreuil
> > Obviously it can be done -- assigning "\n" to a textbox.Text converts it > > Are you sure about this? Or rather, you sure that you're escaping > consistently in the strings provided as examples? Right you are - I had just done a quick test before posting, sorry... Cheers, Robin =

Re: [ADVANCED-DOTNET] escaped string to char

2004-07-05 Thread Robin Debreuil
Yeah, weird eh? Right now I'm just doing it by hand like below, but I was hoping for something a bit more robust, maybe flagging invalid unicode values or something... I just think I must be missing something in the framework... Oh well, thanks for looking in any case, Robin string s = @"\u0497"

[ADVANCED-DOTNET] escaped string to char

2004-07-05 Thread Robin Debreuil
I can't beleive I'm unable to find the answer to this, but I've spent all afternoon trying to figure out how to get a char from a (valid) string that makes an escape sequence (the two character "\n" becomes the single character '\n'). This is for a C# compiler where the token sequence is already p

Re: [ADVANCED-DOTNET] C# generics constraints syntax

2003-10-24 Thread Robin Debreuil
> public class Dictionary : IEnumerable > where T : Bar, Bax, new() > where S : IComparable, new() > BTW, what does the "new()" do? It insures the type has a public (parameterless) constructor, so that new instances of T and S can be created. There is a new C# 2.0 document that talks about this f

Re: [ADVANCED-DOTNET] Do properties need a 'holder' keyword?

2003-10-22 Thread Robin Debreuil
Yeah, I think most people are using some sort of automator, and I don't see many variations on what the gen'd code should look like, so it seems ripe for formalization - unless there would be side effects. Another option would be to have blank get/set methods automatically insert that code, kind of

[ADVANCED-DOTNET] Do properties need a 'holder' keyword?

2003-10-21 Thread Robin Debreuil
I find it is very common to have a private field that properties use to hold there value, like get{return holder;}set{holder=value;} Does anyone have opinions regarding making that a part of a language, much like 'value' is in C#? Of course it would compile to exactly what it compiles to now. It

Re: [ADVANCED-DOTNET] ToString and Parse design question

2003-09-02 Thread Robin Debreuil
How can it derive that you mean a currency from just a string? Realistically you would need culture in there too - some places use 100.000 instead of 100,000 with money iirc, or the negative sign after the number, among other anomalies.. I would say making you specify all this is a better behaviour

Re: [ADVANCED-DOTNET] Singletons and dispose...

2003-06-20 Thread Robin Debreuil
Thanks - I was ok with destroying it at the end, just the way I had it set up, anyone who made a plugin had to have access to the whole CaptureConsole instance. Because it was disposable, and because the singleton had to be public, I was assuming someone would get the idea to call dispose. Rethink

[ADVANCED-DOTNET] Singletons and dispose...

2003-06-20 Thread Robin Debreuil
Sorry in advance if this has an obvious answer. I'm making an application that runs tasks, which are plugins. One of the things it has to do is capture console output, and log/filter/display/forward it. What I've done (and this is always where things seem to start breaking down), is write a class t

Re: [ADVANCED-DOTNET] Compilation question....

2003-02-28 Thread Robin Debreuil
Ug, sorry, never noticed the bottom half of your message. Yeah that is weird, I would guess it just was an optimization that didn't mention itself to the rest of the equation. I'll look closer next time! > Given this source code > > C# source: > public bool IsIndexed { > get { return (SearchF

Re: [ADVANCED-DOTNET] Compilation question....

2003-02-28 Thread Robin Debreuil
...because the attribute can have more than one flag set. In C# you have to explicitly compare non zero values to zero, because !=1 is not the same as true.. Cheers, Robin > Given this source code > > C# source: > public bool IsIndexed { > get { return (SearchFlags & (int) > AttributeSearchFl

Re: [ADVANCED-DOTNET] Regex for parsing XML - Foolish?

2003-02-17 Thread Robin Debreuil
I'd also agree with using text reader, but if you did go the regex route, I've heard compiled regex's are quite a bit faster. Not sure if that is what you were testing... Cheers, Robin - Original Message - From: "Larry O'Brien" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, Fe