12 | [EX] '{ [IN] [NL] [c_statements] [EX] '} [IN] [NL]
15 define c_variable_decl
16 [c_type_decl] [id] [opt union] '; [NL]
29 [c_term] [repeat c_expr_extend]
50 'if '( [c_expr] ') [NL] [IN]
72 redefine al_host_block
73 '{ [NL] [IN] [al_statements] [EX] '} [NL]
74 | '{ [NL] [IN] [c_statements] [EX] '} [NL]
78 replace [al_type_decl]
105 function alStmtToC1 AlStmt [action_lang_stmt]
107 VarDecl [al_variable_decl]
109 Type [al_type_decl] Id [id] OptUnion [opt union]';
110 construct CType [c_type_decl]
112 construct Result [c_variable_decl]
113 CType [boolTypes] [ptrTypes] Id OptUnion ';
114 replace [repeat c_lang_stmt]
126 function alExprExtendToC AlExprExtend [repeat al_expr_extend]
127 deconstruct AlExprExtend
128 Op [al_expr_op] Term [al_term] Rest [repeat al_expr_extend]
129 construct RestC [repeat c_expr_extend]
130 _ [alExprExtendToC Rest]
131 replace [repeat c_expr_extend]
133 Op Term [alTermToC] RestC
136 function alExprToC AlExpr [al_expr]
138 ALTerm [al_term] AlExprExtend [repeat al_expr_extend]
139 construct CExprExtend [repeat c_expr_extend]
140 _ [alExprExtendToC AlExprExtend]
141 construct Result [opt c_expr]
142 ALTerm [alTermToC] CExprExtend
145 Result [boolVals1] [boolVals2]
148 function alStmtToC2 AlStmt [action_lang_stmt]
151 construct OptCExpr [opt c_expr]
155 replace [repeat c_lang_stmt]
160 function alOptElseC AlOptElse [opt al_else]
161 deconstruct AlOptElse
163 AlSubStmt [action_lang_stmt]
164 construct AlSubStmts [repeat action_lang_stmt]
166 construct CSubStmts [repeat c_lang_stmt]
168 deconstruct CSubStmts
169 CSubStmt [c_lang_stmt]
176 function alStmtToC3 AlStmt [action_lang_stmt]
178 'if '( AlExpr [al_expr] ')
179 AlSubStmt [action_lang_stmt]
180 AlOptElse [opt al_else]
181 construct OptCExpr [opt c_expr]
185 construct AlSubStmts [repeat action_lang_stmt]
187 construct CSubStmts [repeat c_lang_stmt]
189 deconstruct CSubStmts
190 CSubStmt [c_lang_stmt]
191 construct OptCElse [opt c_else]
192 _ [alOptElseC AlOptElse]
193 replace [repeat c_lang_stmt]
200 function alStmtToC4a AlStmt [action_lang_stmt]
203 replace [repeat c_lang_stmt]
205 'printf '( '"%i" ', Id ');
208 function alStmtToC4b AlStmt [action_lang_stmt]
210 'prints String [stringlit] ';
211 replace [repeat c_lang_stmt]
213 'fputs '( String , 'stdout ');
216 function alStmtToC4c AlStmt [action_lang_stmt]
219 replace [repeat c_lang_stmt]
221 'fwrite '( Id ', '1 ', 'pos ', 'stdout ');
224 function alStmtToC4d AlStmt [action_lang_stmt]
227 replace [repeat c_lang_stmt]
229 'fwrite '( 'tokstart ', '1 ', 'tokend '- 'tokstart ', 'stdout ');
232 function alStmtToC5 AlStmt [action_lang_stmt]
234 '{ AlSubStmts [repeat action_lang_stmt] '}
235 construct CSubStmts [repeat c_lang_stmt]
237 replace [repeat c_lang_stmt]
242 function alStmtToC6 AlStmt [action_lang_stmt]
244 RagelStmt [al_ragel_stmt]
245 replace [repeat c_lang_stmt]
250 function alToC AlStmts [repeat action_lang_stmt]
252 FirstStmt [action_lang_stmt] Rest [repeat action_lang_stmt]
253 construct FirstC [repeat c_lang_stmt]
255 [alStmtToC1 FirstStmt]
256 [alStmtToC2 FirstStmt]
257 [alStmtToC3 FirstStmt]
258 [alStmtToC4a FirstStmt]
259 [alStmtToC4b FirstStmt]
260 [alStmtToC4c FirstStmt]
261 [alStmtToC4d FirstStmt]
262 [alStmtToC5 FirstStmt]
263 [alStmtToC6 FirstStmt]
264 construct RestC [repeat c_lang_stmt]
266 replace [repeat c_lang_stmt]
272 replace [al_host_block]
273 '{ AlStmts [repeat action_lang_stmt] '}
274 construct CStmts [repeat c_lang_stmt]
282 Definitions [repeat action_lang_stmt]
284 Initializations [repeat action_lang_stmt]
286 construct CDefinitions [repeat c_lang_stmt]
287 _ [alToC Definitions]
288 construct CInitializations [repeat c_lang_stmt]
289 _ [alToC Initializations]
294 RagelDef [actionTransC]