Class Ek9Lexer

java.lang.Object
org.antlr.v4.runtime.Recognizer<Integer,org.antlr.v4.runtime.atn.LexerATNSimulator>
org.antlr.v4.runtime.Lexer
org.ek9lang.antlr.EK9LexerRules
org.ek9lang.compiler.tokenizer.Ek9Lexer
All Implemented Interfaces:
org.antlr.v4.runtime.TokenSource, LexerPlugin

public class Ek9Lexer extends EK9LexerRules implements LexerPlugin
Original good for python but too pythonesque for EK9 - needed reworking to remove # comment and tabs for indenting. EK9 only allows spaces for indents.
  • Field Details

  • Constructor Details

    • Ek9Lexer

      public Ek9Lexer(org.antlr.v4.runtime.CharStream input, int indentToken, int dedentToken)
      Create a lexer for an input with specific indent and dedent tokens.
  • Method Details

    • getSourceName

      public String getSourceName()
      Specified by:
      getSourceName in interface org.antlr.v4.runtime.TokenSource
      Overrides:
      getSourceName in class org.antlr.v4.runtime.Lexer
    • setSourceName

      public Ek9Lexer setSourceName(String sourceName)
    • setTokenListener

      public void setTokenListener(TokenConsumptionListener tokenListener)
    • getIndentToken

      public int getIndentToken()
      Specified by:
      getIndentToken in interface LexerPlugin
    • getDedentToken

      public int getDedentToken()
      Specified by:
      getDedentToken in interface LexerPlugin
    • getSymbolicName

      public String getSymbolicName(int tokenType)
      Specified by:
      getSymbolicName in interface LexerPlugin
    • nextToken

      public org.antlr.v4.runtime.Token nextToken()
      Specified by:
      nextToken in interface org.antlr.v4.runtime.TokenSource
      Overrides:
      nextToken in class org.antlr.v4.runtime.Lexer
    • setPrintTokensAsSupplied

      public Ek9Lexer setPrintTokensAsSupplied(boolean printTokensAsSupplied)
    • popMode

      public int popMode()
      Overrides:
      popMode in class org.antlr.v4.runtime.Lexer
    • isRegexPossible

      protected boolean isRegexPossible()
      Overrides:
      isRegexPossible in class EK9LexerRules