summaryrefslogtreecommitdiffstats
path: root/edify/parser.y
diff options
context:
space:
mode:
authorDoug Zongker <dougz@android.com>2009-06-15 05:49:32 +0200
committerThe Android Open Source Project <initial-contribution@android.com>2009-06-15 05:49:32 +0200
commitcf2b2a2e8fc0361b9db5826c2e5c92d9cb5920d3 (patch)
tree5147d4b4add3e2dc17f5404254e8ef3be80fd23c /edify/parser.y
parentam 9dbc027b: fix sim build in donut, too (diff)
parentedify extensions for OTA package installation, part 2 (diff)
downloadandroid_bootable_recovery-cf2b2a2e8fc0361b9db5826c2e5c92d9cb5920d3.tar
android_bootable_recovery-cf2b2a2e8fc0361b9db5826c2e5c92d9cb5920d3.tar.gz
android_bootable_recovery-cf2b2a2e8fc0361b9db5826c2e5c92d9cb5920d3.tar.bz2
android_bootable_recovery-cf2b2a2e8fc0361b9db5826c2e5c92d9cb5920d3.tar.lz
android_bootable_recovery-cf2b2a2e8fc0361b9db5826c2e5c92d9cb5920d3.tar.xz
android_bootable_recovery-cf2b2a2e8fc0361b9db5826c2e5c92d9cb5920d3.tar.zst
android_bootable_recovery-cf2b2a2e8fc0361b9db5826c2e5c92d9cb5920d3.zip
Diffstat (limited to 'edify/parser.y')
-rw-r--r--edify/parser.y10
1 files changed, 6 insertions, 4 deletions
diff --git a/edify/parser.y b/edify/parser.y
index 67a210fca..cf163c026 100644
--- a/edify/parser.y
+++ b/edify/parser.y
@@ -25,8 +25,8 @@
extern int gLine;
extern int gColumn;
-void yyerror(Expr** root, const char* s);
-int yyparse(Expr** root);
+void yyerror(Expr** root, int* error_count, const char* s);
+int yyparse(Expr** root, int* error_count);
%}
@@ -45,6 +45,7 @@ int yyparse(Expr** root);
%type <args> arglist
%parse-param {Expr** root}
+%parse-param {int* error_count}
%error-verbose
/* declarations in increasing order of precedence */
@@ -86,7 +87,7 @@ expr: STRING {
if ($$->fn == NULL) {
char buffer[256];
snprintf(buffer, sizeof(buffer), "unknown function \"%s\"", $1);
- yyerror(root, buffer);
+ yyerror(root, error_count, buffer);
YYERROR;
}
$$->name = $1;
@@ -113,9 +114,10 @@ arglist: /* empty */ {
%%
-void yyerror(Expr** root, const char* s) {
+void yyerror(Expr** root, int* error_count, const char* s) {
if (strlen(s) == 0) {
s = "syntax error";
}
printf("line %d col %d: %s\n", gLine, gColumn, s);
+ ++*error_count;
}