codewitch-honey-crisis / pck

The Parser Construction Kit ("Puck"): A Parser Generator and Grammar Translator in C#
https://www.codeproject.com/Articles/5165072/Pck-Code-Roundup-and-Quick-Start-Guide
MIT License
35 stars 3 forks source link

How to parse IL peachpie #2

Closed weedkiller closed 3 years ago

weedkiller commented 3 years ago

Hello how can I parse other .NET IL libs.

I want to parse .NET IL from C# and PHP# here

Can you allow us to attach other codeDom syntax from .NET

codewitch-honey-crisis commented 3 years ago
You can attach whatever syntax you like, but you’re barking up the wrong tree. Slang is built to go from C# to the CodeDOM. IL doesn’t enter into it at all. And parsing IL is easy. It’s running IL that isn’t You can’t run IL from PHP and even if you could it would be a terrible idea. Best regards,honey the codewitch Sent from Mail for Windows 10 From: weedkillerSent: Friday, February 5, 2021 2:59 PMTo: codewitch-honey-crisis/pckCc: SubscribedSubject: [codewitch-honey-crisis/pck] How to parse IL peachpie (#2) Hello how can I parse other .NET IL libs.I want to parse .NET IL from C# and PHP# here Can you allow us to attach other codeDom syntax from .NET—You are receiving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or unsubscribe. 
weedkiller commented 3 years ago

the description had me confused, thought it was code dom parser

codewitch-honey-crisis commented 3 years ago

It is a codedom parser. It parses a C# subset into System.CodeDom objects.

if you use it to parse a .cs file you will get a CodeCompileUnit object back.

That has nothing to do with IL. The CodeDOM doesn't produce IL, and doesn't parse IL. It is an abstract syntax tree for representing programming constructs. System.CodeDom.Compiler namespace provides some front end convenience functions to invoke compilers, but its the compiler that turns code rendered from a CodeDOM tree into IL.