title: How would you parse indentation (python style)?
body: <p>How would you define your parser and lexer rules to parse a language that uses indentation for defining scope.</p>
  
  <p>I have already googled and found a clever approach for parsing it by generating INDENT and DEDENT tokens in the lexer.</p>
  
  <p>I will go deeper on this problem and post an answer if I come to something interesting, but I would like to see other approaches to the problem.</p>
  
  <p>EDIT:
  As Charlie pointed out, <a href="https://stackoverflow.com/questions/232682/how-would-you-go-about-implementing-off-side-rule">there is already another thread very similar if not the same.</a> Should my post be deleted?</p>