All Downloads are FREE. Search and download functionalities are using the official Maven repository.

Java.target.apidocs.org.antlr.v4.runtime.CommonTokenStream.html Maven / Gradle / Ivy

There is a newer version: 4.9.0
Show newest version






CommonTokenStream (ANTLR 4 Runtime (Optimized) 4.7.3 API)











org.antlr.v4.runtime

Class CommonTokenStream

    • Field Detail

      • channel

        protected int channel
        Specifies the channel to use for filtering tokens.

        The default value is Token.DEFAULT_CHANNEL, which matches the default channel assigned to tokens created by the lexer.

    • Constructor Detail

      • CommonTokenStream

        public CommonTokenStream(@NotNull
                         TokenSource tokenSource)
        Constructs a new CommonTokenStream using the specified token source and the default token channel (Token.DEFAULT_CHANNEL).
        Parameters:
        tokenSource - The token source.
      • CommonTokenStream

        public CommonTokenStream(@NotNull
                         TokenSource tokenSource,
                         int channel)
        Constructs a new CommonTokenStream using the specified token source and filtering tokens to the specified channel. Only tokens whose Token.getChannel() matches channel or have the Token.getType() equal to Token.EOF will be returned by the token stream lookahead methods.
        Parameters:
        tokenSource - The token source.
        channel - The channel to use for filtering tokens.
    • Method Detail

      • adjustSeekIndex

        protected int adjustSeekIndex(int i)
        Description copied from class: BufferedTokenStream
        Allowed derived classes to modify the behavior of operations which change the current stream position by adjusting the target token index of a seek operation. The default implementation simply returns i. If an exception is thrown in this method, the current stream index should not be changed.

        For example, CommonTokenStream overrides this method to ensure that the seek target is always an on-channel token.

        Overrides:
        adjustSeekIndex in class BufferedTokenStream
        Parameters:
        i - The target token index.
        Returns:
        The adjusted target token index.
      • getNumberOfOnChannelTokens

        public int getNumberOfOnChannelTokens()
        Count EOF just once.

Copyright © 1992–2019 Tunnel Vision Laboratories, LLC. All rights reserved.





© 2015 - 2024 Weber Informatics LLC | Privacy Policy