comparison 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
comparison
equal deleted inserted replaced
25:87590f43e76d 26:26aa76da75ad
53 int lexer_ignorechar; 53 int lexer_ignorechar;
54 54
55 int parser_state; 55 int parser_state;
56 56
57 void *input_state; 57 void *input_state;
58
59 char *currentsub;
58 } cstate; 60 } cstate;
59 61
60 /* parser states */ 62 /* parser states */
61 enum 63 enum
62 { 64 {
73 token_kw_public, /* PUBLIC keyword */ 75 token_kw_public, /* PUBLIC keyword */
74 token_kw_private, /* PRIVATE keyword */ 76 token_kw_private, /* PRIVATE keyword */
75 token_kw_params, /* PARAMS keyword */ 77 token_kw_params, /* PARAMS keyword */
76 token_kw_returns, /* RETURNS keyword */ 78 token_kw_returns, /* RETURNS keyword */
77 token_kw_integer, /* INTEGER keyword */ 79 token_kw_integer, /* INTEGER keyword */
80 token_kw_endsub, /* ENDSUB keyword */
81 token_kw_endfunction, /* ENDFUNCTION keyword */
78 token_identifier, /* an identifier (variable, function, etc. */ 82 token_identifier, /* an identifier (variable, function, etc. */
79 token_char, /* single character; fallback */ 83 token_char, /* single character; fallback */
80 token_uint, /* unsigned integer up to 32 bits */ 84 token_uint, /* unsigned integer up to 32 bits */
81 token_int, /* signed integer up to 32 bits */ 85 token_int, /* signed integer up to 32 bits */
82 token_eol, /* end of line */ 86 token_eol, /* end of line */
93 97
94 #ifndef __lexer_c_seen__ 98 #ifndef __lexer_c_seen__
95 extern void lexer(cstate *state); 99 extern void lexer(cstate *state);
96 #endif 100 #endif
97 101
102 #ifndef __emit_c_seen__
103 extern void emit_prolog(cstate *state, int vis, int framesize);
104 extern void emit_epilog(cstate *state);
105 #endif
106
107
98 #endif /* __lwbasic_h_seen__ */ 108 #endif /* __lwbasic_h_seen__ */