title: (SCHEME) convert words-> Numbers
body: <p>I have most of this program down, but I am trying to figure out how to get the grammar done for this program. The program uses a lexer and a parser to turn words into numbers (IE. "million" -> 100000)
  I have everything working up to the thousands.</p>
  
  <p>Here is the grammar for the parser</p>
  
  <pre><code>  #lang scheme
  
  (S [(zero) $1]
     [(L) $1])
  (zero [(ZERO) 0])
  **(L [(T) $1]
     [(T D) (expt (thousands-number $1) 10)]
     [(T D L) $1])**
  (T [(H) $1]
     [(A HUNDRED H) (+ (* $1 100) $3)]
     [(A HUNDRED) (* $1 100)])
  (H [(B) $1]
     [(C) $1]
     [(C B) (+ $1 $2)]) 
  (A [(UNDERTEN) (undertwenty-number $1)])
  (B [(UNDERTWENTY) (undertwenty-number $1)]
     [(A) $1])
  (C [(TENS) (tens-number $1)])
  (D [(THOUSANDS) (thousands-number $1)])
  )
   )
  )
  </code></pre>
  
  <p>I'm trying to use exponents to the power of 10 to get the number. 
  Everything else works below 1000. "eight thousand" just returns 8. </p>