summaryrefslogtreecommitdiffstats
path: root/edify/parser.y
diff options
context:
space:
mode:
authorDoug Zongker <dougz@android.com>2014-02-14 00:07:56 +0100
committerDoug Zongker <dougz@android.com>2014-02-14 00:34:18 +0100
commit0d32f259cddeaf46917bdc4af3514114c206dd76 (patch)
tree6d6a6f6793cd8a335dbc6f3d6ed21598748378dd /edify/parser.y
parentremove 'retouch' ASLR support (diff)
downloadandroid_bootable_recovery-0d32f259cddeaf46917bdc4af3514114c206dd76.tar
android_bootable_recovery-0d32f259cddeaf46917bdc4af3514114c206dd76.tar.gz
android_bootable_recovery-0d32f259cddeaf46917bdc4af3514114c206dd76.tar.bz2
android_bootable_recovery-0d32f259cddeaf46917bdc4af3514114c206dd76.tar.lz
android_bootable_recovery-0d32f259cddeaf46917bdc4af3514114c206dd76.tar.xz
android_bootable_recovery-0d32f259cddeaf46917bdc4af3514114c206dd76.tar.zst
android_bootable_recovery-0d32f259cddeaf46917bdc4af3514114c206dd76.zip
Diffstat (limited to '')
-rw-r--r--edify/parser.y9
1 files changed, 9 insertions, 0 deletions
diff --git a/edify/parser.y b/edify/parser.y
index 3f9ade144..f8fb2d12f 100644
--- a/edify/parser.y
+++ b/edify/parser.y
@@ -29,6 +29,10 @@ extern int gColumn;
void yyerror(Expr** root, int* error_count, const char* s);
int yyparse(Expr** root, int* error_count);
+struct yy_buffer_state;
+void yy_switch_to_buffer(struct yy_buffer_state* new_buffer);
+struct yy_buffer_state* yy_scan_string(const char* yystr);
+
%}
%locations
@@ -128,3 +132,8 @@ void yyerror(Expr** root, int* error_count, const char* s) {
printf("line %d col %d: %s\n", gLine, gColumn, s);
++*error_count;
}
+
+int parse_string(const char* str, Expr** root, int* error_count) {
+ yy_switch_to_buffer(yy_scan_string(str));
+ return yyparse(root, error_count);
+}