diff lwbasic/lwbasic.h @ 26:26aa76da75ad

Additional parsing in function/sub; emission of prolog/epilog code
author lost@l-w.ca
date Thu, 27 Jan 2011 20:44:57 -0700
parents 87590f43e76d
children 77626fc37af2
line wrap: on
line diff
--- a/lwbasic/lwbasic.h	Mon Jan 24 20:08:09 2011 -0700
+++ b/lwbasic/lwbasic.h	Thu Jan 27 20:44:57 2011 -0700
@@ -55,6 +55,8 @@
 	int parser_state;
 	
 	void *input_state;
+	
+	char *currentsub;
 } cstate;
 
 /* parser states */
@@ -75,6 +77,8 @@
 	token_kw_params,			/* PARAMS keyword */
 	token_kw_returns,			/* RETURNS keyword */
 	token_kw_integer,			/* INTEGER keyword */
+	token_kw_endsub,			/* ENDSUB keyword */
+	token_kw_endfunction,		/* ENDFUNCTION keyword */
 	token_identifier,			/* an identifier (variable, function, etc. */
 	token_char,					/* single character; fallback */
 	token_uint,					/* unsigned integer up to 32 bits */
@@ -95,4 +99,10 @@
 extern void lexer(cstate *state);
 #endif
 
+#ifndef __emit_c_seen__
+extern void emit_prolog(cstate *state, int vis, int framesize);
+extern void emit_epilog(cstate *state);
+#endif
+
+
 #endif /* __lwbasic_h_seen__ */