[antlr-interest] [C# target]about efficiency of the code

Mari Matinlassi mmatinlassi at icinetic.com
Mon Nov 14 00:31:00 PST 2011


Hi,

Maybe you can take a look how a walker is done in this example (download the
code and look at the methods in MessageContractAssembler.cs):
http://abdullin.com/journal/2010/10/12/teach-visual-studio-your-own-language
-easy.html

In addition, it is a good idea to simplify your AST before walking through
it. I have used rewrite rules. You might find this tutorial useful:
http://floris.briolas.nl/floris/2008/08/antlr-ast-and-rewriting-rules/

-mari

-----Original Message-----
From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-bounces at antlr.
org] On Behalf Of ???
Sent: Sunday, November 13, 2011 3:37 PM
To: antlr-interest at antlr.org
Subject: [antlr-interest] [C# target]about efficiency of the code

Hello all

I write a very small script language in C#. I have to use box and unbox
again and again in C# code to walk through the AST tree, and a lot of method
use reflection, so i worry about the code efficiency.

anyone have experience walk through tree in C#? how to do more effectively?
can give me some hints?

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address




More information about the antlr-interest mailing list