Class JavaScriptLexerBase

  • All Implemented Interfaces:
    org.antlr.v4.runtime.TokenSource
    Direct Known Subclasses:
    JavaScriptLexer

    public abstract class JavaScriptLexerBase
    extends org.antlr.v4.runtime.Lexer
    All lexer methods that used in grammar (IsStrictMode) should start with Upper Case Char similar to Lexer rules.
    • Field Summary

      • Fields inherited from class org.antlr.v4.runtime.Lexer

        _channel, _factory, _hitEOF, _input, _mode, _modeStack, _text, _token, _tokenFactorySourcePair, _tokenStartCharIndex, _tokenStartCharPositionInLine, _tokenStartLine, _type, DEFAULT_MODE, DEFAULT_TOKEN_CHANNEL, HIDDEN, MAX_CHAR_VALUE, MIN_CHAR_VALUE, MORE, SKIP
      • Fields inherited from class org.antlr.v4.runtime.Recognizer

        _interp, EOF
    • Constructor Summary

      Constructors 
      Constructor Description
      JavaScriptLexerBase​(org.antlr.v4.runtime.CharStream input)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void DecreaseTemplateDepth()  
      boolean getStrictDefault()  
      void IncreaseTemplateDepth()  
      boolean IsInTemplateString()  
      protected boolean IsRegexPossible()
      Returns true if the lexer can match a regex literal.
      boolean IsStartOfFile()  
      boolean IsStrictMode()  
      org.antlr.v4.runtime.Token nextToken()
      Return the next token from the character stream and records this last token in case it resides on the default channel.
      protected void ProcessCloseBrace()  
      protected void ProcessOpenBrace()  
      protected void ProcessStringLiteral()  
      void setUseStrictDefault​(boolean value)  
      • Methods inherited from class org.antlr.v4.runtime.Lexer

        emit, emit, emitEOF, getAllTokens, getChannel, getChannelNames, getCharErrorDisplay, getCharIndex, getCharPositionInLine, getErrorDisplay, getErrorDisplay, getInputStream, getLine, getModeNames, getSourceName, getText, getToken, getTokenFactory, getTokenNames, getType, mode, more, notifyListeners, popMode, pushMode, recover, recover, reset, setChannel, setCharPositionInLine, setInputStream, setLine, setText, setToken, setTokenFactory, setType, skip
      • Methods inherited from class org.antlr.v4.runtime.Recognizer

        action, addErrorListener, getATN, getErrorHeader, getErrorListenerDispatch, getErrorListeners, getGrammarFileName, getInterpreter, getParseInfo, getRuleIndexMap, getRuleNames, getSerializedATN, getState, getTokenErrorDisplay, getTokenType, getTokenTypeMap, getVocabulary, precpred, removeErrorListener, removeErrorListeners, sempred, setInterpreter, setState
    • Constructor Detail

      • JavaScriptLexerBase

        public JavaScriptLexerBase​(org.antlr.v4.runtime.CharStream input)
    • Method Detail

      • IsStartOfFile

        public boolean IsStartOfFile()
      • getStrictDefault

        public boolean getStrictDefault()
      • setUseStrictDefault

        public void setUseStrictDefault​(boolean value)
      • IsStrictMode

        public boolean IsStrictMode()
      • IsInTemplateString

        public boolean IsInTemplateString()
      • nextToken

        public org.antlr.v4.runtime.Token nextToken()
        Return the next token from the character stream and records this last token in case it resides on the default channel. This recorded token is used to determine when the lexer could possibly match a regex literal. Also changes scopeStrictModes stack if tokenize special string 'use strict';
        Specified by:
        nextToken in interface org.antlr.v4.runtime.TokenSource
        Overrides:
        nextToken in class org.antlr.v4.runtime.Lexer
        Returns:
        the next token from the character stream.
      • ProcessOpenBrace

        protected void ProcessOpenBrace()
      • ProcessCloseBrace

        protected void ProcessCloseBrace()
      • ProcessStringLiteral

        protected void ProcessStringLiteral()
      • IncreaseTemplateDepth

        public void IncreaseTemplateDepth()
      • DecreaseTemplateDepth

        public void DecreaseTemplateDepth()
      • IsRegexPossible

        protected boolean IsRegexPossible()
        Returns true if the lexer can match a regex literal.