I'm planning to write a C# 3.0 compiler in C#. Where can I get the grammar for parser generation?
Preferably one that works with ANTLR v3 without modification.
Where will I be able to find C drive in windows 10 laptops ? Broadly the same as previous versions of Windows, click on file explorer, click on This PC, you'll find the C drive there.
Your file explorer should appear by default on your task bar; it's icon looks like a file folder. If you don't have access to that shortcut, you can just type "this pc" or "file explorer" into the search box, and to get to your C: drive, just type "c:" into the same box.
Please be informed that you can go to local disk C: drive in Windows 10 by pressing Windows + E key from the Windows that appears, on the left hand side you will see This PC click on it and all the drives will be expanded. Click on C: Drive.
Take a look at C# Language Specification. In the chapter B. Grammar you'll find the grammar.
I ran into ANTLR C# Grammar on CodePlex. It's a relatively new project and uses ANTLR 3.2. It says it supports C# 4.0 and is licensed under the Eclipse Public License (EPL).
I played with it a little. It has a bunch of test files containing expressions. It supports lambdas, unsafe context, ... as you'd naturally expect. It parses a C# file and hands you an abstract syntax tree. You can do whatever you want with it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With