parameters: (env)
docstring: Add Builders and construction variables for lex to an Environment.
docstring_summary: Add Builders and construction variables for lex to an Environment.
docstring_tokens: Add Builders and construction variables for lex to an Environment .
function: def generate(env):
      """Add Builders and construction variables for lex to an Environment."""
      c_file, cxx_file = SCons.Tool.createCFileBuilders(env)
  
      # C
      c_file.add_action(".l", LexAction)
      c_file.add_emitter(".l", lexEmitter)
  
      c_file.add_action(".lex", LexAction)
      c_file.add_emitter(".lex", lexEmitter)
  
      # Objective-C
      cxx_file.add_action(".lm", LexAction)
      cxx_file.add_emitter(".lm", lexEmitter)
  
      # C++
      cxx_file.add_action(".ll", LexAction)
      cxx_file.add_emitter(".ll", lexEmitter)
  
      env["LEXFLAGS"] = SCons.Util.CLVar("")
  
      if sys.platform == 'win32':
          # ignore the return - we do not need the full path here
          _ = get_lex_path(env, append_paths=True)
          env["LEX"] = env.Detect(BINS)
          if not env.get("LEXUNISTD"):
              env["LEXUNISTD"] = SCons.Util.CLVar("")
          env["LEXCOM"] = "$LEX $LEXUNISTD $LEXFLAGS -t $SOURCES > $TARGET"
      else:
          env["LEX"] = env.Detect(BINS)
          env["LEXCOM"] = "$LEX $LEXFLAGS -t $SOURCES > $TARGET"
function_tokens: def generate ( env ) : c_file , cxx_file = SCons . Tool . createCFileBuilders ( env ) # C c_file . add_action ( ".l" , LexAction ) c_file . add_emitter ( ".l" , lexEmitter ) c_file . add_action ( ".lex" , LexAction ) c_file . add_emitter ( ".lex" , lexEmitter ) # Objective-C cxx_file . add_action ( ".lm" , LexAction ) cxx_file . add_emitter ( ".lm" , lexEmitter ) # C++ cxx_file . add_action ( ".ll" , LexAction ) cxx_file . add_emitter ( ".ll" , lexEmitter ) env [ "LEXFLAGS" ] = SCons . Util . CLVar ( "" ) if sys . platform == 'win32' : # ignore the return - we do not need the full path here _ = get_lex_path ( env , append_paths = True ) env [ "LEX" ] = env . Detect ( BINS ) if not env . get ( "LEXUNISTD" ) : env [ "LEXUNISTD" ] = SCons . Util . CLVar ( "" ) env [ "LEXCOM" ] = "$LEX $LEXUNISTD $LEXFLAGS -t $SOURCES > $TARGET" else : env [ "LEX" ] = env . Detect ( BINS ) env [ "LEXCOM" ] = "$LEX $LEXFLAGS -t $SOURCES > $TARGET"