2 /******************************************************************************
4 * Module Name: aslprimaries.y - Rules for primary ASL operators
6 *****************************************************************************/
9 * Copyright (C) 2000 - 2016, Intel Corp.
10 * All rights reserved.
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
15 * 1. Redistributions of source code must retain the above copyright
16 * notice, this list of conditions, and the following disclaimer,
17 * without modification.
18 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
19 * substantially similar to the "NO WARRANTY" disclaimer below
20 * ("Disclaimer") and any redistribution must be conditioned upon
21 * including a substantially similar Disclaimer requirement for further
22 * binary redistribution.
23 * 3. Neither the names of the above-listed copyright holders nor the names
24 * of any contributors may be used to endorse or promote products derived
25 * from this software without specific prior written permission.
27 * Alternatively, this software may be distributed under the terms of the
28 * GNU General Public License ("GPL") version 2 as published by the Free
29 * Software Foundation.
32 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
33 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
34 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
35 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
36 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
37 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
38 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
39 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
40 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
41 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
42 * POSSIBILITY OF SUCH DAMAGES.
48 /*******************************************************************************
52 ******************************************************************************/
55 : PARSEOP_ACCESSAS
'('
57 OptionalAccessAttribTerm
58 ')' {$$
= TrCreateNode
(PARSEOP_ACCESSAS
,2,$3,$4);}
59 | PARSEOP_ACCESSAS
'('
60 error ')' {$$
= AslDoError
(); yyclearin;}
64 : PARSEOP_ACQUIRE
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_ACQUIRE
);}
67 ')' {$$
= TrLinkChildren
($
<n
>3,2,$4,$6);}
69 error ')' {$$
= AslDoError
(); yyclearin;}
73 : PARSEOP_ADD
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_ADD
);}
77 ')' {$$
= TrLinkChildren
($
<n
>3,3,$4,$5,$6);}
79 error ')' {$$
= AslDoError
(); yyclearin;}
83 : PARSEOP_ALIAS
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_ALIAS
);}
86 ')' {$$
= TrLinkChildren
($
<n
>3,2,$4,
87 TrSetNodeFlags
($5, NODE_IS_NAME_DECLARATION
));}
89 error ')' {$$
= AslDoError
(); yyclearin;}
93 : PARSEOP_AND
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_AND
);}
97 ')' {$$
= TrLinkChildren
($
<n
>3,3,$4,$5,$6);}
99 error ')' {$$
= AslDoError
(); yyclearin;}
103 : PARSEOP_ARG0
{$$
= TrCreateLeafNode
(PARSEOP_ARG0
);}
104 | PARSEOP_ARG1
{$$
= TrCreateLeafNode
(PARSEOP_ARG1
);}
105 | PARSEOP_ARG2
{$$
= TrCreateLeafNode
(PARSEOP_ARG2
);}
106 | PARSEOP_ARG3
{$$
= TrCreateLeafNode
(PARSEOP_ARG3
);}
107 | PARSEOP_ARG4
{$$
= TrCreateLeafNode
(PARSEOP_ARG4
);}
108 | PARSEOP_ARG5
{$$
= TrCreateLeafNode
(PARSEOP_ARG5
);}
109 | PARSEOP_ARG6
{$$
= TrCreateLeafNode
(PARSEOP_ARG6
);}
113 : PARSEOP_BANKFIELD
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_BANKFIELD
);}
117 ',' AccessTypeKeyword
119 ',' UpdateRuleKeyword
121 FieldUnitList
'}' {$$
= TrLinkChildren
($
<n
>3,7,
122 $4,$5,$6,$8,$10,$12,$15);}
123 | PARSEOP_BANKFIELD
'('
124 error ')' '{' error '}' {$$
= AslDoError
(); yyclearin;}
128 : PARSEOP_BREAK
{$$
= TrCreateNode
(PARSEOP_BREAK
, 0);}
132 : PARSEOP_BREAKPOINT
{$$
= TrCreateNode
(PARSEOP_BREAKPOINT
, 0);}
136 : PARSEOP_BUFFER
{$
<n
>$
= TrCreateLeafNode
(PARSEOP_BUFFER
);}
138 '{' BufferTermData
'}' {$$
= TrLinkChildren
($
<n
>2,2,$3,$5);}
147 : PARSEOP_CASE
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_CASE
);}
150 TermList
'}' {$$
= TrLinkChildren
($
<n
>3,2,$4,$7);}
152 error ')' {$$
= AslDoError
(); yyclearin;}
156 : PARSEOP_CONCATENATE
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_CONCATENATE
);}
160 ')' {$$
= TrLinkChildren
($
<n
>3,3,$4,$5,$6);}
161 | PARSEOP_CONCATENATE
'('
162 error ')' {$$
= AslDoError
(); yyclearin;}
166 : PARSEOP_CONCATENATERESTEMPLATE
'(' {$
<n
>$
= TrCreateLeafNode
(
167 PARSEOP_CONCATENATERESTEMPLATE
);}
171 ')' {$$
= TrLinkChildren
($
<n
>3,3,$4,$5,$6);}
172 | PARSEOP_CONCATENATERESTEMPLATE
'('
173 error ')' {$$
= AslDoError
(); yyclearin;}
177 : PARSEOP_CONNECTION
'('
179 ')' {$$
= TrCreateNode
(PARSEOP_CONNECTION
,1,$3);}
180 | PARSEOP_CONNECTION
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_CONNECTION
);}
182 ')' {$$
= TrLinkChildren
($
<n
>3, 1,
184 TrCreateLeafNode
(PARSEOP_RESOURCETEMPLATE
), 3,
185 TrCreateLeafNode
(PARSEOP_DEFAULT_ARG
),
186 TrCreateLeafNode
(PARSEOP_DEFAULT_ARG
),
188 | PARSEOP_CONNECTION
'('
189 error ')' {$$
= AslDoError
(); yyclearin;}
193 : PARSEOP_CONDREFOF
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_CONDREFOF
);}
196 ')' {$$
= TrLinkChildren
($
<n
>3,2,$4,$5);}
197 | PARSEOP_CONDREFOF
'('
198 error ')' {$$
= AslDoError
(); yyclearin;}
202 : PARSEOP_CONTINUE
{$$
= TrCreateNode
(PARSEOP_CONTINUE
, 0);}
206 : PARSEOP_COPYOBJECT
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_COPYOBJECT
);}
209 ')' {$$
= TrLinkChildren
($
<n
>3,2,$4,
210 TrSetNodeFlags
($6, NODE_IS_TARGET
));}
211 | PARSEOP_COPYOBJECT
'('
212 error ')' {$$
= AslDoError
(); yyclearin;}
216 : PARSEOP_CREATEBITFIELD
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_CREATEBITFIELD
);}
220 ')' {$$
= TrLinkChildren
($
<n
>3,3,$4,$5,
221 TrSetNodeFlags
($6, NODE_IS_NAME_DECLARATION
));}
222 | PARSEOP_CREATEBITFIELD
'('
223 error ')' {$$
= AslDoError
(); yyclearin;}
227 : PARSEOP_CREATEBYTEFIELD
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_CREATEBYTEFIELD
);}
231 ')' {$$
= TrLinkChildren
($
<n
>3,3,$4,$5,
232 TrSetNodeFlags
($6, NODE_IS_NAME_DECLARATION
));}
233 | PARSEOP_CREATEBYTEFIELD
'('
234 error ')' {$$
= AslDoError
(); yyclearin;}
238 : PARSEOP_CREATEDWORDFIELD
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_CREATEDWORDFIELD
);}
242 ')' {$$
= TrLinkChildren
($
<n
>3,3,$4,$5,
243 TrSetNodeFlags
($6, NODE_IS_NAME_DECLARATION
));}
244 | PARSEOP_CREATEDWORDFIELD
'('
245 error ')' {$$
= AslDoError
(); yyclearin;}
249 : PARSEOP_CREATEFIELD
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_CREATEFIELD
);}
254 ')' {$$
= TrLinkChildren
($
<n
>3,4,$4,$5,$6,
255 TrSetNodeFlags
($7, NODE_IS_NAME_DECLARATION
));}
256 | PARSEOP_CREATEFIELD
'('
257 error ')' {$$
= AslDoError
(); yyclearin;}
261 : PARSEOP_CREATEQWORDFIELD
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_CREATEQWORDFIELD
);}
265 ')' {$$
= TrLinkChildren
($
<n
>3,3,$4,$5,
266 TrSetNodeFlags
($6, NODE_IS_NAME_DECLARATION
));}
267 | PARSEOP_CREATEQWORDFIELD
'('
268 error ')' {$$
= AslDoError
(); yyclearin;}
272 : PARSEOP_CREATEWORDFIELD
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_CREATEWORDFIELD
);}
276 ')' {$$
= TrLinkChildren
($
<n
>3,3,$4,$5,
277 TrSetNodeFlags
($6, NODE_IS_NAME_DECLARATION
));}
278 | PARSEOP_CREATEWORDFIELD
'('
279 error ')' {$$
= AslDoError
(); yyclearin;}
283 : PARSEOP_DATATABLEREGION
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_DATATABLEREGION
);}
288 ')' {$$
= TrLinkChildren
($
<n
>3,4,
289 TrSetNodeFlags
($4, NODE_IS_NAME_DECLARATION
),$5,$6,$7);}
290 | PARSEOP_DATATABLEREGION
'('
291 error ')' {$$
= AslDoError
(); yyclearin;}
295 : PARSEOP_DEBUG
{$$
= TrCreateLeafNode
(PARSEOP_DEBUG
);}
299 : PARSEOP_DECREMENT
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_DECREMENT
);}
301 ')' {$$
= TrLinkChildren
($
<n
>3,1,$4);}
302 | PARSEOP_DECREMENT
'('
303 error ')' {$$
= AslDoError
(); yyclearin;}
307 : PARSEOP_DEFAULT
'{' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_DEFAULT
);}
308 TermList
'}' {$$
= TrLinkChildren
($
<n
>3,1,$4);}
309 | PARSEOP_DEFAULT
'{'
310 error '}' {$$
= AslDoError
(); yyclearin;}
314 : PARSEOP_DEREFOF
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_DEREFOF
);}
316 ')' {$$
= TrLinkChildren
($
<n
>3,1,$4);}
317 | PARSEOP_DEREFOF
'('
318 error ')' {$$
= AslDoError
(); yyclearin;}
322 : PARSEOP_DEVICE
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_DEVICE
);}
325 TermList
'}' {$$
= TrLinkChildren
($
<n
>3,2,
326 TrSetNodeFlags
($4, NODE_IS_NAME_DECLARATION
),$7);}
328 error ')' {$$
= AslDoError
(); yyclearin;}
332 : PARSEOP_DIVIDE
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_DIVIDE
);}
337 ')' {$$
= TrLinkChildren
($
<n
>3,4,$4,$5,$6,$7);}
339 error ')' {$$
= AslDoError
(); yyclearin;}
344 StringData
')' {$$
= TrUpdateNode
(PARSEOP_EISAID
, $3);}
346 error ')' {$$
= AslDoError
(); yyclearin;}
350 : IfTerm ElseTerm
{$$
= TrLinkPeerNode
($1,$2);}
355 | PARSEOP_ELSE
'{' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_ELSE
);}
356 TermList
'}' {$$
= TrLinkChildren
($
<n
>3,1,$4);}
359 error '}' {$$
= AslDoError
(); yyclearin;}
362 error {$$
= AslDoError
(); yyclearin;}
364 | PARSEOP_ELSEIF
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_ELSE
);}
365 TermArg
{$
<n
>$
= TrCreateLeafNode
(PARSEOP_IF
);}
367 TermList
'}' {TrLinkChildren
($
<n
>5,2,$4,$8);}
368 ElseTerm
{TrLinkPeerNode
($
<n
>5,$11);}
369 {$$
= TrLinkChildren
($
<n
>3,1,$
<n
>5);}
372 error ')' {$$
= AslDoError
(); yyclearin;}
375 error {$$
= AslDoError
(); yyclearin;}
379 : PARSEOP_EVENT
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_EVENT
);}
381 ')' {$$
= TrLinkChildren
($
<n
>3,1,
382 TrSetNodeFlags
($4, NODE_IS_NAME_DECLARATION
));}
384 error ')' {$$
= AslDoError
(); yyclearin;}
388 : PARSEOP_EXTERNAL
'('
390 OptionalObjectTypeKeyword
391 OptionalParameterTypePackage
392 OptionalParameterTypesPackage
393 ')' {$$
= TrCreateNode
(PARSEOP_EXTERNAL
,4,$3,$4,$5,$6);}
394 | PARSEOP_EXTERNAL
'('
395 error ')' {$$
= AslDoError
(); yyclearin;}
399 : PARSEOP_FATAL
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_FATAL
);}
403 ')' {$$
= TrLinkChildren
($
<n
>3,3,$4,$6,$7);}
405 error ')' {$$
= AslDoError
(); yyclearin;}
409 : PARSEOP_FIELD
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_FIELD
);}
411 ',' AccessTypeKeyword
413 ',' UpdateRuleKeyword
415 FieldUnitList
'}' {$$
= TrLinkChildren
($
<n
>3,5,$4,$6,$8,$10,$13);}
417 error ')' '{' error '}' {$$
= AslDoError
(); yyclearin;}
421 : PARSEOP_FINDSETLEFTBIT
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_FINDSETLEFTBIT
);}
424 ')' {$$
= TrLinkChildren
($
<n
>3,2,$4,$5);}
425 | PARSEOP_FINDSETLEFTBIT
'('
426 error ')' {$$
= AslDoError
(); yyclearin;}
430 : PARSEOP_FINDSETRIGHTBIT
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_FINDSETRIGHTBIT
);}
433 ')' {$$
= TrLinkChildren
($
<n
>3,2,$4,$5);}
434 | PARSEOP_FINDSETRIGHTBIT
'('
435 error ')' {$$
= AslDoError
(); yyclearin;}
438 /* Convert a For() loop to a While() loop */
440 : PARSEOP_FOR
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_WHILE
);}
441 OptionalTermArg
',' {}
442 OptionalPredicate
','
443 OptionalTermArg
{$
<n
>$
= TrLinkPeerNode
($4,$
<n
>3);
444 TrSetParent
($9,$
<n
>3);} /* New parent is WHILE */
445 ')' '{' TermList
'}' {$
<n
>$
= TrLinkChildren
($
<n
>3,2,$7,$13);}
446 {$
<n
>$
= TrLinkPeerNode
($13,$9);
451 : {$$
= TrCreateValuedLeafNode
(PARSEOP_INTEGER
, 1);}
456 : PARSEOP_FPRINTF
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_FPRINTF
);}
460 ')' {$$
= TrLinkChildren
($
<n
>3,3,$4,$6,$7);}
461 | PARSEOP_FPRINTF
'('
462 error ')' {$$
= AslDoError
(); yyclearin;}
466 : PARSEOP_FROMBCD
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_FROMBCD
);}
469 ')' {$$
= TrLinkChildren
($
<n
>3,2,$4,$5);}
470 | PARSEOP_FROMBCD
'('
471 error ')' {$$
= AslDoError
(); yyclearin;}
475 : PARSEOP_FUNCTION
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_METHOD
);}
477 OptionalParameterTypePackage
478 OptionalParameterTypesPackage
480 TermList
'}' {$$
= TrLinkChildren
($
<n
>3,7,
481 TrSetNodeFlags
($4, NODE_IS_NAME_DECLARATION
),
482 TrCreateValuedLeafNode
(PARSEOP_BYTECONST
, 0),
483 TrCreateLeafNode
(PARSEOP_SERIALIZERULE_NOTSERIAL
),
484 TrCreateValuedLeafNode
(PARSEOP_BYTECONST
, 0),$5,$6,$9);}
485 | PARSEOP_FUNCTION
'('
486 error ')' {$$
= AslDoError
(); yyclearin;}
490 : PARSEOP_IF
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_IF
);}
493 TermList
'}' {$$
= TrLinkChildren
($
<n
>3,2,$4,$7);}
496 error ')' {$$
= AslDoError
(); yyclearin;}
500 : PARSEOP_INCLUDE
'('
501 String
')' {$$
= TrUpdateNode
(PARSEOP_INCLUDE
, $3);
502 FlOpenIncludeFile
($3);}
506 : PARSEOP_INCLUDE_END
{$
<n
>$
= TrCreateLeafNode
(PARSEOP_INCLUDE_END
);
507 TrSetCurrentFilename
($$
);}
511 : PARSEOP_INCREMENT
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_INCREMENT
);}
513 ')' {$$
= TrLinkChildren
($
<n
>3,1,$4);}
514 | PARSEOP_INCREMENT
'('
515 error ')' {$$
= AslDoError
(); yyclearin;}
519 : PARSEOP_INDEXFIELD
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_INDEXFIELD
);}
522 ',' AccessTypeKeyword
524 ',' UpdateRuleKeyword
526 FieldUnitList
'}' {$$
= TrLinkChildren
($
<n
>3,6,$4,$5,$7,$9,$11,$14);}
527 | PARSEOP_INDEXFIELD
'('
528 error ')' '{' error '}' {$$
= AslDoError
(); yyclearin;}
532 : PARSEOP_INDEX
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_INDEX
);}
536 ')' {$$
= TrLinkChildren
($
<n
>3,3,$4,$5,$6);}
538 error ')' {$$
= AslDoError
(); yyclearin;}
542 : PARSEOP_LAND
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_LAND
);}
545 ')' {$$
= TrLinkChildren
($
<n
>3,2,$4,$5);}
547 error ')' {$$
= AslDoError
(); yyclearin;}
551 : PARSEOP_LEQUAL
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_LEQUAL
);}
554 ')' {$$
= TrLinkChildren
($
<n
>3,2,$4,$5);}
556 error ')' {$$
= AslDoError
(); yyclearin;}
560 : PARSEOP_LGREATEREQUAL
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_LLESS
);}
563 ')' {$$
= TrCreateNode
(PARSEOP_LNOT
, 1,
564 TrLinkChildren
($
<n
>3,2,$4,$5));}
565 | PARSEOP_LGREATEREQUAL
'('
566 error ')' {$$
= AslDoError
(); yyclearin;}
570 : PARSEOP_LGREATER
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_LGREATER
);}
573 ')' {$$
= TrLinkChildren
($
<n
>3,2,$4,$5);}
574 | PARSEOP_LGREATER
'('
575 error ')' {$$
= AslDoError
(); yyclearin;}
579 : PARSEOP_LLESSEQUAL
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_LGREATER
);}
582 ')' {$$
= TrCreateNode
(PARSEOP_LNOT
, 1,
583 TrLinkChildren
($
<n
>3,2,$4,$5));}
584 | PARSEOP_LLESSEQUAL
'('
585 error ')' {$$
= AslDoError
(); yyclearin;}
589 : PARSEOP_LLESS
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_LLESS
);}
592 ')' {$$
= TrLinkChildren
($
<n
>3,2,$4,$5);}
594 error ')' {$$
= AslDoError
(); yyclearin;}
598 : PARSEOP_LNOTEQUAL
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_LEQUAL
);}
601 ')' {$$
= TrCreateNode
(PARSEOP_LNOT
, 1,
602 TrLinkChildren
($
<n
>3,2,$4,$5));}
603 | PARSEOP_LNOTEQUAL
'('
604 error ')' {$$
= AslDoError
(); yyclearin;}
608 : PARSEOP_LNOT
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_LNOT
);}
610 ')' {$$
= TrLinkChildren
($
<n
>3,1,$4);}
612 error ')' {$$
= AslDoError
(); yyclearin;}
616 : PARSEOP_LOADTABLE
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_LOADTABLE
);}
623 ')' {$$
= TrLinkChildren
($
<n
>3,6,$4,$5,$6,$7,$8,$9);}
624 | PARSEOP_LOADTABLE
'('
625 error ')' {$$
= AslDoError
(); yyclearin;}
629 : PARSEOP_LOAD
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_LOAD
);}
632 ')' {$$
= TrLinkChildren
($
<n
>3,2,$4,$5);}
634 error ')' {$$
= AslDoError
(); yyclearin;}
638 : PARSEOP_LOCAL0
{$$
= TrCreateLeafNode
(PARSEOP_LOCAL0
);}
639 | PARSEOP_LOCAL1
{$$
= TrCreateLeafNode
(PARSEOP_LOCAL1
);}
640 | PARSEOP_LOCAL2
{$$
= TrCreateLeafNode
(PARSEOP_LOCAL2
);}
641 | PARSEOP_LOCAL3
{$$
= TrCreateLeafNode
(PARSEOP_LOCAL3
);}
642 | PARSEOP_LOCAL4
{$$
= TrCreateLeafNode
(PARSEOP_LOCAL4
);}
643 | PARSEOP_LOCAL5
{$$
= TrCreateLeafNode
(PARSEOP_LOCAL5
);}
644 | PARSEOP_LOCAL6
{$$
= TrCreateLeafNode
(PARSEOP_LOCAL6
);}
645 | PARSEOP_LOCAL7
{$$
= TrCreateLeafNode
(PARSEOP_LOCAL7
);}
649 : PARSEOP_LOR
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_LOR
);}
652 ')' {$$
= TrLinkChildren
($
<n
>3,2,$4,$5);}
654 error ')' {$$
= AslDoError
(); yyclearin;}
658 : PARSEOP_MATCH
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_MATCH
);}
665 ')' {$$
= TrLinkChildren
($
<n
>3,6,$4,$6,$7,$9,$10,$11);}
667 error ')' {$$
= AslDoError
(); yyclearin;}
671 : PARSEOP_METHOD
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_METHOD
);}
673 OptionalByteConstExpr
{UtCheckIntegerRange
($5, 0, 7);}
674 OptionalSerializeRuleKeyword
675 OptionalByteConstExpr
676 OptionalParameterTypePackage
677 OptionalParameterTypesPackage
679 TermList
'}' {$$
= TrLinkChildren
($
<n
>3,7,
680 TrSetNodeFlags
($4, NODE_IS_NAME_DECLARATION
),
681 $5,$7,$8,$9,$10,$13);}
683 error ')' {$$
= AslDoError
(); yyclearin;}
687 : PARSEOP_MID
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_MID
);}
692 ')' {$$
= TrLinkChildren
($
<n
>3,4,$4,$5,$6,$7);}
694 error ')' {$$
= AslDoError
(); yyclearin;}
698 : PARSEOP_MOD
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_MOD
);}
702 ')' {$$
= TrLinkChildren
($
<n
>3,3,$4,$5,$6);}
704 error ')' {$$
= AslDoError
(); yyclearin;}
708 : PARSEOP_MULTIPLY
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_MULTIPLY
);}
712 ')' {$$
= TrLinkChildren
($
<n
>3,3,$4,$5,$6);}
713 | PARSEOP_MULTIPLY
'('
714 error ')' {$$
= AslDoError
(); yyclearin;}
718 : PARSEOP_MUTEX
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_MUTEX
);}
721 ')' {$$
= TrLinkChildren
($
<n
>3,2,
722 TrSetNodeFlags
($4, NODE_IS_NAME_DECLARATION
),$6);}
724 error ')' {$$
= AslDoError
(); yyclearin;}
728 : PARSEOP_NAME
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_NAME
);}
731 ')' {$$
= TrLinkChildren
($
<n
>3,2,
732 TrSetNodeFlags
($4, NODE_IS_NAME_DECLARATION
),$6);}
734 error ')' {$$
= AslDoError
(); yyclearin;}
738 : PARSEOP_NAND
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_NAND
);}
742 ')' {$$
= TrLinkChildren
($
<n
>3,3,$4,$5,$6);}
744 error ')' {$$
= AslDoError
(); yyclearin;}
748 : PARSEOP_NOOP
{$$
= TrCreateNode
(PARSEOP_NOOP
, 0);}
752 : PARSEOP_NOR
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_NOR
);}
756 ')' {$$
= TrLinkChildren
($
<n
>3,3,$4,$5,$6);}
758 error ')' {$$
= AslDoError
(); yyclearin;}
762 : PARSEOP_NOTIFY
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_NOTIFY
);}
765 ')' {$$
= TrLinkChildren
($
<n
>3,2,$4,$5);}
767 error ')' {$$
= AslDoError
(); yyclearin;}
771 : PARSEOP_NOT
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_NOT
);}
774 ')' {$$
= TrLinkChildren
($
<n
>3,2,$4,$5);}
776 error ')' {$$
= AslDoError
(); yyclearin;}
780 : PARSEOP_OBJECTTYPE
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_OBJECTTYPE
);}
782 ')' {$$
= TrLinkChildren
($
<n
>3,1,$4);}
783 | PARSEOP_OBJECTTYPE
'('
784 error ')' {$$
= AslDoError
(); yyclearin;}
790 ')' {$$
= TrCreateNode
(PARSEOP_OFFSET
,1,$3);}
792 error ')' {$$
= AslDoError
(); yyclearin;}
796 : PARSEOP_OPERATIONREGION
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_OPERATIONREGION
);}
798 ',' OpRegionSpaceIdTerm
801 ')' {$$
= TrLinkChildren
($
<n
>3,4,
802 TrSetNodeFlags
($4, NODE_IS_NAME_DECLARATION
),
804 | PARSEOP_OPERATIONREGION
'('
805 error ')' {$$
= AslDoError
(); yyclearin;}
809 : RegionSpaceKeyword
{}
810 | ByteConst
{$$
= UtCheckIntegerRange
($1, 0x80, 0xFF);}
814 : PARSEOP_OR
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_OR
);}
818 ')' {$$
= TrLinkChildren
($
<n
>3,3,$4,$5,$6);}
820 error ')' {$$
= AslDoError
(); yyclearin;}
824 : PARSEOP_PACKAGE
{$
<n
>$
= TrCreateLeafNode
(PARSEOP_VAR_PACKAGE
);}
826 '{' PackageList
'}' {$$
= TrLinkChildren
($
<n
>2,2,$3,$5);}
829 : PARSEOP_POWERRESOURCE
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_POWERRESOURCE
);}
834 TermList
'}' {$$
= TrLinkChildren
($
<n
>3,4,
835 TrSetNodeFlags
($4, NODE_IS_NAME_DECLARATION
),
837 | PARSEOP_POWERRESOURCE
'('
838 error ')' {$$
= AslDoError
(); yyclearin;}
842 : PARSEOP_PRINTF
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_PRINTF
);}
845 ')' {$$
= TrLinkChildren
($
<n
>3,2,$4,$5);}
847 error ')' {$$
= AslDoError
(); yyclearin;}
854 TermArg
{$$
= TrLinkPeerNode
($1, $3);}
858 : PARSEOP_PROCESSOR
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_PROCESSOR
);}
861 OptionalDWordConstExpr
862 OptionalByteConstExpr
864 TermList
'}' {$$
= TrLinkChildren
($
<n
>3,5,
865 TrSetNodeFlags
($4, NODE_IS_NAME_DECLARATION
),
867 | PARSEOP_PROCESSOR
'('
868 error ')' {$$
= AslDoError
(); yyclearin;}
872 : PARSEOP_DATABUFFER
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_DATABUFFER
);}
875 ByteList
'}' {$$
= TrLinkChildren
($
<n
>3,2,$4,$7);}
876 | PARSEOP_DATABUFFER
'('
877 error ')' {$$
= AslDoError
(); yyclearin;}
881 * In RefOf, the node isn't really a target, but we can't keep track of it after
882 * we've taken a pointer to it. (hard to tell if a local becomes initialized this way.)
885 : PARSEOP_REFOF
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_REFOF
);}
887 ')' {$$
= TrLinkChildren
($
<n
>3,1,
888 TrSetNodeFlags
($4, NODE_IS_TARGET
));}
890 error ')' {$$
= AslDoError
(); yyclearin;}
894 : PARSEOP_RELEASE
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_RELEASE
);}
896 ')' {$$
= TrLinkChildren
($
<n
>3,1,$4);}
897 | PARSEOP_RELEASE
'('
898 error ')' {$$
= AslDoError
(); yyclearin;}
902 : PARSEOP_RESET
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_RESET
);}
904 ')' {$$
= TrLinkChildren
($
<n
>3,1,$4);}
906 error ')' {$$
= AslDoError
(); yyclearin;}
910 : PARSEOP_RETURN
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_RETURN
);}
912 ')' {$$
= TrLinkChildren
($
<n
>3,1,$4);}
913 | PARSEOP_RETURN
{$$
= TrLinkChildren
(
914 TrCreateLeafNode
(PARSEOP_RETURN
),1,
915 TrSetNodeFlags
(TrCreateLeafNode
(PARSEOP_ZERO
),
916 NODE_IS_NULL_RETURN
));}
918 error ')' {$$
= AslDoError
(); yyclearin;}
922 : PARSEOP_SCOPE
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_SCOPE
);}
925 TermList
'}' {$$
= TrLinkChildren
($
<n
>3,2,
926 TrSetNodeFlags
($4, NODE_IS_NAME_DECLARATION
),$7);}
928 error ')' {$$
= AslDoError
(); yyclearin;}
932 : PARSEOP_SHIFTLEFT
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_SHIFTLEFT
);}
936 ')' {$$
= TrLinkChildren
($
<n
>3,3,$4,$5,$6);}
937 | PARSEOP_SHIFTLEFT
'('
938 error ')' {$$
= AslDoError
(); yyclearin;}
942 : PARSEOP_SHIFTRIGHT
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_SHIFTRIGHT
);}
946 ')' {$$
= TrLinkChildren
($
<n
>3,3,$4,$5,$6);}
947 | PARSEOP_SHIFTRIGHT
'('
948 error ')' {$$
= AslDoError
(); yyclearin;}
952 : PARSEOP_SIGNAL
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_SIGNAL
);}
954 ')' {$$
= TrLinkChildren
($
<n
>3,1,$4);}
956 error ')' {$$
= AslDoError
(); yyclearin;}
960 : PARSEOP_SIZEOF
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_SIZEOF
);}
962 ')' {$$
= TrLinkChildren
($
<n
>3,1,$4);}
964 error ')' {$$
= AslDoError
(); yyclearin;}
968 : PARSEOP_SLEEP
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_SLEEP
);}
970 ')' {$$
= TrLinkChildren
($
<n
>3,1,$4);}
972 error ')' {$$
= AslDoError
(); yyclearin;}
976 : PARSEOP_STALL
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_STALL
);}
978 ')' {$$
= TrLinkChildren
($
<n
>3,1,$4);}
980 error ')' {$$
= AslDoError
(); yyclearin;}
984 : PARSEOP_STORE
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_STORE
);}
987 ')' {$$
= TrLinkChildren
($
<n
>3,2,$4,
988 TrSetNodeFlags
($6, NODE_IS_TARGET
));}
990 error ')' {$$
= AslDoError
(); yyclearin;}
994 : PARSEOP_SUBTRACT
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_SUBTRACT
);}
998 ')' {$$
= TrLinkChildren
($
<n
>3,3,$4,$5,$6);}
999 | PARSEOP_SUBTRACT
'('
1000 error ')' {$$
= AslDoError
(); yyclearin;}
1004 : PARSEOP_SWITCH
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_SWITCH
);}
1007 CaseDefaultTermList
'}'
1008 {$$
= TrLinkChildren
($
<n
>3,2,$4,$7);}
1009 | PARSEOP_SWITCH
'('
1010 error ')' {$$
= AslDoError
(); yyclearin;}
1014 : PARSEOP_THERMALZONE
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_THERMALZONE
);}
1017 TermList
'}' {$$
= TrLinkChildren
($
<n
>3,2,
1018 TrSetNodeFlags
($4, NODE_IS_NAME_DECLARATION
),$7);}
1019 | PARSEOP_THERMALZONE
'('
1020 error ')' {$$
= AslDoError
(); yyclearin;}
1024 : PARSEOP_TIMER
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_TIMER
);}
1025 ')' {$$
= TrLinkChildren
($
<n
>3,0);}
1026 | PARSEOP_TIMER
{$$
= TrLinkChildren
(
1027 TrCreateLeafNode
(PARSEOP_TIMER
),0);}
1029 error ')' {$$
= AslDoError
(); yyclearin;}
1033 : PARSEOP_TOBCD
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_TOBCD
);}
1036 ')' {$$
= TrLinkChildren
($
<n
>3,2,$4,$5);}
1038 error ')' {$$
= AslDoError
(); yyclearin;}
1042 : PARSEOP_TOBUFFER
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_TOBUFFER
);}
1045 ')' {$$
= TrLinkChildren
($
<n
>3,2,$4,$5);}
1046 | PARSEOP_TOBUFFER
'('
1047 error ')' {$$
= AslDoError
(); yyclearin;}
1051 : PARSEOP_TODECIMALSTRING
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_TODECIMALSTRING
);}
1054 ')' {$$
= TrLinkChildren
($
<n
>3,2,$4,$5);}
1055 | PARSEOP_TODECIMALSTRING
'('
1056 error ')' {$$
= AslDoError
(); yyclearin;}
1060 : PARSEOP_TOHEXSTRING
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_TOHEXSTRING
);}
1063 ')' {$$
= TrLinkChildren
($
<n
>3,2,$4,$5);}
1064 | PARSEOP_TOHEXSTRING
'('
1065 error ')' {$$
= AslDoError
(); yyclearin;}
1069 : PARSEOP_TOINTEGER
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_TOINTEGER
);}
1072 ')' {$$
= TrLinkChildren
($
<n
>3,2,$4,$5);}
1073 | PARSEOP_TOINTEGER
'('
1074 error ')' {$$
= AslDoError
(); yyclearin;}
1078 : PARSEOP_TOPLD
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_TOPLD
);}
1080 ')' {$$
= TrLinkChildren
($
<n
>3,1,$4);}
1082 error ')' {$$
= AslDoError
(); yyclearin;}
1088 PARSEOP_EXP_EQUALS Integer
{$$
= TrLinkChildren
($1,1,$3);}
1090 PARSEOP_EXP_EQUALS String
{$$
= TrLinkChildren
($1,1,$3);}
1091 | PldKeywordList
',' /* Allows a trailing comma at list end */
1092 | PldKeywordList
','
1094 PARSEOP_EXP_EQUALS Integer
{$$
= TrLinkPeerNode
($1,TrLinkChildren
($3,1,$5));}
1095 | PldKeywordList
','
1097 PARSEOP_EXP_EQUALS String
{$$
= TrLinkPeerNode
($1,TrLinkChildren
($3,1,$5));}
1102 : PARSEOP_TOSTRING
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_TOSTRING
);}
1106 ')' {$$
= TrLinkChildren
($
<n
>3,3,$4,$5,$6);}
1107 | PARSEOP_TOSTRING
'('
1108 error ')' {$$
= AslDoError
(); yyclearin;}
1112 : PARSEOP_TOUUID
'('
1113 StringData
')' {$$
= TrUpdateNode
(PARSEOP_TOUUID
, $3);}
1114 | PARSEOP_TOUUID
'('
1115 error ')' {$$
= AslDoError
(); yyclearin;}
1119 : PARSEOP_UNICODE
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_UNICODE
);}
1121 ')' {$$
= TrLinkChildren
($
<n
>3,2,0,$4);}
1122 | PARSEOP_UNICODE
'('
1123 error ')' {$$
= AslDoError
(); yyclearin;}
1127 : PARSEOP_UNLOAD
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_UNLOAD
);}
1129 ')' {$$
= TrLinkChildren
($
<n
>3,1,$4);}
1130 | PARSEOP_UNLOAD
'('
1131 error ')' {$$
= AslDoError
(); yyclearin;}
1135 : PARSEOP_WAIT
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_WAIT
);}
1138 ')' {$$
= TrLinkChildren
($
<n
>3,2,$4,$5);}
1140 error ')' {$$
= AslDoError
(); yyclearin;}
1144 : PARSEOP_XOR
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_XOR
);}
1148 ')' {$$
= TrLinkChildren
($
<n
>3,3,$4,$5,$6);}
1150 error ')' {$$
= AslDoError
(); yyclearin;}
1154 : PARSEOP_WHILE
'(' {$
<n
>$
= TrCreateLeafNode
(PARSEOP_WHILE
);}
1156 ')' '{' TermList
'}'
1157 {$$
= TrLinkChildren
($
<n
>3,2,$4,$7);}
1159 error ')' {$$
= AslDoError
(); yyclearin;}