Class ANTLRParser.grammar_Adaptor

    • Constructor Detail

      • grammar_Adaptor

        public grammar_Adaptor​(ANTLRParser outer)
    • Method Detail

      • create

        public java.lang.Object create​(Token payload)
        Description copied from interface: TreeAdaptor
        Create a tree node from Token object; for CommonTree type trees, then the token just becomes the payload. This is the most common create call. Override if you want another kind of node to be built.
        Specified by:
        create in interface TreeAdaptor
        Overrides:
        create in class CommonTreeAdaptor
      • errorNode

        public java.lang.Object errorNode​(TokenStream input,
                                          Token start,
                                          Token stop,
                                          RecognitionException e)
        Description copied from class: BaseTreeAdaptor
        create tree node that holds the start and stop tokens associated with an error. If you specify your own kind of tree nodes, you will likely have to override this method. CommonTree returns Token.INVALID_TOKEN_TYPE if no token payload but you might have to set token type for diff node type. You don't have to subclass CommonErrorNode; you will likely need to subclass your own tree node class to avoid class cast exception.
        Specified by:
        errorNode in interface TreeAdaptor
        Overrides:
        errorNode in class BaseTreeAdaptor