Fixed compatibility of output.
[AROS.git] / arch / all-pc / acpica / source / compiler / aslcompiler.y
blob7394b3d8dd77f51128fa3cc6594cc06e977978b1
1 %{
2 /******************************************************************************
4 * Module Name: aslcompiler.y - Bison/Yacc input file (ASL grammar and actions)
6 *****************************************************************************/
8 /*
9 * Copyright (C) 2000 - 2013, 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
14 * are met:
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.
31 * NO WARRANTY
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.
45 #include "aslcompiler.h"
46 #include <stdio.h>
47 #include <stdlib.h>
48 #include <string.h>
49 #include "acpi.h"
50 #include "accommon.h"
52 #define _COMPONENT ACPI_COMPILER
53 ACPI_MODULE_NAME ("aslparse")
56 * Global Notes:
58 * October 2005: The following list terms have been optimized (from the
59 * original ASL grammar in the ACPI specification) to force the immediate
60 * reduction of each list item so that the parse stack use doesn't increase on
61 * each list element and possibly overflow on very large lists (>4000 items).
62 * This dramatically reduces use of the parse stack overall.
64 * ArgList, TermList, Objectlist, ByteList, DWordList, PackageList,
65 * ResourceMacroList, and FieldUnitList
68 void * AslLocalAllocate (unsigned int Size);
70 /* Bison/yacc configuration */
72 #define static
73 #undef alloca
74 #define alloca AslLocalAllocate
75 #define yytname AslCompilername
77 #define YYINITDEPTH 600 /* State stack depth */
78 #define YYDEBUG 1 /* Enable debug output */
79 #define YYERROR_VERBOSE 1 /* Verbose error messages */
81 /* Define YYMALLOC/YYFREE to prevent redefinition errors */
83 #define YYMALLOC malloc
84 #define YYFREE free
87 * The windows version of bison defines this incorrectly as "32768" (Not negative).
88 * We use a custom (edited binary) version of bison that defines YYFLAG as YYFBAD
89 * instead (#define YYFBAD 32768), so we can define it correctly here.
91 * The problem is that if YYFLAG is positive, the extended syntax error messages
92 * are disabled.
94 #define YYFLAG -32768
99 * Declare the type of values in the grammar
101 %union {
102 UINT64 i;
103 char *s;
104 ACPI_PARSE_OBJECT *n;
107 /*! [Begin] no source code translation */
110 * These shift/reduce conflicts are expected. There should be zero
111 * reduce/reduce conflicts.
113 %expect 86
115 /******************************************************************************
117 * Token types: These are returned by the lexer
119 * NOTE: This list MUST match the AslKeywordMapping table found
120 * in aslmap.c EXACTLY! Double check any changes!
122 *****************************************************************************/
124 %token <i> PARSEOP_ACCESSAS
125 %token <i> PARSEOP_ACCESSATTRIB_BLOCK
126 %token <i> PARSEOP_ACCESSATTRIB_BLOCK_CALL
127 %token <i> PARSEOP_ACCESSATTRIB_BYTE
128 %token <i> PARSEOP_ACCESSATTRIB_MULTIBYTE
129 %token <i> PARSEOP_ACCESSATTRIB_QUICK
130 %token <i> PARSEOP_ACCESSATTRIB_RAW_BYTES
131 %token <i> PARSEOP_ACCESSATTRIB_RAW_PROCESS
132 %token <i> PARSEOP_ACCESSATTRIB_SND_RCV
133 %token <i> PARSEOP_ACCESSATTRIB_WORD
134 %token <i> PARSEOP_ACCESSATTRIB_WORD_CALL
135 %token <i> PARSEOP_ACCESSTYPE_ANY
136 %token <i> PARSEOP_ACCESSTYPE_BUF
137 %token <i> PARSEOP_ACCESSTYPE_BYTE
138 %token <i> PARSEOP_ACCESSTYPE_DWORD
139 %token <i> PARSEOP_ACCESSTYPE_QWORD
140 %token <i> PARSEOP_ACCESSTYPE_WORD
141 %token <i> PARSEOP_ACQUIRE
142 %token <i> PARSEOP_ADD
143 %token <i> PARSEOP_ADDRESSINGMODE_7BIT
144 %token <i> PARSEOP_ADDRESSINGMODE_10BIT
145 %token <i> PARSEOP_ADDRESSTYPE_ACPI
146 %token <i> PARSEOP_ADDRESSTYPE_MEMORY
147 %token <i> PARSEOP_ADDRESSTYPE_NVS
148 %token <i> PARSEOP_ADDRESSTYPE_RESERVED
149 %token <i> PARSEOP_ALIAS
150 %token <i> PARSEOP_AND
151 %token <i> PARSEOP_ARG0
152 %token <i> PARSEOP_ARG1
153 %token <i> PARSEOP_ARG2
154 %token <i> PARSEOP_ARG3
155 %token <i> PARSEOP_ARG4
156 %token <i> PARSEOP_ARG5
157 %token <i> PARSEOP_ARG6
158 %token <i> PARSEOP_BANKFIELD
159 %token <i> PARSEOP_BITSPERBYTE_EIGHT
160 %token <i> PARSEOP_BITSPERBYTE_FIVE
161 %token <i> PARSEOP_BITSPERBYTE_NINE
162 %token <i> PARSEOP_BITSPERBYTE_SEVEN
163 %token <i> PARSEOP_BITSPERBYTE_SIX
164 %token <i> PARSEOP_BREAK
165 %token <i> PARSEOP_BREAKPOINT
166 %token <i> PARSEOP_BUFFER
167 %token <i> PARSEOP_BUSMASTERTYPE_MASTER
168 %token <i> PARSEOP_BUSMASTERTYPE_NOTMASTER
169 %token <i> PARSEOP_BYTECONST
170 %token <i> PARSEOP_CASE
171 %token <i> PARSEOP_CLOCKPHASE_FIRST
172 %token <i> PARSEOP_CLOCKPHASE_SECOND
173 %token <i> PARSEOP_CLOCKPOLARITY_HIGH
174 %token <i> PARSEOP_CLOCKPOLARITY_LOW
175 %token <i> PARSEOP_CONCATENATE
176 %token <i> PARSEOP_CONCATENATERESTEMPLATE
177 %token <i> PARSEOP_CONDREFOF
178 %token <i> PARSEOP_CONNECTION
179 %token <i> PARSEOP_CONTINUE
180 %token <i> PARSEOP_COPYOBJECT
181 %token <i> PARSEOP_CREATEBITFIELD
182 %token <i> PARSEOP_CREATEBYTEFIELD
183 %token <i> PARSEOP_CREATEDWORDFIELD
184 %token <i> PARSEOP_CREATEFIELD
185 %token <i> PARSEOP_CREATEQWORDFIELD
186 %token <i> PARSEOP_CREATEWORDFIELD
187 %token <i> PARSEOP_DATABUFFER
188 %token <i> PARSEOP_DATATABLEREGION
189 %token <i> PARSEOP_DEBUG
190 %token <i> PARSEOP_DECODETYPE_POS
191 %token <i> PARSEOP_DECODETYPE_SUB
192 %token <i> PARSEOP_DECREMENT
193 %token <i> PARSEOP_DEFAULT
194 %token <i> PARSEOP_DEFAULT_ARG
195 %token <i> PARSEOP_DEFINITIONBLOCK
196 %token <i> PARSEOP_DEREFOF
197 %token <i> PARSEOP_DEVICE
198 %token <i> PARSEOP_DEVICEPOLARITY_HIGH
199 %token <i> PARSEOP_DEVICEPOLARITY_LOW
200 %token <i> PARSEOP_DIVIDE
201 %token <i> PARSEOP_DMA
202 %token <i> PARSEOP_DMATYPE_A
203 %token <i> PARSEOP_DMATYPE_COMPATIBILITY
204 %token <i> PARSEOP_DMATYPE_B
205 %token <i> PARSEOP_DMATYPE_F
206 %token <i> PARSEOP_DWORDCONST
207 %token <i> PARSEOP_DWORDIO
208 %token <i> PARSEOP_DWORDMEMORY
209 %token <i> PARSEOP_DWORDSPACE
210 %token <i> PARSEOP_EISAID
211 %token <i> PARSEOP_ELSE
212 %token <i> PARSEOP_ELSEIF
213 %token <i> PARSEOP_ENDDEPENDENTFN
214 %token <i> PARSEOP_ENDIAN_BIG
215 %token <i> PARSEOP_ENDIAN_LITTLE
216 %token <i> PARSEOP_ENDTAG
217 %token <i> PARSEOP_ERRORNODE
218 %token <i> PARSEOP_EVENT
219 %token <i> PARSEOP_EXTENDEDIO
220 %token <i> PARSEOP_EXTENDEDMEMORY
221 %token <i> PARSEOP_EXTENDEDSPACE
222 %token <i> PARSEOP_EXTERNAL
223 %token <i> PARSEOP_FATAL
224 %token <i> PARSEOP_FIELD
225 %token <i> PARSEOP_FINDSETLEFTBIT
226 %token <i> PARSEOP_FINDSETRIGHTBIT
227 %token <i> PARSEOP_FIXEDDMA
228 %token <i> PARSEOP_FIXEDIO
229 %token <i> PARSEOP_FLOWCONTROL_HW
230 %token <i> PARSEOP_FLOWCONTROL_NONE
231 %token <i> PARSEOP_FLOWCONTROL_SW
232 %token <i> PARSEOP_FROMBCD
233 %token <i> PARSEOP_FUNCTION
234 %token <i> PARSEOP_GPIO_INT
235 %token <i> PARSEOP_GPIO_IO
236 %token <i> PARSEOP_I2C_SERIALBUS
237 %token <i> PARSEOP_IF
238 %token <i> PARSEOP_INCLUDE
239 %token <i> PARSEOP_INCLUDE_END
240 %token <i> PARSEOP_INCREMENT
241 %token <i> PARSEOP_INDEX
242 %token <i> PARSEOP_INDEXFIELD
243 %token <i> PARSEOP_INTEGER
244 %token <i> PARSEOP_INTERRUPT
245 %token <i> PARSEOP_INTLEVEL_ACTIVEBOTH
246 %token <i> PARSEOP_INTLEVEL_ACTIVEHIGH
247 %token <i> PARSEOP_INTLEVEL_ACTIVELOW
248 %token <i> PARSEOP_INTTYPE_EDGE
249 %token <i> PARSEOP_INTTYPE_LEVEL
250 %token <i> PARSEOP_IO
251 %token <i> PARSEOP_IODECODETYPE_10
252 %token <i> PARSEOP_IODECODETYPE_16
253 %token <i> PARSEOP_IORESTRICT_IN
254 %token <i> PARSEOP_IORESTRICT_NONE
255 %token <i> PARSEOP_IORESTRICT_OUT
256 %token <i> PARSEOP_IORESTRICT_PRESERVE
257 %token <i> PARSEOP_IRQ
258 %token <i> PARSEOP_IRQNOFLAGS
259 %token <i> PARSEOP_LAND
260 %token <i> PARSEOP_LEQUAL
261 %token <i> PARSEOP_LGREATER
262 %token <i> PARSEOP_LGREATEREQUAL
263 %token <i> PARSEOP_LLESS
264 %token <i> PARSEOP_LLESSEQUAL
265 %token <i> PARSEOP_LNOT
266 %token <i> PARSEOP_LNOTEQUAL
267 %token <i> PARSEOP_LOAD
268 %token <i> PARSEOP_LOADTABLE
269 %token <i> PARSEOP_LOCAL0
270 %token <i> PARSEOP_LOCAL1
271 %token <i> PARSEOP_LOCAL2
272 %token <i> PARSEOP_LOCAL3
273 %token <i> PARSEOP_LOCAL4
274 %token <i> PARSEOP_LOCAL5
275 %token <i> PARSEOP_LOCAL6
276 %token <i> PARSEOP_LOCAL7
277 %token <i> PARSEOP_LOCKRULE_LOCK
278 %token <i> PARSEOP_LOCKRULE_NOLOCK
279 %token <i> PARSEOP_LOR
280 %token <i> PARSEOP_MATCH
281 %token <i> PARSEOP_MATCHTYPE_MEQ
282 %token <i> PARSEOP_MATCHTYPE_MGE
283 %token <i> PARSEOP_MATCHTYPE_MGT
284 %token <i> PARSEOP_MATCHTYPE_MLE
285 %token <i> PARSEOP_MATCHTYPE_MLT
286 %token <i> PARSEOP_MATCHTYPE_MTR
287 %token <i> PARSEOP_MAXTYPE_FIXED
288 %token <i> PARSEOP_MAXTYPE_NOTFIXED
289 %token <i> PARSEOP_MEMORY24
290 %token <i> PARSEOP_MEMORY32
291 %token <i> PARSEOP_MEMORY32FIXED
292 %token <i> PARSEOP_MEMTYPE_CACHEABLE
293 %token <i> PARSEOP_MEMTYPE_NONCACHEABLE
294 %token <i> PARSEOP_MEMTYPE_PREFETCHABLE
295 %token <i> PARSEOP_MEMTYPE_WRITECOMBINING
296 %token <i> PARSEOP_METHOD
297 %token <i> PARSEOP_METHODCALL
298 %token <i> PARSEOP_MID
299 %token <i> PARSEOP_MINTYPE_FIXED
300 %token <i> PARSEOP_MINTYPE_NOTFIXED
301 %token <i> PARSEOP_MOD
302 %token <i> PARSEOP_MULTIPLY
303 %token <i> PARSEOP_MUTEX
304 %token <i> PARSEOP_NAME
305 %token <s> PARSEOP_NAMESEG
306 %token <s> PARSEOP_NAMESTRING
307 %token <i> PARSEOP_NAND
308 %token <i> PARSEOP_NOOP
309 %token <i> PARSEOP_NOR
310 %token <i> PARSEOP_NOT
311 %token <i> PARSEOP_NOTIFY
312 %token <i> PARSEOP_OBJECTTYPE
313 %token <i> PARSEOP_OBJECTTYPE_BFF
314 %token <i> PARSEOP_OBJECTTYPE_BUF
315 %token <i> PARSEOP_OBJECTTYPE_DDB
316 %token <i> PARSEOP_OBJECTTYPE_DEV
317 %token <i> PARSEOP_OBJECTTYPE_EVT
318 %token <i> PARSEOP_OBJECTTYPE_FLD
319 %token <i> PARSEOP_OBJECTTYPE_INT
320 %token <i> PARSEOP_OBJECTTYPE_MTH
321 %token <i> PARSEOP_OBJECTTYPE_MTX
322 %token <i> PARSEOP_OBJECTTYPE_OPR
323 %token <i> PARSEOP_OBJECTTYPE_PKG
324 %token <i> PARSEOP_OBJECTTYPE_POW
325 %token <i> PARSEOP_OBJECTTYPE_PRO
326 %token <i> PARSEOP_OBJECTTYPE_STR
327 %token <i> PARSEOP_OBJECTTYPE_THZ
328 %token <i> PARSEOP_OBJECTTYPE_UNK
329 %token <i> PARSEOP_OFFSET
330 %token <i> PARSEOP_ONE
331 %token <i> PARSEOP_ONES
332 %token <i> PARSEOP_OPERATIONREGION
333 %token <i> PARSEOP_OR
334 %token <i> PARSEOP_PACKAGE
335 %token <i> PARSEOP_PACKAGE_LENGTH
336 %token <i> PARSEOP_PARITYTYPE_EVEN
337 %token <i> PARSEOP_PARITYTYPE_MARK
338 %token <i> PARSEOP_PARITYTYPE_NONE
339 %token <i> PARSEOP_PARITYTYPE_ODD
340 %token <i> PARSEOP_PARITYTYPE_SPACE
341 %token <i> PARSEOP_PIN_NOPULL
342 %token <i> PARSEOP_PIN_PULLDEFAULT
343 %token <i> PARSEOP_PIN_PULLDOWN
344 %token <i> PARSEOP_PIN_PULLUP
345 %token <i> PARSEOP_POWERRESOURCE
346 %token <i> PARSEOP_PROCESSOR
347 %token <i> PARSEOP_QWORDCONST
348 %token <i> PARSEOP_QWORDIO
349 %token <i> PARSEOP_QWORDMEMORY
350 %token <i> PARSEOP_QWORDSPACE
351 %token <i> PARSEOP_RANGETYPE_ENTIRE
352 %token <i> PARSEOP_RANGETYPE_ISAONLY
353 %token <i> PARSEOP_RANGETYPE_NONISAONLY
354 %token <i> PARSEOP_RAW_DATA
355 %token <i> PARSEOP_READWRITETYPE_BOTH
356 %token <i> PARSEOP_READWRITETYPE_READONLY
357 %token <i> PARSEOP_REFOF
358 %token <i> PARSEOP_REGIONSPACE_CMOS
359 %token <i> PARSEOP_REGIONSPACE_EC
360 %token <i> PARSEOP_REGIONSPACE_FFIXEDHW
361 %token <i> PARSEOP_REGIONSPACE_GPIO
362 %token <i> PARSEOP_REGIONSPACE_GSBUS
363 %token <i> PARSEOP_REGIONSPACE_IO
364 %token <i> PARSEOP_REGIONSPACE_IPMI
365 %token <i> PARSEOP_REGIONSPACE_MEM
366 %token <i> PARSEOP_REGIONSPACE_PCC
367 %token <i> PARSEOP_REGIONSPACE_PCI
368 %token <i> PARSEOP_REGIONSPACE_PCIBAR
369 %token <i> PARSEOP_REGIONSPACE_SMBUS
370 %token <i> PARSEOP_REGISTER
371 %token <i> PARSEOP_RELEASE
372 %token <i> PARSEOP_RESERVED_BYTES
373 %token <i> PARSEOP_RESET
374 %token <i> PARSEOP_RESOURCETEMPLATE
375 %token <i> PARSEOP_RESOURCETYPE_CONSUMER
376 %token <i> PARSEOP_RESOURCETYPE_PRODUCER
377 %token <i> PARSEOP_RETURN
378 %token <i> PARSEOP_REVISION
379 %token <i> PARSEOP_SCOPE
380 %token <i> PARSEOP_SERIALIZERULE_NOTSERIAL
381 %token <i> PARSEOP_SERIALIZERULE_SERIAL
382 %token <i> PARSEOP_SHARETYPE_EXCLUSIVE
383 %token <i> PARSEOP_SHARETYPE_EXCLUSIVEWAKE
384 %token <i> PARSEOP_SHARETYPE_SHARED
385 %token <i> PARSEOP_SHARETYPE_SHAREDWAKE
386 %token <i> PARSEOP_SHIFTLEFT
387 %token <i> PARSEOP_SHIFTRIGHT
388 %token <i> PARSEOP_SIGNAL
389 %token <i> PARSEOP_SIZEOF
390 %token <i> PARSEOP_SLAVEMODE_CONTROLLERINIT
391 %token <i> PARSEOP_SLAVEMODE_DEVICEINIT
392 %token <i> PARSEOP_SLEEP
393 %token <i> PARSEOP_SPI_SERIALBUS
394 %token <i> PARSEOP_STALL
395 %token <i> PARSEOP_STARTDEPENDENTFN
396 %token <i> PARSEOP_STARTDEPENDENTFN_NOPRI
397 %token <i> PARSEOP_STOPBITS_ONE
398 %token <i> PARSEOP_STOPBITS_ONEPLUSHALF
399 %token <i> PARSEOP_STOPBITS_TWO
400 %token <i> PARSEOP_STOPBITS_ZERO
401 %token <i> PARSEOP_STORE
402 %token <s> PARSEOP_STRING_LITERAL
403 %token <i> PARSEOP_SUBTRACT
404 %token <i> PARSEOP_SWITCH
405 %token <i> PARSEOP_THERMALZONE
406 %token <i> PARSEOP_TIMER
407 %token <i> PARSEOP_TOBCD
408 %token <i> PARSEOP_TOBUFFER
409 %token <i> PARSEOP_TODECIMALSTRING
410 %token <i> PARSEOP_TOHEXSTRING
411 %token <i> PARSEOP_TOINTEGER
412 %token <i> PARSEOP_TOSTRING
413 %token <i> PARSEOP_TOUUID
414 %token <i> PARSEOP_TRANSLATIONTYPE_DENSE
415 %token <i> PARSEOP_TRANSLATIONTYPE_SPARSE
416 %token <i> PARSEOP_TYPE_STATIC
417 %token <i> PARSEOP_TYPE_TRANSLATION
418 %token <i> PARSEOP_UART_SERIALBUS
419 %token <i> PARSEOP_UNICODE
420 %token <i> PARSEOP_UNLOAD
421 %token <i> PARSEOP_UPDATERULE_ONES
422 %token <i> PARSEOP_UPDATERULE_PRESERVE
423 %token <i> PARSEOP_UPDATERULE_ZEROS
424 %token <i> PARSEOP_VAR_PACKAGE
425 %token <i> PARSEOP_VENDORLONG
426 %token <i> PARSEOP_VENDORSHORT
427 %token <i> PARSEOP_WAIT
428 %token <i> PARSEOP_WHILE
429 %token <i> PARSEOP_WIREMODE_FOUR
430 %token <i> PARSEOP_WIREMODE_THREE
431 %token <i> PARSEOP_WORDBUSNUMBER
432 %token <i> PARSEOP_WORDCONST
433 %token <i> PARSEOP_WORDIO
434 %token <i> PARSEOP_WORDSPACE
435 %token <i> PARSEOP_XFERSIZE_8
436 %token <i> PARSEOP_XFERSIZE_16
437 %token <i> PARSEOP_XFERSIZE_32
438 %token <i> PARSEOP_XFERSIZE_64
439 %token <i> PARSEOP_XFERSIZE_128
440 %token <i> PARSEOP_XFERSIZE_256
441 %token <i> PARSEOP_XFERTYPE_8
442 %token <i> PARSEOP_XFERTYPE_8_16
443 %token <i> PARSEOP_XFERTYPE_16
444 %token <i> PARSEOP_XOR
445 %token <i> PARSEOP_ZERO
448 * Special functions. These should probably stay at the end of this
449 * table.
451 %token <i> PARSEOP___DATE__
452 %token <i> PARSEOP___FILE__
453 %token <i> PARSEOP___LINE__
454 %token <i> PARSEOP___PATH__
457 /******************************************************************************
459 * Production names
461 *****************************************************************************/
463 %type <n> ArgList
464 %type <n> ASLCode
465 %type <n> BufferData
466 %type <n> BufferTermData
467 %type <n> CompilerDirective
468 %type <n> DataObject
469 %type <n> DefinitionBlockTerm
470 %type <n> IntegerData
471 %type <n> NamedObject
472 %type <n> NameSpaceModifier
473 %type <n> Object
474 %type <n> ObjectList
475 %type <n> PackageData
476 %type <n> ParameterTypePackage
477 %type <n> ParameterTypePackageList
478 %type <n> ParameterTypesPackage
479 %type <n> ParameterTypesPackageList
480 %type <n> RequiredTarget
481 %type <n> SimpleTarget
482 %type <n> StringData
483 %type <n> Target
484 %type <n> Term
485 %type <n> TermArg
486 %type <n> TermList
487 %type <n> UserTerm
489 /* Type4Opcode is obsolete */
491 %type <n> Type1Opcode
492 %type <n> Type2BufferOpcode
493 %type <n> Type2BufferOrStringOpcode
494 %type <n> Type2IntegerOpcode
495 %type <n> Type2Opcode
496 %type <n> Type2StringOpcode
497 %type <n> Type3Opcode
498 %type <n> Type5Opcode
499 %type <n> Type6Opcode
501 %type <n> AccessAsTerm
502 %type <n> ExternalTerm
503 %type <n> FieldUnit
504 %type <n> FieldUnitEntry
505 %type <n> FieldUnitList
506 %type <n> IncludeTerm
507 %type <n> OffsetTerm
508 %type <n> OptionalAccessAttribTerm
510 /* Named Objects */
512 %type <n> BankFieldTerm
513 %type <n> CreateBitFieldTerm
514 %type <n> CreateByteFieldTerm
515 %type <n> CreateDWordFieldTerm
516 %type <n> CreateFieldTerm
517 %type <n> CreateQWordFieldTerm
518 %type <n> CreateWordFieldTerm
519 %type <n> DataRegionTerm
520 %type <n> DeviceTerm
521 %type <n> EventTerm
522 %type <n> FieldTerm
523 %type <n> FunctionTerm
524 %type <n> IndexFieldTerm
525 %type <n> MethodTerm
526 %type <n> MutexTerm
527 %type <n> OpRegionTerm
528 %type <n> OpRegionSpaceIdTerm
529 %type <n> PowerResTerm
530 %type <n> ProcessorTerm
531 %type <n> ThermalZoneTerm
533 /* Namespace modifiers */
535 %type <n> AliasTerm
536 %type <n> NameTerm
537 %type <n> ScopeTerm
539 /* Type 1 opcodes */
541 %type <n> BreakPointTerm
542 %type <n> BreakTerm
543 %type <n> CaseDefaultTermList
544 %type <n> CaseTerm
545 %type <n> ContinueTerm
546 %type <n> DefaultTerm
547 %type <n> ElseTerm
548 %type <n> FatalTerm
549 %type <n> IfElseTerm
550 %type <n> IfTerm
551 %type <n> LoadTerm
552 %type <n> NoOpTerm
553 %type <n> NotifyTerm
554 %type <n> ReleaseTerm
555 %type <n> ResetTerm
556 %type <n> ReturnTerm
557 %type <n> SignalTerm
558 %type <n> SleepTerm
559 %type <n> StallTerm
560 %type <n> SwitchTerm
561 %type <n> UnloadTerm
562 %type <n> WhileTerm
563 /* %type <n> CaseTermList */
565 /* Type 2 opcodes */
567 %type <n> AcquireTerm
568 %type <n> AddTerm
569 %type <n> AndTerm
570 %type <n> ConcatResTerm
571 %type <n> ConcatTerm
572 %type <n> CondRefOfTerm
573 %type <n> CopyObjectTerm
574 %type <n> DecTerm
575 %type <n> DerefOfTerm
576 %type <n> DivideTerm
577 %type <n> FindSetLeftBitTerm
578 %type <n> FindSetRightBitTerm
579 %type <n> FromBCDTerm
580 %type <n> IncTerm
581 %type <n> IndexTerm
582 %type <n> LAndTerm
583 %type <n> LEqualTerm
584 %type <n> LGreaterEqualTerm
585 %type <n> LGreaterTerm
586 %type <n> LLessEqualTerm
587 %type <n> LLessTerm
588 %type <n> LNotEqualTerm
589 %type <n> LNotTerm
590 %type <n> LoadTableTerm
591 %type <n> LOrTerm
592 %type <n> MatchTerm
593 %type <n> MidTerm
594 %type <n> ModTerm
595 %type <n> MultiplyTerm
596 %type <n> NAndTerm
597 %type <n> NOrTerm
598 %type <n> NotTerm
599 %type <n> ObjectTypeTerm
600 %type <n> OrTerm
601 %type <n> RefOfTerm
602 %type <n> ShiftLeftTerm
603 %type <n> ShiftRightTerm
604 %type <n> SizeOfTerm
605 %type <n> StoreTerm
606 %type <n> SubtractTerm
607 %type <n> TimerTerm
608 %type <n> ToBCDTerm
609 %type <n> ToBufferTerm
610 %type <n> ToDecimalStringTerm
611 %type <n> ToHexStringTerm
612 %type <n> ToIntegerTerm
613 %type <n> ToStringTerm
614 %type <n> WaitTerm
615 %type <n> XOrTerm
617 /* Keywords */
619 %type <n> AccessAttribKeyword
620 %type <n> AccessTypeKeyword
621 %type <n> AddressingModeKeyword
622 %type <n> AddressKeyword
623 %type <n> AddressSpaceKeyword
624 %type <n> BitsPerByteKeyword
625 %type <n> ClockPhaseKeyword
626 %type <n> ClockPolarityKeyword
627 %type <n> DecodeKeyword
628 %type <n> DevicePolarityKeyword
629 %type <n> DMATypeKeyword
630 %type <n> EndianKeyword
631 %type <n> FlowControlKeyword
632 %type <n> InterruptLevel
633 %type <n> InterruptTypeKeyword
634 %type <n> IODecodeKeyword
635 %type <n> IoRestrictionKeyword
636 %type <n> LockRuleKeyword
637 %type <n> MatchOpKeyword
638 %type <n> MaxKeyword
639 %type <n> MemTypeKeyword
640 %type <n> MinKeyword
641 %type <n> ObjectTypeKeyword
642 %type <n> OptionalBusMasterKeyword
643 %type <n> OptionalReadWriteKeyword
644 %type <n> ParityTypeKeyword
645 %type <n> PinConfigByte
646 %type <n> PinConfigKeyword
647 %type <n> RangeTypeKeyword
648 %type <n> RegionSpaceKeyword
649 %type <n> ResourceTypeKeyword
650 %type <n> SerializeRuleKeyword
651 %type <n> ShareTypeKeyword
652 %type <n> SlaveModeKeyword
653 %type <n> StopBitsKeyword
654 %type <n> TranslationKeyword
655 %type <n> TypeKeyword
656 %type <n> UpdateRuleKeyword
657 %type <n> WireModeKeyword
658 %type <n> XferSizeKeyword
659 %type <n> XferTypeKeyword
661 /* Types */
663 %type <n> SuperName
664 %type <n> ObjectTypeName
665 %type <n> ArgTerm
666 %type <n> LocalTerm
667 %type <n> DebugTerm
669 %type <n> Integer
670 %type <n> ByteConst
671 %type <n> WordConst
672 %type <n> DWordConst
673 %type <n> QWordConst
674 %type <n> String
676 %type <n> ConstTerm
677 %type <n> ConstExprTerm
678 %type <n> ByteConstExpr
679 %type <n> WordConstExpr
680 %type <n> DWordConstExpr
681 %type <n> QWordConstExpr
683 %type <n> DWordList
684 %type <n> BufferTerm
685 %type <n> ByteList
687 %type <n> PackageElement
688 %type <n> PackageList
689 %type <n> PackageTerm
690 %type <n> VarPackageLengthTerm
692 /* Macros */
694 %type <n> EISAIDTerm
695 %type <n> ResourceMacroList
696 %type <n> ResourceMacroTerm
697 %type <n> ResourceTemplateTerm
698 %type <n> ToUUIDTerm
699 %type <n> UnicodeTerm
701 /* Resource Descriptors */
703 %type <n> ConnectionTerm
704 %type <n> DataBufferTerm
705 %type <n> DMATerm
706 %type <n> DWordIOTerm
707 %type <n> DWordMemoryTerm
708 %type <n> DWordSpaceTerm
709 %type <n> EndDependentFnTerm
710 %type <n> ExtendedIOTerm
711 %type <n> ExtendedMemoryTerm
712 %type <n> ExtendedSpaceTerm
713 %type <n> FixedDmaTerm
714 %type <n> FixedIOTerm
715 %type <n> GpioIntTerm
716 %type <n> GpioIoTerm
717 %type <n> I2cSerialBusTerm
718 %type <n> InterruptTerm
719 %type <n> IOTerm
720 %type <n> IRQNoFlagsTerm
721 %type <n> IRQTerm
722 %type <n> Memory24Term
723 %type <n> Memory32FixedTerm
724 %type <n> Memory32Term
725 %type <n> NameSeg
726 %type <n> NameString
727 %type <n> QWordIOTerm
728 %type <n> QWordMemoryTerm
729 %type <n> QWordSpaceTerm
730 %type <n> RegisterTerm
731 %type <n> SpiSerialBusTerm
732 %type <n> StartDependentFnNoPriTerm
733 %type <n> StartDependentFnTerm
734 %type <n> UartSerialBusTerm
735 %type <n> VendorLongTerm
736 %type <n> VendorShortTerm
737 %type <n> WordBusNumberTerm
738 %type <n> WordIOTerm
739 %type <n> WordSpaceTerm
741 /* Local types that help construct the AML, not in ACPI spec */
743 %type <n> AmlPackageLengthTerm
744 %type <n> IncludeEndTerm
745 %type <n> NameStringItem
746 %type <n> TermArgItem
748 %type <n> OptionalAccessSize
749 %type <n> OptionalAddressingMode
750 %type <n> OptionalAddressRange
751 %type <n> OptionalBitsPerByte
752 %type <n> OptionalBuffer_Last
753 %type <n> OptionalByteConstExpr
754 %type <n> OptionalCount
755 %type <n> OptionalDecodeType
756 %type <n> OptionalDevicePolarity
757 %type <n> OptionalDWordConstExpr
758 %type <n> OptionalEndian
759 %type <n> OptionalFlowControl
760 %type <n> OptionalIoRestriction
761 %type <n> OptionalListString
762 %type <n> OptionalMaxType
763 %type <n> OptionalMemType
764 %type <n> OptionalMinType
765 %type <n> OptionalNameString
766 %type <n> OptionalNameString_First
767 %type <n> OptionalNameString_Last
768 %type <n> OptionalObjectTypeKeyword
769 %type <n> OptionalParameterTypePackage
770 %type <n> OptionalParameterTypesPackage
771 %type <n> OptionalParityType
772 %type <n> OptionalQWordConstExpr
773 %type <n> OptionalRangeType
774 %type <n> OptionalReference
775 %type <n> OptionalResourceType
776 %type <n> OptionalResourceType_First
777 %type <n> OptionalReturnArg
778 %type <n> OptionalSerializeRuleKeyword
779 %type <n> OptionalShareType
780 %type <n> OptionalShareType_First
781 %type <n> OptionalSlaveMode
782 %type <n> OptionalStopBits
783 %type <n> OptionalStringData
784 %type <n> OptionalTermArg
785 %type <n> OptionalTranslationType_Last
786 %type <n> OptionalType
787 %type <n> OptionalType_Last
788 %type <n> OptionalWireMode
789 %type <n> OptionalWordConst
790 %type <n> OptionalWordConstExpr
791 %type <n> OptionalXferSize
794 /*******************************************************************************
796 * Production rules start here
798 ******************************************************************************/
801 * ASL Names
806 * Root rule. Allow multiple #line directives before the definition block
807 * to handle output from preprocessors
809 ASLCode
810 : DefinitionBlockTerm
811 | error {YYABORT; $$ = NULL;}
815 * Blocks, Data, and Opcodes
819 * Note concerning support for "module-level code".
821 * ACPI 1.0 allowed Type1 and Type2 executable opcodes outside of control
822 * methods (the so-called module-level code.) This support was explicitly
823 * removed in ACPI 2.0, but this type of code continues to be created by
824 * BIOS vendors. In order to support the disassembly and recompilation of
825 * such code (and the porting of ASL code to iASL), iASL supports this
826 * code in violation of the current ACPI specification.
828 * The grammar change to support module-level code is to revert the
829 * {ObjectList} portion of the DefinitionBlockTerm in ACPI 2.0 to the
830 * original use of {TermList} instead (see below.) This allows the use
831 * of Type1 and Type2 opcodes at module level.
833 DefinitionBlockTerm
834 : PARSEOP_DEFINITIONBLOCK '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DEFINITIONBLOCK);}
835 String ','
836 String ','
837 ByteConst ','
838 String ','
839 String ','
840 DWordConst
841 ')' {TrSetEndLineNumber ($<n>3);}
842 '{' TermList '}' {$$ = TrLinkChildren ($<n>3,7,$4,$6,$8,$10,$12,$14,$18);}
845 /* ACPI 3.0 -- allow semicolons between terms */
847 TermList
848 : {$$ = NULL;}
849 | TermList Term {$$ = TrLinkPeerNode (TrSetNodeFlags ($1, NODE_RESULT_NOT_USED),$2);}
850 | TermList Term ';' {$$ = TrLinkPeerNode (TrSetNodeFlags ($1, NODE_RESULT_NOT_USED),$2);}
851 | TermList ';' Term {$$ = TrLinkPeerNode (TrSetNodeFlags ($1, NODE_RESULT_NOT_USED),$3);}
852 | TermList ';' Term ';' {$$ = TrLinkPeerNode (TrSetNodeFlags ($1, NODE_RESULT_NOT_USED),$3);}
855 Term
856 : Object {}
857 | Type1Opcode {}
858 | Type2Opcode {}
859 | Type2IntegerOpcode {}
860 | Type2StringOpcode {}
861 | Type2BufferOpcode {}
862 | Type2BufferOrStringOpcode {}
863 | error {$$ = AslDoError(); yyclearin;}
866 CompilerDirective
867 : IncludeTerm {}
868 | ExternalTerm {}
871 ObjectList
872 : {$$ = NULL;}
873 | ObjectList Object {$$ = TrLinkPeerNode ($1,$2);}
874 | error {$$ = AslDoError(); yyclearin;}
877 Object
878 : CompilerDirective {}
879 | NamedObject {}
880 | NameSpaceModifier {}
883 DataObject
884 : BufferData {}
885 | PackageData {}
886 | IntegerData {}
887 | StringData {}
890 BufferData
891 : Type5Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);}
892 | Type2BufferOrStringOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);}
893 | Type2BufferOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);}
894 | BufferTerm {}
897 PackageData
898 : PackageTerm {}
901 IntegerData
902 : Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);}
903 | Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);}
904 | Integer {}
905 | ConstTerm {}
908 StringData
909 : Type2StringOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);}
910 | String {}
913 NamedObject
914 : BankFieldTerm {}
915 | CreateBitFieldTerm {}
916 | CreateByteFieldTerm {}
917 | CreateDWordFieldTerm {}
918 | CreateFieldTerm {}
919 | CreateQWordFieldTerm {}
920 | CreateWordFieldTerm {}
921 | DataRegionTerm {}
922 | DeviceTerm {}
923 | EventTerm {}
924 | FieldTerm {}
925 | FunctionTerm {}
926 | IndexFieldTerm {}
927 | MethodTerm {}
928 | MutexTerm {}
929 | OpRegionTerm {}
930 | PowerResTerm {}
931 | ProcessorTerm {}
932 | ThermalZoneTerm {}
935 NameSpaceModifier
936 : AliasTerm {}
937 | NameTerm {}
938 | ScopeTerm {}
941 UserTerm
942 : NameString '(' {TrUpdateNode (PARSEOP_METHODCALL, $1);}
943 ArgList ')' {$$ = TrLinkChildNode ($1,$4);}
946 ArgList
947 : {$$ = NULL;}
948 | TermArg
949 | ArgList ',' /* Allows a trailing comma at list end */
950 | ArgList ','
951 TermArg {$$ = TrLinkPeerNode ($1,$3);}
955 Removed from TermArg due to reduce/reduce conflicts
956 | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
957 | Type2StringOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
958 | Type2BufferOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
959 | Type2BufferOrStringOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
963 TermArg
964 : Type2Opcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
965 | DataObject {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
966 | NameString {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
967 | ArgTerm {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
968 | LocalTerm {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);}
971 Target
972 : {$$ = TrSetNodeFlags (TrCreateLeafNode (PARSEOP_ZERO), NODE_IS_TARGET | NODE_COMPILE_TIME_CONST);} /* Placeholder is a ZeroOp object */
973 | ',' {$$ = TrSetNodeFlags (TrCreateLeafNode (PARSEOP_ZERO), NODE_IS_TARGET | NODE_COMPILE_TIME_CONST);} /* Placeholder is a ZeroOp object */
974 | ',' SuperName {$$ = TrSetNodeFlags ($2, NODE_IS_TARGET);}
977 RequiredTarget
978 : ',' SuperName {$$ = TrSetNodeFlags ($2, NODE_IS_TARGET);}
981 SimpleTarget
982 : NameString {}
983 | LocalTerm {}
984 | ArgTerm {}
987 /* Rules for specifying the type of one method argument or return value */
989 ParameterTypePackage
990 : {$$ = NULL;}
991 | ObjectTypeKeyword {$$ = $1;}
992 | ParameterTypePackage ','
993 ObjectTypeKeyword {$$ = TrLinkPeerNodes (2,$1,$3);}
996 ParameterTypePackageList
997 : {$$ = NULL;}
998 | ObjectTypeKeyword {$$ = $1;}
999 | '{' ParameterTypePackage '}' {$$ = $2;}
1002 OptionalParameterTypePackage
1003 : {$$ = TrCreateLeafNode (PARSEOP_DEFAULT_ARG);}
1004 | ',' ParameterTypePackageList {$$ = TrLinkChildren (TrCreateLeafNode (PARSEOP_DEFAULT_ARG),1,$2);}
1007 /* Rules for specifying the types for method arguments */
1009 ParameterTypesPackage
1010 : ParameterTypePackageList {$$ = $1;}
1011 | ParameterTypesPackage ','
1012 ParameterTypePackageList {$$ = TrLinkPeerNodes (2,$1,$3);}
1015 ParameterTypesPackageList
1016 : {$$ = NULL;}
1017 | ObjectTypeKeyword {$$ = $1;}
1018 | '{' ParameterTypesPackage '}' {$$ = $2;}
1021 OptionalParameterTypesPackage
1022 : {$$ = TrCreateLeafNode (PARSEOP_DEFAULT_ARG);}
1023 | ',' ParameterTypesPackageList {$$ = TrLinkChildren (TrCreateLeafNode (PARSEOP_DEFAULT_ARG),1,$2);}
1027 /* Opcode types */
1029 Type1Opcode
1030 : BreakTerm {}
1031 | BreakPointTerm {}
1032 | ContinueTerm {}
1033 | FatalTerm {}
1034 | IfElseTerm {}
1035 | LoadTerm {}
1036 | NoOpTerm {}
1037 | NotifyTerm {}
1038 | ReleaseTerm {}
1039 | ResetTerm {}
1040 | ReturnTerm {}
1041 | SignalTerm {}
1042 | SleepTerm {}
1043 | StallTerm {}
1044 | SwitchTerm {}
1045 | UnloadTerm {}
1046 | WhileTerm {}
1049 Type2Opcode
1050 : AcquireTerm {}
1051 | CondRefOfTerm {}
1052 | CopyObjectTerm {}
1053 | DerefOfTerm {}
1054 | ObjectTypeTerm {}
1055 | RefOfTerm {}
1056 | SizeOfTerm {}
1057 | StoreTerm {}
1058 | TimerTerm {}
1059 | WaitTerm {}
1060 | UserTerm {}
1064 * Type 3/4/5 opcodes
1067 Type2IntegerOpcode /* "Type3" opcodes */
1068 : AddTerm {}
1069 | AndTerm {}
1070 | DecTerm {}
1071 | DivideTerm {}
1072 | FindSetLeftBitTerm {}
1073 | FindSetRightBitTerm {}
1074 | FromBCDTerm {}
1075 | IncTerm {}
1076 | IndexTerm {}
1077 | LAndTerm {}
1078 | LEqualTerm {}
1079 | LGreaterTerm {}
1080 | LGreaterEqualTerm {}
1081 | LLessTerm {}
1082 | LLessEqualTerm {}
1083 | LNotTerm {}
1084 | LNotEqualTerm {}
1085 | LoadTableTerm {}
1086 | LOrTerm {}
1087 | MatchTerm {}
1088 | ModTerm {}
1089 | MultiplyTerm {}
1090 | NAndTerm {}
1091 | NOrTerm {}
1092 | NotTerm {}
1093 | OrTerm {}
1094 | ShiftLeftTerm {}
1095 | ShiftRightTerm {}
1096 | SubtractTerm {}
1097 | ToBCDTerm {}
1098 | ToIntegerTerm {}
1099 | XOrTerm {}
1102 Type2StringOpcode /* "Type4" Opcodes */
1103 : ToDecimalStringTerm {}
1104 | ToHexStringTerm {}
1105 | ToStringTerm {}
1108 Type2BufferOpcode /* "Type5" Opcodes */
1109 : ToBufferTerm {}
1110 | ConcatResTerm {}
1113 Type2BufferOrStringOpcode
1114 : ConcatTerm {}
1115 | MidTerm {}
1119 * A type 3 opcode evaluates to an Integer and cannot have a destination operand
1122 Type3Opcode
1123 : EISAIDTerm {}
1126 /* Obsolete
1127 Type4Opcode
1128 : ConcatTerm {}
1129 | ToDecimalStringTerm {}
1130 | ToHexStringTerm {}
1131 | MidTerm {}
1132 | ToStringTerm {}
1137 Type5Opcode
1138 : ResourceTemplateTerm {}
1139 | UnicodeTerm {}
1140 | ToUUIDTerm {}
1143 Type6Opcode
1144 : RefOfTerm {}
1145 | DerefOfTerm {}
1146 | IndexTerm {}
1147 | UserTerm {}
1150 IncludeTerm
1151 : PARSEOP_INCLUDE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INCLUDE);}
1152 String ')' {TrLinkChildren ($<n>3,1,$4);FlOpenIncludeFile ($4);}
1153 TermList
1154 IncludeEndTerm {$$ = TrLinkPeerNodes (3,$<n>3,$7,$8);}
1157 IncludeEndTerm
1158 : PARSEOP_INCLUDE_END {$$ = TrCreateLeafNode (PARSEOP_INCLUDE_END);}
1161 ExternalTerm
1162 : PARSEOP_EXTERNAL '('
1163 NameString
1164 OptionalObjectTypeKeyword
1165 OptionalParameterTypePackage
1166 OptionalParameterTypesPackage
1167 ')' {$$ = TrCreateNode (PARSEOP_EXTERNAL,4,$3,$4,$5,$6);}
1168 | PARSEOP_EXTERNAL '('
1169 error ')' {$$ = AslDoError(); yyclearin;}
1173 /******* Named Objects *******************************************************/
1176 BankFieldTerm
1177 : PARSEOP_BANKFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_BANKFIELD);}
1178 NameString
1179 NameStringItem
1180 TermArgItem
1181 ',' AccessTypeKeyword
1182 ',' LockRuleKeyword
1183 ',' UpdateRuleKeyword
1184 ')' '{'
1185 FieldUnitList '}' {$$ = TrLinkChildren ($<n>3,7,$4,$5,$6,$8,$10,$12,$15);}
1186 | PARSEOP_BANKFIELD '('
1187 error ')' '{' error '}' {$$ = AslDoError(); yyclearin;}
1190 FieldUnitList
1191 : {$$ = NULL;}
1192 | FieldUnit
1193 | FieldUnitList ',' /* Allows a trailing comma at list end */
1194 | FieldUnitList ','
1195 FieldUnit {$$ = TrLinkPeerNode ($1,$3);}
1198 FieldUnit
1199 : FieldUnitEntry {}
1200 | OffsetTerm {}
1201 | AccessAsTerm {}
1202 | ConnectionTerm {}
1205 FieldUnitEntry
1206 : ',' AmlPackageLengthTerm {$$ = TrCreateNode (PARSEOP_RESERVED_BYTES,1,$2);}
1207 | NameSeg ','
1208 AmlPackageLengthTerm {$$ = TrLinkChildNode ($1,$3);}
1211 OffsetTerm
1212 : PARSEOP_OFFSET '('
1213 AmlPackageLengthTerm
1214 ')' {$$ = TrCreateNode (PARSEOP_OFFSET,1,$3);}
1215 | PARSEOP_OFFSET '('
1216 error ')' {$$ = AslDoError(); yyclearin;}
1219 AccessAsTerm
1220 : PARSEOP_ACCESSAS '('
1221 AccessTypeKeyword
1222 OptionalAccessAttribTerm
1223 ')' {$$ = TrCreateNode (PARSEOP_ACCESSAS,2,$3,$4);}
1224 | PARSEOP_ACCESSAS '('
1225 error ')' {$$ = AslDoError(); yyclearin;}
1228 ConnectionTerm
1229 : PARSEOP_CONNECTION '('
1230 NameString
1231 ')' {$$ = TrCreateNode (PARSEOP_CONNECTION,1,$3);}
1232 | PARSEOP_CONNECTION '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONNECTION);}
1233 ResourceMacroTerm
1234 ')' {$$ = TrLinkChildren ($<n>3, 1,
1235 TrLinkChildren (TrCreateLeafNode (PARSEOP_RESOURCETEMPLATE), 3,
1236 TrCreateLeafNode (PARSEOP_DEFAULT_ARG),
1237 TrCreateLeafNode (PARSEOP_DEFAULT_ARG),
1238 $4));}
1239 | PARSEOP_CONNECTION '('
1240 error ')' {$$ = AslDoError(); yyclearin;}
1243 CreateBitFieldTerm
1244 : PARSEOP_CREATEBITFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEBITFIELD);}
1245 TermArg
1246 TermArgItem
1247 NameStringItem
1248 ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));}
1249 | PARSEOP_CREATEBITFIELD '('
1250 error ')' {$$ = AslDoError(); yyclearin;}
1253 CreateByteFieldTerm
1254 : PARSEOP_CREATEBYTEFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEBYTEFIELD);}
1255 TermArg
1256 TermArgItem
1257 NameStringItem
1258 ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));}
1259 | PARSEOP_CREATEBYTEFIELD '('
1260 error ')' {$$ = AslDoError(); yyclearin;}
1263 CreateDWordFieldTerm
1264 : PARSEOP_CREATEDWORDFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEDWORDFIELD);}
1265 TermArg
1266 TermArgItem
1267 NameStringItem
1268 ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));}
1269 | PARSEOP_CREATEDWORDFIELD '('
1270 error ')' {$$ = AslDoError(); yyclearin;}
1273 CreateFieldTerm
1274 : PARSEOP_CREATEFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEFIELD);}
1275 TermArg
1276 TermArgItem
1277 TermArgItem
1278 NameStringItem
1279 ')' {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6,TrSetNodeFlags ($7, NODE_IS_NAME_DECLARATION));}
1280 | PARSEOP_CREATEFIELD '('
1281 error ')' {$$ = AslDoError(); yyclearin;}
1284 CreateQWordFieldTerm
1285 : PARSEOP_CREATEQWORDFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEQWORDFIELD);}
1286 TermArg
1287 TermArgItem
1288 NameStringItem
1289 ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));}
1290 | PARSEOP_CREATEQWORDFIELD '('
1291 error ')' {$$ = AslDoError(); yyclearin;}
1294 CreateWordFieldTerm
1295 : PARSEOP_CREATEWORDFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEWORDFIELD);}
1296 TermArg
1297 TermArgItem
1298 NameStringItem
1299 ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));}
1300 | PARSEOP_CREATEWORDFIELD '('
1301 error ')' {$$ = AslDoError(); yyclearin;}
1304 DataRegionTerm
1305 : PARSEOP_DATATABLEREGION '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DATATABLEREGION);}
1306 NameString
1307 TermArgItem
1308 TermArgItem
1309 TermArgItem
1310 ')' {$$ = TrLinkChildren ($<n>3,4,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$5,$6,$7);}
1311 | PARSEOP_DATATABLEREGION '('
1312 error ')' {$$ = AslDoError(); yyclearin;}
1315 DeviceTerm
1316 : PARSEOP_DEVICE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DEVICE);}
1317 NameString
1318 ')' '{'
1319 ObjectList '}' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);}
1320 | PARSEOP_DEVICE '('
1321 error ')' {$$ = AslDoError(); yyclearin;}
1324 EventTerm
1325 : PARSEOP_EVENT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_EVENT);}
1326 NameString
1327 ')' {$$ = TrLinkChildren ($<n>3,1,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION));}
1328 | PARSEOP_EVENT '('
1329 error ')' {$$ = AslDoError(); yyclearin;}
1332 FieldTerm
1333 : PARSEOP_FIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FIELD);}
1334 NameString
1335 ',' AccessTypeKeyword
1336 ',' LockRuleKeyword
1337 ',' UpdateRuleKeyword
1338 ')' '{'
1339 FieldUnitList '}' {$$ = TrLinkChildren ($<n>3,5,$4,$6,$8,$10,$13);}
1340 | PARSEOP_FIELD '('
1341 error ')' '{' error '}' {$$ = AslDoError(); yyclearin;}
1344 FunctionTerm
1345 : PARSEOP_FUNCTION '(' {$<n>$ = TrCreateLeafNode (PARSEOP_METHOD);}
1346 NameString
1347 OptionalParameterTypePackage
1348 OptionalParameterTypesPackage
1349 ')' '{'
1350 TermList '}' {$$ = TrLinkChildren ($<n>3,7,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),
1351 TrCreateValuedLeafNode (PARSEOP_BYTECONST, 0),
1352 TrCreateLeafNode (PARSEOP_SERIALIZERULE_NOTSERIAL),
1353 TrCreateValuedLeafNode (PARSEOP_BYTECONST, 0),$5,$6,$9);}
1354 | PARSEOP_FUNCTION '('
1355 error ')' {$$ = AslDoError(); yyclearin;}
1358 IndexFieldTerm
1359 : PARSEOP_INDEXFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INDEXFIELD);}
1360 NameString
1361 NameStringItem
1362 ',' AccessTypeKeyword
1363 ',' LockRuleKeyword
1364 ',' UpdateRuleKeyword
1365 ')' '{'
1366 FieldUnitList '}' {$$ = TrLinkChildren ($<n>3,6,$4,$5,$7,$9,$11,$14);}
1367 | PARSEOP_INDEXFIELD '('
1368 error ')' '{' error '}' {$$ = AslDoError(); yyclearin;}
1371 MethodTerm
1372 : PARSEOP_METHOD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_METHOD);}
1373 NameString
1374 OptionalByteConstExpr {UtCheckIntegerRange ($5, 0, 7);}
1375 OptionalSerializeRuleKeyword
1376 OptionalByteConstExpr
1377 OptionalParameterTypePackage
1378 OptionalParameterTypesPackage
1379 ')' '{'
1380 TermList '}' {$$ = TrLinkChildren ($<n>3,7,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$5,$7,$8,$9,$10,$13);}
1381 | PARSEOP_METHOD '('
1382 error ')' {$$ = AslDoError(); yyclearin;}
1385 MutexTerm
1386 : PARSEOP_MUTEX '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MUTEX);}
1387 NameString
1388 ',' ByteConstExpr
1389 ')' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6);}
1390 | PARSEOP_MUTEX '('
1391 error ')' {$$ = AslDoError(); yyclearin;}
1394 OpRegionTerm
1395 : PARSEOP_OPERATIONREGION '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OPERATIONREGION);}
1396 NameString
1397 ',' OpRegionSpaceIdTerm
1398 TermArgItem
1399 TermArgItem
1400 ')' {$$ = TrLinkChildren ($<n>3,4,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$7,$8);}
1401 | PARSEOP_OPERATIONREGION '('
1402 error ')' {$$ = AslDoError(); yyclearin;}
1405 OpRegionSpaceIdTerm
1406 : RegionSpaceKeyword {}
1407 | ByteConst {$$ = UtCheckIntegerRange ($1, 0x80, 0xFF);}
1410 PowerResTerm
1411 : PARSEOP_POWERRESOURCE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_POWERRESOURCE);}
1412 NameString
1413 ',' ByteConstExpr
1414 ',' WordConstExpr
1415 ')' '{'
1416 ObjectList '}' {$$ = TrLinkChildren ($<n>3,4,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$8,$11);}
1417 | PARSEOP_POWERRESOURCE '('
1418 error ')' {$$ = AslDoError(); yyclearin;}
1421 ProcessorTerm
1422 : PARSEOP_PROCESSOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_PROCESSOR);}
1423 NameString
1424 ',' ByteConstExpr
1425 OptionalDWordConstExpr
1426 OptionalByteConstExpr
1427 ')' '{'
1428 ObjectList '}' {$$ = TrLinkChildren ($<n>3,5,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$7,$8,$11);}
1429 | PARSEOP_PROCESSOR '('
1430 error ')' {$$ = AslDoError(); yyclearin;}
1433 ThermalZoneTerm
1434 : PARSEOP_THERMALZONE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_THERMALZONE);}
1435 NameString
1436 ')' '{'
1437 ObjectList '}' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);}
1438 | PARSEOP_THERMALZONE '('
1439 error ')' {$$ = AslDoError(); yyclearin;}
1443 /******* Namespace modifiers *************************************************/
1446 AliasTerm
1447 : PARSEOP_ALIAS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ALIAS);}
1448 NameString
1449 NameStringItem
1450 ')' {$$ = TrLinkChildren ($<n>3,2,$4,TrSetNodeFlags ($5, NODE_IS_NAME_DECLARATION));}
1451 | PARSEOP_ALIAS '('
1452 error ')' {$$ = AslDoError(); yyclearin;}
1455 NameTerm
1456 : PARSEOP_NAME '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NAME);}
1457 NameString
1458 ',' DataObject
1459 ')' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6);}
1460 | PARSEOP_NAME '('
1461 error ')' {$$ = AslDoError(); yyclearin;}
1464 ScopeTerm
1465 : PARSEOP_SCOPE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SCOPE);}
1466 NameString
1467 ')' '{'
1468 ObjectList '}' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);}
1469 | PARSEOP_SCOPE '('
1470 error ')' {$$ = AslDoError(); yyclearin;}
1474 /******* Type 1 opcodes *******************************************************/
1477 BreakTerm
1478 : PARSEOP_BREAK {$$ = TrCreateNode (PARSEOP_BREAK, 0);}
1481 BreakPointTerm
1482 : PARSEOP_BREAKPOINT {$$ = TrCreateNode (PARSEOP_BREAKPOINT, 0);}
1485 ContinueTerm
1486 : PARSEOP_CONTINUE {$$ = TrCreateNode (PARSEOP_CONTINUE, 0);}
1489 FatalTerm
1490 : PARSEOP_FATAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FATAL);}
1491 ByteConstExpr
1492 ',' DWordConstExpr
1493 TermArgItem
1494 ')' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);}
1495 | PARSEOP_FATAL '('
1496 error ')' {$$ = AslDoError(); yyclearin;}
1499 IfElseTerm
1500 : IfTerm ElseTerm {$$ = TrLinkPeerNode ($1,$2);}
1503 IfTerm
1504 : PARSEOP_IF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_IF);}
1505 TermArg
1506 ')' '{'
1507 TermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);}
1509 | PARSEOP_IF '('
1510 error ')' {$$ = AslDoError(); yyclearin;}
1513 ElseTerm
1514 : {$$ = NULL;}
1515 | PARSEOP_ELSE '{' {$<n>$ = TrCreateLeafNode (PARSEOP_ELSE);}
1516 TermList '}' {$$ = TrLinkChildren ($<n>3,1,$4);}
1518 | PARSEOP_ELSE '{'
1519 error '}' {$$ = AslDoError(); yyclearin;}
1521 | PARSEOP_ELSE
1522 error {$$ = AslDoError(); yyclearin;}
1524 | PARSEOP_ELSEIF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ELSE);}
1525 TermArg {$<n>$ = TrCreateLeafNode (PARSEOP_IF);}
1526 ')' '{'
1527 TermList '}' {TrLinkChildren ($<n>5,2,$4,$8);}
1528 ElseTerm {TrLinkPeerNode ($<n>5,$11);}
1529 {$$ = TrLinkChildren ($<n>3,1,$<n>5);}
1531 | PARSEOP_ELSEIF '('
1532 error ')' {$$ = AslDoError(); yyclearin;}
1534 | PARSEOP_ELSEIF
1535 error {$$ = AslDoError(); yyclearin;}
1538 LoadTerm
1539 : PARSEOP_LOAD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LOAD);}
1540 NameString
1541 RequiredTarget
1542 ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
1543 | PARSEOP_LOAD '('
1544 error ')' {$$ = AslDoError(); yyclearin;}
1547 NoOpTerm
1548 : PARSEOP_NOOP {$$ = TrCreateNode (PARSEOP_NOOP, 0);}
1551 NotifyTerm
1552 : PARSEOP_NOTIFY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOTIFY);}
1553 SuperName
1554 TermArgItem
1555 ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
1556 | PARSEOP_NOTIFY '('
1557 error ')' {$$ = AslDoError(); yyclearin;}
1560 ReleaseTerm
1561 : PARSEOP_RELEASE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RELEASE);}
1562 SuperName
1563 ')' {$$ = TrLinkChildren ($<n>3,1,$4);}
1564 | PARSEOP_RELEASE '('
1565 error ')' {$$ = AslDoError(); yyclearin;}
1568 ResetTerm
1569 : PARSEOP_RESET '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RESET);}
1570 SuperName
1571 ')' {$$ = TrLinkChildren ($<n>3,1,$4);}
1572 | PARSEOP_RESET '('
1573 error ')' {$$ = AslDoError(); yyclearin;}
1576 ReturnTerm
1577 : PARSEOP_RETURN '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RETURN);}
1578 OptionalReturnArg
1579 ')' {$$ = TrLinkChildren ($<n>3,1,$4);}
1580 | PARSEOP_RETURN {$$ = TrLinkChildren (TrCreateLeafNode (PARSEOP_RETURN),1,TrSetNodeFlags (TrCreateLeafNode (PARSEOP_ZERO), NODE_IS_NULL_RETURN));}
1581 | PARSEOP_RETURN '('
1582 error ')' {$$ = AslDoError(); yyclearin;}
1585 SignalTerm
1586 : PARSEOP_SIGNAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SIGNAL);}
1587 SuperName
1588 ')' {$$ = TrLinkChildren ($<n>3,1,$4);}
1589 | PARSEOP_SIGNAL '('
1590 error ')' {$$ = AslDoError(); yyclearin;}
1593 SleepTerm
1594 : PARSEOP_SLEEP '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SLEEP);}
1595 TermArg
1596 ')' {$$ = TrLinkChildren ($<n>3,1,$4);}
1597 | PARSEOP_SLEEP '('
1598 error ')' {$$ = AslDoError(); yyclearin;}
1601 StallTerm
1602 : PARSEOP_STALL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STALL);}
1603 TermArg
1604 ')' {$$ = TrLinkChildren ($<n>3,1,$4);}
1605 | PARSEOP_STALL '('
1606 error ')' {$$ = AslDoError(); yyclearin;}
1609 SwitchTerm
1610 : PARSEOP_SWITCH '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SWITCH);}
1611 TermArg
1612 ')' '{'
1613 CaseDefaultTermList '}'
1614 {$$ = TrLinkChildren ($<n>3,2,$4,$7);}
1615 | PARSEOP_SWITCH '('
1616 error ')' {$$ = AslDoError(); yyclearin;}
1620 * Case-Default list; allow only one Default term and unlimited Case terms
1623 CaseDefaultTermList
1624 : {$$ = NULL;}
1625 | CaseTerm {}
1626 | DefaultTerm {}
1627 | CaseDefaultTermList
1628 CaseTerm {$$ = TrLinkPeerNode ($1,$2);}
1629 | CaseDefaultTermList
1630 DefaultTerm {$$ = TrLinkPeerNode ($1,$2);}
1632 /* Original - attempts to force zero or one default term within the switch */
1635 CaseDefaultTermList
1636 : {$$ = NULL;}
1637 | CaseTermList
1638 DefaultTerm
1639 CaseTermList {$$ = TrLinkPeerNode ($1,TrLinkPeerNode ($2, $3));}
1640 | CaseTermList
1641 CaseTerm {$$ = TrLinkPeerNode ($1,$2);}
1644 CaseTermList
1645 : {$$ = NULL;}
1646 | CaseTerm {}
1647 | CaseTermList
1648 CaseTerm {$$ = TrLinkPeerNode ($1,$2);}
1652 CaseTerm
1653 : PARSEOP_CASE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CASE);}
1654 DataObject
1655 ')' '{'
1656 TermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);}
1657 | PARSEOP_CASE '('
1658 error ')' {$$ = AslDoError(); yyclearin;}
1661 DefaultTerm
1662 : PARSEOP_DEFAULT '{' {$<n>$ = TrCreateLeafNode (PARSEOP_DEFAULT);}
1663 TermList '}' {$$ = TrLinkChildren ($<n>3,1,$4);}
1664 | PARSEOP_DEFAULT '{'
1665 error '}' {$$ = AslDoError(); yyclearin;}
1668 UnloadTerm
1669 : PARSEOP_UNLOAD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UNLOAD);}
1670 SuperName
1671 ')' {$$ = TrLinkChildren ($<n>3,1,$4);}
1672 | PARSEOP_UNLOAD '('
1673 error ')' {$$ = AslDoError(); yyclearin;}
1676 WhileTerm
1677 : PARSEOP_WHILE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WHILE);}
1678 TermArg
1679 ')' '{' TermList '}'
1680 {$$ = TrLinkChildren ($<n>3,2,$4,$7);}
1681 | PARSEOP_WHILE '('
1682 error ')' {$$ = AslDoError(); yyclearin;}
1686 /******* Type 2 opcodes *******************************************************/
1688 AcquireTerm
1689 : PARSEOP_ACQUIRE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACQUIRE);}
1690 SuperName
1691 ',' WordConstExpr
1692 ')' {$$ = TrLinkChildren ($<n>3,2,$4,$6);}
1693 | PARSEOP_ACQUIRE '('
1694 error ')' {$$ = AslDoError(); yyclearin;}
1697 AddTerm
1698 : PARSEOP_ADD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);}
1699 TermArg
1700 TermArgItem
1701 Target
1702 ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
1703 | PARSEOP_ADD '('
1704 error ')' {$$ = AslDoError(); yyclearin;}
1707 AndTerm
1708 : PARSEOP_AND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_AND);}
1709 TermArg
1710 TermArgItem
1711 Target
1712 ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
1713 | PARSEOP_AND '('
1714 error ')' {$$ = AslDoError(); yyclearin;}
1717 ConcatTerm
1718 : PARSEOP_CONCATENATE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONCATENATE);}
1719 TermArg
1720 TermArgItem
1721 Target
1722 ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
1723 | PARSEOP_CONCATENATE '('
1724 error ')' {$$ = AslDoError(); yyclearin;}
1727 ConcatResTerm
1728 : PARSEOP_CONCATENATERESTEMPLATE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONCATENATERESTEMPLATE);}
1729 TermArg
1730 TermArgItem
1731 Target
1732 ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
1733 | PARSEOP_CONCATENATERESTEMPLATE '('
1734 error ')' {$$ = AslDoError(); yyclearin;}
1737 CondRefOfTerm
1738 : PARSEOP_CONDREFOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONDREFOF);}
1739 SuperName
1740 Target
1741 ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
1742 | PARSEOP_CONDREFOF '('
1743 error ')' {$$ = AslDoError(); yyclearin;}
1746 CopyObjectTerm
1747 : PARSEOP_COPYOBJECT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_COPYOBJECT);}
1748 TermArg
1749 ',' SimpleTarget
1750 ')' {$$ = TrLinkChildren ($<n>3,2,$4,TrSetNodeFlags ($6, NODE_IS_TARGET));}
1751 | PARSEOP_COPYOBJECT '('
1752 error ')' {$$ = AslDoError(); yyclearin;}
1755 DecTerm
1756 : PARSEOP_DECREMENT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DECREMENT);}
1757 SuperName
1758 ')' {$$ = TrLinkChildren ($<n>3,1,$4);}
1759 | PARSEOP_DECREMENT '('
1760 error ')' {$$ = AslDoError(); yyclearin;}
1763 DerefOfTerm
1764 : PARSEOP_DEREFOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DEREFOF);}
1765 TermArg
1766 ')' {$$ = TrLinkChildren ($<n>3,1,$4);}
1767 | PARSEOP_DEREFOF '('
1768 error ')' {$$ = AslDoError(); yyclearin;}
1771 DivideTerm
1772 : PARSEOP_DIVIDE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);}
1773 TermArg
1774 TermArgItem
1775 Target
1776 Target
1777 ')' {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6,$7);}
1778 | PARSEOP_DIVIDE '('
1779 error ')' {$$ = AslDoError(); yyclearin;}
1782 FindSetLeftBitTerm
1783 : PARSEOP_FINDSETLEFTBIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FINDSETLEFTBIT);}
1784 TermArg
1785 Target
1786 ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
1787 | PARSEOP_FINDSETLEFTBIT '('
1788 error ')' {$$ = AslDoError(); yyclearin;}
1791 FindSetRightBitTerm
1792 : PARSEOP_FINDSETRIGHTBIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FINDSETRIGHTBIT);}
1793 TermArg
1794 Target
1795 ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
1796 | PARSEOP_FINDSETRIGHTBIT '('
1797 error ')' {$$ = AslDoError(); yyclearin;}
1800 FromBCDTerm
1801 : PARSEOP_FROMBCD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FROMBCD);}
1802 TermArg
1803 Target
1804 ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
1805 | PARSEOP_FROMBCD '('
1806 error ')' {$$ = AslDoError(); yyclearin;}
1809 IncTerm
1810 : PARSEOP_INCREMENT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INCREMENT);}
1811 SuperName
1812 ')' {$$ = TrLinkChildren ($<n>3,1,$4);}
1813 | PARSEOP_INCREMENT '('
1814 error ')' {$$ = AslDoError(); yyclearin;}
1817 IndexTerm
1818 : PARSEOP_INDEX '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INDEX);}
1819 TermArg
1820 TermArgItem
1821 Target
1822 ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
1823 | PARSEOP_INDEX '('
1824 error ')' {$$ = AslDoError(); yyclearin;}
1827 LAndTerm
1828 : PARSEOP_LAND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LAND);}
1829 TermArg
1830 TermArgItem
1831 ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
1832 | PARSEOP_LAND '('
1833 error ')' {$$ = AslDoError(); yyclearin;}
1836 LEqualTerm
1837 : PARSEOP_LEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);}
1838 TermArg
1839 TermArgItem
1840 ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
1841 | PARSEOP_LEQUAL '('
1842 error ')' {$$ = AslDoError(); yyclearin;}
1845 LGreaterTerm
1846 : PARSEOP_LGREATER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);}
1847 TermArg
1848 TermArgItem
1849 ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
1850 | PARSEOP_LGREATER '('
1851 error ')' {$$ = AslDoError(); yyclearin;}
1854 LGreaterEqualTerm
1855 : PARSEOP_LGREATEREQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);}
1856 TermArg
1857 TermArgItem
1858 ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($<n>3,2,$4,$5));}
1859 | PARSEOP_LGREATEREQUAL '('
1860 error ')' {$$ = AslDoError(); yyclearin;}
1863 LLessTerm
1864 : PARSEOP_LLESS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);}
1865 TermArg
1866 TermArgItem
1867 ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
1868 | PARSEOP_LLESS '('
1869 error ')' {$$ = AslDoError(); yyclearin;}
1872 LLessEqualTerm
1873 : PARSEOP_LLESSEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);}
1874 TermArg
1875 TermArgItem
1876 ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($<n>3,2,$4,$5));}
1877 | PARSEOP_LLESSEQUAL '('
1878 error ')' {$$ = AslDoError(); yyclearin;}
1881 LNotTerm
1882 : PARSEOP_LNOT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LNOT);}
1883 TermArg
1884 ')' {$$ = TrLinkChildren ($<n>3,1,$4);}
1885 | PARSEOP_LNOT '('
1886 error ')' {$$ = AslDoError(); yyclearin;}
1889 LNotEqualTerm
1890 : PARSEOP_LNOTEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);}
1891 TermArg
1892 TermArgItem
1893 ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($<n>3,2,$4,$5));}
1894 | PARSEOP_LNOTEQUAL '('
1895 error ')' {$$ = AslDoError(); yyclearin;}
1898 LoadTableTerm
1899 : PARSEOP_LOADTABLE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LOADTABLE);}
1900 TermArg
1901 TermArgItem
1902 TermArgItem
1903 OptionalListString
1904 OptionalListString
1905 OptionalReference
1906 ')' {$$ = TrLinkChildren ($<n>3,6,$4,$5,$6,$7,$8,$9);}
1907 | PARSEOP_LOADTABLE '('
1908 error ')' {$$ = AslDoError(); yyclearin;}
1911 LOrTerm
1912 : PARSEOP_LOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LOR);}
1913 TermArg
1914 TermArgItem
1915 ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
1916 | PARSEOP_LOR '('
1917 error ')' {$$ = AslDoError(); yyclearin;}
1920 MatchTerm
1921 : PARSEOP_MATCH '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MATCH);}
1922 TermArg
1923 ',' MatchOpKeyword
1924 TermArgItem
1925 ',' MatchOpKeyword
1926 TermArgItem
1927 TermArgItem
1928 ')' {$$ = TrLinkChildren ($<n>3,6,$4,$6,$7,$9,$10,$11);}
1929 | PARSEOP_MATCH '('
1930 error ')' {$$ = AslDoError(); yyclearin;}
1933 MidTerm
1934 : PARSEOP_MID '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MID);}
1935 TermArg
1936 TermArgItem
1937 TermArgItem
1938 Target
1939 ')' {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6,$7);}
1940 | PARSEOP_MID '('
1941 error ')' {$$ = AslDoError(); yyclearin;}
1944 ModTerm
1945 : PARSEOP_MOD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);}
1946 TermArg
1947 TermArgItem
1948 Target
1949 ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
1950 | PARSEOP_MOD '('
1951 error ')' {$$ = AslDoError(); yyclearin;}
1954 MultiplyTerm
1955 : PARSEOP_MULTIPLY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);}
1956 TermArg
1957 TermArgItem
1958 Target
1959 ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
1960 | PARSEOP_MULTIPLY '('
1961 error ')' {$$ = AslDoError(); yyclearin;}
1964 NAndTerm
1965 : PARSEOP_NAND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NAND);}
1966 TermArg
1967 TermArgItem
1968 Target
1969 ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
1970 | PARSEOP_NAND '('
1971 error ')' {$$ = AslDoError(); yyclearin;}
1974 NOrTerm
1975 : PARSEOP_NOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOR);}
1976 TermArg
1977 TermArgItem
1978 Target
1979 ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
1980 | PARSEOP_NOR '('
1981 error ')' {$$ = AslDoError(); yyclearin;}
1984 NotTerm
1985 : PARSEOP_NOT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOT);}
1986 TermArg
1987 Target
1988 ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
1989 | PARSEOP_NOT '('
1990 error ')' {$$ = AslDoError(); yyclearin;}
1993 ObjectTypeTerm
1994 : PARSEOP_OBJECTTYPE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE);}
1995 ObjectTypeName
1996 ')' {$$ = TrLinkChildren ($<n>3,1,$4);}
1997 | PARSEOP_OBJECTTYPE '('
1998 error ')' {$$ = AslDoError(); yyclearin;}
2001 OrTerm
2002 : PARSEOP_OR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OR);}
2003 TermArg
2004 TermArgItem
2005 Target
2006 ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
2007 | PARSEOP_OR '('
2008 error ')' {$$ = AslDoError(); yyclearin;}
2012 * In RefOf, the node isn't really a target, but we can't keep track of it after
2013 * we've taken a pointer to it. (hard to tell if a local becomes initialized this way.)
2015 RefOfTerm
2016 : PARSEOP_REFOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_REFOF);}
2017 SuperName
2018 ')' {$$ = TrLinkChildren ($<n>3,1,TrSetNodeFlags ($4, NODE_IS_TARGET));}
2019 | PARSEOP_REFOF '('
2020 error ')' {$$ = AslDoError(); yyclearin;}
2023 ShiftLeftTerm
2024 : PARSEOP_SHIFTLEFT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);}
2025 TermArg
2026 TermArgItem
2027 Target
2028 ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
2029 | PARSEOP_SHIFTLEFT '('
2030 error ')' {$$ = AslDoError(); yyclearin;}
2033 ShiftRightTerm
2034 : PARSEOP_SHIFTRIGHT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);}
2035 TermArg
2036 TermArgItem
2037 Target
2038 ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
2039 | PARSEOP_SHIFTRIGHT '('
2040 error ')' {$$ = AslDoError(); yyclearin;}
2043 SizeOfTerm
2044 : PARSEOP_SIZEOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SIZEOF);}
2045 SuperName
2046 ')' {$$ = TrLinkChildren ($<n>3,1,$4);}
2047 | PARSEOP_SIZEOF '('
2048 error ')' {$$ = AslDoError(); yyclearin;}
2051 StoreTerm
2052 : PARSEOP_STORE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STORE);}
2053 TermArg
2054 ',' SuperName
2055 ')' {$$ = TrLinkChildren ($<n>3,2,$4,TrSetNodeFlags ($6, NODE_IS_TARGET));}
2056 | PARSEOP_STORE '('
2057 error ')' {$$ = AslDoError(); yyclearin;}
2060 SubtractTerm
2061 : PARSEOP_SUBTRACT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);}
2062 TermArg
2063 TermArgItem
2064 Target
2065 ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
2066 | PARSEOP_SUBTRACT '('
2067 error ')' {$$ = AslDoError(); yyclearin;}
2070 TimerTerm
2071 : PARSEOP_TIMER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TIMER);}
2072 ')' {$$ = TrLinkChildren ($<n>3,0);}
2073 | PARSEOP_TIMER {$$ = TrLinkChildren (TrCreateLeafNode (PARSEOP_TIMER),0);}
2074 | PARSEOP_TIMER '('
2075 error ')' {$$ = AslDoError(); yyclearin;}
2078 ToBCDTerm
2079 : PARSEOP_TOBCD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOBCD);}
2080 TermArg
2081 Target
2082 ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
2083 | PARSEOP_TOBCD '('
2084 error ')' {$$ = AslDoError(); yyclearin;}
2087 ToBufferTerm
2088 : PARSEOP_TOBUFFER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOBUFFER);}
2089 TermArg
2090 Target
2091 ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
2092 | PARSEOP_TOBUFFER '('
2093 error ')' {$$ = AslDoError(); yyclearin;}
2096 ToDecimalStringTerm
2097 : PARSEOP_TODECIMALSTRING '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TODECIMALSTRING);}
2098 TermArg
2099 Target
2100 ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
2101 | PARSEOP_TODECIMALSTRING '('
2102 error ')' {$$ = AslDoError(); yyclearin;}
2105 ToHexStringTerm
2106 : PARSEOP_TOHEXSTRING '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOHEXSTRING);}
2107 TermArg
2108 Target
2109 ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
2110 | PARSEOP_TOHEXSTRING '('
2111 error ')' {$$ = AslDoError(); yyclearin;}
2114 ToIntegerTerm
2115 : PARSEOP_TOINTEGER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOINTEGER);}
2116 TermArg
2117 Target
2118 ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
2119 | PARSEOP_TOINTEGER '('
2120 error ')' {$$ = AslDoError(); yyclearin;}
2123 ToStringTerm
2124 : PARSEOP_TOSTRING '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOSTRING);}
2125 TermArg
2126 OptionalCount
2127 Target
2128 ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
2129 | PARSEOP_TOSTRING '('
2130 error ')' {$$ = AslDoError(); yyclearin;}
2133 ToUUIDTerm
2134 : PARSEOP_TOUUID '('
2135 StringData ')' {$$ = TrUpdateNode (PARSEOP_TOUUID, $3);}
2136 | PARSEOP_TOUUID '('
2137 error ')' {$$ = AslDoError(); yyclearin;}
2140 WaitTerm
2141 : PARSEOP_WAIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WAIT);}
2142 SuperName
2143 TermArgItem
2144 ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);}
2145 | PARSEOP_WAIT '('
2146 error ')' {$$ = AslDoError(); yyclearin;}
2149 XOrTerm
2150 : PARSEOP_XOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);}
2151 TermArg
2152 TermArgItem
2153 Target
2154 ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);}
2155 | PARSEOP_XOR '('
2156 error ')' {$$ = AslDoError(); yyclearin;}
2160 /******* Keywords *************************************************************/
2163 AccessAttribKeyword
2164 : PARSEOP_ACCESSATTRIB_BLOCK {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_BLOCK);}
2165 | PARSEOP_ACCESSATTRIB_BLOCK_CALL {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_BLOCK_CALL);}
2166 | PARSEOP_ACCESSATTRIB_BYTE {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_BYTE);}
2167 | PARSEOP_ACCESSATTRIB_QUICK {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_QUICK );}
2168 | PARSEOP_ACCESSATTRIB_SND_RCV {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_SND_RCV);}
2169 | PARSEOP_ACCESSATTRIB_WORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_WORD);}
2170 | PARSEOP_ACCESSATTRIB_WORD_CALL {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_WORD_CALL);}
2171 | PARSEOP_ACCESSATTRIB_MULTIBYTE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_MULTIBYTE);}
2172 ByteConst
2173 ')' {$$ = TrLinkChildren ($<n>3,1,$4);}
2174 | PARSEOP_ACCESSATTRIB_RAW_BYTES '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_RAW_BYTES);}
2175 ByteConst
2176 ')' {$$ = TrLinkChildren ($<n>3,1,$4);}
2177 | PARSEOP_ACCESSATTRIB_RAW_PROCESS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_RAW_PROCESS);}
2178 ByteConst
2179 ')' {$$ = TrLinkChildren ($<n>3,1,$4);}
2182 AccessTypeKeyword
2183 : PARSEOP_ACCESSTYPE_ANY {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_ANY);}
2184 | PARSEOP_ACCESSTYPE_BYTE {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_BYTE);}
2185 | PARSEOP_ACCESSTYPE_WORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_WORD);}
2186 | PARSEOP_ACCESSTYPE_DWORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_DWORD);}
2187 | PARSEOP_ACCESSTYPE_QWORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_QWORD);}
2188 | PARSEOP_ACCESSTYPE_BUF {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_BUF);}
2191 AddressingModeKeyword
2192 : PARSEOP_ADDRESSINGMODE_7BIT {$$ = TrCreateLeafNode (PARSEOP_ADDRESSINGMODE_7BIT);}
2193 | PARSEOP_ADDRESSINGMODE_10BIT {$$ = TrCreateLeafNode (PARSEOP_ADDRESSINGMODE_10BIT);}
2196 AddressKeyword
2197 : PARSEOP_ADDRESSTYPE_MEMORY {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_MEMORY);}
2198 | PARSEOP_ADDRESSTYPE_RESERVED {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_RESERVED);}
2199 | PARSEOP_ADDRESSTYPE_NVS {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_NVS);}
2200 | PARSEOP_ADDRESSTYPE_ACPI {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_ACPI);}
2203 AddressSpaceKeyword
2204 : ByteConst {$$ = UtCheckIntegerRange ($1, 0x0A, 0xFF);}
2205 | RegionSpaceKeyword {}
2208 BitsPerByteKeyword
2209 : PARSEOP_BITSPERBYTE_FIVE {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_FIVE);}
2210 | PARSEOP_BITSPERBYTE_SIX {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_SIX);}
2211 | PARSEOP_BITSPERBYTE_SEVEN {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_SEVEN);}
2212 | PARSEOP_BITSPERBYTE_EIGHT {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_EIGHT);}
2213 | PARSEOP_BITSPERBYTE_NINE {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_NINE);}
2216 ClockPhaseKeyword
2217 : PARSEOP_CLOCKPHASE_FIRST {$$ = TrCreateLeafNode (PARSEOP_CLOCKPHASE_FIRST);}
2218 | PARSEOP_CLOCKPHASE_SECOND {$$ = TrCreateLeafNode (PARSEOP_CLOCKPHASE_SECOND);}
2221 ClockPolarityKeyword
2222 : PARSEOP_CLOCKPOLARITY_LOW {$$ = TrCreateLeafNode (PARSEOP_CLOCKPOLARITY_LOW);}
2223 | PARSEOP_CLOCKPOLARITY_HIGH {$$ = TrCreateLeafNode (PARSEOP_CLOCKPOLARITY_HIGH);}
2226 DecodeKeyword
2227 : PARSEOP_DECODETYPE_POS {$$ = TrCreateLeafNode (PARSEOP_DECODETYPE_POS);}
2228 | PARSEOP_DECODETYPE_SUB {$$ = TrCreateLeafNode (PARSEOP_DECODETYPE_SUB);}
2231 DevicePolarityKeyword
2232 : PARSEOP_DEVICEPOLARITY_LOW {$$ = TrCreateLeafNode (PARSEOP_DEVICEPOLARITY_LOW);}
2233 | PARSEOP_DEVICEPOLARITY_HIGH {$$ = TrCreateLeafNode (PARSEOP_DEVICEPOLARITY_HIGH);}
2236 DMATypeKeyword
2237 : PARSEOP_DMATYPE_A {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_A);}
2238 | PARSEOP_DMATYPE_COMPATIBILITY {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_COMPATIBILITY);}
2239 | PARSEOP_DMATYPE_B {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_B);}
2240 | PARSEOP_DMATYPE_F {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_F);}
2243 EndianKeyword
2244 : PARSEOP_ENDIAN_LITTLE {$$ = TrCreateLeafNode (PARSEOP_ENDIAN_LITTLE);}
2245 | PARSEOP_ENDIAN_BIG {$$ = TrCreateLeafNode (PARSEOP_ENDIAN_BIG);}
2248 FlowControlKeyword
2249 : PARSEOP_FLOWCONTROL_HW {$$ = TrCreateLeafNode (PARSEOP_FLOWCONTROL_HW);}
2250 | PARSEOP_FLOWCONTROL_NONE {$$ = TrCreateLeafNode (PARSEOP_FLOWCONTROL_NONE);}
2251 | PARSEOP_FLOWCONTROL_SW {$$ = TrCreateLeafNode (PARSEOP_FLOWCONTROL_SW);}
2254 InterruptLevel
2255 : PARSEOP_INTLEVEL_ACTIVEBOTH {$$ = TrCreateLeafNode (PARSEOP_INTLEVEL_ACTIVEBOTH);}
2256 | PARSEOP_INTLEVEL_ACTIVEHIGH {$$ = TrCreateLeafNode (PARSEOP_INTLEVEL_ACTIVEHIGH);}
2257 | PARSEOP_INTLEVEL_ACTIVELOW {$$ = TrCreateLeafNode (PARSEOP_INTLEVEL_ACTIVELOW);}
2260 InterruptTypeKeyword
2261 : PARSEOP_INTTYPE_EDGE {$$ = TrCreateLeafNode (PARSEOP_INTTYPE_EDGE);}
2262 | PARSEOP_INTTYPE_LEVEL {$$ = TrCreateLeafNode (PARSEOP_INTTYPE_LEVEL);}
2265 IODecodeKeyword
2266 : PARSEOP_IODECODETYPE_16 {$$ = TrCreateLeafNode (PARSEOP_IODECODETYPE_16);}
2267 | PARSEOP_IODECODETYPE_10 {$$ = TrCreateLeafNode (PARSEOP_IODECODETYPE_10);}
2270 IoRestrictionKeyword
2271 : PARSEOP_IORESTRICT_IN {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_IN);}
2272 | PARSEOP_IORESTRICT_OUT {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_OUT);}
2273 | PARSEOP_IORESTRICT_NONE {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_NONE);}
2274 | PARSEOP_IORESTRICT_PRESERVE {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_PRESERVE);}
2277 LockRuleKeyword
2278 : PARSEOP_LOCKRULE_LOCK {$$ = TrCreateLeafNode (PARSEOP_LOCKRULE_LOCK);}
2279 | PARSEOP_LOCKRULE_NOLOCK {$$ = TrCreateLeafNode (PARSEOP_LOCKRULE_NOLOCK);}
2282 MatchOpKeyword
2283 : PARSEOP_MATCHTYPE_MTR {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MTR);}
2284 | PARSEOP_MATCHTYPE_MEQ {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MEQ);}
2285 | PARSEOP_MATCHTYPE_MLE {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MLE);}
2286 | PARSEOP_MATCHTYPE_MLT {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MLT);}
2287 | PARSEOP_MATCHTYPE_MGE {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MGE);}
2288 | PARSEOP_MATCHTYPE_MGT {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MGT);}
2291 MaxKeyword
2292 : PARSEOP_MAXTYPE_FIXED {$$ = TrCreateLeafNode (PARSEOP_MAXTYPE_FIXED);}
2293 | PARSEOP_MAXTYPE_NOTFIXED {$$ = TrCreateLeafNode (PARSEOP_MAXTYPE_NOTFIXED);}
2296 MemTypeKeyword
2297 : PARSEOP_MEMTYPE_CACHEABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_CACHEABLE);}
2298 | PARSEOP_MEMTYPE_WRITECOMBINING {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_WRITECOMBINING);}
2299 | PARSEOP_MEMTYPE_PREFETCHABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_PREFETCHABLE);}
2300 | PARSEOP_MEMTYPE_NONCACHEABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_NONCACHEABLE);}
2303 MinKeyword
2304 : PARSEOP_MINTYPE_FIXED {$$ = TrCreateLeafNode (PARSEOP_MINTYPE_FIXED);}
2305 | PARSEOP_MINTYPE_NOTFIXED {$$ = TrCreateLeafNode (PARSEOP_MINTYPE_NOTFIXED);}
2308 ObjectTypeKeyword
2309 : PARSEOP_OBJECTTYPE_UNK {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_UNK);}
2310 | PARSEOP_OBJECTTYPE_INT {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_INT);}
2311 | PARSEOP_OBJECTTYPE_STR {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_STR);}
2312 | PARSEOP_OBJECTTYPE_BUF {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_BUF);}
2313 | PARSEOP_OBJECTTYPE_PKG {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_PKG);}
2314 | PARSEOP_OBJECTTYPE_FLD {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_FLD);}
2315 | PARSEOP_OBJECTTYPE_DEV {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_DEV);}
2316 | PARSEOP_OBJECTTYPE_EVT {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_EVT);}
2317 | PARSEOP_OBJECTTYPE_MTH {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_MTH);}
2318 | PARSEOP_OBJECTTYPE_MTX {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_MTX);}
2319 | PARSEOP_OBJECTTYPE_OPR {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_OPR);}
2320 | PARSEOP_OBJECTTYPE_POW {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_POW);}
2321 | PARSEOP_OBJECTTYPE_PRO {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_PRO);}
2322 | PARSEOP_OBJECTTYPE_THZ {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_THZ);}
2323 | PARSEOP_OBJECTTYPE_BFF {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_BFF);}
2324 | PARSEOP_OBJECTTYPE_DDB {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_DDB);}
2327 ParityTypeKeyword
2328 : PARSEOP_PARITYTYPE_SPACE {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_SPACE);}
2329 | PARSEOP_PARITYTYPE_MARK {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_MARK);}
2330 | PARSEOP_PARITYTYPE_ODD {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_ODD);}
2331 | PARSEOP_PARITYTYPE_EVEN {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_EVEN);}
2332 | PARSEOP_PARITYTYPE_NONE {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_NONE);}
2335 PinConfigByte
2336 : PinConfigKeyword {$$ = $1;}
2337 | ByteConstExpr {$$ = UtCheckIntegerRange ($1, 0x80, 0xFF);}
2340 PinConfigKeyword
2341 : PARSEOP_PIN_NOPULL {$$ = TrCreateLeafNode (PARSEOP_PIN_NOPULL);}
2342 | PARSEOP_PIN_PULLDOWN {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLDOWN);}
2343 | PARSEOP_PIN_PULLUP {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLUP);}
2344 | PARSEOP_PIN_PULLDEFAULT {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLDEFAULT);}
2347 RangeTypeKeyword
2348 : PARSEOP_RANGETYPE_ISAONLY {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_ISAONLY);}
2349 | PARSEOP_RANGETYPE_NONISAONLY {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_NONISAONLY);}
2350 | PARSEOP_RANGETYPE_ENTIRE {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_ENTIRE);}
2353 RegionSpaceKeyword
2354 : PARSEOP_REGIONSPACE_IO {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_IO);}
2355 | PARSEOP_REGIONSPACE_MEM {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_MEM);}
2356 | PARSEOP_REGIONSPACE_PCI {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCI);}
2357 | PARSEOP_REGIONSPACE_EC {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_EC);}
2358 | PARSEOP_REGIONSPACE_SMBUS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_SMBUS);}
2359 | PARSEOP_REGIONSPACE_CMOS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_CMOS);}
2360 | PARSEOP_REGIONSPACE_PCIBAR {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCIBAR);}
2361 | PARSEOP_REGIONSPACE_IPMI {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_IPMI);}
2362 | PARSEOP_REGIONSPACE_GPIO {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_GPIO);}
2363 | PARSEOP_REGIONSPACE_GSBUS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_GSBUS);}
2364 | PARSEOP_REGIONSPACE_PCC {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCC);}
2365 | PARSEOP_REGIONSPACE_FFIXEDHW {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_FFIXEDHW);}
2368 ResourceTypeKeyword
2369 : PARSEOP_RESOURCETYPE_CONSUMER {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_CONSUMER);}
2370 | PARSEOP_RESOURCETYPE_PRODUCER {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_PRODUCER);}
2373 SerializeRuleKeyword
2374 : PARSEOP_SERIALIZERULE_SERIAL {$$ = TrCreateLeafNode (PARSEOP_SERIALIZERULE_SERIAL);}
2375 | PARSEOP_SERIALIZERULE_NOTSERIAL {$$ = TrCreateLeafNode (PARSEOP_SERIALIZERULE_NOTSERIAL);}
2378 ShareTypeKeyword
2379 : PARSEOP_SHARETYPE_SHARED {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_SHARED);}
2380 | PARSEOP_SHARETYPE_EXCLUSIVE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_EXCLUSIVE);}
2381 | PARSEOP_SHARETYPE_SHAREDWAKE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_SHAREDWAKE);}
2382 | PARSEOP_SHARETYPE_EXCLUSIVEWAKE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_EXCLUSIVEWAKE);}
2385 SlaveModeKeyword
2386 : PARSEOP_SLAVEMODE_CONTROLLERINIT {$$ = TrCreateLeafNode (PARSEOP_SLAVEMODE_CONTROLLERINIT);}
2387 | PARSEOP_SLAVEMODE_DEVICEINIT {$$ = TrCreateLeafNode (PARSEOP_SLAVEMODE_DEVICEINIT);}
2390 StopBitsKeyword
2391 : PARSEOP_STOPBITS_TWO {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_TWO);}
2392 | PARSEOP_STOPBITS_ONEPLUSHALF {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ONEPLUSHALF);}
2393 | PARSEOP_STOPBITS_ONE {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ONE);}
2394 | PARSEOP_STOPBITS_ZERO {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ZERO);}
2397 TranslationKeyword
2398 : PARSEOP_TRANSLATIONTYPE_SPARSE {$$ = TrCreateLeafNode (PARSEOP_TRANSLATIONTYPE_SPARSE);}
2399 | PARSEOP_TRANSLATIONTYPE_DENSE {$$ = TrCreateLeafNode (PARSEOP_TRANSLATIONTYPE_DENSE);}
2402 TypeKeyword
2403 : PARSEOP_TYPE_TRANSLATION {$$ = TrCreateLeafNode (PARSEOP_TYPE_TRANSLATION);}
2404 | PARSEOP_TYPE_STATIC {$$ = TrCreateLeafNode (PARSEOP_TYPE_STATIC);}
2407 UpdateRuleKeyword
2408 : PARSEOP_UPDATERULE_PRESERVE {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_PRESERVE);}
2409 | PARSEOP_UPDATERULE_ONES {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_ONES);}
2410 | PARSEOP_UPDATERULE_ZEROS {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_ZEROS);}
2413 WireModeKeyword
2414 : PARSEOP_WIREMODE_FOUR {$$ = TrCreateLeafNode (PARSEOP_WIREMODE_FOUR);}
2415 | PARSEOP_WIREMODE_THREE {$$ = TrCreateLeafNode (PARSEOP_WIREMODE_THREE);}
2418 XferSizeKeyword
2419 : PARSEOP_XFERSIZE_8 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_8, 0);}
2420 | PARSEOP_XFERSIZE_16 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_16, 1);}
2421 | PARSEOP_XFERSIZE_32 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_32, 2);}
2422 | PARSEOP_XFERSIZE_64 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_64, 3);}
2423 | PARSEOP_XFERSIZE_128 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_128, 4);}
2424 | PARSEOP_XFERSIZE_256 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_256, 5);}
2427 XferTypeKeyword
2428 : PARSEOP_XFERTYPE_8 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_8);}
2429 | PARSEOP_XFERTYPE_8_16 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_8_16);}
2430 | PARSEOP_XFERTYPE_16 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_16);}
2434 /******* Miscellaneous Types **************************************************/
2437 SuperName
2438 : NameString {}
2439 | ArgTerm {}
2440 | LocalTerm {}
2441 | DebugTerm {}
2442 | Type6Opcode {}
2444 /* For ObjectType: SuperName except for UserTerm (method invocation) */
2446 ObjectTypeName
2447 : NameString {}
2448 | ArgTerm {}
2449 | LocalTerm {}
2450 | DebugTerm {}
2451 | RefOfTerm {}
2452 | DerefOfTerm {}
2453 | IndexTerm {}
2455 /* | UserTerm {} */ /* Caused reduce/reduce with Type6Opcode->UserTerm */
2458 ArgTerm
2459 : PARSEOP_ARG0 {$$ = TrCreateLeafNode (PARSEOP_ARG0);}
2460 | PARSEOP_ARG1 {$$ = TrCreateLeafNode (PARSEOP_ARG1);}
2461 | PARSEOP_ARG2 {$$ = TrCreateLeafNode (PARSEOP_ARG2);}
2462 | PARSEOP_ARG3 {$$ = TrCreateLeafNode (PARSEOP_ARG3);}
2463 | PARSEOP_ARG4 {$$ = TrCreateLeafNode (PARSEOP_ARG4);}
2464 | PARSEOP_ARG5 {$$ = TrCreateLeafNode (PARSEOP_ARG5);}
2465 | PARSEOP_ARG6 {$$ = TrCreateLeafNode (PARSEOP_ARG6);}
2468 LocalTerm
2469 : PARSEOP_LOCAL0 {$$ = TrCreateLeafNode (PARSEOP_LOCAL0);}
2470 | PARSEOP_LOCAL1 {$$ = TrCreateLeafNode (PARSEOP_LOCAL1);}
2471 | PARSEOP_LOCAL2 {$$ = TrCreateLeafNode (PARSEOP_LOCAL2);}
2472 | PARSEOP_LOCAL3 {$$ = TrCreateLeafNode (PARSEOP_LOCAL3);}
2473 | PARSEOP_LOCAL4 {$$ = TrCreateLeafNode (PARSEOP_LOCAL4);}
2474 | PARSEOP_LOCAL5 {$$ = TrCreateLeafNode (PARSEOP_LOCAL5);}
2475 | PARSEOP_LOCAL6 {$$ = TrCreateLeafNode (PARSEOP_LOCAL6);}
2476 | PARSEOP_LOCAL7 {$$ = TrCreateLeafNode (PARSEOP_LOCAL7);}
2479 DebugTerm
2480 : PARSEOP_DEBUG {$$ = TrCreateLeafNode (PARSEOP_DEBUG);}
2484 ByteConst
2485 : Integer {$$ = TrUpdateNode (PARSEOP_BYTECONST, $1);}
2488 WordConst
2489 : Integer {$$ = TrUpdateNode (PARSEOP_WORDCONST, $1);}
2492 DWordConst
2493 : Integer {$$ = TrUpdateNode (PARSEOP_DWORDCONST, $1);}
2496 QWordConst
2497 : Integer {$$ = TrUpdateNode (PARSEOP_QWORDCONST, $1);}
2500 Integer
2501 : PARSEOP_INTEGER {$$ = TrCreateValuedLeafNode (PARSEOP_INTEGER, AslCompilerlval.i);}
2504 String
2505 : PARSEOP_STRING_LITERAL {$$ = TrCreateValuedLeafNode (PARSEOP_STRING_LITERAL, (ACPI_NATIVE_INT) AslCompilerlval.s);}
2508 ConstTerm
2509 : ConstExprTerm {}
2510 | PARSEOP_REVISION {$$ = TrCreateLeafNode (PARSEOP_REVISION);}
2513 ConstExprTerm
2514 : PARSEOP_ZERO {$$ = TrCreateValuedLeafNode (PARSEOP_ZERO, 0);}
2515 | PARSEOP_ONE {$$ = TrCreateValuedLeafNode (PARSEOP_ONE, 1);}
2516 | PARSEOP_ONES {$$ = TrCreateValuedLeafNode (PARSEOP_ONES, ACPI_UINT64_MAX);}
2517 | PARSEOP___DATE__ {$$ = TrCreateConstantLeafNode (PARSEOP___DATE__);}
2518 | PARSEOP___FILE__ {$$ = TrCreateConstantLeafNode (PARSEOP___FILE__);}
2519 | PARSEOP___LINE__ {$$ = TrCreateConstantLeafNode (PARSEOP___LINE__);}
2520 | PARSEOP___PATH__ {$$ = TrCreateConstantLeafNode (PARSEOP___PATH__);}
2524 * The NODE_COMPILE_TIME_CONST flag in the following constant expressions
2525 * enables compile-time constant folding to reduce the Type3Opcodes/Type2IntegerOpcodes
2526 * to simple integers. It is an error if these types of expressions cannot be
2527 * reduced, since the AML grammar for ****ConstExpr requires a simple constant.
2528 * Note: The required byte length of the constant is passed through to the
2529 * constant folding code in the node AmlLength field.
2531 ByteConstExpr
2532 : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 1);}
2533 | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 1);}
2534 | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_BYTECONST, $1);}
2535 | ByteConst {}
2538 WordConstExpr
2539 : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 2);}
2540 | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 2);}
2541 | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_WORDCONST, $1);}
2542 | WordConst {}
2545 DWordConstExpr
2546 : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 4);}
2547 | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 4);}
2548 | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_DWORDCONST, $1);}
2549 | DWordConst {}
2552 QWordConstExpr
2553 : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 8);}
2554 | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 8);}
2555 | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_QWORDCONST, $1);}
2556 | QWordConst {}
2559 /* OptionalCount must appear before ByteList or an incorrect reduction will result */
2561 OptionalCount
2562 : {$$ = TrCreateLeafNode (PARSEOP_ONES);} /* Placeholder is a OnesOp object */
2563 | ',' {$$ = TrCreateLeafNode (PARSEOP_ONES);} /* Placeholder is a OnesOp object */
2564 | ',' TermArg {$$ = $2;}
2567 BufferTerm
2568 : PARSEOP_BUFFER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_BUFFER);}
2569 OptionalTermArg
2570 ')' '{'
2571 BufferTermData '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);}
2572 | PARSEOP_BUFFER '('
2573 error ')' {$$ = AslDoError(); yyclearin;}
2576 BufferTermData
2577 : ByteList {}
2578 | StringData {}
2581 ByteList
2582 : {$$ = NULL;}
2583 | ByteConstExpr
2584 | ByteList ',' /* Allows a trailing comma at list end */
2585 | ByteList ','
2586 ByteConstExpr {$$ = TrLinkPeerNode ($1,$3);}
2589 DataBufferTerm
2590 : PARSEOP_DATABUFFER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DATABUFFER);}
2591 OptionalWordConst
2592 ')' '{'
2593 ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);}
2594 | PARSEOP_DATABUFFER '('
2595 error ')' {$$ = AslDoError(); yyclearin;}
2598 DWordList
2599 : {$$ = NULL;}
2600 | DWordConstExpr
2601 | DWordList ',' /* Allows a trailing comma at list end */
2602 | DWordList ','
2603 DWordConstExpr {$$ = TrLinkPeerNode ($1,$3);}
2606 PackageTerm
2607 : PARSEOP_PACKAGE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_VAR_PACKAGE);}
2608 VarPackageLengthTerm
2609 ')' '{'
2610 PackageList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);}
2611 | PARSEOP_PACKAGE '('
2612 error ')' {$$ = AslDoError(); yyclearin;}
2615 PackageList
2616 : {$$ = NULL;}
2617 | PackageElement
2618 | PackageList ',' /* Allows a trailing comma at list end */
2619 | PackageList ','
2620 PackageElement {$$ = TrLinkPeerNode ($1,$3);}
2623 PackageElement
2624 : DataObject {}
2625 | NameString {}
2628 VarPackageLengthTerm
2629 : {$$ = TrCreateLeafNode (PARSEOP_DEFAULT_ARG);}
2630 | TermArg {$$ = $1;}
2634 /******* Macros ***********************************************/
2637 EISAIDTerm
2638 : PARSEOP_EISAID '('
2639 StringData ')' {$$ = TrUpdateNode (PARSEOP_EISAID, $3);}
2640 | PARSEOP_EISAID '('
2641 error ')' {$$ = AslDoError(); yyclearin;}
2644 UnicodeTerm
2645 : PARSEOP_UNICODE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UNICODE);}
2646 StringData
2647 ')' {$$ = TrLinkChildren ($<n>3,2,0,$4);}
2648 | PARSEOP_UNICODE '('
2649 error ')' {$$ = AslDoError(); yyclearin;}
2653 /******* Resources and Memory ***********************************************/
2657 * Note: Create two default nodes to allow conversion to a Buffer AML opcode
2658 * Also, insert the EndTag at the end of the template.
2660 ResourceTemplateTerm
2661 : PARSEOP_RESOURCETEMPLATE '(' ')'
2663 ResourceMacroList '}' {$$ = TrCreateNode (PARSEOP_RESOURCETEMPLATE,4,
2664 TrCreateLeafNode (PARSEOP_DEFAULT_ARG),
2665 TrCreateLeafNode (PARSEOP_DEFAULT_ARG),
2667 TrCreateLeafNode (PARSEOP_ENDTAG));}
2670 ResourceMacroList
2671 : {$$ = NULL;}
2672 | ResourceMacroList
2673 ResourceMacroTerm {$$ = TrLinkPeerNode ($1,$2);}
2676 ResourceMacroTerm
2677 : DMATerm {}
2678 | DWordIOTerm {}
2679 | DWordMemoryTerm {}
2680 | DWordSpaceTerm {}
2681 | EndDependentFnTerm {}
2682 | ExtendedIOTerm {}
2683 | ExtendedMemoryTerm {}
2684 | ExtendedSpaceTerm {}
2685 | FixedDmaTerm {}
2686 | FixedIOTerm {}
2687 | GpioIntTerm {}
2688 | GpioIoTerm {}
2689 | I2cSerialBusTerm {}
2690 | InterruptTerm {}
2691 | IOTerm {}
2692 | IRQNoFlagsTerm {}
2693 | IRQTerm {}
2694 | Memory24Term {}
2695 | Memory32FixedTerm {}
2696 | Memory32Term {}
2697 | QWordIOTerm {}
2698 | QWordMemoryTerm {}
2699 | QWordSpaceTerm {}
2700 | RegisterTerm {}
2701 | SpiSerialBusTerm {}
2702 | StartDependentFnNoPriTerm {}
2703 | StartDependentFnTerm {}
2704 | UartSerialBusTerm {}
2705 | VendorLongTerm {}
2706 | VendorShortTerm {}
2707 | WordBusNumberTerm {}
2708 | WordIOTerm {}
2709 | WordSpaceTerm {}
2712 DMATerm
2713 : PARSEOP_DMA '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DMA);}
2714 DMATypeKeyword
2715 OptionalBusMasterKeyword
2716 ',' XferTypeKeyword
2717 OptionalNameString_Last
2718 ')' '{'
2719 ByteList '}' {$$ = TrLinkChildren ($<n>3,5,$4,$5,$7,$8,$11);}
2720 | PARSEOP_DMA '('
2721 error ')' {$$ = AslDoError(); yyclearin;}
2724 DWordIOTerm
2725 : PARSEOP_DWORDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DWORDIO);}
2726 OptionalResourceType_First
2727 OptionalMinType
2728 OptionalMaxType
2729 OptionalDecodeType
2730 OptionalRangeType
2731 ',' DWordConstExpr
2732 ',' DWordConstExpr
2733 ',' DWordConstExpr
2734 ',' DWordConstExpr
2735 ',' DWordConstExpr
2736 OptionalByteConstExpr
2737 OptionalStringData
2738 OptionalNameString
2739 OptionalType
2740 OptionalTranslationType_Last
2741 ')' {$$ = TrLinkChildren ($<n>3,15,$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22,$23);}
2742 | PARSEOP_DWORDIO '('
2743 error ')' {$$ = AslDoError(); yyclearin;}
2746 DWordMemoryTerm
2747 : PARSEOP_DWORDMEMORY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DWORDMEMORY);}
2748 OptionalResourceType_First
2749 OptionalDecodeType
2750 OptionalMinType
2751 OptionalMaxType
2752 OptionalMemType
2753 ',' OptionalReadWriteKeyword
2754 ',' DWordConstExpr
2755 ',' DWordConstExpr
2756 ',' DWordConstExpr
2757 ',' DWordConstExpr
2758 ',' DWordConstExpr
2759 OptionalByteConstExpr
2760 OptionalStringData
2761 OptionalNameString
2762 OptionalAddressRange
2763 OptionalType_Last
2764 ')' {$$ = TrLinkChildren ($<n>3,16,$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$20,$21,$22,$23,$24,$25);}
2765 | PARSEOP_DWORDMEMORY '('
2766 error ')' {$$ = AslDoError(); yyclearin;}
2769 DWordSpaceTerm
2770 : PARSEOP_DWORDSPACE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DWORDSPACE);}
2771 ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);}
2772 OptionalResourceType
2773 OptionalDecodeType
2774 OptionalMinType
2775 OptionalMaxType
2776 ',' ByteConstExpr
2777 ',' DWordConstExpr
2778 ',' DWordConstExpr
2779 ',' DWordConstExpr
2780 ',' DWordConstExpr
2781 ',' DWordConstExpr
2782 OptionalByteConstExpr
2783 OptionalStringData
2784 OptionalNameString_Last
2785 ')' {$$ = TrLinkChildren ($<n>3,14,$4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23,$24);}
2786 | PARSEOP_DWORDSPACE '('
2787 error ')' {$$ = AslDoError(); yyclearin;}
2791 EndDependentFnTerm
2792 : PARSEOP_ENDDEPENDENTFN '('
2793 ')' {$$ = TrCreateLeafNode (PARSEOP_ENDDEPENDENTFN);}
2794 | PARSEOP_ENDDEPENDENTFN '('
2795 error ')' {$$ = AslDoError(); yyclearin;}
2798 ExtendedIOTerm
2799 : PARSEOP_EXTENDEDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_EXTENDEDIO);}
2800 OptionalResourceType_First
2801 OptionalMinType
2802 OptionalMaxType
2803 OptionalDecodeType
2804 OptionalRangeType
2805 ',' QWordConstExpr
2806 ',' QWordConstExpr
2807 ',' QWordConstExpr
2808 ',' QWordConstExpr
2809 ',' QWordConstExpr
2810 OptionalQWordConstExpr
2811 OptionalNameString
2812 OptionalType
2813 OptionalTranslationType_Last
2814 ')' {$$ = TrLinkChildren ($<n>3,14,$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22);}
2815 | PARSEOP_EXTENDEDIO '('
2816 error ')' {$$ = AslDoError(); yyclearin;}
2819 ExtendedMemoryTerm
2820 : PARSEOP_EXTENDEDMEMORY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_EXTENDEDMEMORY);}
2821 OptionalResourceType_First
2822 OptionalDecodeType
2823 OptionalMinType
2824 OptionalMaxType
2825 OptionalMemType
2826 ',' OptionalReadWriteKeyword
2827 ',' QWordConstExpr
2828 ',' QWordConstExpr
2829 ',' QWordConstExpr
2830 ',' QWordConstExpr
2831 ',' QWordConstExpr
2832 OptionalQWordConstExpr
2833 OptionalNameString
2834 OptionalAddressRange
2835 OptionalType_Last
2836 ')' {$$ = TrLinkChildren ($<n>3,15,$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$20,$21,$22,$23,$24);}
2837 | PARSEOP_EXTENDEDMEMORY '('
2838 error ')' {$$ = AslDoError(); yyclearin;}
2841 ExtendedSpaceTerm
2842 : PARSEOP_EXTENDEDSPACE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_EXTENDEDSPACE);}
2843 ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);}
2844 OptionalResourceType
2845 OptionalDecodeType
2846 OptionalMinType
2847 OptionalMaxType
2848 ',' ByteConstExpr
2849 ',' QWordConstExpr
2850 ',' QWordConstExpr
2851 ',' QWordConstExpr
2852 ',' QWordConstExpr
2853 ',' QWordConstExpr
2854 OptionalQWordConstExpr
2855 OptionalNameString_Last
2856 ')' {$$ = TrLinkChildren ($<n>3,13,$4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23);}
2857 | PARSEOP_EXTENDEDSPACE '('
2858 error ')' {$$ = AslDoError(); yyclearin;}
2861 FixedDmaTerm
2862 : PARSEOP_FIXEDDMA '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FIXEDDMA);}
2863 WordConstExpr /* 04: DMA RequestLines */
2864 ',' WordConstExpr /* 06: DMA Channels */
2865 OptionalXferSize /* 07: DMA TransferSize */
2866 OptionalNameString /* 08: DescriptorName */
2867 ')' {$$ = TrLinkChildren ($<n>3,4,$4,$6,$7,$8);}
2868 | PARSEOP_FIXEDDMA '('
2869 error ')' {$$ = AslDoError(); yyclearin;}
2872 FixedIOTerm
2873 : PARSEOP_FIXEDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FIXEDIO);}
2874 WordConstExpr
2875 ',' ByteConstExpr
2876 OptionalNameString_Last
2877 ')' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);}
2878 | PARSEOP_FIXEDIO '('
2879 error ')' {$$ = AslDoError(); yyclearin;}
2882 GpioIntTerm
2883 : PARSEOP_GPIO_INT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_GPIO_INT);}
2884 InterruptTypeKeyword /* 04: InterruptType */
2885 ',' InterruptLevel /* 06: InterruptLevel */
2886 OptionalShareType /* 07: SharedType */
2887 ',' PinConfigByte /* 09: PinConfig */
2888 OptionalWordConstExpr /* 10: DebounceTimeout */
2889 ',' StringData /* 12: ResourceSource */
2890 OptionalByteConstExpr /* 13: ResourceSourceIndex */
2891 OptionalResourceType /* 14: ResourceType */
2892 OptionalNameString /* 15: DescriptorName */
2893 OptionalBuffer_Last /* 16: VendorData */
2894 ')' '{'
2895 DWordConstExpr '}' {$$ = TrLinkChildren ($<n>3,11,$4,$6,$7,$9,$10,$12,$13,$14,$15,$16,$19);}
2896 | PARSEOP_GPIO_INT '('
2897 error ')' {$$ = AslDoError(); yyclearin;}
2900 GpioIoTerm
2901 : PARSEOP_GPIO_IO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_GPIO_IO);}
2902 OptionalShareType_First /* 04: SharedType */
2903 ',' PinConfigByte /* 06: PinConfig */
2904 OptionalWordConstExpr /* 07: DebounceTimeout */
2905 OptionalWordConstExpr /* 08: DriveStrength */
2906 OptionalIoRestriction /* 09: IoRestriction */
2907 ',' StringData /* 11: ResourceSource */
2908 OptionalByteConstExpr /* 12: ResourceSourceIndex */
2909 OptionalResourceType /* 13: ResourceType */
2910 OptionalNameString /* 14: DescriptorName */
2911 OptionalBuffer_Last /* 15: VendorData */
2912 ')' '{'
2913 DWordList '}' {$$ = TrLinkChildren ($<n>3,11,$4,$6,$7,$8,$9,$11,$12,$13,$14,$15,$18);}
2914 | PARSEOP_GPIO_IO '('
2915 error ')' {$$ = AslDoError(); yyclearin;}
2918 I2cSerialBusTerm
2919 : PARSEOP_I2C_SERIALBUS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_I2C_SERIALBUS);}
2920 WordConstExpr /* 04: SlaveAddress */
2921 OptionalSlaveMode /* 05: SlaveMode */
2922 ',' DWordConstExpr /* 07: ConnectionSpeed */
2923 OptionalAddressingMode /* 08: AddressingMode */
2924 ',' StringData /* 10: ResourceSource */
2925 OptionalByteConstExpr /* 11: ResourceSourceIndex */
2926 OptionalResourceType /* 12: ResourceType */
2927 OptionalNameString /* 13: DescriptorName */
2928 OptionalBuffer_Last /* 14: VendorData */
2929 ')' {$$ = TrLinkChildren ($<n>3,9,$4,$5,$7,$8,$10,$11,$12,$13,$14);}
2930 | PARSEOP_I2C_SERIALBUS '('
2931 error ')' {$$ = AslDoError(); yyclearin;}
2934 InterruptTerm
2935 : PARSEOP_INTERRUPT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INTERRUPT);}
2936 OptionalResourceType_First
2937 ',' InterruptTypeKeyword
2938 ',' InterruptLevel
2939 OptionalShareType
2940 OptionalByteConstExpr
2941 OptionalStringData
2942 OptionalNameString_Last
2943 ')' '{'
2944 DWordList '}' {$$ = TrLinkChildren ($<n>3,8,$4,$6,$8,$9,$10,$11,$12,$15);}
2945 | PARSEOP_INTERRUPT '('
2946 error ')' {$$ = AslDoError(); yyclearin;}
2949 IOTerm
2950 : PARSEOP_IO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_IO);}
2951 IODecodeKeyword
2952 ',' WordConstExpr
2953 ',' WordConstExpr
2954 ',' ByteConstExpr
2955 ',' ByteConstExpr
2956 OptionalNameString_Last
2957 ')' {$$ = TrLinkChildren ($<n>3,6,$4,$6,$8,$10,$12,$13);}
2958 | PARSEOP_IO '('
2959 error ')' {$$ = AslDoError(); yyclearin;}
2962 IRQNoFlagsTerm
2963 : PARSEOP_IRQNOFLAGS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_IRQNOFLAGS);}
2964 OptionalNameString_First
2965 ')' '{'
2966 ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);}
2967 | PARSEOP_IRQNOFLAGS '('
2968 error ')' {$$ = AslDoError(); yyclearin;}
2971 IRQTerm
2972 : PARSEOP_IRQ '(' {$<n>$ = TrCreateLeafNode (PARSEOP_IRQ);}
2973 InterruptTypeKeyword
2974 ',' InterruptLevel
2975 OptionalShareType
2976 OptionalNameString_Last
2977 ')' '{'
2978 ByteList '}' {$$ = TrLinkChildren ($<n>3,5,$4,$6,$7,$8,$11);}
2979 | PARSEOP_IRQ '('
2980 error ')' {$$ = AslDoError(); yyclearin;}
2983 Memory24Term
2984 : PARSEOP_MEMORY24 '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MEMORY24);}
2985 OptionalReadWriteKeyword
2986 ',' WordConstExpr
2987 ',' WordConstExpr
2988 ',' WordConstExpr
2989 ',' WordConstExpr
2990 OptionalNameString_Last
2991 ')' {$$ = TrLinkChildren ($<n>3,6,$4,$6,$8,$10,$12,$13);}
2992 | PARSEOP_MEMORY24 '('
2993 error ')' {$$ = AslDoError(); yyclearin;}
2996 Memory32FixedTerm
2997 : PARSEOP_MEMORY32FIXED '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MEMORY32FIXED);}
2998 OptionalReadWriteKeyword
2999 ',' DWordConstExpr
3000 ',' DWordConstExpr
3001 OptionalNameString_Last
3002 ')' {$$ = TrLinkChildren ($<n>3,4,$4,$6,$8,$9);}
3003 | PARSEOP_MEMORY32FIXED '('
3004 error ')' {$$ = AslDoError(); yyclearin;}
3007 Memory32Term
3008 : PARSEOP_MEMORY32 '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MEMORY32);}
3009 OptionalReadWriteKeyword
3010 ',' DWordConstExpr
3011 ',' DWordConstExpr
3012 ',' DWordConstExpr
3013 ',' DWordConstExpr
3014 OptionalNameString_Last
3015 ')' {$$ = TrLinkChildren ($<n>3,6,$4,$6,$8,$10,$12,$13);}
3016 | PARSEOP_MEMORY32 '('
3017 error ')' {$$ = AslDoError(); yyclearin;}
3020 QWordIOTerm
3021 : PARSEOP_QWORDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDIO);}
3022 OptionalResourceType_First
3023 OptionalMinType
3024 OptionalMaxType
3025 OptionalDecodeType
3026 OptionalRangeType
3027 ',' QWordConstExpr
3028 ',' QWordConstExpr
3029 ',' QWordConstExpr
3030 ',' QWordConstExpr
3031 ',' QWordConstExpr
3032 OptionalByteConstExpr
3033 OptionalStringData
3034 OptionalNameString
3035 OptionalType
3036 OptionalTranslationType_Last
3037 ')' {$$ = TrLinkChildren ($<n>3,15,$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22,$23);}
3038 | PARSEOP_QWORDIO '('
3039 error ')' {$$ = AslDoError(); yyclearin;}
3042 QWordMemoryTerm
3043 : PARSEOP_QWORDMEMORY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDMEMORY);}
3044 OptionalResourceType_First
3045 OptionalDecodeType
3046 OptionalMinType
3047 OptionalMaxType
3048 OptionalMemType
3049 ',' OptionalReadWriteKeyword
3050 ',' QWordConstExpr
3051 ',' QWordConstExpr
3052 ',' QWordConstExpr
3053 ',' QWordConstExpr
3054 ',' QWordConstExpr
3055 OptionalByteConstExpr
3056 OptionalStringData
3057 OptionalNameString
3058 OptionalAddressRange
3059 OptionalType_Last
3060 ')' {$$ = TrLinkChildren ($<n>3,16,$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$20,$21,$22,$23,$24,$25);}
3061 | PARSEOP_QWORDMEMORY '('
3062 error ')' {$$ = AslDoError(); yyclearin;}
3065 QWordSpaceTerm
3066 : PARSEOP_QWORDSPACE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDSPACE);}
3067 ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);}
3068 OptionalResourceType
3069 OptionalDecodeType
3070 OptionalMinType
3071 OptionalMaxType
3072 ',' ByteConstExpr
3073 ',' QWordConstExpr
3074 ',' QWordConstExpr
3075 ',' QWordConstExpr
3076 ',' QWordConstExpr
3077 ',' QWordConstExpr
3078 OptionalByteConstExpr
3079 OptionalStringData
3080 OptionalNameString_Last
3081 ')' {$$ = TrLinkChildren ($<n>3,14,$4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23,$24);}
3082 | PARSEOP_QWORDSPACE '('
3083 error ')' {$$ = AslDoError(); yyclearin;}
3086 RegisterTerm
3087 : PARSEOP_REGISTER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_REGISTER);}
3088 AddressSpaceKeyword
3089 ',' ByteConstExpr
3090 ',' ByteConstExpr
3091 ',' QWordConstExpr
3092 OptionalAccessSize
3093 OptionalNameString_Last
3094 ')' {$$ = TrLinkChildren ($<n>3,6,$4,$6,$8,$10,$11,$12);}
3095 | PARSEOP_REGISTER '('
3096 error ')' {$$ = AslDoError(); yyclearin;}
3099 SpiSerialBusTerm
3100 : PARSEOP_SPI_SERIALBUS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SPI_SERIALBUS);}
3101 WordConstExpr /* 04: DeviceSelection */
3102 OptionalDevicePolarity /* 05: DevicePolarity */
3103 OptionalWireMode /* 06: WireMode */
3104 ',' ByteConstExpr /* 08: DataBitLength */
3105 OptionalSlaveMode /* 09: SlaveMode */
3106 ',' DWordConstExpr /* 11: ConnectionSpeed */
3107 ',' ClockPolarityKeyword /* 13: ClockPolarity */
3108 ',' ClockPhaseKeyword /* 15: ClockPhase */
3109 ',' StringData /* 17: ResourceSource */
3110 OptionalByteConstExpr /* 18: ResourceSourceIndex */
3111 OptionalResourceType /* 19: ResourceType */
3112 OptionalNameString /* 20: DescriptorName */
3113 OptionalBuffer_Last /* 21: VendorData */
3114 ')' {$$ = TrLinkChildren ($<n>3,13,$4,$5,$6,$8,$9,$11,$13,$15,$17,$18,$19,$20,$21);}
3115 | PARSEOP_SPI_SERIALBUS '('
3116 error ')' {$$ = AslDoError(); yyclearin;}
3119 StartDependentFnNoPriTerm
3120 : PARSEOP_STARTDEPENDENTFN_NOPRI '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STARTDEPENDENTFN_NOPRI);}
3121 ')' '{'
3122 ResourceMacroList '}' {$$ = TrLinkChildren ($<n>3,1,$6);}
3123 | PARSEOP_STARTDEPENDENTFN_NOPRI '('
3124 error ')' {$$ = AslDoError(); yyclearin;}
3127 StartDependentFnTerm
3128 : PARSEOP_STARTDEPENDENTFN '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STARTDEPENDENTFN);}
3129 ByteConstExpr
3130 ',' ByteConstExpr
3131 ')' '{'
3132 ResourceMacroList '}' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$9);}
3133 | PARSEOP_STARTDEPENDENTFN '('
3134 error ')' {$$ = AslDoError(); yyclearin;}
3137 UartSerialBusTerm
3138 : PARSEOP_UART_SERIALBUS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UART_SERIALBUS);}
3139 DWordConstExpr /* 04: ConnectionSpeed */
3140 OptionalBitsPerByte /* 05: BitsPerByte */
3141 OptionalStopBits /* 06: StopBits */
3142 ',' ByteConstExpr /* 08: LinesInUse */
3143 OptionalEndian /* 09: Endianess */
3144 OptionalParityType /* 10: Parity */
3145 OptionalFlowControl /* 11: FlowControl */
3146 ',' WordConstExpr /* 13: Rx BufferSize */
3147 ',' WordConstExpr /* 15: Tx BufferSize */
3148 ',' StringData /* 17: ResourceSource */
3149 OptionalByteConstExpr /* 18: ResourceSourceIndex */
3150 OptionalResourceType /* 19: ResourceType */
3151 OptionalNameString /* 20: DescriptorName */
3152 OptionalBuffer_Last /* 21: VendorData */
3153 ')' {$$ = TrLinkChildren ($<n>3,14,$4,$5,$6,$8,$9,$10,$11,$13,$15,$17,$18,$19,$20,$21);}
3154 | PARSEOP_UART_SERIALBUS '('
3155 error ')' {$$ = AslDoError(); yyclearin;}
3158 VendorLongTerm
3159 : PARSEOP_VENDORLONG '(' {$<n>$ = TrCreateLeafNode (PARSEOP_VENDORLONG);}
3160 OptionalNameString_First
3161 ')' '{'
3162 ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);}
3163 | PARSEOP_VENDORLONG '('
3164 error ')' {$$ = AslDoError(); yyclearin;}
3167 VendorShortTerm
3168 : PARSEOP_VENDORSHORT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_VENDORSHORT);}
3169 OptionalNameString_First
3170 ')' '{'
3171 ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);}
3172 | PARSEOP_VENDORSHORT '('
3173 error ')' {$$ = AslDoError(); yyclearin;}
3176 WordBusNumberTerm
3177 : PARSEOP_WORDBUSNUMBER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WORDBUSNUMBER);}
3178 OptionalResourceType_First
3179 OptionalMinType
3180 OptionalMaxType
3181 OptionalDecodeType
3182 ',' WordConstExpr
3183 ',' WordConstExpr
3184 ',' WordConstExpr
3185 ',' WordConstExpr
3186 ',' WordConstExpr
3187 OptionalByteConstExpr
3188 OptionalStringData
3189 OptionalNameString_Last
3190 ')' {$$ = TrLinkChildren ($<n>3,12,$4,$5,$6,$7,$9,$11,$13,$15,$17,$18,$19,$20);}
3191 | PARSEOP_WORDBUSNUMBER '('
3192 error ')' {$$ = AslDoError(); yyclearin;}
3195 WordIOTerm
3196 : PARSEOP_WORDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WORDIO);}
3197 OptionalResourceType_First
3198 OptionalMinType
3199 OptionalMaxType
3200 OptionalDecodeType
3201 OptionalRangeType
3202 ',' WordConstExpr
3203 ',' WordConstExpr
3204 ',' WordConstExpr
3205 ',' WordConstExpr
3206 ',' WordConstExpr
3207 OptionalByteConstExpr
3208 OptionalStringData
3209 OptionalNameString
3210 OptionalType
3211 OptionalTranslationType_Last
3212 ')' {$$ = TrLinkChildren ($<n>3,15,$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22,$23);}
3213 | PARSEOP_WORDIO '('
3214 error ')' {$$ = AslDoError(); yyclearin;}
3217 WordSpaceTerm
3218 : PARSEOP_WORDSPACE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WORDSPACE);}
3219 ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);}
3220 OptionalResourceType
3221 OptionalDecodeType
3222 OptionalMinType
3223 OptionalMaxType
3224 ',' ByteConstExpr
3225 ',' WordConstExpr
3226 ',' WordConstExpr
3227 ',' WordConstExpr
3228 ',' WordConstExpr
3229 ',' WordConstExpr
3230 OptionalByteConstExpr
3231 OptionalStringData
3232 OptionalNameString_Last
3233 ')' {$$ = TrLinkChildren ($<n>3,14,$4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23,$24);}
3234 | PARSEOP_WORDSPACE '('
3235 error ')' {$$ = AslDoError(); yyclearin;}
3239 /******* Object References ***********************************************/
3241 /* Allow IO, DMA, IRQ Resource macro names to also be used as identifiers */
3243 NameString
3244 : NameSeg {}
3245 | PARSEOP_NAMESTRING {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) AslCompilerlval.s);}
3246 | PARSEOP_IO {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "IO");}
3247 | PARSEOP_DMA {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "DMA");}
3248 | PARSEOP_IRQ {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "IRQ");}
3251 NameSeg
3252 : PARSEOP_NAMESEG {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESEG, (ACPI_NATIVE_INT) AslCompilerlval.s);}
3256 /******* Helper rules ****************************************************/
3259 AmlPackageLengthTerm
3260 : Integer {$$ = TrUpdateNode (PARSEOP_PACKAGE_LENGTH,(ACPI_PARSE_OBJECT *) $1);}
3263 NameStringItem
3264 : ',' NameString {$$ = $2;}
3265 | ',' error {$$ = AslDoError (); yyclearin;}
3268 TermArgItem
3269 : ',' TermArg {$$ = $2;}
3270 | ',' error {$$ = AslDoError (); yyclearin;}
3273 OptionalBusMasterKeyword
3274 : ',' {$$ = TrCreateLeafNode (PARSEOP_BUSMASTERTYPE_MASTER);}
3275 | ',' PARSEOP_BUSMASTERTYPE_MASTER {$$ = TrCreateLeafNode (PARSEOP_BUSMASTERTYPE_MASTER);}
3276 | ',' PARSEOP_BUSMASTERTYPE_NOTMASTER {$$ = TrCreateLeafNode (PARSEOP_BUSMASTERTYPE_NOTMASTER);}
3279 OptionalAccessAttribTerm
3280 : {$$ = NULL;}
3281 | ',' {$$ = NULL;}
3282 | ',' ByteConstExpr {$$ = $2;}
3283 | ',' AccessAttribKeyword {$$ = $2;}
3286 OptionalAccessSize
3287 : {$$ = TrCreateValuedLeafNode (PARSEOP_BYTECONST, 0);}
3288 | ',' {$$ = TrCreateValuedLeafNode (PARSEOP_BYTECONST, 0);}
3289 | ',' ByteConstExpr {$$ = $2;}
3292 OptionalAddressingMode
3293 : ',' {$$ = NULL;}
3294 | ',' AddressingModeKeyword {$$ = $2;}
3297 OptionalAddressRange
3298 : {$$ = NULL;}
3299 | ',' {$$ = NULL;}
3300 | ',' AddressKeyword {$$ = $2;}
3303 OptionalBitsPerByte
3304 : ',' {$$ = NULL;}
3305 | ',' BitsPerByteKeyword {$$ = $2;}
3308 OptionalBuffer_Last
3309 : {$$ = NULL;}
3310 | ',' {$$ = NULL;}
3311 | ',' DataBufferTerm {$$ = $2;}
3314 OptionalByteConstExpr
3315 : {$$ = NULL;}
3316 | ',' {$$ = NULL;}
3317 | ',' ByteConstExpr {$$ = $2;}
3320 OptionalDecodeType
3321 : ',' {$$ = NULL;}
3322 | ',' DecodeKeyword {$$ = $2;}
3325 OptionalDevicePolarity
3326 : ',' {$$ = NULL;}
3327 | ',' DevicePolarityKeyword {$$ = $2;}
3330 OptionalDWordConstExpr
3331 : {$$ = NULL;}
3332 | ',' {$$ = NULL;}
3333 | ',' DWordConstExpr {$$ = $2;}
3336 OptionalEndian
3337 : ',' {$$ = NULL;}
3338 | ',' EndianKeyword {$$ = $2;}
3341 OptionalFlowControl
3342 : ',' {$$ = NULL;}
3343 | ',' FlowControlKeyword {$$ = $2;}
3346 OptionalIoRestriction
3347 : ',' {$$ = NULL;}
3348 | ',' IoRestrictionKeyword {$$ = $2;}
3351 OptionalListString
3352 : {$$ = TrCreateValuedLeafNode (PARSEOP_STRING_LITERAL, ACPI_TO_INTEGER (""));} /* Placeholder is a NULL string */
3353 | ',' {$$ = TrCreateValuedLeafNode (PARSEOP_STRING_LITERAL, ACPI_TO_INTEGER (""));} /* Placeholder is a NULL string */
3354 | ',' TermArg {$$ = $2;}
3357 OptionalMaxType
3358 : ',' {$$ = NULL;}
3359 | ',' MaxKeyword {$$ = $2;}
3362 OptionalMemType
3363 : ',' {$$ = NULL;}
3364 | ',' MemTypeKeyword {$$ = $2;}
3367 OptionalMinType
3368 : ',' {$$ = NULL;}
3369 | ',' MinKeyword {$$ = $2;}
3372 OptionalNameString
3373 : {$$ = NULL;}
3374 | ',' {$$ = NULL;}
3375 | ',' NameString {$$ = $2;}
3378 OptionalNameString_Last
3379 : {$$ = NULL;}
3380 | ',' {$$ = NULL;}
3381 | ',' NameString {$$ = $2;}
3384 OptionalNameString_First
3385 : {$$ = TrCreateLeafNode (PARSEOP_ZERO);}
3386 | NameString {$$ = $1;}
3389 OptionalObjectTypeKeyword
3390 : {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_UNK);}
3391 | ',' ObjectTypeKeyword {$$ = $2;}
3394 OptionalParityType
3395 : ',' {$$ = NULL;}
3396 | ',' ParityTypeKeyword {$$ = $2;}
3399 OptionalQWordConstExpr
3400 : {$$ = NULL;}
3401 | ',' {$$ = NULL;}
3402 | ',' QWordConstExpr {$$ = $2;}
3405 OptionalRangeType
3406 : ',' {$$ = NULL;}
3407 | ',' RangeTypeKeyword {$$ = $2;}
3410 OptionalReadWriteKeyword
3411 : {$$ = TrCreateLeafNode (PARSEOP_READWRITETYPE_BOTH);}
3412 | PARSEOP_READWRITETYPE_BOTH {$$ = TrCreateLeafNode (PARSEOP_READWRITETYPE_BOTH);}
3413 | PARSEOP_READWRITETYPE_READONLY {$$ = TrCreateLeafNode (PARSEOP_READWRITETYPE_READONLY);}
3416 OptionalReference
3417 : {$$ = TrCreateLeafNode (PARSEOP_ZERO);} /* Placeholder is a ZeroOp object */
3418 | ',' {$$ = TrCreateLeafNode (PARSEOP_ZERO);} /* Placeholder is a ZeroOp object */
3419 | ',' TermArg {$$ = $2;}
3422 OptionalResourceType_First
3423 : {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_CONSUMER);}
3424 | ResourceTypeKeyword {$$ = $1;}
3427 OptionalResourceType
3428 : {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_CONSUMER);}
3429 | ',' {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_CONSUMER);}
3430 | ',' ResourceTypeKeyword {$$ = $2;}
3433 OptionalReturnArg
3434 : {$$ = TrSetNodeFlags (TrCreateLeafNode (PARSEOP_ZERO), NODE_IS_NULL_RETURN);} /* Placeholder is a ZeroOp object */
3435 | TermArg {$$ = $1;}
3438 OptionalSerializeRuleKeyword
3439 : {$$ = NULL;}
3440 | ',' {$$ = NULL;}
3441 | ',' SerializeRuleKeyword {$$ = $2;}
3444 OptionalSlaveMode
3445 : ',' {$$ = NULL;}
3446 | ',' SlaveModeKeyword {$$ = $2;}
3449 OptionalShareType
3450 : {$$ = NULL;}
3451 | ',' {$$ = NULL;}
3452 | ',' ShareTypeKeyword {$$ = $2;}
3455 OptionalShareType_First
3456 : {$$ = NULL;}
3457 | ShareTypeKeyword {$$ = $1;}
3460 OptionalStopBits
3461 : ',' {$$ = NULL;}
3462 | ',' StopBitsKeyword {$$ = $2;}
3465 OptionalStringData
3466 : {$$ = NULL;}
3467 | ',' {$$ = NULL;}
3468 | ',' StringData {$$ = $2;}
3471 OptionalTermArg
3472 : {$$ = NULL;}
3473 | TermArg {$$ = $1;}
3476 OptionalType
3477 : {$$ = NULL;}
3478 | ',' {$$ = NULL;}
3479 | ',' TypeKeyword {$$ = $2;}
3482 OptionalType_Last
3483 : {$$ = NULL;}
3484 | ',' {$$ = NULL;}
3485 | ',' TypeKeyword {$$ = $2;}
3488 OptionalTranslationType_Last
3489 : {$$ = NULL;}
3490 | ',' {$$ = NULL;}
3491 | ',' TranslationKeyword {$$ = $2;}
3494 OptionalWireMode
3495 : ',' {$$ = NULL;}
3496 | ',' WireModeKeyword {$$ = $2;}
3499 OptionalWordConst
3500 : {$$ = NULL;}
3501 | WordConst {$$ = $1;}
3504 OptionalWordConstExpr
3505 : ',' {$$ = NULL;}
3506 | ',' WordConstExpr {$$ = $2;}
3509 OptionalXferSize
3510 : {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_32, 2);}
3511 | ',' {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_32, 2);}
3512 | ',' XferSizeKeyword {$$ = $2;}
3516 /******************************************************************************
3518 * Local support functions
3520 *****************************************************************************/
3523 AslCompilerwrap(void)
3525 return (1);
3528 /*! [End] no source code translation !*/
3530 void *
3531 AslLocalAllocate (unsigned int Size)
3533 void *Mem;
3536 DbgPrint (ASL_PARSE_OUTPUT, "\nAslLocalAllocate: Expanding Stack to %u\n\n", Size);
3538 Mem = ACPI_ALLOCATE_ZEROED (Size);
3539 if (!Mem)
3541 AslCommonError (ASL_ERROR, ASL_MSG_MEMORY_ALLOCATION,
3542 Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
3543 Gbl_InputByteCount, Gbl_CurrentColumn,
3544 Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
3545 exit (1);
3548 return (Mem);
3551 ACPI_PARSE_OBJECT *
3552 AslDoError (void)
3556 return (TrCreateLeafNode (PARSEOP_ERRORNODE));
3561 /*******************************************************************************
3563 * FUNCTION: UtGetOpName
3565 * PARAMETERS: ParseOpcode - Parser keyword ID
3567 * RETURN: Pointer to the opcode name
3569 * DESCRIPTION: Get the ascii name of the parse opcode
3571 ******************************************************************************/
3573 char *
3574 UtGetOpName (
3575 UINT32 ParseOpcode)
3577 #ifdef ASL_YYTNAME_START
3579 * First entries (ASL_YYTNAME_START) in yytname are special reserved names.
3580 * Ignore first 8 characters of the name
3582 return ((char *) yytname
3583 [(ParseOpcode - ASL_FIRST_PARSE_OPCODE) + ASL_YYTNAME_START] + 8);
3584 #else
3585 return ("[Unknown parser generator]");
3586 #endif