diff --git a/.gitattributes b/.gitattributes index e728fc33039cb54a63ac62dd5a6cb45d10236fe8..1ef08d32a89f601f3d642cc73f5ed8a3ed224bda 100644 --- a/.gitattributes +++ b/.gitattributes @@ -185,3 +185,6 @@ my_container_sandbox/workspace/anaconda3/pkgs/xz-5.4.6-h5eee18b_0.conda filter=l my_container_sandbox/workspace/anaconda3/pkgs/libgomp-9.3.0-h5101ec6_17.conda filter=lfs diff=lfs merge=lfs -text my_container_sandbox/workspace/anaconda3/pkgs/setuptools-52.0.0-py39h06a4308_0.conda filter=lfs diff=lfs merge=lfs -text my_container_sandbox/workspace/anaconda3/pkgs/setuptools-69.2.0-pyhd8ed1ab_0.conda filter=lfs diff=lfs merge=lfs -text +my_container_sandbox/workspace/anaconda3/pkgs/openssl-1.1.1k-h27cfd23_0.conda filter=lfs diff=lfs merge=lfs -text +my_container_sandbox/workspace/anaconda3/pkgs/ld_impl_linux-64-2.35.1-h7274673_9.conda filter=lfs diff=lfs merge=lfs -text +my_container_sandbox/workspace/anaconda3/pkgs/readline-8.1-h27cfd23_0.conda filter=lfs diff=lfs merge=lfs -text diff --git a/my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/antlr4/BufferedTokenStream.py b/my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/antlr4/BufferedTokenStream.py new file mode 100644 index 0000000000000000000000000000000000000000..aaa58c63dc02b8b0bf43398b751f1d14fef89ad9 --- /dev/null +++ b/my_container_sandbox/workspace/anaconda3/lib/python3.8/site-packages/antlr4/BufferedTokenStream.py @@ -0,0 +1,302 @@ +# +# Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. +# Use of this file is governed by the BSD 3-clause license that +# can be found in the LICENSE.txt file in the project root. + +# This implementation of {@link TokenStream} loads tokens from a +# {@link TokenSource} on-demand, and places the tokens in a buffer to provide +# access to any previous token by index. +# +#

+# This token stream ignores the value of {@link Token#getChannel}. If your +# parser requires the token stream filter tokens to only those on a particular +# channel, such as {@link Token#DEFAULT_CHANNEL} or +# {@link Token#HIDDEN_CHANNEL}, use a filtering token stream such a +# {@link CommonTokenStream}.

+from io import StringIO +from antlr4.Token import Token +from antlr4.error.Errors import IllegalStateException + +# need forward declaration +Lexer = None + +# this is just to keep meaningful parameter types to Parser +class TokenStream(object): + + pass + + +class BufferedTokenStream(TokenStream): + __slots__ = ('tokenSource', 'tokens', 'index', 'fetchedEOF') + + def __init__(self, tokenSource:Lexer): + # The {@link TokenSource} from which tokens for this stream are fetched. + self.tokenSource = tokenSource + + # A collection of all tokens fetched from the token source. The list is + # considered a complete view of the input once {@link #fetchedEOF} is set + # to {@code true}. + self.tokens = [] + + # The index into {@link #tokens} of the current token (next token to + # {@link #consume}). {@link #tokens}{@code [}{@link #p}{@code ]} should be + # {@link #LT LT(1)}. + # + #

This field is set to -1 when the stream is first constructed or when + # {@link #setTokenSource} is called, indicating that the first token has + # not yet been fetched from the token source. For additional information, + # see the documentation of {@link IntStream} for a description of + # Initializing Methods.

+ self.index = -1 + + # Indicates whether the {@link Token#EOF} token has been fetched from + # {@link #tokenSource} and added to {@link #tokens}. This field improves + # performance for the following cases: + # + #