Hi there;

I did define a customized node, extending a commonTree, defined an
adaptor extending a  CommonTreeAdaptor, for my semantic analysis.

I did extend as well CommonErrorNode;

And now myAdaptor look like:

public class BTLTreeAdaptor extends CommonTreeAdaptor{
        @Override
        public Object create(Token payload) {
                return new BTLNodeTree(payload);
        }
        @Override
        public Object errorNode(TokenStream input, Token start, Token stop,
RecognitionException e) {
                return new BTLErrorNode(input, start, stop, e);
        }

Now I supose, that I have to extend CommonTreeNodeStream because I'm
getting a classCastExcpetion, I didn't find any information in the
book:
The Definitive ANTLR Reference, about how to deal with that. I'm using
ANTLR v3.1.

How should I extend CommonTreeNodeStream? Do I need to change my
adaptor or something else? My customized node tree has just few
attributes, to allow the walker to analyze the semantic of the
language I'm defining.

My customized node tree look like:

public class BTLNodeTree extends CommonTree {

        public Identificador identificador;
        public SymbolConst symbolConst;
        public String expType = "";
        public String expSecType = "";

        public BTLNodeTree(Token t)
        {
                 super(t);
        }
}


Thx in advance for your help,

Cheers

-- 
Marouane

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

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to