Class JavaScriptLexerBase

java.lang.Object
Lexer
org.luwrain.antlr.js.JavaScriptLexerBase

public abstract class JavaScriptLexerBase extends Lexer
All lexer methods that used in grammar (IsStrictMode) should start with Upper Case Char similar to Lexer rules.
  • Constructor Details

    • JavaScriptLexerBase

      public JavaScriptLexerBase(CharStream input)
  • Method Details

    • IsStartOfFile

      public boolean IsStartOfFile()
    • getStrictDefault

      public boolean getStrictDefault()
    • setUseStrictDefault

      public void setUseStrictDefault(boolean value)
    • IsStrictMode

      public boolean IsStrictMode()
    • IsInTemplateString

      public boolean IsInTemplateString()
    • nextToken

      public 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';
      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.
    • reset

      public void reset()