:py:mod:`pyab_experiment.language.lexer`
========================================

.. py:module:: pyab_experiment.language.lexer

.. autoapi-nested-parse::

   Lexical Analysis for Experiment Language Definition

   This module defines the lexer for the experiment language definition.
   It includes common constructs such as operators, identifiers, and literals
   (floats, integers). The module also defines reserved keywords used by the grammar.

   The lexical analysis is performed using YACC (via the SLY implementation)
   for finite state automaton processing.



Module Contents
---------------

Classes
~~~~~~~

.. autoapisummary::

   pyab_experiment.language.lexer.BlockComment
   pyab_experiment.language.lexer.ExperimentLexer




.. py:class:: BlockComment


   Bases: :py:obj:`pyab_experiment.sly.Lexer`

   Helper state that deals with C style opening
   and closing block comments

   .. py:attribute:: ignore_newline
      :value: '\\n+'

      

   .. py:attribute:: tokens

      

   .. py:method:: BLOCK_COMMENT_END(t)


   .. py:method:: ignore_newline(t)


   .. py:method:: t_block_comment_content(t)



.. py:class:: ExperimentLexer


   Bases: :py:obj:`pyab_experiment.sly.Lexer`

   Lexical analyzer for an AB testing configuration language.

   This class provides a method for tokenizing an AB testing configuration
   file into a list of tokens, to be used for parsing and validation, in conjunction
   with the grammar defined in a companion class.
   The lexer uses regular expressions to match terminal patterns in the configuration
   file and generate corresponding tokens.

   .. py:attribute:: COLON
      :value: ':'

      

   .. py:attribute:: COMMA
      :value: ','

      

   .. py:attribute:: ID
      :value: '[a-zA-Z_][a-zA-Z0-9_]*'

      

   .. py:attribute:: KW_AND
      :value: 'and'

      

   .. py:attribute:: KW_DEF
      :value: 'def'

      

   .. py:attribute:: KW_ELIF
      :value: 'else\\s*if'

      

   .. py:attribute:: KW_ELSE
      :value: 'else'

      

   .. py:attribute:: KW_EQ
      :value: '=='

      

   .. py:attribute:: KW_GE
      :value: '>='

      

   .. py:attribute:: KW_GT
      :value: '>'

      

   .. py:attribute:: KW_IF
      :value: 'if'

      

   .. py:attribute:: KW_IN
      :value: 'in'

      

   .. py:attribute:: KW_LE
      :value: '<='

      

   .. py:attribute:: KW_LT
      :value: '<'

      

   .. py:attribute:: KW_NE
      :value: '!='

      

   .. py:attribute:: KW_NOT
      :value: 'not'

      

   .. py:attribute:: KW_NOT_IN
      :value: 'not\\s+in'

      

   .. py:attribute:: KW_OR
      :value: 'or'

      

   .. py:attribute:: KW_RETURN
      :value: 'return'

      

   .. py:attribute:: KW_SALT
      :value: 'salt'

      

   .. py:attribute:: KW_SPLITTERS
      :value: 'splitters'

      

   .. py:attribute:: KW_WEIGHTED
      :value: 'weighted'

      

   .. py:attribute:: LBRACE
      :value: '{'

      

   .. py:attribute:: LPAREN
      :value: '\\('

      

   .. py:attribute:: MINUS
      :value: '-'

      

   .. py:attribute:: RBRACE
      :value: '}'

      

   .. py:attribute:: RPAREN
      :value: '\\)'

      

   .. py:attribute:: ignore_inline_comment
      :value: '//.*'

      

   .. py:attribute:: ignore_newline
      :value: '\\n+'

      

   .. py:attribute:: ignore_ws
      :value: '\\s+'

      

   .. py:attribute:: tokens

      

   .. py:method:: BLOCK_COMMENT_START(t)


   .. py:method:: NON_NEG_FLOAT(t)


   .. py:method:: NON_NEG_INTEGER(t)


   .. py:method:: STRING_LITERAL(t)


   .. py:method:: error(t)


   .. py:method:: ignore_newline(t)



