code: def first_lookup(self, symbol, size=1):
          
          if isinstance(symbol, (TerminalSymbol, NullSymbol)):
              return [symbol.gd]
          result = []
          for production in self.productions:
              if production.leftside[0] != symbol:
                  continue
              for right_symbol in production.rightside:
                  if right_symbol == symbol: #Avoids infinite recursion
                      break
                  current_symbol_first = self.first_lookup(right_symbol, size)
                  import collections
                  from pydsl.grammar.definition import String
                  if isinstance(current_symbol_first, collections.Iterable) and not isinstance(current_symbol_first, String):
                      result += current_symbol_first
                  else:
                      result.append(current_symbol_first)
                  if isinstance(current_symbol_first, String) or \
                          not isinstance(current_symbol_first, collections.Iterable) or \
                          (NullSymbol not in current_symbol_first):
                      break # This element doesn't have Null in its first set so there is no need to continue
          if not result:
              raise KeyError("Symbol doesn't exist in this grammar")
          return Choice(result)
docs: Returns a Grammar Definition with the first n terminal symbols
          produced by the input symbol