summaryrefslogtreecommitdiffstats
path: root/parser.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2013-12-14 23:46:32 -0800
committerKaz Kylheku <kaz@kylheku.com>2013-12-14 23:46:32 -0800
commite5cd9bbd3de84e90d5602b83a0eb7780ec4b750e (patch)
treee5a35dda0dc080b69ff6b9042cdabcbd5dd2fa70 /parser.h
parentf8ffbad0cec3ff0be1376a6352fe63a3c5e5f361 (diff)
downloadtxr-e5cd9bbd3de84e90d5602b83a0eb7780ec4b750e.tar.gz
txr-e5cd9bbd3de84e90d5602b83a0eb7780ec4b750e.tar.bz2
txr-e5cd9bbd3de84e90d5602b83a0eb7780ec4b750e.zip
Support for parsing Lisp expression out of strings and streams.
New catenated streams make the Yacc hack possible. * eval.c (eval_init): Register lisp_parse as intrinsic. * parser.h (lisp_parse): Declared. * parser.l: New lexical hack to produce SECRET_ESCAPE_E token. (regex_parse): Move declaration before statements. (lisp_parse): New function. * parser.y (SECRET_ESCAPE_E): New token type. (spec): New production rule for single expression. * stream.c (cat_stream_print, cat_get_line, cat_get_char, cat_get_byte, cat_get_prop): New static functions. (cat_stream_ops): New static function. (make_catenated_stream): New function. * stream.h (make_catenated_stream): Declared.
Diffstat (limited to 'parser.h')
-rw-r--r--parser.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/parser.h b/parser.h
index 93061fe4..bf582fcb 100644
--- a/parser.h
+++ b/parser.h
@@ -50,3 +50,4 @@ INLINE val rlcp(val to, val from)
return rlset(to, source_loc(from));
}
val regex_parse(val string, val error_stream);
+val lisp_parse(val source, val error_stream);