title: Parser Combinators, separating grammar and AST construction
body: <p>I'm writing a simple functional programming language in Scala using the parser-combinators library.</p>
  
  <p>The syntax is specified here: <a href="https://github.com/hejfelix/Frase/blob/master/src/main/scala/it/vigtig/lambda/ParserLike.scala">https://github.com/hejfelix/Frase/blob/master/src/main/scala/it/vigtig/lambda/ParserLike.scala</a></p>
  
  <p>There is one thing which I haven't been able to solve with the implementation: how do I separate grammar definition from the transformation into AST nodes?</p>
  
  <p>Would be really cool to have a close-to-human-readable grammar directly the parser source, especially considering that I'm the only programmer on the project ATM and it could serve as documentation.</p>
  
  <p>How do I separate the grammar and AST-specific code?</p>