2 * Copyright 2011 Jacek Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
24 #include "wine/debug.h"
26 WINE_DEFAULT_DEBUG_CHANNEL
(vbscript
);
29 #define YYLEX_PARAM ctx
30 #define YYPARSE_PARAM ctx
32 static int parser_error
(const char*);
34 static void parse_complete
(parser_ctx_t
*,BOOL
);
36 static void source_add_statement
(parser_ctx_t
*,statement_t
*);
37 static void source_add_class
(parser_ctx_t
*,class_decl_t
*);
39 static void *new_expression
(parser_ctx_t
*,expression_type_t
,size_t);
40 static expression_t
*new_bool_expression
(parser_ctx_t
*,VARIANT_BOOL
);
41 static expression_t
*new_string_expression
(parser_ctx_t
*,const WCHAR
*);
42 static expression_t
*new_long_expression
(parser_ctx_t
*,expression_type_t
,LONG
);
43 static expression_t
*new_double_expression
(parser_ctx_t
*,double);
44 static expression_t
*new_unary_expression
(parser_ctx_t
*,expression_type_t
,expression_t
*);
45 static expression_t
*new_binary_expression
(parser_ctx_t
*,expression_type_t
,expression_t
*,expression_t
*);
46 static expression_t
*new_new_expression
(parser_ctx_t
*,const WCHAR
*);
48 static member_expression_t
*new_member_expression
(parser_ctx_t
*,expression_t
*,const WCHAR
*);
50 static void *new_statement
(parser_ctx_t
*,statement_type_t
,size_t);
51 static statement_t
*new_call_statement
(parser_ctx_t
*,member_expression_t
*);
52 static statement_t
*new_assign_statement
(parser_ctx_t
*,member_expression_t
*,expression_t
*);
53 static statement_t
*new_set_statement
(parser_ctx_t
*,member_expression_t
*,expression_t
*);
54 static statement_t
*new_dim_statement
(parser_ctx_t
*,dim_decl_t
*);
55 static statement_t
*new_if_statement
(parser_ctx_t
*,expression_t
*,statement_t
*,elseif_decl_t
*,statement_t
*);
56 static statement_t
*new_function_statement
(parser_ctx_t
*,function_decl_t
*);
58 static dim_decl_t
*new_dim_decl
(parser_ctx_t
*,const WCHAR
*,dim_decl_t
*);
59 static elseif_decl_t
*new_elseif_decl
(parser_ctx_t
*,expression_t
*,statement_t
*);
60 static function_decl_t
*new_function_decl
(parser_ctx_t
*,const WCHAR
*,function_type_t
,unsigned,arg_decl_t
*,statement_t
*);
61 static arg_decl_t
*new_argument_decl
(parser_ctx_t
*,const WCHAR
*,BOOL
);
63 static class_decl_t
*new_class_decl
(parser_ctx_t
*);
64 static class_decl_t
*add_class_function
(parser_ctx_t
*,class_decl_t
*,function_decl_t
*);
66 #define STORAGE_IS_PRIVATE 1
67 #define STORAGE_IS_DEFAULT 2
69 #define CHECK_ERROR if(((parser_ctx_t*)ctx)->hres != S_OK) YYABORT
78 statement_t
*statement
;
79 expression_t
*expression
;
80 member_expression_t
*member
;
81 elseif_decl_t
*elseif
;
83 function_decl_t
*func_decl
;
85 class_decl_t
*class_decl
;
92 %token tEOF tNL tREM tEMPTYBRACKETS
94 %token tNOT tAND tOR tXOR tEQV tIMP tNEQ
95 %token tIS tLTEQ tGTEQ tMOD
96 %token tCALL tDIM tSUB tFUNCTION tPROPERTY tGET tLET
97 %token tIF tELSE tELSEIF tEND tTHEN tEXIT
98 %token tWHILE tWEND tDO tLOOP tUNTIL
100 %token tOPTION tEXPLICIT
102 %token tNOTHING tEMPTY tNULL
103 %token tCLASS tSET tNEW tPUBLIC tPRIVATE tDEFAULT tME
104 %token tERROR tNEXT tON tRESUME tGOTO
105 %token
<string> tIdentifier tString
106 %token
<lng
> tLong tShort
109 %type
<statement
> Statement StatementNl StatementsNl StatementsNl_opt IfStatement Else_opt
110 %type
<expression
> Expression LiteralExpression PrimaryExpression EqualityExpression CallExpression
111 %type
<expression
> ConcatExpression AdditiveExpression ModExpression IntdivExpression MultiplicativeExpression ExpExpression
112 %type
<expression
> NotExpression UnaryExpression AndExpression OrExpression XorExpression EqvExpression
113 %type
<member
> MemberExpression
114 %type
<expression
> Arguments_opt ArgumentList_opt ArgumentList
115 %type
<bool> OptionExplicit_opt
116 %type
<arg_decl
> ArgumentsDecl_opt ArgumentDeclList ArgumentDecl
117 %type
<func_decl
> FunctionDecl
118 %type
<elseif
> ElseIfs_opt ElseIfs ElseIf
119 %type
<class_decl
> ClassDeclaration ClassBody
120 %type
<uint
> Storage Storage_opt
121 %type
<dim_decl
> DimDeclList
126 : OptionExplicit_opt SourceElements tEOF
{ parse_complete
(ctx
, $1); }
129 : /* empty */ { $$
= FALSE
; }
130 | tOPTION tEXPLICIT tNL
{ $$
= TRUE
; }
134 | SourceElements StatementNl
{ source_add_statement
(ctx
, $2); }
135 | SourceElements ClassDeclaration
{ source_add_class
(ctx
, $2); }
138 : /* empty */ { $$
= NULL
; }
139 | StatementsNl
{ $$
= $1; }
142 : StatementNl
{ $$
= $1; }
143 | StatementNl StatementsNl
{ $1->next
= $2; $$
= $1; }
146 : Statement tNL
{ $$
= $1; }
149 : MemberExpression ArgumentList_opt
{ $1->args
= $2; $$
= new_call_statement
(ctx
, $1); CHECK_ERROR
; }
150 | tCALL MemberExpression Arguments_opt
{ $2->args
= $3; $$
= new_call_statement
(ctx
, $2); CHECK_ERROR
; }
151 | MemberExpression Arguments_opt
'=' Expression
152 { $1->args
= $2; $$
= new_assign_statement
(ctx
, $1, $4); CHECK_ERROR
; }
153 | tDIM DimDeclList
{ $$
= new_dim_statement
(ctx
, $2); CHECK_ERROR
; }
154 | IfStatement
{ $$
= $1; }
155 | FunctionDecl
{ $$
= new_function_statement
(ctx
, $1); CHECK_ERROR
; }
156 | tEXIT tFUNCTION
{ $$
= new_statement
(ctx
, STAT_EXITFUNC
, 0); CHECK_ERROR
; }
157 | tEXIT tSUB
{ $$
= new_statement
(ctx
, STAT_EXITSUB
, 0); CHECK_ERROR
; }
158 | tSET MemberExpression Arguments_opt
'=' Expression
159 { $2->args
= $3; $$
= new_set_statement
(ctx
, $2, $5); CHECK_ERROR
; }
160 | tSTOP
{ $$
= new_statement
(ctx
, STAT_STOP
, 0); CHECK_ERROR
; }
163 : tIdentifier
{ $$
= new_member_expression
(ctx
, NULL
, $1); CHECK_ERROR
; }
164 | CallExpression
'.' tIdentifier
{ $$
= new_member_expression
(ctx
, $1, $3); CHECK_ERROR
; }
166 DimDeclList
/* FIXME: Support arrays */
167 : tIdentifier
{ $$
= new_dim_decl
(ctx
, $1, NULL
); CHECK_ERROR
; }
168 | tIdentifier
',' DimDeclList
{ $$
= new_dim_decl
(ctx
, $1, $3); CHECK_ERROR
; }
171 : tIF Expression tTHEN tNL StatementsNl ElseIfs_opt Else_opt tEND tIF
172 { $$
= new_if_statement
(ctx
, $2, $5, $6, $7); CHECK_ERROR
; }
173 /* FIXME: short if statement */
176 : /* empty */ { $$
= NULL
; }
177 | ElseIfs
{ $$
= $1; }
180 : ElseIf
{ $$
= $1; }
181 | ElseIf ElseIfs
{ $1->next
= $2; $$
= $1; }
184 : tELSEIF Expression tTHEN tNL StatementsNl
185 { $$
= new_elseif_decl
(ctx
, $2, $5); }
188 : /* empty */ { $$
= NULL
; }
189 | tELSE tNL StatementsNl
{ $$
= $3; }
192 : EmptyBrackets_opt
{ $$
= NULL
; }
193 |
'(' ArgumentList
')' { $$
= $2; }
196 : EmptyBrackets_opt
{ $$
= NULL
; }
197 | ArgumentList
{ $$
= $1; }
200 : Expression
{ $$
= $1; }
201 | Expression
',' ArgumentList
{ $1->next
= $3; $$
= $1; }
208 : EqvExpression
{ $$
= $1; }
209 | Expression tIMP EqvExpression
{ $$
= new_binary_expression
(ctx
, EXPR_IMP
, $1, $3); CHECK_ERROR
; }
212 : XorExpression
{ $$
= $1; }
213 | EqvExpression tEQV XorExpression
{ $$
= new_binary_expression
(ctx
, EXPR_EQV
, $1, $3); CHECK_ERROR
; }
216 : OrExpression
{ $$
= $1; }
217 | XorExpression tXOR OrExpression
{ $$
= new_binary_expression
(ctx
, EXPR_XOR
, $1, $3); CHECK_ERROR
; }
220 : AndExpression
{ $$
= $1; }
221 | OrExpression tOR AndExpression
{ $$
= new_binary_expression
(ctx
, EXPR_OR
, $1, $3); CHECK_ERROR
; }
224 : NotExpression
{ $$
= $1; }
225 | AndExpression tAND NotExpression
{ $$
= new_binary_expression
(ctx
, EXPR_AND
, $1, $3); CHECK_ERROR
; }
228 : EqualityExpression
{ $$
= $1; }
229 | tNOT NotExpression
{ $$
= new_unary_expression
(ctx
, EXPR_NOT
, $2); CHECK_ERROR
; }
232 : ConcatExpression
{ $$
= $1; }
233 | EqualityExpression
'=' ConcatExpression
{ $$
= new_binary_expression
(ctx
, EXPR_EQUAL
, $1, $3); CHECK_ERROR
; }
234 | EqualityExpression tNEQ ConcatExpression
{ $$
= new_binary_expression
(ctx
, EXPR_NEQUAL
, $1, $3); CHECK_ERROR
; }
237 : AdditiveExpression
{ $$
= $1; }
238 | ConcatExpression
'&' AdditiveExpression
{ $$
= new_binary_expression
(ctx
, EXPR_CONCAT
, $1, $3); CHECK_ERROR
; }
241 : ModExpression
{ $$
= $1; }
242 | AdditiveExpression
'+' ModExpression
{ $$
= new_binary_expression
(ctx
, EXPR_ADD
, $1, $3); CHECK_ERROR
; }
243 | AdditiveExpression
'-' ModExpression
{ $$
= new_binary_expression
(ctx
, EXPR_SUB
, $1, $3); CHECK_ERROR
; }
246 : IntdivExpression
{ $$
= $1; }
247 | ModExpression tMOD IntdivExpression
{ $$
= new_binary_expression
(ctx
, EXPR_MOD
, $1, $3); CHECK_ERROR
; }
250 : MultiplicativeExpression
{ $$
= $1; }
251 | IntdivExpression
'\\' MultiplicativeExpression
252 { $$
= new_binary_expression
(ctx
, EXPR_IDIV
, $1, $3); CHECK_ERROR
; }
254 MultiplicativeExpression
255 : ExpExpression
{ $$
= $1; }
256 | MultiplicativeExpression
'*' ExpExpression
257 { $$
= new_binary_expression
(ctx
, EXPR_MUL
, $1, $3); CHECK_ERROR
; }
258 | MultiplicativeExpression
'/' ExpExpression
259 { $$
= new_binary_expression
(ctx
, EXPR_DIV
, $1, $3); CHECK_ERROR
; }
262 : UnaryExpression
{ $$
= $1; }
263 | ExpExpression
'^' UnaryExpression
{ $$
= new_binary_expression
(ctx
, EXPR_EXP
, $1, $3); CHECK_ERROR
; }
266 : LiteralExpression
{ $$
= $1; }
267 | CallExpression
{ $$
= $1; }
268 | tNEW tIdentifier
{ $$
= new_new_expression
(ctx
, $2); CHECK_ERROR
; }
269 |
'-' UnaryExpression
{ $$
= new_unary_expression
(ctx
, EXPR_NEG
, $2); CHECK_ERROR
; }
272 : PrimaryExpression
{ $$
= $1; }
273 | MemberExpression Arguments_opt
{ $1->args
= $2; $$
= &$1->expr
; }
276 : tTRUE
{ $$
= new_bool_expression
(ctx
, VARIANT_TRUE
); CHECK_ERROR
; }
277 | tFALSE
{ $$
= new_bool_expression
(ctx
, VARIANT_FALSE
); CHECK_ERROR
; }
278 | tString
{ $$
= new_string_expression
(ctx
, $1); CHECK_ERROR
; }
279 | tShort
{ $$
= new_long_expression
(ctx
, EXPR_USHORT
, $1); CHECK_ERROR
; }
280 |
'0' { $$
= new_long_expression
(ctx
, EXPR_USHORT
, 0); CHECK_ERROR
; }
281 | tLong
{ $$
= new_long_expression
(ctx
, EXPR_ULONG
, $1); CHECK_ERROR
; }
282 | tDouble
{ $$
= new_double_expression
(ctx
, $1); CHECK_ERROR
; }
283 | tEMPTY
{ $$
= new_expression
(ctx
, EXPR_EMPTY
, 0); CHECK_ERROR
; }
284 | tNULL
{ $$
= new_expression
(ctx
, EXPR_NULL
, 0); CHECK_ERROR
; }
285 | tNOTHING
{ $$
= new_expression
(ctx
, EXPR_NOTHING
, 0); CHECK_ERROR
; }
288 : '(' Expression
')' { $$
= $2; }
291 : tCLASS tIdentifier tNL ClassBody tEND tCLASS tNL
{ $4->name
= $2; $$
= $4; }
294 : /* empty */ { $$
= new_class_decl
(ctx
); }
295 | FunctionDecl tNL ClassBody
{ $$
= add_class_function
(ctx
, $3, $1); CHECK_ERROR
; }
298 : Storage_opt tSUB tIdentifier ArgumentsDecl_opt tNL StatementsNl_opt tEND tSUB
299 { $$
= new_function_decl
(ctx
, $3, FUNC_SUB
, $1, $4, $6); CHECK_ERROR
; }
300 | Storage_opt tFUNCTION tIdentifier ArgumentsDecl_opt tNL StatementsNl_opt tEND tFUNCTION
301 { $$
= new_function_decl
(ctx
, $3, FUNC_FUNCTION
, $1, $4, $6); CHECK_ERROR
; }
304 : /* empty*/ { $$
= 0; }
305 | Storage
{ $$
= $1; }
308 : tPUBLIC tDEFAULT
{ $$
= STORAGE_IS_DEFAULT
; }
309 | tPUBLIC
{ $$
= 0; }
310 | tPRIVATE
{ $$
= STORAGE_IS_PRIVATE
; }
313 : EmptyBrackets_opt
{ $$
= NULL
; }
314 |
'(' ArgumentDeclList
')' { $$
= $2; }
317 : ArgumentDecl
{ $$
= $1; }
318 | ArgumentDecl
',' ArgumentDeclList
{ $1->next
= $3; $$
= $1; }
321 : tIdentifier
{ $$
= new_argument_decl
(ctx
, $1, TRUE
); }
322 | tBYREF tIdentifier
{ $$
= new_argument_decl
(ctx
, $2, TRUE
); }
323 | tBYVAL tIdentifier
{ $$
= new_argument_decl
(ctx
, $2, FALSE
); }
327 static int parser_error
(const char *str
)
332 static void source_add_statement
(parser_ctx_t
*ctx
, statement_t
*stat
)
335 ctx
->stats_tail
->next
= stat
;
336 ctx
->stats_tail
= stat
;
338 ctx
->stats
= ctx
->stats_tail
= stat
;
342 static void source_add_class
(parser_ctx_t
*ctx
, class_decl_t
*class_decl
)
344 class_decl
->next
= ctx
->class_decls
;
345 ctx
->class_decls
= class_decl
;
348 static void parse_complete
(parser_ctx_t
*ctx
, BOOL option_explicit
)
350 ctx
->parse_complete
= TRUE
;
351 ctx
->option_explicit
= option_explicit
;
354 static void *new_expression
(parser_ctx_t
*ctx
, expression_type_t type
, size_t size
)
358 expr
= parser_alloc
(ctx
, size ? size
: sizeof
(*expr
));
367 static expression_t
*new_bool_expression
(parser_ctx_t
*ctx
, VARIANT_BOOL value
)
369 bool_expression_t
*expr
;
371 expr
= new_expression
(ctx
, EXPR_BOOL
, sizeof
(*expr
));
379 static expression_t
*new_string_expression
(parser_ctx_t
*ctx
, const WCHAR
*value
)
381 string_expression_t
*expr
;
383 expr
= new_expression
(ctx
, EXPR_STRING
, sizeof
(*expr
));
391 static expression_t
*new_long_expression
(parser_ctx_t
*ctx
, expression_type_t type
, LONG value
)
393 int_expression_t
*expr
;
395 expr
= new_expression
(ctx
, type
, sizeof
(*expr
));
403 static expression_t
*new_double_expression
(parser_ctx_t
*ctx
, double value
)
405 double_expression_t
*expr
;
407 expr
= new_expression
(ctx
, EXPR_DOUBLE
, sizeof
(*expr
));
415 static expression_t
*new_unary_expression
(parser_ctx_t
*ctx
, expression_type_t type
, expression_t
*subexpr
)
417 unary_expression_t
*expr
;
419 expr
= new_expression
(ctx
, type
, sizeof
(*expr
));
423 expr
->subexpr
= subexpr
;
427 static expression_t
*new_binary_expression
(parser_ctx_t
*ctx
, expression_type_t type
, expression_t
*left
, expression_t
*right
)
429 binary_expression_t
*expr
;
431 expr
= new_expression
(ctx
, type
, sizeof
(*expr
));
440 static member_expression_t
*new_member_expression
(parser_ctx_t
*ctx
, expression_t
*obj_expr
, const WCHAR
*identifier
)
442 member_expression_t
*expr
;
444 expr
= new_expression
(ctx
, EXPR_MEMBER
, sizeof
(*expr
));
448 expr
->obj_expr
= obj_expr
;
449 expr
->identifier
= identifier
;
454 static expression_t
*new_new_expression
(parser_ctx_t
*ctx
, const WCHAR
*identifier
)
456 string_expression_t
*expr
;
458 expr
= new_expression
(ctx
, EXPR_NEW
, sizeof
(*expr
));
462 expr
->value
= identifier
;
466 static void *new_statement
(parser_ctx_t
*ctx
, statement_type_t type
, size_t size
)
470 stat
= parser_alloc
(ctx
, size ? size
: sizeof
(*stat
));
479 static statement_t
*new_call_statement
(parser_ctx_t
*ctx
, member_expression_t
*expr
)
481 call_statement_t
*stat
;
483 stat
= new_statement
(ctx
, STAT_CALL
, sizeof
(*stat
));
491 static statement_t
*new_assign_statement
(parser_ctx_t
*ctx
, member_expression_t
*left
, expression_t
*right
)
493 assign_statement_t
*stat
;
495 stat
= new_statement
(ctx
, STAT_ASSIGN
, sizeof
(*stat
));
499 stat
->member_expr
= left
;
500 stat
->value_expr
= right
;
504 static statement_t
*new_set_statement
(parser_ctx_t
*ctx
, member_expression_t
*left
, expression_t
*right
)
506 assign_statement_t
*stat
;
508 stat
= new_statement
(ctx
, STAT_SET
, sizeof
(*stat
));
512 stat
->member_expr
= left
;
513 stat
->value_expr
= right
;
517 static dim_decl_t
*new_dim_decl
(parser_ctx_t
*ctx
, const WCHAR
*name
, dim_decl_t
*next
)
521 decl
= parser_alloc
(ctx
, sizeof
(*decl
));
530 static statement_t
*new_dim_statement
(parser_ctx_t
*ctx
, dim_decl_t
*decls
)
532 dim_statement_t
*stat
;
534 stat
= new_statement
(ctx
, STAT_DIM
, sizeof
(*stat
));
538 stat
->dim_decls
= decls
;
542 static elseif_decl_t
*new_elseif_decl
(parser_ctx_t
*ctx
, expression_t
*expr
, statement_t
*stat
)
546 decl
= parser_alloc
(ctx
, sizeof
(*decl
));
556 static statement_t
*new_if_statement
(parser_ctx_t
*ctx
, expression_t
*expr
, statement_t
*if_stat
, elseif_decl_t
*elseif_decl
,
557 statement_t
*else_stat
)
559 if_statement_t
*stat
;
561 stat
= new_statement
(ctx
, STAT_IF
, sizeof
(*stat
));
566 stat
->if_stat
= if_stat
;
567 stat
->elseifs
= elseif_decl
;
568 stat
->else_stat
= else_stat
;
572 static arg_decl_t
*new_argument_decl
(parser_ctx_t
*ctx
, const WCHAR
*name
, BOOL by_ref
)
574 arg_decl_t
*arg_decl
;
576 arg_decl
= parser_alloc
(ctx
, sizeof
(*arg_decl
));
580 arg_decl
->name
= name
;
581 arg_decl
->by_ref
= by_ref
;
582 arg_decl
->next
= NULL
;
586 static function_decl_t
*new_function_decl
(parser_ctx_t
*ctx
, const WCHAR
*name
, function_type_t type
,
587 unsigned storage_flags
, arg_decl_t
*arg_decl
, statement_t
*body
)
589 function_decl_t
*decl
;
591 if
(storage_flags
& STORAGE_IS_DEFAULT
) {
592 FIXME
("Function declared as default property\n");
597 decl
= parser_alloc
(ctx
, sizeof
(*decl
));
603 decl
->is_public
= !(storage_flags
& STORAGE_IS_PRIVATE
);
604 decl
->args
= arg_decl
;
610 static statement_t
*new_function_statement
(parser_ctx_t
*ctx
, function_decl_t
*decl
)
612 function_statement_t
*stat
;
614 stat
= new_statement
(ctx
, STAT_FUNC
, sizeof
(*stat
));
618 stat
->func_decl
= decl
;
622 static class_decl_t
*new_class_decl
(parser_ctx_t
*ctx
)
624 class_decl_t
*class_decl
;
626 class_decl
= parser_alloc
(ctx
, sizeof
(*class_decl
));
630 class_decl
->funcs
= NULL
;
631 class_decl
->next
= NULL
;
635 static class_decl_t
*add_class_function
(parser_ctx_t
*ctx
, class_decl_t
*class_decl
, function_decl_t
*decl
)
637 function_decl_t
*iter
;
639 for
(iter
= class_decl
->funcs
; iter
; iter
= iter
->next
) {
640 if
(!strcmpiW
(iter
->name
, decl
->name
)) {
641 if
(decl
->type
== FUNC_SUB || decl
->type
== FUNC_FUNCTION
) {
642 FIXME
("Redefinition of %s::%s\n", debugstr_w
(class_decl
->name
), debugstr_w
(decl
->name
));
649 decl
->next
= class_decl
->funcs
;
650 class_decl
->funcs
= decl
;
654 void *parser_alloc
(parser_ctx_t
*ctx
, size_t size
)
658 ret
= vbsheap_alloc
(&ctx
->heap
, size
);
660 ctx
->hres
= E_OUTOFMEMORY
;
664 HRESULT parse_script
(parser_ctx_t
*ctx
, const WCHAR
*code
)
666 ctx
->code
= ctx
->ptr
= code
;
667 ctx
->end
= ctx
->code
+ strlenW
(ctx
->code
);
669 vbsheap_init
(&ctx
->heap
);
671 ctx
->parse_complete
= FALSE
;
674 ctx
->last_token
= tNL
;
676 ctx
->stats
= ctx
->stats_tail
= NULL
;
677 ctx
->class_decls
= NULL
;
678 ctx
->option_explicit
= FALSE
;
682 if
(FAILED
(ctx
->hres
))
684 if
(!ctx
->parse_complete
) {
685 FIXME
("parser failed on parsing %s\n", debugstr_w
(ctx
->ptr
));
692 void parser_release
(parser_ctx_t
*ctx
)
694 vbsheap_free
(&ctx
->heap
);