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 ******************************************************************************/
58 OptionalAccessAttribTerm
59 PARSEOP_CLOSE_PAREN {$$ = TrCreateNode (PARSEOP_ACCESSAS,2,$3,$4);}
62 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
67 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_ACQUIRE);}
70 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$6);}
73 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
78 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);}
82 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
85 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
90 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_ALIAS);}
93 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,
94 TrSetNodeFlags ($5, NODE_IS_NAME_DECLARATION));}
97 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
102 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_AND);}
106 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
109 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
113 : PARSEOP_ARG0 {$$ = TrCreateLeafNode (PARSEOP_ARG0);}
114 | PARSEOP_ARG1 {$$ = TrCreateLeafNode (PARSEOP_ARG1);}
115 | PARSEOP_ARG2 {$$ = TrCreateLeafNode (PARSEOP_ARG2);}
116 | PARSEOP_ARG3 {$$ = TrCreateLeafNode (PARSEOP_ARG3);}
117 | PARSEOP_ARG4 {$$ = TrCreateLeafNode (PARSEOP_ARG4);}
118 | PARSEOP_ARG5 {$$ = TrCreateLeafNode (PARSEOP_ARG5);}
119 | PARSEOP_ARG6 {$$ = TrCreateLeafNode (PARSEOP_ARG6);}
124 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_BANKFIELD);}
128 ',' AccessTypeKeyword
130 ',' UpdateRuleKeyword
131 PARSEOP_CLOSE_PAREN '{'
132 FieldUnitList '}' {$$ = TrLinkChildren ($<n>3,7,
133 $4,$5,$6,$8,$10,$12,$15);}
136 error PARSEOP_CLOSE_PAREN
137 '{' error '}' {$$ = AslDoError(); yyclearin;}
141 : PARSEOP_BREAK {$$ = TrCreateNode (PARSEOP_BREAK, 0);}
145 : PARSEOP_BREAKPOINT {$$ = TrCreateNode (PARSEOP_BREAKPOINT, 0);}
149 : PARSEOP_BUFFER {$<n>$ = TrCreateLeafNode (PARSEOP_BUFFER);}
151 '{' BufferTermData '}' {$$ = TrLinkChildren ($<n>2,2,$3,$5);}
161 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CASE);}
163 PARSEOP_CLOSE_PAREN '{'
164 TermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);}
167 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
171 : PARSEOP_CONCATENATE
172 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CONCATENATE);}
176 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
177 | PARSEOP_CONCATENATE
179 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
183 : PARSEOP_CONCATENATERESTEMPLATE
184 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (
185 PARSEOP_CONCATENATERESTEMPLATE);}
189 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
190 | PARSEOP_CONCATENATERESTEMPLATE
192 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
197 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CONDREFOF);}
200 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
203 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
210 PARSEOP_CLOSE_PAREN {$$ = TrCreateNode (PARSEOP_CONNECTION,1,$3);}
212 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CONNECTION);}
214 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3, 1,
216 TrCreateLeafNode (PARSEOP_RESOURCETEMPLATE), 3,
217 TrCreateLeafNode (PARSEOP_DEFAULT_ARG),
218 TrCreateLeafNode (PARSEOP_DEFAULT_ARG),
222 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
226 : PARSEOP_CONTINUE {$$ = TrCreateNode (PARSEOP_CONTINUE, 0);}
231 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_COPYOBJECT);}
234 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,
235 TrSetNodeFlags ($6, NODE_IS_TARGET));}
238 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
242 : PARSEOP_CREATEBITFIELD
243 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEBITFIELD);}
247 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,
248 TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));}
249 | PARSEOP_CREATEBITFIELD
251 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
255 : PARSEOP_CREATEBYTEFIELD
256 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEBYTEFIELD);}
260 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,
261 TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));}
262 | PARSEOP_CREATEBYTEFIELD
264 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
268 : PARSEOP_CREATEDWORDFIELD
269 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEDWORDFIELD);}
273 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,
274 TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));}
275 | PARSEOP_CREATEDWORDFIELD
277 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
281 : PARSEOP_CREATEFIELD
282 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEFIELD);}
287 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6,
288 TrSetNodeFlags ($7, NODE_IS_NAME_DECLARATION));}
289 | PARSEOP_CREATEFIELD
291 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
295 : PARSEOP_CREATEQWORDFIELD
296 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEQWORDFIELD);}
300 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,
301 TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));}
302 | PARSEOP_CREATEQWORDFIELD
304 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
308 : PARSEOP_CREATEWORDFIELD
309 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEWORDFIELD);}
313 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,
314 TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));}
315 | PARSEOP_CREATEWORDFIELD
317 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
321 : PARSEOP_DATATABLEREGION
322 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DATATABLEREGION);}
327 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,4,
328 TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$5,$6,$7);}
329 | PARSEOP_DATATABLEREGION
331 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
335 : PARSEOP_DEBUG {$$ = TrCreateLeafNode (PARSEOP_DEBUG);}
340 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DECREMENT);}
342 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);}
345 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
349 : PARSEOP_DEFAULT '{' {$<n>$ = TrCreateLeafNode (PARSEOP_DEFAULT);}
350 TermList '}' {$$ = TrLinkChildren ($<n>3,1,$4);}
351 | PARSEOP_DEFAULT '{'
352 error '}' {$$ = AslDoError(); yyclearin;}
357 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DEREFOF);}
359 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);}
362 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
367 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DEVICE);}
369 PARSEOP_CLOSE_PAREN '{'
370 TermList '}' {$$ = TrLinkChildren ($<n>3,2,
371 TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);}
374 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
379 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);}
384 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6,$7);}
387 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
394 PARSEOP_CLOSE_PAREN {$$ = TrUpdateNode (PARSEOP_EISAID, $3);}
397 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
401 : IfTerm ElseTerm {$$ = TrLinkPeerNode ($1,$2);}
406 | PARSEOP_ELSE '{' {$<n>$ = TrCreateLeafNode (PARSEOP_ELSE);}
407 TermList '}' {$$ = TrLinkChildren ($<n>3,1,$4);}
410 error '}' {$$ = AslDoError(); yyclearin;}
413 error {$$ = AslDoError(); yyclearin;}
416 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_ELSE);}
417 TermArg {$<n>$ = TrCreateLeafNode (PARSEOP_IF);}
418 PARSEOP_CLOSE_PAREN '{'
419 TermList '}' {TrLinkChildren ($<n>5,2,$4,$8);}
420 ElseTerm {TrLinkPeerNode ($<n>5,$11);}
421 {$$ = TrLinkChildren ($<n>3,1,$<n>5);}
425 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
428 error {$$ = AslDoError(); yyclearin;}
433 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_EVENT);}
435 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,
436 TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION));}
439 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
446 OptionalObjectTypeKeyword
447 OptionalParameterTypePackage
448 OptionalParameterTypesPackage
449 PARSEOP_CLOSE_PAREN {$$ = TrCreateNode (PARSEOP_EXTERNAL,4,$3,$4,$5,$6);}
452 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
457 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_FATAL);}
461 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);}
464 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
469 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_FIELD);}
471 ',' AccessTypeKeyword
473 ',' UpdateRuleKeyword
474 PARSEOP_CLOSE_PAREN '{'
475 FieldUnitList '}' {$$ = TrLinkChildren ($<n>3,5,$4,$6,$8,$10,$13);}
478 error PARSEOP_CLOSE_PAREN
479 '{' error '}' {$$ = AslDoError(); yyclearin;}
483 : PARSEOP_FINDSETLEFTBIT
484 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_FINDSETLEFTBIT);}
487 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
488 | PARSEOP_FINDSETLEFTBIT
490 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
494 : PARSEOP_FINDSETRIGHTBIT
495 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_FINDSETRIGHTBIT);}
498 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
499 | PARSEOP_FINDSETRIGHTBIT
501 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
504 /* Convert a For() loop to a While() loop */
507 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_WHILE);}
508 OptionalTermArg ',' {}
509 OptionalPredicate ','
510 OptionalTermArg {$<n>$ = TrLinkPeerNode ($4,$<n>3);
511 TrSetParent ($9,$<n>3);} /* New parent is WHILE */
513 '{' TermList '}' {$<n>$ = TrLinkChildren ($<n>3,2,$7,$13);}
514 {$<n>$ = TrLinkPeerNode ($13,$9);
519 : {$$ = TrCreateValuedLeafNode (PARSEOP_INTEGER, 1);}
525 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_FPRINTF);}
529 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);}
532 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
537 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_FROMBCD);}
540 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
543 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
548 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_METHOD);}
550 OptionalParameterTypePackage
551 OptionalParameterTypesPackage
552 PARSEOP_CLOSE_PAREN '{'
553 TermList '}' {$$ = TrLinkChildren ($<n>3,7,
554 TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),
555 TrCreateValuedLeafNode (PARSEOP_BYTECONST, 0),
556 TrCreateLeafNode (PARSEOP_SERIALIZERULE_NOTSERIAL),
557 TrCreateValuedLeafNode (PARSEOP_BYTECONST, 0),$5,$6,$9);}
560 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
565 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_IF);}
567 PARSEOP_CLOSE_PAREN '{'
568 TermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);}
572 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
579 PARSEOP_CLOSE_PAREN {$$ = TrUpdateNode (PARSEOP_INCLUDE, $3);
580 FlOpenIncludeFile ($3);}
584 : PARSEOP_INCLUDE_END {$<n>$ = TrCreateLeafNode (PARSEOP_INCLUDE_END);
585 TrSetCurrentFilename ($$);}
590 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_INCREMENT);}
592 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);}
595 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
600 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_INDEXFIELD);}
603 ',' AccessTypeKeyword
605 ',' UpdateRuleKeyword
606 PARSEOP_CLOSE_PAREN '{'
607 FieldUnitList '}' {$$ = TrLinkChildren ($<n>3,6,$4,$5,$7,$9,$11,$14);}
610 error PARSEOP_CLOSE_PAREN
611 '{' error '}' {$$ = AslDoError(); yyclearin;}
616 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_INDEX);}
620 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
623 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
628 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LAND);}
631 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
634 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
639 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);}
642 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
645 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
649 : PARSEOP_LGREATEREQUAL
650 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);}
653 PARSEOP_CLOSE_PAREN {$$ = TrCreateNode (PARSEOP_LNOT, 1,
654 TrLinkChildren ($<n>3,2,$4,$5));}
655 | PARSEOP_LGREATEREQUAL
657 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
662 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);}
665 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
668 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
673 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);}
676 PARSEOP_CLOSE_PAREN {$$ = TrCreateNode (PARSEOP_LNOT, 1,
677 TrLinkChildren ($<n>3,2,$4,$5));}
680 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
685 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);}
688 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
691 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
696 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);}
699 PARSEOP_CLOSE_PAREN {$$ = TrCreateNode (PARSEOP_LNOT, 1,
700 TrLinkChildren ($<n>3,2,$4,$5));}
703 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
708 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LNOT);}
710 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);}
713 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
718 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LOADTABLE);}
725 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,6,$4,$5,$6,$7,$8,$9);}
728 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
733 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LOAD);}
736 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
739 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
743 : PARSEOP_LOCAL0 {$$ = TrCreateLeafNode (PARSEOP_LOCAL0);}
744 | PARSEOP_LOCAL1 {$$ = TrCreateLeafNode (PARSEOP_LOCAL1);}
745 | PARSEOP_LOCAL2 {$$ = TrCreateLeafNode (PARSEOP_LOCAL2);}
746 | PARSEOP_LOCAL3 {$$ = TrCreateLeafNode (PARSEOP_LOCAL3);}
747 | PARSEOP_LOCAL4 {$$ = TrCreateLeafNode (PARSEOP_LOCAL4);}
748 | PARSEOP_LOCAL5 {$$ = TrCreateLeafNode (PARSEOP_LOCAL5);}
749 | PARSEOP_LOCAL6 {$$ = TrCreateLeafNode (PARSEOP_LOCAL6);}
750 | PARSEOP_LOCAL7 {$$ = TrCreateLeafNode (PARSEOP_LOCAL7);}
755 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_LOR);}
758 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
761 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
766 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_MATCH);}
773 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,6,$4,$6,$7,$9,$10,$11);}
776 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
781 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_METHOD);}
783 OptionalByteConstExpr {UtCheckIntegerRange ($5, 0, 7);}
784 OptionalSerializeRuleKeyword
785 OptionalByteConstExpr
786 OptionalParameterTypePackage
787 OptionalParameterTypesPackage
788 PARSEOP_CLOSE_PAREN '{'
789 TermList '}' {$$ = TrLinkChildren ($<n>3,7,
790 TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),
791 $5,$7,$8,$9,$10,$13);}
794 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
799 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_MID);}
804 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6,$7);}
807 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
812 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);}
816 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
819 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
824 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);}
828 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
831 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
836 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_MUTEX);}
839 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,
840 TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6);}
843 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
848 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_NAME);}
851 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,
852 TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6);}
855 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
860 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_NAND);}
864 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
867 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
871 : PARSEOP_NOOP {$$ = TrCreateNode (PARSEOP_NOOP, 0);}
876 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_NOR);}
880 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
883 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
888 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_NOTIFY);}
891 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
894 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
899 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_NOT);}
902 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
905 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
910 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE);}
912 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);}
915 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
922 PARSEOP_CLOSE_PAREN {$$ = TrCreateNode (PARSEOP_OFFSET,1,$3);}
925 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
929 : PARSEOP_OPERATIONREGION
930 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_OPERATIONREGION);}
932 ',' OpRegionSpaceIdTerm
935 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,4,
936 TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),
938 | PARSEOP_OPERATIONREGION
940 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
944 : RegionSpaceKeyword {}
945 | ByteConst {$$ = UtCheckIntegerRange ($1, 0x80, 0xFF);}
950 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_OR);}
954 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
957 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
961 : PARSEOP_PACKAGE {$<n>$ = TrCreateLeafNode (PARSEOP_VAR_PACKAGE);}
963 '{' PackageList '}' {$$ = TrLinkChildren ($<n>2,2,$3,$5);}
966 : PARSEOP_POWERRESOURCE
967 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_POWERRESOURCE);}
971 PARSEOP_CLOSE_PAREN '{'
972 TermList '}' {$$ = TrLinkChildren ($<n>3,4,
973 TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),
975 | PARSEOP_POWERRESOURCE
977 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
982 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_PRINTF);}
985 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
988 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
995 TermArg {$$ = TrLinkPeerNode ($1, $3);}
1000 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_PROCESSOR);}
1003 OptionalDWordConstExpr
1004 OptionalByteConstExpr
1005 PARSEOP_CLOSE_PAREN '{'
1006 TermList '}' {$$ = TrLinkChildren ($<n>3,5,
1007 TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),
1011 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
1015 : PARSEOP_DATABUFFER
1016 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_DATABUFFER);}
1018 PARSEOP_CLOSE_PAREN '{'
1019 ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);}
1020 | PARSEOP_DATABUFFER
1022 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
1026 * In RefOf, the node isn't really a target, but we can't keep track of it after
1027 * we've taken a pointer to it. (hard to tell if a local becomes initialized this way.)
1031 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_REFOF);}
1033 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,
1034 TrSetNodeFlags ($4, NODE_IS_TARGET));}
1037 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
1042 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_RELEASE);}
1044 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);}
1047 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
1052 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_RESET);}
1054 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);}
1057 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
1062 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_RETURN);}
1064 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);}
1065 | PARSEOP_RETURN {$$ = TrLinkChildren (
1066 TrCreateLeafNode (PARSEOP_RETURN),1,
1067 TrSetNodeFlags (TrCreateLeafNode (PARSEOP_ZERO),
1068 NODE_IS_NULL_RETURN));}
1071 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
1076 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SCOPE);}
1078 PARSEOP_CLOSE_PAREN '{'
1079 TermList '}' {$$ = TrLinkChildren ($<n>3,2,
1080 TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);}
1083 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
1088 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);}
1092 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
1095 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
1099 : PARSEOP_SHIFTRIGHT
1100 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);}
1104 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
1105 | PARSEOP_SHIFTRIGHT
1107 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
1112 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SIGNAL);}
1114 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);}
1117 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
1122 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SIZEOF);}
1124 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);}
1127 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
1132 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SLEEP);}
1134 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);}
1137 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
1142 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_STALL);}
1144 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);}
1147 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
1152 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_STORE);}
1155 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,
1156 TrSetNodeFlags ($6, NODE_IS_TARGET));}
1159 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
1164 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);}
1168 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
1171 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
1176 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_SWITCH);}
1178 PARSEOP_CLOSE_PAREN '{'
1179 CaseDefaultTermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);}
1182 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
1186 : PARSEOP_THERMALZONE
1187 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_THERMALZONE);}
1189 PARSEOP_CLOSE_PAREN '{'
1190 TermList '}' {$$ = TrLinkChildren ($<n>3,2,
1191 TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);}
1192 | PARSEOP_THERMALZONE
1194 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
1199 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_TIMER);}
1200 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,0);}
1201 | PARSEOP_TIMER {$$ = TrLinkChildren (
1202 TrCreateLeafNode (PARSEOP_TIMER),0);}
1205 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
1210 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_TOBCD);}
1213 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
1216 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
1221 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_TOBUFFER);}
1224 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
1227 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
1231 : PARSEOP_TODECIMALSTRING
1232 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_TODECIMALSTRING);}
1235 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
1236 | PARSEOP_TODECIMALSTRING
1238 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
1242 : PARSEOP_TOHEXSTRING
1243 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_TOHEXSTRING);}
1246 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
1247 | PARSEOP_TOHEXSTRING
1249 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
1254 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_TOINTEGER);}
1257 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
1260 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
1265 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_TOPLD);}
1267 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);}
1270 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
1276 PARSEOP_EXP_EQUALS Integer {$$ = TrLinkChildren ($1,1,$3);}
1278 PARSEOP_EXP_EQUALS String {$$ = TrLinkChildren ($1,1,$3);}
1279 | PldKeywordList ',' /* Allows a trailing comma at list end */
1280 | PldKeywordList ','
1282 PARSEOP_EXP_EQUALS Integer {$$ = TrLinkPeerNode ($1,TrLinkChildren ($3,1,$5));}
1283 | PldKeywordList ','
1285 PARSEOP_EXP_EQUALS String {$$ = TrLinkPeerNode ($1,TrLinkChildren ($3,1,$5));}
1291 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_TOSTRING);}
1295 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
1298 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
1305 PARSEOP_CLOSE_PAREN {$$ = TrUpdateNode (PARSEOP_TOUUID, $3);}
1308 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
1313 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_UNICODE);}
1315 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,0,$4);}
1318 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
1323 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_UNLOAD);}
1325 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,1,$4);}
1328 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
1333 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_WAIT);}
1336 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
1339 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
1344 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);}
1348 PARSEOP_CLOSE_PAREN {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
1351 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}
1356 PARSEOP_OPEN_PAREN {$<n>$ = TrCreateLeafNode (PARSEOP_WHILE);}
1359 '{' TermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);}
1362 error PARSEOP_CLOSE_PAREN {$$ = AslDoError(); yyclearin;}