¿Dónde puedo encontrar la gramática de C# 3.0?


Estoy planeando escribir un compilador de C# 3.0 en C#. ¿Dónde puedo obtener la gramática para parser generation?

Preferiblemente uno que funcione con ANTLR v3 sin modificaciones.

Author: Mehrdad Afshari, 2009-10-13

4 answers

Eche un vistazo a Especificación del lenguaje C# . En el capítulo B. Gramática encontrarás la gramática.

 12
Author: Michael Damatov,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2009-10-14 06:52:46

Me encontré con ANTLR C# Grammar en CodePlex. Es un proyecto relativamente nuevo y utiliza ANTLR 3.2. Dice que es compatible con C # 4.0 y está licenciado bajo la Licencia Pública Eclipse (EPL).

Jugué con él un poco. Tiene un montón de archivos de prueba que contienen expresiones. Soporta lambdas, unsafe context,... como naturalmente esperarías. Analiza un archivo C# y le entrega un árbol de sintaxis abstracta. Puedes hacer lo que quieras con él.

 7
Author: Mehrdad Afshari,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2010-01-21 14:55:38

Estás buscando algo como este o este?

Por favor refiérase también a la pregunta Gramática en C# ANLTR.

 3
Author: Rubens Farias,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-05-23 12:01:26

Echa un vistazo a COCO/Rparece que tienen la especificación de lenguaje para C# 3.0.

 3
Author: ErvinS,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2009-10-14 06:47:07