YAY! Slang parsed 8000+ lines of C# code.
-
It parses fast enough, but it takes so long to resolve what it parsed though. I need to figure out how to optimize this thing. Still, the parser is getting more and more stable. It already parses better than that ANTLR C#6 grammar did. Technically, it can usually convert to VB without going through the resolution process, but it's kind of a hack. It just so happens that in VB there's no difference in syntax between a delegate invocation and a method call, nor a field access and a property access so it happens to work, but it's not proper to resolve method invocations as delegate invocations and all member access as field access which is what the parser has to do, since it doesn't have type info. Overall I'm happy with the project but I need to figure on something to make it more speedy so it will be generally useful.
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.
-
It parses fast enough, but it takes so long to resolve what it parsed though. I need to figure out how to optimize this thing. Still, the parser is getting more and more stable. It already parses better than that ANTLR C#6 grammar did. Technically, it can usually convert to VB without going through the resolution process, but it's kind of a hack. It just so happens that in VB there's no difference in syntax between a delegate invocation and a method call, nor a field access and a property access so it happens to work, but it's not proper to resolve method invocations as delegate invocations and all member access as field access which is what the parser has to do, since it doesn't have type info. Overall I'm happy with the project but I need to figure on something to make it more speedy so it will be generally useful.
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.
Awesome work (and best of luck with the optimising)
cheers Chris Maunder
-
It parses fast enough, but it takes so long to resolve what it parsed though. I need to figure out how to optimize this thing. Still, the parser is getting more and more stable. It already parses better than that ANTLR C#6 grammar did. Technically, it can usually convert to VB without going through the resolution process, but it's kind of a hack. It just so happens that in VB there's no difference in syntax between a delegate invocation and a method call, nor a field access and a property access so it happens to work, but it's not proper to resolve method invocations as delegate invocations and all member access as field access which is what the parser has to do, since it doesn't have type info. Overall I'm happy with the project but I need to figure on something to make it more speedy so it will be generally useful.
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.
There are no lines. :D Something I keep wondering about your Slang system is whether or not it can be used to implement a language extension similar to Oracle's PRO*C or Microsoft's ESQL -- SQL statements embedded in C programs (or C# now I suppose).
-
There are no lines. :D Something I keep wondering about your Slang system is whether or not it can be used to implement a language extension similar to Oracle's PRO*C or Microsoft's ESQL -- SQL statements embedded in C programs (or C# now I suppose).
LINQ already kind of provides that, but yes. You can use this as a starting point to implement a Domain Specific Language. If I was real clever I might make it so you could extend the language through the language itself. Adding keywords and such but that's out of the scope of this for now.
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.
-
Awesome work (and best of luck with the optimising)
cheers Chris Maunder
Thanks. The articles bombed so far but I think that's either because it's so preliminary, or people don't understand it, or nobody has a use for it. Or a combination of those things. Still, *I* have a couple of uses for it and I understand it so that's a start. :laugh:
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.
-
It parses fast enough, but it takes so long to resolve what it parsed though. I need to figure out how to optimize this thing. Still, the parser is getting more and more stable. It already parses better than that ANTLR C#6 grammar did. Technically, it can usually convert to VB without going through the resolution process, but it's kind of a hack. It just so happens that in VB there's no difference in syntax between a delegate invocation and a method call, nor a field access and a property access so it happens to work, but it's not proper to resolve method invocations as delegate invocations and all member access as field access which is what the parser has to do, since it doesn't have type info. Overall I'm happy with the project but I need to figure on something to make it more speedy so it will be generally useful.
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.
Wow... are you trying to impress us? well.... it might work! :) you need to make an article with some cool nifty example! :P
A new .NET Serializer All in one Menu-Ribbon Bar Taking over the world since 1371!
-
LINQ already kind of provides that, but yes. You can use this as a starting point to implement a Domain Specific Language. If I was real clever I might make it so you could extend the language through the language itself. Adding keywords and such but that's out of the scope of this for now.
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:
LINQ already kind of provides that
It does no such thing.
-
honey the codewitch wrote:
LINQ already kind of provides that
It does no such thing.
Then i misunderstood what you meant. LINQ provides SQL like syntax over disparate datasources, including databases.
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.
-
Wow... are you trying to impress us? well.... it might work! :) you need to make an article with some cool nifty example! :P
A new .NET Serializer All in one Menu-Ribbon Bar Taking over the world since 1371!
The 2 articles i posted on it so far bombed LOL
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.
-
Then i misunderstood what you meant. LINQ provides SQL like syntax over disparate datasources, including databases.
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.
It does no such thing.
-
It does no such thing.
Then I must be using a magic feature of an as of yet unheard of version of C# with magical embedded sql like syntax that nobody else has access to. Gosh thanks microsoft. Boy, I feel speshul.
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.
-
The 2 articles i posted on it so far bombed LOL
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.
mm... I am not sure what you mean by "bombed" is it [this](https://www.codeproject.com/Articles/5252827/Slang-Part-1-Parsing-a-Csharp-Subset-into-the-Code) and [that](https://www.codeproject.com/Articles/5253246/Slang-Part-2-Scope-and-Type-Resolution-in-the-Code) one? I can only see 4 and 2 votes so far! :O ;P Just quickly read that at work just now! ;P Mm.... this is cool and obviously quite an achievement :thumbsup::cool: However I am not sure where I could reuse that myself.. :O I'll have to think about it again if / when I need code generation....
A new .NET Serializer All in one Menu-Ribbon Bar Taking over the world since 1371!
-
mm... I am not sure what you mean by "bombed" is it [this](https://www.codeproject.com/Articles/5252827/Slang-Part-1-Parsing-a-Csharp-Subset-into-the-Code) and [that](https://www.codeproject.com/Articles/5253246/Slang-Part-2-Scope-and-Type-Resolution-in-the-Code) one? I can only see 4 and 2 votes so far! :O ;P Just quickly read that at work just now! ;P Mm.... this is cool and obviously quite an achievement :thumbsup::cool: However I am not sure where I could reuse that myself.. :O I'll have to think about it again if / when I need code generation....
A new .NET Serializer All in one Menu-Ribbon Bar Taking over the world since 1371!
It *is* pretty specialized. I do a lot of codegen so obv to me it's useful but i don't think it will ever have a wide audience. Where it's super useful to is once it's shored up enough I can use it in my parsers for code inside the grammar. If you write it in Slang it will render out in whatever so it doesn't tie the grammar to a particular output language. Downside is the language in the grammar must be Slang. Right now I've also added an
Evaluate()
method to CodeDomResolver so it can evaluate expressions, call methods and such at runtime. If I did full evaluation i could do runtime grammars without codegen but it would be S-L-O-W.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.
-
Then I must be using a magic feature of an as of yet unheard of version of C# with magical embedded sql like syntax that nobody else has access to. Gosh thanks microsoft. Boy, I feel speshul.
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.
Unstoppable force, may I introduce immovable object. :) ESQL and Pro*C aren't "SQL Like". They are embedded SQL.
Wrong is evil and must be defeated. - Jeff Ello