Package antlr

Class TokenStreamSelector

  • All Implemented Interfaces:
    IASDebugStream, TokenStream

    public class TokenStreamSelector
    extends Object
    implements TokenStream, IASDebugStream
    A token stream MUX (multiplexor) knows about n token streams and can multiplex them onto the same channel for use by token stream consumer like a parser. This is a way to have multiple lexers break up the same input stream for a single parser. Or, you can have multiple instances of the same lexer handle multiple input streams; this works great for includes.
    • Field Detail

      • inputStreamNames

        protected Hashtable inputStreamNames
        The set of inputs to the MUX
      • input

        protected TokenStream input
        The currently-selected token stream input
      • streamStack

        protected Stack streamStack
        Used to track stack of input streams
    • Constructor Detail

      • TokenStreamSelector

        public TokenStreamSelector()