Handle error case when yylex() failed to parse.

Remove the incorrect characters in rs.spec as well.

Change-Id: I7106e263e79239b970a7a1442efe2625dbe28298
diff --git a/rs.spec b/rs.spec
index c2e3fd8..e9051ac 100644
--- a/rs.spec
+++ b/rs.spec
@@ -159,7 +159,7 @@
     param uint32_t z
     param uint32_t array
     param size_t *stride
-    ret void *s
+    ret void *
     }
 
 Allocation1DData {
@@ -367,7 +367,7 @@
 ScriptInvokeIDCreate {
     param RsScript s
     param uint32_t slot
-    ret RsScriptInvokeID;
+    ret RsScriptInvokeID
     }
 
 ScriptInvoke {
diff --git a/spec.l b/spec.l
index a24bfd3..e500159 100644
--- a/spec.l
+++ b/spec.l
@@ -187,6 +187,11 @@
     BEGIN(INITIAL);
     }
 
+<*>. {
+    fprintf(stderr, "error: unexpected character \'%c\' at line %d\n",
+            *yytext, num_lines + 1);
+    exit(1);
+    }
 
 %%