[antlr-interest] Tree display

Gerald Rosenberg gerald at certiv.net
Tue Aug 4 11:40:15 PDT 2009


Heh, you are on an email list.  What do you expect?

There are instructions on the bottom of every list email on how to unsubscribe.

At 09:57 AM 8/4/2009, PATEL Vandana wrote:

>Please don’t Copy my email again...
>
>
>Cordialement / Best regards,
>Vandana PATEL
>Business Operations Team
>Mobile:
>Vandana.PATEL at 3ds.com
>
>Visit us at: www.3ds.com
>Dassault Systemes Inc. - 393 St-Jacques West
>Suite 300 -  MONTREAL, QC H2Y 1N9,  Canada
>-----Original Message-----
>From: antlr-interest-bounces at antlr.org 
>[mailto:antlr-interest-bounces at antlr.org] On Behalf Of Gerald Rosenberg
>Sent: Tuesday, August 04, 2009 12:50 PM
>To: Safiye Celik
>Cc: antlr-interest at antlr.org
>Subject: Re: [antlr-interest] Tree display
>
>At 07:28 AM 8/4/2009, Safiye Celik wrote:
> >Hi,
> >I am writing an ANTLR code in Java. I am using ANTLR version 3. I
> >created my tree, but how can I show the tree on the screen. On the
> >internet, there are lots of info about doing that job in ANTLR v2.
> >They create an ASTFrame object from created CommonAST tree and use
> >ASTFrame's setVisible() function to show it. But CommonTree is used
> >in v3 instead of AST, so I cannot write it in that way. So, what is
> >the v3 correspondence of the ASTFrame usage??
> >
> >Below is my CommonTree creation code.
> >
> >String s = //assigned to an expression valid in my grammar;
> >MyLexer lexer = new MyLexer( new ANTLRStringStream(s) );
> >CommonTokenStream tokens = new CommonTokenStream(lexer);
> >MyParser.expression_return ret = parser.expression();
> >CommonTree exptree = ( CommonTree ) ret.tree;
> >
> >What I need it how to show that "exptree" on the screen??
>
>If you are using Eclipse, AntlrDT provide views that will show the
>generated AST, the underlying token stream, and list of parsing/lexing errors.
>
>
>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