   catch result
     result = "<div class=\"error\">" + result + "</div>"
   return result.replace /\n/g,''
-
-

      lookahead = tokens.shift()
      lookahead = null  if typeof lookahead is "undefined"
    else 
      throw "Syntax Error. Expected #{t} found '" + 
            lookahead.value + "' near '" + 
            input.substr(lookahead.from) + "'"
    return


  program = ->
    result = block()
    if lookahead and lookahead.type is "."
      match "."
    else
      throw "Syntax Error. Expected '.' Remember to end
                 your input with a ."
    result

  block = ->
    resultarr = []

    if lookahead and lookahead.type is "CONST"
       match "CONST"
       constante = ->
         result = null
         if lookahead and lookahead.type is "ID"
           left =
             type: "Const ID"
             value: lookahead.value
           match "ID"
           match "="
           if lookahead and lookahead.type is "NUM"
             right =
               type: "NUM"
               value: lookahead.value
             match "NUM"
           else # Error!
             throw "Syntax Error. Expected NUM but found " + 
                   (if lookahead then lookahead.value else "end of input") + 
                   " near '#{input.substr(lookahead.from)}'"
         else # Error!
           throw "Syntax Error. Expected ID but found " + 
                 (if lookahead then lookahead.value else "end of input") + 
                 " near '#{input.substr(lookahead.from)}'"
         result =
           type: "="
           left: left
           right: right
         result
       resultarr.push constante()
       while lookahead and lookahead.type is ","
         match ","
         resultarr.push constante()
       match ";"
    
    if lookahead and lookahead.type is "VAR"
       match "VAR"
       variable = ->
         result = null
         if lookahead and lookahead.type is "ID"
           result =
             type: "Var ID"
             value: lookahead.value
           match "ID"
         else # Error!
           throw "Syntax Error. Expected ID but found " + 
                 (if lookahead then lookahead.value else "end of input") + 
                 " near '#{input.substr(lookahead.from)}'"
         result
       resultarr.push variable()
       while lookahead and lookahead.type is ","
         match ","
         resultarr.push variable()
       match ";"
  
    proced = ->
      result = null

          value: value
          left: block()
        match ";"
      else
        throw "Syntax Error. Expected ID but found " + 
              (if lookahead then lookahead.value else "end of input") + 
              " near '#{input.substr(lookahead.from)}'"
