title: How to write a parser in javascript to parse text in editor into JSON with a model?
body: <p>I don't know if it is the place to ask this. But I will try.</p>
  
  <p>What I need is, for example, if user writes some text in Code Mirror editor like:</p>
  
  <pre><code>a1=Some Text
      a11 = Some Child text
  </code></pre>
  
  <p>and the parser should check if the grammer is correct, and parse it to:</p>
  
  <pre><code> {
      'a1' : {
               'value' : "Some Text",
               'a11' : "some child text"
      }
   }
  </code></pre>
  
  <p>Something like this according to the gramme. </p>
  
  <p>So, is there any parser library or something in javascript?</p>