1 NoEcho(' 2 /****************************************************************************** 3 * 4 * Module Name: aslrules.y - Bison/Yacc production rules 5 * 6 *****************************************************************************/ 7 8 /* 9 * Copyright (C) 2000 - 2015, Intel Corp. 10 * All rights reserved. 11 * 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. 26 * 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. 30 * 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. 43 */ 44 45 ') 46 47 /******************************************************************************* 48 * 49 * Production rules start here 50 * 51 ******************************************************************************/ 52 53 /* 54 * ASL Names 55 * 56 * Root rule. Allow multiple #line directives before the definition block 57 * to handle output from preprocessors 58 */ 59 ASLCode 60 : DefinitionBlockTerm 61 | error {YYABORT; $$ = NULL;} 62 ; 63 64 /* 65 * Blocks, Data, and Opcodes 66 */ 67 68 /* 69 * Note concerning support for "module-level code". 70 * 71 * ACPI 1.0 allowed Type1 and Type2 executable opcodes outside of control 72 * methods (the so-called module-level code.) This support was explicitly 73 * removed in ACPI 2.0, but this type of code continues to be created by 74 * BIOS vendors. In order to support the disassembly and recompilation of 75 * such code (and the porting of ASL code to iASL), iASL supports this 76 * code in violation of the current ACPI specification. 77 * 78 * The grammar change to support module-level code is to revert the 79 * {ObjectList} portion of the DefinitionBlockTerm in ACPI 2.0 to the 80 * original use of {TermList} instead (see below.) This allows the use 81 * of Type1 and Type2 opcodes at module level. 82 */ 83 DefinitionBlockTerm 84 : PARSEOP_DEFINITIONBLOCK '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DEFINITIONBLOCK);} 85 String ',' 86 String ',' 87 ByteConst ',' 88 String ',' 89 String ',' 90 DWordConst 91 ')' {TrSetEndLineNumber ($<n>3);} 92 '{' TermList '}' {$$ = TrLinkChildren ($<n>3,7,$4,$6,$8,$10,$12,$14,$18);} 93 ; 94 95 /* 96 * ASL Extensions: C-style math/logical operators and expressions. 97 * The implementation transforms these operators into the standard 98 * AML opcodes and syntax. 99 * 100 * Supported operators and precedence rules (high-to-low) 101 * 102 * NOTE: The operator precedence and associativity rules are 103 * implemented by the tokens in asltokens.y 104 * 105 * (left-to-right): 106 * 1) ( ) expr++ expr-- 107 * 108 * (right-to-left): 109 * 2) ! ~ 110 * 111 * (left-to-right): 112 * 3) * / % 113 * 4) + - 114 * 5) >> << 115 * 6) < > <= >= 116 * 7) == != 117 * 8) & 118 * 9) ^ 119 * 10) | 120 * 11) && 121 * 12) || 122 * 123 * (right-to-left): 124 * 13) = += -= *= /= %= <<= >>= &= ^= |= 125 */ 126 Expression 127 128 /* Unary operators */ 129 130 : PARSEOP_EXP_LOGICAL_NOT {$<n>$ = TrCreateLeafNode (PARSEOP_LNOT);} 131 TermArg {$$ = TrLinkChildren ($<n>2,1,$3);} 132 | PARSEOP_EXP_NOT {$<n>$ = TrCreateLeafNode (PARSEOP_NOT);} 133 TermArg {$$ = TrLinkChildren ($<n>2,2,$3,TrCreateLeafNode (PARSEOP_ZERO));} 134 135 | SuperName PARSEOP_EXP_INCREMENT {$<n>$ = TrCreateLeafNode (PARSEOP_INCREMENT);} 136 {$$ = TrLinkChildren ($<n>3,1,$1);} 137 | SuperName PARSEOP_EXP_DECREMENT {$<n>$ = TrCreateLeafNode (PARSEOP_DECREMENT);} 138 {$$ = TrLinkChildren ($<n>3,1,$1);} 139 140 /* Binary operators: math and logical */ 141 142 | TermArg PARSEOP_EXP_ADD {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);} 143 TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));} 144 | TermArg PARSEOP_EXP_DIVIDE {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);} 145 TermArg {$$ = TrLinkChildren ($<n>3,4,$1,$4,TrCreateLeafNode (PARSEOP_ZERO), 146 TrCreateLeafNode (PARSEOP_ZERO));} 147 | TermArg PARSEOP_EXP_MODULO {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);} 148 TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));} 149 | TermArg PARSEOP_EXP_MULTIPLY {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} 150 TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));} 151 | TermArg PARSEOP_EXP_SHIFT_LEFT {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} 152 TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));} 153 | TermArg PARSEOP_EXP_SHIFT_RIGHT {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} 154 TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));} 155 | TermArg PARSEOP_EXP_SUBTRACT {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);} 156 TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));} 157 158 | TermArg PARSEOP_EXP_AND {$<n>$ = TrCreateLeafNode (PARSEOP_AND);} 159 TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));} 160 | TermArg PARSEOP_EXP_OR {$<n>$ = TrCreateLeafNode (PARSEOP_OR);} 161 TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));} 162 | TermArg PARSEOP_EXP_XOR {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);} 163 TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4,TrCreateLeafNode (PARSEOP_ZERO));} 164 165 | TermArg PARSEOP_EXP_GREATER {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);} 166 TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} 167 | TermArg PARSEOP_EXP_GREATER_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATEREQUAL);} 168 TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} 169 | TermArg PARSEOP_EXP_LESS {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);} 170 TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} 171 | TermArg PARSEOP_EXP_LESS_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LLESSEQUAL);} 172 TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} 173 174 | TermArg PARSEOP_EXP_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);} 175 TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} 176 | TermArg PARSEOP_EXP_NOT_EQUAL {$<n>$ = TrCreateLeafNode (PARSEOP_LNOTEQUAL);} 177 TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} 178 179 | TermArg PARSEOP_EXP_LOGICAL_AND {$<n>$ = TrCreateLeafNode (PARSEOP_LAND);} 180 TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} 181 | TermArg PARSEOP_EXP_LOGICAL_OR {$<n>$ = TrCreateLeafNode (PARSEOP_LOR);} 182 TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} 183 184 /* Parentheses */ 185 186 | '(' TermArg ')' { $$ = $2;} 187 ; 188 189 EqualsTerm 190 191 /* All assignment-type operations */ 192 193 : SuperName PARSEOP_EXP_EQUALS 194 TermArg {$$ = TrCreateAssignmentNode ($1, $3);} 195 196 | TermArg PARSEOP_EXP_ADD_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);} 197 TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, 198 TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} 199 200 | TermArg PARSEOP_EXP_DIV_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);} 201 TermArg {$$ = TrLinkChildren ($<n>3,4,$1,$4,TrCreateLeafNode (PARSEOP_ZERO), 202 TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} 203 204 | TermArg PARSEOP_EXP_MOD_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);} 205 TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, 206 TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} 207 208 | TermArg PARSEOP_EXP_MUL_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} 209 TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, 210 TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} 211 212 | TermArg PARSEOP_EXP_SHL_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} 213 TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, 214 TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} 215 216 | TermArg PARSEOP_EXP_SHR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} 217 TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, 218 TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} 219 220 | TermArg PARSEOP_EXP_SUB_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);} 221 TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, 222 TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} 223 224 | TermArg PARSEOP_EXP_AND_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_AND);} 225 TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, 226 TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} 227 228 | TermArg PARSEOP_EXP_OR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_OR);} 229 TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, 230 TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} 231 232 | TermArg PARSEOP_EXP_XOR_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);} 233 TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, 234 TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} 235 ; 236 237 238 /* ACPI 3.0 -- allow semicolons between terms */ 239 240 TermList 241 : {$$ = NULL;} 242 | TermList Term {$$ = TrLinkPeerNode (TrSetNodeFlags ($1, NODE_RESULT_NOT_USED),$2);} 243 | TermList Term ';' {$$ = TrLinkPeerNode (TrSetNodeFlags ($1, NODE_RESULT_NOT_USED),$2);} 244 | TermList ';' Term {$$ = TrLinkPeerNode (TrSetNodeFlags ($1, NODE_RESULT_NOT_USED),$3);} 245 | TermList ';' Term ';' {$$ = TrLinkPeerNode (TrSetNodeFlags ($1, NODE_RESULT_NOT_USED),$3);} 246 ; 247 248 Term 249 : Object {} 250 | Expression {} 251 | Type1Opcode {} 252 | Type2Opcode {} 253 | Type2IntegerOpcode {} 254 | Type2StringOpcode {} 255 | Type2BufferOpcode {} 256 | Type2BufferOrStringOpcode {} 257 | error {$$ = AslDoError(); yyclearin;} 258 ; 259 260 CompilerDirective 261 : IncludeTerm {} 262 | ExternalTerm {} 263 ; 264 265 ObjectList 266 : {$$ = NULL;} 267 | ObjectList Object {$$ = TrLinkPeerNode ($1,$2);} 268 | error {$$ = AslDoError(); yyclearin;} 269 ; 270 271 Object 272 : CompilerDirective {} 273 | NamedObject {} 274 | NameSpaceModifier {} 275 ; 276 277 DataObject 278 : BufferData {} 279 | PackageData {} 280 | IntegerData {} 281 | StringData {} 282 ; 283 284 BufferData 285 : Type5Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} 286 | Type2BufferOrStringOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} 287 | Type2BufferOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} 288 | BufferTerm {} 289 ; 290 291 PackageData 292 : PackageTerm {} 293 ; 294 295 IntegerData 296 : Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} 297 | Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} 298 | Integer {} 299 | ConstTerm {} 300 ; 301 302 StringData 303 : Type2StringOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST);} 304 | String {} 305 ; 306 307 NamedObject 308 : BankFieldTerm {} 309 | CreateBitFieldTerm {} 310 | CreateByteFieldTerm {} 311 | CreateDWordFieldTerm {} 312 | CreateFieldTerm {} 313 | CreateQWordFieldTerm {} 314 | CreateWordFieldTerm {} 315 | DataRegionTerm {} 316 | DeviceTerm {} 317 | EventTerm {} 318 | FieldTerm {} 319 | FunctionTerm {} 320 | IndexFieldTerm {} 321 | MethodTerm {} 322 | MutexTerm {} 323 | OpRegionTerm {} 324 | PowerResTerm {} 325 | ProcessorTerm {} 326 | ThermalZoneTerm {} 327 ; 328 329 NameSpaceModifier 330 : AliasTerm {} 331 | NameTerm {} 332 | ScopeTerm {} 333 ; 334 335 UserTerm 336 : NameString '(' {TrUpdateNode (PARSEOP_METHODCALL, $1);} 337 ArgList ')' {$$ = TrLinkChildNode ($1,$4);} 338 ; 339 340 ArgList 341 : {$$ = NULL;} 342 | TermArg 343 | ArgList ',' /* Allows a trailing comma at list end */ 344 | ArgList ',' 345 TermArg {$$ = TrLinkPeerNode ($1,$3);} 346 ; 347 348 /* 349 Removed from TermArg due to reduce/reduce conflicts 350 | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} 351 | Type2StringOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} 352 | Type2BufferOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} 353 | Type2BufferOrStringOpcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} 354 355 */ 356 357 TermArg 358 : Expression {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} 359 | Type2Opcode {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} 360 | DataObject {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} 361 | NameString {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} 362 | ArgTerm {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} 363 | LocalTerm {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} 364 ; 365 366 Target 367 : {$$ = TrSetNodeFlags (TrCreateLeafNode (PARSEOP_ZERO), NODE_IS_TARGET | NODE_COMPILE_TIME_CONST);} /* Placeholder is a ZeroOp object */ 368 | ',' {$$ = TrSetNodeFlags (TrCreateLeafNode (PARSEOP_ZERO), NODE_IS_TARGET | NODE_COMPILE_TIME_CONST);} /* Placeholder is a ZeroOp object */ 369 | ',' SuperName {$$ = TrSetNodeFlags ($2, NODE_IS_TARGET);} 370 ; 371 372 RequiredTarget 373 : ',' SuperName {$$ = TrSetNodeFlags ($2, NODE_IS_TARGET);} 374 ; 375 376 SimpleTarget 377 : NameString {} 378 | LocalTerm {} 379 | ArgTerm {} 380 ; 381 382 /* Rules for specifying the type of one method argument or return value */ 383 384 ParameterTypePackage 385 : {$$ = NULL;} 386 | ObjectTypeKeyword {$$ = $1;} 387 | ParameterTypePackage ',' 388 ObjectTypeKeyword {$$ = TrLinkPeerNodes (2,$1,$3);} 389 ; 390 391 ParameterTypePackageList 392 : {$$ = NULL;} 393 | ObjectTypeKeyword {$$ = $1;} 394 | '{' ParameterTypePackage '}' {$$ = $2;} 395 ; 396 397 OptionalParameterTypePackage 398 : {$$ = TrCreateLeafNode (PARSEOP_DEFAULT_ARG);} 399 | ',' ParameterTypePackageList {$$ = TrLinkChildren (TrCreateLeafNode (PARSEOP_DEFAULT_ARG),1,$2);} 400 ; 401 402 /* Rules for specifying the types for method arguments */ 403 404 ParameterTypesPackage 405 : ParameterTypePackageList {$$ = $1;} 406 | ParameterTypesPackage ',' 407 ParameterTypePackageList {$$ = TrLinkPeerNodes (2,$1,$3);} 408 ; 409 410 ParameterTypesPackageList 411 : {$$ = NULL;} 412 | ObjectTypeKeyword {$$ = $1;} 413 | '{' ParameterTypesPackage '}' {$$ = $2;} 414 ; 415 416 OptionalParameterTypesPackage 417 : {$$ = TrCreateLeafNode (PARSEOP_DEFAULT_ARG);} 418 | ',' ParameterTypesPackageList {$$ = TrLinkChildren (TrCreateLeafNode (PARSEOP_DEFAULT_ARG),1,$2);} 419 ; 420 421 422 /* Opcode types */ 423 424 Type1Opcode 425 : BreakTerm {} 426 | BreakPointTerm {} 427 | ContinueTerm {} 428 | FatalTerm {} 429 | IfElseTerm {} 430 | LoadTerm {} 431 | NoOpTerm {} 432 | NotifyTerm {} 433 | ReleaseTerm {} 434 | ResetTerm {} 435 | ReturnTerm {} 436 | SignalTerm {} 437 | SleepTerm {} 438 | StallTerm {} 439 | SwitchTerm {} 440 | UnloadTerm {} 441 | WhileTerm {} 442 ; 443 444 Type2Opcode 445 : AcquireTerm {} 446 | CondRefOfTerm {} 447 | CopyObjectTerm {} 448 | DerefOfTerm {} 449 | ObjectTypeTerm {} 450 | RefOfTerm {} 451 | SizeOfTerm {} 452 | StoreTerm {} 453 | EqualsTerm {} 454 | TimerTerm {} 455 | WaitTerm {} 456 | UserTerm {} 457 ; 458 459 /* 460 * Type 3/4/5 opcodes 461 */ 462 463 Type2IntegerOpcode /* "Type3" opcodes */ 464 : AddTerm {} 465 | AndTerm {} 466 | DecTerm {} 467 | DivideTerm {} 468 | FindSetLeftBitTerm {} 469 | FindSetRightBitTerm {} 470 | FromBCDTerm {} 471 | IncTerm {} 472 | IndexTerm {} 473 | LAndTerm {} 474 | LEqualTerm {} 475 | LGreaterTerm {} 476 | LGreaterEqualTerm {} 477 | LLessTerm {} 478 | LLessEqualTerm {} 479 | LNotTerm {} 480 | LNotEqualTerm {} 481 | LoadTableTerm {} 482 | LOrTerm {} 483 | MatchTerm {} 484 | ModTerm {} 485 | MultiplyTerm {} 486 | NAndTerm {} 487 | NOrTerm {} 488 | NotTerm {} 489 | OrTerm {} 490 | ShiftLeftTerm {} 491 | ShiftRightTerm {} 492 | SubtractTerm {} 493 | ToBCDTerm {} 494 | ToIntegerTerm {} 495 | XOrTerm {} 496 ; 497 498 Type2StringOpcode /* "Type4" Opcodes */ 499 : ToDecimalStringTerm {} 500 | ToHexStringTerm {} 501 | ToStringTerm {} 502 ; 503 504 Type2BufferOpcode /* "Type5" Opcodes */ 505 : ToBufferTerm {} 506 | ConcatResTerm {} 507 ; 508 509 Type2BufferOrStringOpcode 510 : ConcatTerm {} 511 | PrintfTerm {} 512 | FprintfTerm {} 513 | MidTerm {} 514 ; 515 516 /* 517 * A type 3 opcode evaluates to an Integer and cannot have a destination operand 518 */ 519 520 Type3Opcode 521 : EISAIDTerm {} 522 ; 523 524 /* Obsolete 525 Type4Opcode 526 : ConcatTerm {} 527 | ToDecimalStringTerm {} 528 | ToHexStringTerm {} 529 | MidTerm {} 530 | ToStringTerm {} 531 ; 532 */ 533 534 535 Type5Opcode 536 : ResourceTemplateTerm {} 537 | UnicodeTerm {} 538 | ToPLDTerm {} 539 | ToUUIDTerm {} 540 ; 541 542 Type6Opcode 543 : RefOfTerm {} 544 | DerefOfTerm {} 545 | IndexTerm {} 546 | UserTerm {} 547 ; 548 549 IncludeTerm 550 : PARSEOP_INCLUDE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INCLUDE);} 551 String ')' {TrLinkChildren ($<n>3,1,$4);FlOpenIncludeFile ($4);} 552 TermList 553 IncludeEndTerm {$$ = TrLinkPeerNodes (3,$<n>3,$7,$8);} 554 ; 555 556 IncludeEndTerm 557 : PARSEOP_INCLUDE_END {$$ = TrCreateLeafNode (PARSEOP_INCLUDE_END);} 558 ; 559 560 ExternalTerm 561 : PARSEOP_EXTERNAL '(' 562 NameString 563 OptionalObjectTypeKeyword 564 OptionalParameterTypePackage 565 OptionalParameterTypesPackage 566 ')' {$$ = TrCreateNode (PARSEOP_EXTERNAL,4,$3,$4,$5,$6);} 567 | PARSEOP_EXTERNAL '(' 568 error ')' {$$ = AslDoError(); yyclearin;} 569 ; 570 571 572 /******* Named Objects *******************************************************/ 573 574 575 BankFieldTerm 576 : PARSEOP_BANKFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_BANKFIELD);} 577 NameString 578 NameStringItem 579 TermArgItem 580 ',' AccessTypeKeyword 581 ',' LockRuleKeyword 582 ',' UpdateRuleKeyword 583 ')' '{' 584 FieldUnitList '}' {$$ = TrLinkChildren ($<n>3,7,$4,$5,$6,$8,$10,$12,$15);} 585 | PARSEOP_BANKFIELD '(' 586 error ')' '{' error '}' {$$ = AslDoError(); yyclearin;} 587 ; 588 589 FieldUnitList 590 : {$$ = NULL;} 591 | FieldUnit 592 | FieldUnitList ',' /* Allows a trailing comma at list end */ 593 | FieldUnitList ',' 594 FieldUnit {$$ = TrLinkPeerNode ($1,$3);} 595 ; 596 597 FieldUnit 598 : FieldUnitEntry {} 599 | OffsetTerm {} 600 | AccessAsTerm {} 601 | ConnectionTerm {} 602 ; 603 604 FieldUnitEntry 605 : ',' AmlPackageLengthTerm {$$ = TrCreateNode (PARSEOP_RESERVED_BYTES,1,$2);} 606 | NameSeg ',' 607 AmlPackageLengthTerm {$$ = TrLinkChildNode ($1,$3);} 608 ; 609 610 OffsetTerm 611 : PARSEOP_OFFSET '(' 612 AmlPackageLengthTerm 613 ')' {$$ = TrCreateNode (PARSEOP_OFFSET,1,$3);} 614 | PARSEOP_OFFSET '(' 615 error ')' {$$ = AslDoError(); yyclearin;} 616 ; 617 618 AccessAsTerm 619 : PARSEOP_ACCESSAS '(' 620 AccessTypeKeyword 621 OptionalAccessAttribTerm 622 ')' {$$ = TrCreateNode (PARSEOP_ACCESSAS,2,$3,$4);} 623 | PARSEOP_ACCESSAS '(' 624 error ')' {$$ = AslDoError(); yyclearin;} 625 ; 626 627 ConnectionTerm 628 : PARSEOP_CONNECTION '(' 629 NameString 630 ')' {$$ = TrCreateNode (PARSEOP_CONNECTION,1,$3);} 631 | PARSEOP_CONNECTION '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONNECTION);} 632 ResourceMacroTerm 633 ')' {$$ = TrLinkChildren ($<n>3, 1, 634 TrLinkChildren (TrCreateLeafNode (PARSEOP_RESOURCETEMPLATE), 3, 635 TrCreateLeafNode (PARSEOP_DEFAULT_ARG), 636 TrCreateLeafNode (PARSEOP_DEFAULT_ARG), 637 $4));} 638 | PARSEOP_CONNECTION '(' 639 error ')' {$$ = AslDoError(); yyclearin;} 640 ; 641 642 CreateBitFieldTerm 643 : PARSEOP_CREATEBITFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEBITFIELD);} 644 TermArg 645 TermArgItem 646 NameStringItem 647 ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));} 648 | PARSEOP_CREATEBITFIELD '(' 649 error ')' {$$ = AslDoError(); yyclearin;} 650 ; 651 652 CreateByteFieldTerm 653 : PARSEOP_CREATEBYTEFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEBYTEFIELD);} 654 TermArg 655 TermArgItem 656 NameStringItem 657 ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));} 658 | PARSEOP_CREATEBYTEFIELD '(' 659 error ')' {$$ = AslDoError(); yyclearin;} 660 ; 661 662 CreateDWordFieldTerm 663 : PARSEOP_CREATEDWORDFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEDWORDFIELD);} 664 TermArg 665 TermArgItem 666 NameStringItem 667 ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));} 668 | PARSEOP_CREATEDWORDFIELD '(' 669 error ')' {$$ = AslDoError(); yyclearin;} 670 ; 671 672 CreateFieldTerm 673 : PARSEOP_CREATEFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEFIELD);} 674 TermArg 675 TermArgItem 676 TermArgItem 677 NameStringItem 678 ')' {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6,TrSetNodeFlags ($7, NODE_IS_NAME_DECLARATION));} 679 | PARSEOP_CREATEFIELD '(' 680 error ')' {$$ = AslDoError(); yyclearin;} 681 ; 682 683 CreateQWordFieldTerm 684 : PARSEOP_CREATEQWORDFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEQWORDFIELD);} 685 TermArg 686 TermArgItem 687 NameStringItem 688 ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));} 689 | PARSEOP_CREATEQWORDFIELD '(' 690 error ')' {$$ = AslDoError(); yyclearin;} 691 ; 692 693 CreateWordFieldTerm 694 : PARSEOP_CREATEWORDFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEWORDFIELD);} 695 TermArg 696 TermArgItem 697 NameStringItem 698 ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));} 699 | PARSEOP_CREATEWORDFIELD '(' 700 error ')' {$$ = AslDoError(); yyclearin;} 701 ; 702 703 DataRegionTerm 704 : PARSEOP_DATATABLEREGION '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DATATABLEREGION);} 705 NameString 706 TermArgItem 707 TermArgItem 708 TermArgItem 709 ')' {$$ = TrLinkChildren ($<n>3,4,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$5,$6,$7);} 710 | PARSEOP_DATATABLEREGION '(' 711 error ')' {$$ = AslDoError(); yyclearin;} 712 ; 713 714 DeviceTerm 715 : PARSEOP_DEVICE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DEVICE);} 716 NameString 717 ')' '{' 718 ObjectList '}' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} 719 | PARSEOP_DEVICE '(' 720 error ')' {$$ = AslDoError(); yyclearin;} 721 ; 722 723 EventTerm 724 : PARSEOP_EVENT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_EVENT);} 725 NameString 726 ')' {$$ = TrLinkChildren ($<n>3,1,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION));} 727 | PARSEOP_EVENT '(' 728 error ')' {$$ = AslDoError(); yyclearin;} 729 ; 730 731 FieldTerm 732 : PARSEOP_FIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FIELD);} 733 NameString 734 ',' AccessTypeKeyword 735 ',' LockRuleKeyword 736 ',' UpdateRuleKeyword 737 ')' '{' 738 FieldUnitList '}' {$$ = TrLinkChildren ($<n>3,5,$4,$6,$8,$10,$13);} 739 | PARSEOP_FIELD '(' 740 error ')' '{' error '}' {$$ = AslDoError(); yyclearin;} 741 ; 742 743 FunctionTerm 744 : PARSEOP_FUNCTION '(' {$<n>$ = TrCreateLeafNode (PARSEOP_METHOD);} 745 NameString 746 OptionalParameterTypePackage 747 OptionalParameterTypesPackage 748 ')' '{' 749 TermList '}' {$$ = TrLinkChildren ($<n>3,7,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION), 750 TrCreateValuedLeafNode (PARSEOP_BYTECONST, 0), 751 TrCreateLeafNode (PARSEOP_SERIALIZERULE_NOTSERIAL), 752 TrCreateValuedLeafNode (PARSEOP_BYTECONST, 0),$5,$6,$9);} 753 | PARSEOP_FUNCTION '(' 754 error ')' {$$ = AslDoError(); yyclearin;} 755 ; 756 757 IndexFieldTerm 758 : PARSEOP_INDEXFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INDEXFIELD);} 759 NameString 760 NameStringItem 761 ',' AccessTypeKeyword 762 ',' LockRuleKeyword 763 ',' UpdateRuleKeyword 764 ')' '{' 765 FieldUnitList '}' {$$ = TrLinkChildren ($<n>3,6,$4,$5,$7,$9,$11,$14);} 766 | PARSEOP_INDEXFIELD '(' 767 error ')' '{' error '}' {$$ = AslDoError(); yyclearin;} 768 ; 769 770 MethodTerm 771 : PARSEOP_METHOD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_METHOD);} 772 NameString 773 OptionalByteConstExpr {UtCheckIntegerRange ($5, 0, 7);} 774 OptionalSerializeRuleKeyword 775 OptionalByteConstExpr 776 OptionalParameterTypePackage 777 OptionalParameterTypesPackage 778 ')' '{' 779 TermList '}' {$$ = TrLinkChildren ($<n>3,7,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$5,$7,$8,$9,$10,$13);} 780 | PARSEOP_METHOD '(' 781 error ')' {$$ = AslDoError(); yyclearin;} 782 ; 783 784 MutexTerm 785 : PARSEOP_MUTEX '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MUTEX);} 786 NameString 787 ',' ByteConstExpr 788 ')' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6);} 789 | PARSEOP_MUTEX '(' 790 error ')' {$$ = AslDoError(); yyclearin;} 791 ; 792 793 OpRegionTerm 794 : PARSEOP_OPERATIONREGION '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OPERATIONREGION);} 795 NameString 796 ',' OpRegionSpaceIdTerm 797 TermArgItem 798 TermArgItem 799 ')' {$$ = TrLinkChildren ($<n>3,4,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$7,$8);} 800 | PARSEOP_OPERATIONREGION '(' 801 error ')' {$$ = AslDoError(); yyclearin;} 802 ; 803 804 OpRegionSpaceIdTerm 805 : RegionSpaceKeyword {} 806 | ByteConst {$$ = UtCheckIntegerRange ($1, 0x80, 0xFF);} 807 ; 808 809 PowerResTerm 810 : PARSEOP_POWERRESOURCE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_POWERRESOURCE);} 811 NameString 812 ',' ByteConstExpr 813 ',' WordConstExpr 814 ')' '{' 815 ObjectList '}' {$$ = TrLinkChildren ($<n>3,4,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$8,$11);} 816 | PARSEOP_POWERRESOURCE '(' 817 error ')' {$$ = AslDoError(); yyclearin;} 818 ; 819 820 ProcessorTerm 821 : PARSEOP_PROCESSOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_PROCESSOR);} 822 NameString 823 ',' ByteConstExpr 824 OptionalDWordConstExpr 825 OptionalByteConstExpr 826 ')' '{' 827 ObjectList '}' {$$ = TrLinkChildren ($<n>3,5,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$7,$8,$11);} 828 | PARSEOP_PROCESSOR '(' 829 error ')' {$$ = AslDoError(); yyclearin;} 830 ; 831 832 ThermalZoneTerm 833 : PARSEOP_THERMALZONE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_THERMALZONE);} 834 NameString 835 ')' '{' 836 ObjectList '}' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} 837 | PARSEOP_THERMALZONE '(' 838 error ')' {$$ = AslDoError(); yyclearin;} 839 ; 840 841 842 /******* Namespace modifiers *************************************************/ 843 844 845 AliasTerm 846 : PARSEOP_ALIAS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ALIAS);} 847 NameString 848 NameStringItem 849 ')' {$$ = TrLinkChildren ($<n>3,2,$4,TrSetNodeFlags ($5, NODE_IS_NAME_DECLARATION));} 850 | PARSEOP_ALIAS '(' 851 error ')' {$$ = AslDoError(); yyclearin;} 852 ; 853 854 NameTerm 855 : PARSEOP_NAME '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NAME);} 856 NameString 857 ',' DataObject 858 ')' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6);} 859 | PARSEOP_NAME '(' 860 error ')' {$$ = AslDoError(); yyclearin;} 861 ; 862 863 ScopeTerm 864 : PARSEOP_SCOPE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SCOPE);} 865 NameString 866 ')' '{' 867 ObjectList '}' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} 868 | PARSEOP_SCOPE '(' 869 error ')' {$$ = AslDoError(); yyclearin;} 870 ; 871 872 873 /******* Type 1 opcodes *******************************************************/ 874 875 876 BreakTerm 877 : PARSEOP_BREAK {$$ = TrCreateNode (PARSEOP_BREAK, 0);} 878 ; 879 880 BreakPointTerm 881 : PARSEOP_BREAKPOINT {$$ = TrCreateNode (PARSEOP_BREAKPOINT, 0);} 882 ; 883 884 ContinueTerm 885 : PARSEOP_CONTINUE {$$ = TrCreateNode (PARSEOP_CONTINUE, 0);} 886 ; 887 888 FatalTerm 889 : PARSEOP_FATAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FATAL);} 890 ByteConstExpr 891 ',' DWordConstExpr 892 TermArgItem 893 ')' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);} 894 | PARSEOP_FATAL '(' 895 error ')' {$$ = AslDoError(); yyclearin;} 896 ; 897 898 IfElseTerm 899 : IfTerm ElseTerm {$$ = TrLinkPeerNode ($1,$2);} 900 ; 901 902 IfTerm 903 : PARSEOP_IF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_IF);} 904 TermArg 905 ')' '{' 906 TermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} 907 908 | PARSEOP_IF '(' 909 error ')' {$$ = AslDoError(); yyclearin;} 910 ; 911 912 ElseTerm 913 : {$$ = NULL;} 914 | PARSEOP_ELSE '{' {$<n>$ = TrCreateLeafNode (PARSEOP_ELSE);} 915 TermList '}' {$$ = TrLinkChildren ($<n>3,1,$4);} 916 917 | PARSEOP_ELSE '{' 918 error '}' {$$ = AslDoError(); yyclearin;} 919 920 | PARSEOP_ELSE 921 error {$$ = AslDoError(); yyclearin;} 922 923 | PARSEOP_ELSEIF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ELSE);} 924 TermArg {$<n>$ = TrCreateLeafNode (PARSEOP_IF);} 925 ')' '{' 926 TermList '}' {TrLinkChildren ($<n>5,2,$4,$8);} 927 ElseTerm {TrLinkPeerNode ($<n>5,$11);} 928 {$$ = TrLinkChildren ($<n>3,1,$<n>5);} 929 930 | PARSEOP_ELSEIF '(' 931 error ')' {$$ = AslDoError(); yyclearin;} 932 933 | PARSEOP_ELSEIF 934 error {$$ = AslDoError(); yyclearin;} 935 ; 936 937 LoadTerm 938 : PARSEOP_LOAD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LOAD);} 939 NameString 940 RequiredTarget 941 ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} 942 | PARSEOP_LOAD '(' 943 error ')' {$$ = AslDoError(); yyclearin;} 944 ; 945 946 NoOpTerm 947 : PARSEOP_NOOP {$$ = TrCreateNode (PARSEOP_NOOP, 0);} 948 ; 949 950 NotifyTerm 951 : PARSEOP_NOTIFY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOTIFY);} 952 SuperName 953 TermArgItem 954 ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} 955 | PARSEOP_NOTIFY '(' 956 error ')' {$$ = AslDoError(); yyclearin;} 957 ; 958 959 ReleaseTerm 960 : PARSEOP_RELEASE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RELEASE);} 961 SuperName 962 ')' {$$ = TrLinkChildren ($<n>3,1,$4);} 963 | PARSEOP_RELEASE '(' 964 error ')' {$$ = AslDoError(); yyclearin;} 965 ; 966 967 ResetTerm 968 : PARSEOP_RESET '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RESET);} 969 SuperName 970 ')' {$$ = TrLinkChildren ($<n>3,1,$4);} 971 | PARSEOP_RESET '(' 972 error ')' {$$ = AslDoError(); yyclearin;} 973 ; 974 975 ReturnTerm 976 : PARSEOP_RETURN '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RETURN);} 977 OptionalReturnArg 978 ')' {$$ = TrLinkChildren ($<n>3,1,$4);} 979 | PARSEOP_RETURN {$$ = TrLinkChildren (TrCreateLeafNode (PARSEOP_RETURN),1,TrSetNodeFlags (TrCreateLeafNode (PARSEOP_ZERO), NODE_IS_NULL_RETURN));} 980 | PARSEOP_RETURN '(' 981 error ')' {$$ = AslDoError(); yyclearin;} 982 ; 983 984 SignalTerm 985 : PARSEOP_SIGNAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SIGNAL);} 986 SuperName 987 ')' {$$ = TrLinkChildren ($<n>3,1,$4);} 988 | PARSEOP_SIGNAL '(' 989 error ')' {$$ = AslDoError(); yyclearin;} 990 ; 991 992 SleepTerm 993 : PARSEOP_SLEEP '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SLEEP);} 994 TermArg 995 ')' {$$ = TrLinkChildren ($<n>3,1,$4);} 996 | PARSEOP_SLEEP '(' 997 error ')' {$$ = AslDoError(); yyclearin;} 998 ; 999 1000 StallTerm 1001 : PARSEOP_STALL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STALL);} 1002 TermArg 1003 ')' {$$ = TrLinkChildren ($<n>3,1,$4);} 1004 | PARSEOP_STALL '(' 1005 error ')' {$$ = AslDoError(); yyclearin;} 1006 ; 1007 1008 SwitchTerm 1009 : PARSEOP_SWITCH '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SWITCH);} 1010 TermArg 1011 ')' '{' 1012 CaseDefaultTermList '}' 1013 {$$ = TrLinkChildren ($<n>3,2,$4,$7);} 1014 | PARSEOP_SWITCH '(' 1015 error ')' {$$ = AslDoError(); yyclearin;} 1016 ; 1017 1018 /* 1019 * Case-Default list; allow only one Default term and unlimited Case terms 1020 */ 1021 1022 CaseDefaultTermList 1023 : {$$ = NULL;} 1024 | CaseTerm {} 1025 | DefaultTerm {} 1026 | CaseDefaultTermList 1027 CaseTerm {$$ = TrLinkPeerNode ($1,$2);} 1028 | CaseDefaultTermList 1029 DefaultTerm {$$ = TrLinkPeerNode ($1,$2);} 1030 1031 /* Original - attempts to force zero or one default term within the switch */ 1032 1033 /* 1034 CaseDefaultTermList 1035 : {$$ = NULL;} 1036 | CaseTermList 1037 DefaultTerm 1038 CaseTermList {$$ = TrLinkPeerNode ($1,TrLinkPeerNode ($2, $3));} 1039 | CaseTermList 1040 CaseTerm {$$ = TrLinkPeerNode ($1,$2);} 1041 ; 1042 1043 CaseTermList 1044 : {$$ = NULL;} 1045 | CaseTerm {} 1046 | CaseTermList 1047 CaseTerm {$$ = TrLinkPeerNode ($1,$2);} 1048 ; 1049 */ 1050 1051 CaseTerm 1052 : PARSEOP_CASE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CASE);} 1053 DataObject 1054 ')' '{' 1055 TermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} 1056 | PARSEOP_CASE '(' 1057 error ')' {$$ = AslDoError(); yyclearin;} 1058 ; 1059 1060 DefaultTerm 1061 : PARSEOP_DEFAULT '{' {$<n>$ = TrCreateLeafNode (PARSEOP_DEFAULT);} 1062 TermList '}' {$$ = TrLinkChildren ($<n>3,1,$4);} 1063 | PARSEOP_DEFAULT '{' 1064 error '}' {$$ = AslDoError(); yyclearin;} 1065 ; 1066 1067 UnloadTerm 1068 : PARSEOP_UNLOAD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UNLOAD);} 1069 SuperName 1070 ')' {$$ = TrLinkChildren ($<n>3,1,$4);} 1071 | PARSEOP_UNLOAD '(' 1072 error ')' {$$ = AslDoError(); yyclearin;} 1073 ; 1074 1075 WhileTerm 1076 : PARSEOP_WHILE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WHILE);} 1077 TermArg 1078 ')' '{' TermList '}' 1079 {$$ = TrLinkChildren ($<n>3,2,$4,$7);} 1080 | PARSEOP_WHILE '(' 1081 error ')' {$$ = AslDoError(); yyclearin;} 1082 ; 1083 1084 1085 /******* Type 2 opcodes *******************************************************/ 1086 1087 AcquireTerm 1088 : PARSEOP_ACQUIRE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACQUIRE);} 1089 SuperName 1090 ',' WordConstExpr 1091 ')' {$$ = TrLinkChildren ($<n>3,2,$4,$6);} 1092 | PARSEOP_ACQUIRE '(' 1093 error ')' {$$ = AslDoError(); yyclearin;} 1094 ; 1095 1096 AddTerm 1097 : PARSEOP_ADD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);} 1098 TermArg 1099 TermArgItem 1100 Target 1101 ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} 1102 | PARSEOP_ADD '(' 1103 error ')' {$$ = AslDoError(); yyclearin;} 1104 ; 1105 1106 AndTerm 1107 : PARSEOP_AND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_AND);} 1108 TermArg 1109 TermArgItem 1110 Target 1111 ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} 1112 | PARSEOP_AND '(' 1113 error ')' {$$ = AslDoError(); yyclearin;} 1114 ; 1115 1116 ConcatTerm 1117 : PARSEOP_CONCATENATE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONCATENATE);} 1118 TermArg 1119 TermArgItem 1120 Target 1121 ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} 1122 | PARSEOP_CONCATENATE '(' 1123 error ')' {$$ = AslDoError(); yyclearin;} 1124 ; 1125 1126 ConcatResTerm 1127 : PARSEOP_CONCATENATERESTEMPLATE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONCATENATERESTEMPLATE);} 1128 TermArg 1129 TermArgItem 1130 Target 1131 ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} 1132 | PARSEOP_CONCATENATERESTEMPLATE '(' 1133 error ')' {$$ = AslDoError(); yyclearin;} 1134 ; 1135 1136 CondRefOfTerm 1137 : PARSEOP_CONDREFOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONDREFOF);} 1138 SuperName 1139 Target 1140 ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} 1141 | PARSEOP_CONDREFOF '(' 1142 error ')' {$$ = AslDoError(); yyclearin;} 1143 ; 1144 1145 CopyObjectTerm 1146 : PARSEOP_COPYOBJECT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_COPYOBJECT);} 1147 TermArg 1148 ',' SimpleTarget 1149 ')' {$$ = TrLinkChildren ($<n>3,2,$4,TrSetNodeFlags ($6, NODE_IS_TARGET));} 1150 | PARSEOP_COPYOBJECT '(' 1151 error ')' {$$ = AslDoError(); yyclearin;} 1152 ; 1153 1154 DecTerm 1155 : PARSEOP_DECREMENT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DECREMENT);} 1156 SuperName 1157 ')' {$$ = TrLinkChildren ($<n>3,1,$4);} 1158 | PARSEOP_DECREMENT '(' 1159 error ')' {$$ = AslDoError(); yyclearin;} 1160 ; 1161 1162 DerefOfTerm 1163 : PARSEOP_DEREFOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DEREFOF);} 1164 TermArg 1165 ')' {$$ = TrLinkChildren ($<n>3,1,$4);} 1166 | PARSEOP_DEREFOF '(' 1167 error ')' {$$ = AslDoError(); yyclearin;} 1168 ; 1169 1170 DivideTerm 1171 : PARSEOP_DIVIDE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);} 1172 TermArg 1173 TermArgItem 1174 Target 1175 Target 1176 ')' {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6,$7);} 1177 | PARSEOP_DIVIDE '(' 1178 error ')' {$$ = AslDoError(); yyclearin;} 1179 ; 1180 1181 FindSetLeftBitTerm 1182 : PARSEOP_FINDSETLEFTBIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FINDSETLEFTBIT);} 1183 TermArg 1184 Target 1185 ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} 1186 | PARSEOP_FINDSETLEFTBIT '(' 1187 error ')' {$$ = AslDoError(); yyclearin;} 1188 ; 1189 1190 FindSetRightBitTerm 1191 : PARSEOP_FINDSETRIGHTBIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FINDSETRIGHTBIT);} 1192 TermArg 1193 Target 1194 ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} 1195 | PARSEOP_FINDSETRIGHTBIT '(' 1196 error ')' {$$ = AslDoError(); yyclearin;} 1197 ; 1198 1199 FromBCDTerm 1200 : PARSEOP_FROMBCD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FROMBCD);} 1201 TermArg 1202 Target 1203 ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} 1204 | PARSEOP_FROMBCD '(' 1205 error ')' {$$ = AslDoError(); yyclearin;} 1206 ; 1207 1208 IncTerm 1209 : PARSEOP_INCREMENT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INCREMENT);} 1210 SuperName 1211 ')' {$$ = TrLinkChildren ($<n>3,1,$4);} 1212 | PARSEOP_INCREMENT '(' 1213 error ')' {$$ = AslDoError(); yyclearin;} 1214 ; 1215 1216 IndexTerm 1217 : PARSEOP_INDEX '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INDEX);} 1218 TermArg 1219 TermArgItem 1220 Target 1221 ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} 1222 | PARSEOP_INDEX '(' 1223 error ')' {$$ = AslDoError(); yyclearin;} 1224 ; 1225 1226 LAndTerm 1227 : PARSEOP_LAND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LAND);} 1228 TermArg 1229 TermArgItem 1230 ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} 1231 | PARSEOP_LAND '(' 1232 error ')' {$$ = AslDoError(); yyclearin;} 1233 ; 1234 1235 LEqualTerm 1236 : PARSEOP_LEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);} 1237 TermArg 1238 TermArgItem 1239 ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} 1240 | PARSEOP_LEQUAL '(' 1241 error ')' {$$ = AslDoError(); yyclearin;} 1242 ; 1243 1244 LGreaterTerm 1245 : PARSEOP_LGREATER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);} 1246 TermArg 1247 TermArgItem 1248 ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} 1249 | PARSEOP_LGREATER '(' 1250 error ')' {$$ = AslDoError(); yyclearin;} 1251 ; 1252 1253 LGreaterEqualTerm 1254 : PARSEOP_LGREATEREQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);} 1255 TermArg 1256 TermArgItem 1257 ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($<n>3,2,$4,$5));} 1258 | PARSEOP_LGREATEREQUAL '(' 1259 error ')' {$$ = AslDoError(); yyclearin;} 1260 ; 1261 1262 LLessTerm 1263 : PARSEOP_LLESS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);} 1264 TermArg 1265 TermArgItem 1266 ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} 1267 | PARSEOP_LLESS '(' 1268 error ')' {$$ = AslDoError(); yyclearin;} 1269 ; 1270 1271 LLessEqualTerm 1272 : PARSEOP_LLESSEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);} 1273 TermArg 1274 TermArgItem 1275 ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($<n>3,2,$4,$5));} 1276 | PARSEOP_LLESSEQUAL '(' 1277 error ')' {$$ = AslDoError(); yyclearin;} 1278 ; 1279 1280 LNotTerm 1281 : PARSEOP_LNOT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LNOT);} 1282 TermArg 1283 ')' {$$ = TrLinkChildren ($<n>3,1,$4);} 1284 | PARSEOP_LNOT '(' 1285 error ')' {$$ = AslDoError(); yyclearin;} 1286 ; 1287 1288 LNotEqualTerm 1289 : PARSEOP_LNOTEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);} 1290 TermArg 1291 TermArgItem 1292 ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($<n>3,2,$4,$5));} 1293 | PARSEOP_LNOTEQUAL '(' 1294 error ')' {$$ = AslDoError(); yyclearin;} 1295 ; 1296 1297 LoadTableTerm 1298 : PARSEOP_LOADTABLE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LOADTABLE);} 1299 TermArg 1300 TermArgItem 1301 TermArgItem 1302 OptionalListString 1303 OptionalListString 1304 OptionalReference 1305 ')' {$$ = TrLinkChildren ($<n>3,6,$4,$5,$6,$7,$8,$9);} 1306 | PARSEOP_LOADTABLE '(' 1307 error ')' {$$ = AslDoError(); yyclearin;} 1308 ; 1309 1310 LOrTerm 1311 : PARSEOP_LOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LOR);} 1312 TermArg 1313 TermArgItem 1314 ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} 1315 | PARSEOP_LOR '(' 1316 error ')' {$$ = AslDoError(); yyclearin;} 1317 ; 1318 1319 MatchTerm 1320 : PARSEOP_MATCH '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MATCH);} 1321 TermArg 1322 ',' MatchOpKeyword 1323 TermArgItem 1324 ',' MatchOpKeyword 1325 TermArgItem 1326 TermArgItem 1327 ')' {$$ = TrLinkChildren ($<n>3,6,$4,$6,$7,$9,$10,$11);} 1328 | PARSEOP_MATCH '(' 1329 error ')' {$$ = AslDoError(); yyclearin;} 1330 ; 1331 1332 MidTerm 1333 : PARSEOP_MID '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MID);} 1334 TermArg 1335 TermArgItem 1336 TermArgItem 1337 Target 1338 ')' {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6,$7);} 1339 | PARSEOP_MID '(' 1340 error ')' {$$ = AslDoError(); yyclearin;} 1341 ; 1342 1343 ModTerm 1344 : PARSEOP_MOD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);} 1345 TermArg 1346 TermArgItem 1347 Target 1348 ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} 1349 | PARSEOP_MOD '(' 1350 error ')' {$$ = AslDoError(); yyclearin;} 1351 ; 1352 1353 MultiplyTerm 1354 : PARSEOP_MULTIPLY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} 1355 TermArg 1356 TermArgItem 1357 Target 1358 ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} 1359 | PARSEOP_MULTIPLY '(' 1360 error ')' {$$ = AslDoError(); yyclearin;} 1361 ; 1362 1363 NAndTerm 1364 : PARSEOP_NAND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NAND);} 1365 TermArg 1366 TermArgItem 1367 Target 1368 ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} 1369 | PARSEOP_NAND '(' 1370 error ')' {$$ = AslDoError(); yyclearin;} 1371 ; 1372 1373 NOrTerm 1374 : PARSEOP_NOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOR);} 1375 TermArg 1376 TermArgItem 1377 Target 1378 ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} 1379 | PARSEOP_NOR '(' 1380 error ')' {$$ = AslDoError(); yyclearin;} 1381 ; 1382 1383 NotTerm 1384 : PARSEOP_NOT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOT);} 1385 TermArg 1386 Target 1387 ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} 1388 | PARSEOP_NOT '(' 1389 error ')' {$$ = AslDoError(); yyclearin;} 1390 ; 1391 1392 ObjectTypeTerm 1393 : PARSEOP_OBJECTTYPE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE);} 1394 ObjectTypeName 1395 ')' {$$ = TrLinkChildren ($<n>3,1,$4);} 1396 | PARSEOP_OBJECTTYPE '(' 1397 error ')' {$$ = AslDoError(); yyclearin;} 1398 ; 1399 1400 OrTerm 1401 : PARSEOP_OR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OR);} 1402 TermArg 1403 TermArgItem 1404 Target 1405 ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} 1406 | PARSEOP_OR '(' 1407 error ')' {$$ = AslDoError(); yyclearin;} 1408 ; 1409 1410 /* 1411 * In RefOf, the node isn't really a target, but we can't keep track of it after 1412 * we've taken a pointer to it. (hard to tell if a local becomes initialized this way.) 1413 */ 1414 RefOfTerm 1415 : PARSEOP_REFOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_REFOF);} 1416 SuperName 1417 ')' {$$ = TrLinkChildren ($<n>3,1,TrSetNodeFlags ($4, NODE_IS_TARGET));} 1418 | PARSEOP_REFOF '(' 1419 error ')' {$$ = AslDoError(); yyclearin;} 1420 ; 1421 1422 ShiftLeftTerm 1423 : PARSEOP_SHIFTLEFT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} 1424 TermArg 1425 TermArgItem 1426 Target 1427 ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} 1428 | PARSEOP_SHIFTLEFT '(' 1429 error ')' {$$ = AslDoError(); yyclearin;} 1430 ; 1431 1432 ShiftRightTerm 1433 : PARSEOP_SHIFTRIGHT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} 1434 TermArg 1435 TermArgItem 1436 Target 1437 ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} 1438 | PARSEOP_SHIFTRIGHT '(' 1439 error ')' {$$ = AslDoError(); yyclearin;} 1440 ; 1441 1442 SizeOfTerm 1443 : PARSEOP_SIZEOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SIZEOF);} 1444 SuperName 1445 ')' {$$ = TrLinkChildren ($<n>3,1,$4);} 1446 | PARSEOP_SIZEOF '(' 1447 error ')' {$$ = AslDoError(); yyclearin;} 1448 ; 1449 1450 StoreTerm 1451 : PARSEOP_STORE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STORE);} 1452 TermArg 1453 ',' SuperName 1454 ')' {$$ = TrLinkChildren ($<n>3,2,$4,TrSetNodeFlags ($6, NODE_IS_TARGET));} 1455 | PARSEOP_STORE '(' 1456 error ')' {$$ = AslDoError(); yyclearin;} 1457 ; 1458 1459 SubtractTerm 1460 : PARSEOP_SUBTRACT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);} 1461 TermArg 1462 TermArgItem 1463 Target 1464 ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} 1465 | PARSEOP_SUBTRACT '(' 1466 error ')' {$$ = AslDoError(); yyclearin;} 1467 ; 1468 1469 TimerTerm 1470 : PARSEOP_TIMER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TIMER);} 1471 ')' {$$ = TrLinkChildren ($<n>3,0);} 1472 | PARSEOP_TIMER {$$ = TrLinkChildren (TrCreateLeafNode (PARSEOP_TIMER),0);} 1473 | PARSEOP_TIMER '(' 1474 error ')' {$$ = AslDoError(); yyclearin;} 1475 ; 1476 1477 ToBCDTerm 1478 : PARSEOP_TOBCD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOBCD);} 1479 TermArg 1480 Target 1481 ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} 1482 | PARSEOP_TOBCD '(' 1483 error ')' {$$ = AslDoError(); yyclearin;} 1484 ; 1485 1486 ToBufferTerm 1487 : PARSEOP_TOBUFFER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOBUFFER);} 1488 TermArg 1489 Target 1490 ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} 1491 | PARSEOP_TOBUFFER '(' 1492 error ')' {$$ = AslDoError(); yyclearin;} 1493 ; 1494 1495 ToDecimalStringTerm 1496 : PARSEOP_TODECIMALSTRING '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TODECIMALSTRING);} 1497 TermArg 1498 Target 1499 ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} 1500 | PARSEOP_TODECIMALSTRING '(' 1501 error ')' {$$ = AslDoError(); yyclearin;} 1502 ; 1503 1504 ToHexStringTerm 1505 : PARSEOP_TOHEXSTRING '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOHEXSTRING);} 1506 TermArg 1507 Target 1508 ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} 1509 | PARSEOP_TOHEXSTRING '(' 1510 error ')' {$$ = AslDoError(); yyclearin;} 1511 ; 1512 1513 ToIntegerTerm 1514 : PARSEOP_TOINTEGER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOINTEGER);} 1515 TermArg 1516 Target 1517 ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} 1518 | PARSEOP_TOINTEGER '(' 1519 error ')' {$$ = AslDoError(); yyclearin;} 1520 ; 1521 1522 PldKeyword 1523 : PARSEOP_PLD_REVISION {$$ = TrCreateLeafNode (PARSEOP_PLD_REVISION);} 1524 | PARSEOP_PLD_IGNORECOLOR {$$ = TrCreateLeafNode (PARSEOP_PLD_IGNORECOLOR);} 1525 | PARSEOP_PLD_RED {$$ = TrCreateLeafNode (PARSEOP_PLD_RED);} 1526 | PARSEOP_PLD_GREEN {$$ = TrCreateLeafNode (PARSEOP_PLD_GREEN);} 1527 | PARSEOP_PLD_BLUE {$$ = TrCreateLeafNode (PARSEOP_PLD_BLUE);} 1528 | PARSEOP_PLD_WIDTH {$$ = TrCreateLeafNode (PARSEOP_PLD_WIDTH);} 1529 | PARSEOP_PLD_HEIGHT {$$ = TrCreateLeafNode (PARSEOP_PLD_HEIGHT);} 1530 | PARSEOP_PLD_USERVISIBLE {$$ = TrCreateLeafNode (PARSEOP_PLD_USERVISIBLE);} 1531 | PARSEOP_PLD_DOCK {$$ = TrCreateLeafNode (PARSEOP_PLD_DOCK);} 1532 | PARSEOP_PLD_LID {$$ = TrCreateLeafNode (PARSEOP_PLD_LID);} 1533 | PARSEOP_PLD_PANEL {$$ = TrCreateLeafNode (PARSEOP_PLD_PANEL);} 1534 | PARSEOP_PLD_VERTICALPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_VERTICALPOSITION);} 1535 | PARSEOP_PLD_HORIZONTALPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_HORIZONTALPOSITION);} 1536 | PARSEOP_PLD_SHAPE {$$ = TrCreateLeafNode (PARSEOP_PLD_SHAPE);} 1537 | PARSEOP_PLD_GROUPORIENTATION {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPORIENTATION);} 1538 | PARSEOP_PLD_GROUPTOKEN {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPTOKEN);} 1539 | PARSEOP_PLD_GROUPPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPPOSITION);} 1540 | PARSEOP_PLD_BAY {$$ = TrCreateLeafNode (PARSEOP_PLD_BAY);} 1541 | PARSEOP_PLD_EJECTABLE {$$ = TrCreateLeafNode (PARSEOP_PLD_EJECTABLE);} 1542 | PARSEOP_PLD_EJECTREQUIRED {$$ = TrCreateLeafNode (PARSEOP_PLD_EJECTREQUIRED);} 1543 | PARSEOP_PLD_CABINETNUMBER {$$ = TrCreateLeafNode (PARSEOP_PLD_CABINETNUMBER);} 1544 | PARSEOP_PLD_CARDCAGENUMBER {$$ = TrCreateLeafNode (PARSEOP_PLD_CARDCAGENUMBER);} 1545 | PARSEOP_PLD_REFERENCE {$$ = TrCreateLeafNode (PARSEOP_PLD_REFERENCE);} 1546 | PARSEOP_PLD_ROTATION {$$ = TrCreateLeafNode (PARSEOP_PLD_ROTATION);} 1547 | PARSEOP_PLD_ORDER {$$ = TrCreateLeafNode (PARSEOP_PLD_ORDER);} 1548 | PARSEOP_PLD_RESERVED {$$ = TrCreateLeafNode (PARSEOP_PLD_RESERVED);} 1549 | PARSEOP_PLD_VERTICALOFFSET {$$ = TrCreateLeafNode (PARSEOP_PLD_VERTICALOFFSET);} 1550 | PARSEOP_PLD_HORIZONTALOFFSET {$$ = TrCreateLeafNode (PARSEOP_PLD_HORIZONTALOFFSET);} 1551 ; 1552 1553 PldKeywordList 1554 : {$$ = NULL;} 1555 | PldKeyword 1556 PARSEOP_EXP_EQUALS Integer {$$ = TrLinkChildren ($1,1,$3);} 1557 | PldKeyword 1558 PARSEOP_EXP_EQUALS String {$$ = TrLinkChildren ($1,1,$3);} 1559 | PldKeywordList ',' /* Allows a trailing comma at list end */ 1560 | PldKeywordList ',' 1561 PldKeyword 1562 PARSEOP_EXP_EQUALS Integer {$$ = TrLinkPeerNode ($1,TrLinkChildren ($3,1,$5));} 1563 | PldKeywordList ',' 1564 PldKeyword 1565 PARSEOP_EXP_EQUALS String {$$ = TrLinkPeerNode ($1,TrLinkChildren ($3,1,$5));} 1566 ; 1567 1568 ToPLDTerm 1569 : PARSEOP_TOPLD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOPLD);} 1570 PldKeywordList 1571 ')' {$$ = TrLinkChildren ($<n>3,1,$4);} 1572 | PARSEOP_TOPLD '(' 1573 error ')' {$$ = AslDoError(); yyclearin;} 1574 ; 1575 1576 PrintfArgList 1577 : {$$ = NULL;} 1578 | TermArg {$$ = $1;} 1579 | PrintfArgList ',' 1580 TermArg {$$ = TrLinkPeerNode ($1, $3);} 1581 ; 1582 1583 PrintfTerm 1584 : PARSEOP_PRINTF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_PRINTF);} 1585 StringData 1586 PrintfArgList 1587 ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} 1588 | PARSEOP_PRINTF '(' 1589 error ')' {$$ = AslDoError(); yyclearin;} 1590 ; 1591 1592 FprintfTerm 1593 : PARSEOP_FPRINTF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FPRINTF);} 1594 TermArg ',' 1595 StringData 1596 PrintfArgList 1597 ')' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);} 1598 | PARSEOP_FPRINTF '(' 1599 error ')' {$$ = AslDoError(); yyclearin;} 1600 ; 1601 1602 ToStringTerm 1603 : PARSEOP_TOSTRING '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOSTRING);} 1604 TermArg 1605 OptionalCount 1606 Target 1607 ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} 1608 | PARSEOP_TOSTRING '(' 1609 error ')' {$$ = AslDoError(); yyclearin;} 1610 ; 1611 1612 ToUUIDTerm 1613 : PARSEOP_TOUUID '(' 1614 StringData ')' {$$ = TrUpdateNode (PARSEOP_TOUUID, $3);} 1615 | PARSEOP_TOUUID '(' 1616 error ')' {$$ = AslDoError(); yyclearin;} 1617 ; 1618 1619 WaitTerm 1620 : PARSEOP_WAIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WAIT);} 1621 SuperName 1622 TermArgItem 1623 ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} 1624 | PARSEOP_WAIT '(' 1625 error ')' {$$ = AslDoError(); yyclearin;} 1626 ; 1627 1628 XOrTerm 1629 : PARSEOP_XOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);} 1630 TermArg 1631 TermArgItem 1632 Target 1633 ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} 1634 | PARSEOP_XOR '(' 1635 error ')' {$$ = AslDoError(); yyclearin;} 1636 ; 1637 1638 1639 /******* Keywords *************************************************************/ 1640 1641 1642 AccessAttribKeyword 1643 : PARSEOP_ACCESSATTRIB_BLOCK {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_BLOCK);} 1644 | PARSEOP_ACCESSATTRIB_BLOCK_CALL {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_BLOCK_CALL);} 1645 | PARSEOP_ACCESSATTRIB_BYTE {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_BYTE);} 1646 | PARSEOP_ACCESSATTRIB_QUICK {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_QUICK );} 1647 | PARSEOP_ACCESSATTRIB_SND_RCV {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_SND_RCV);} 1648 | PARSEOP_ACCESSATTRIB_WORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_WORD);} 1649 | PARSEOP_ACCESSATTRIB_WORD_CALL {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_WORD_CALL);} 1650 | PARSEOP_ACCESSATTRIB_MULTIBYTE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_MULTIBYTE);} 1651 ByteConst 1652 ')' {$$ = TrLinkChildren ($<n>3,1,$4);} 1653 | PARSEOP_ACCESSATTRIB_RAW_BYTES '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_RAW_BYTES);} 1654 ByteConst 1655 ')' {$$ = TrLinkChildren ($<n>3,1,$4);} 1656 | PARSEOP_ACCESSATTRIB_RAW_PROCESS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_RAW_PROCESS);} 1657 ByteConst 1658 ')' {$$ = TrLinkChildren ($<n>3,1,$4);} 1659 ; 1660 1661 AccessTypeKeyword 1662 : PARSEOP_ACCESSTYPE_ANY {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_ANY);} 1663 | PARSEOP_ACCESSTYPE_BYTE {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_BYTE);} 1664 | PARSEOP_ACCESSTYPE_WORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_WORD);} 1665 | PARSEOP_ACCESSTYPE_DWORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_DWORD);} 1666 | PARSEOP_ACCESSTYPE_QWORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_QWORD);} 1667 | PARSEOP_ACCESSTYPE_BUF {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_BUF);} 1668 ; 1669 1670 AddressingModeKeyword 1671 : PARSEOP_ADDRESSINGMODE_7BIT {$$ = TrCreateLeafNode (PARSEOP_ADDRESSINGMODE_7BIT);} 1672 | PARSEOP_ADDRESSINGMODE_10BIT {$$ = TrCreateLeafNode (PARSEOP_ADDRESSINGMODE_10BIT);} 1673 ; 1674 1675 AddressKeyword 1676 : PARSEOP_ADDRESSTYPE_MEMORY {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_MEMORY);} 1677 | PARSEOP_ADDRESSTYPE_RESERVED {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_RESERVED);} 1678 | PARSEOP_ADDRESSTYPE_NVS {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_NVS);} 1679 | PARSEOP_ADDRESSTYPE_ACPI {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_ACPI);} 1680 ; 1681 1682 AddressSpaceKeyword 1683 : ByteConst {$$ = UtCheckIntegerRange ($1, 0x0A, 0xFF);} 1684 | RegionSpaceKeyword {} 1685 ; 1686 1687 BitsPerByteKeyword 1688 : PARSEOP_BITSPERBYTE_FIVE {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_FIVE);} 1689 | PARSEOP_BITSPERBYTE_SIX {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_SIX);} 1690 | PARSEOP_BITSPERBYTE_SEVEN {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_SEVEN);} 1691 | PARSEOP_BITSPERBYTE_EIGHT {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_EIGHT);} 1692 | PARSEOP_BITSPERBYTE_NINE {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_NINE);} 1693 ; 1694 1695 ClockPhaseKeyword 1696 : PARSEOP_CLOCKPHASE_FIRST {$$ = TrCreateLeafNode (PARSEOP_CLOCKPHASE_FIRST);} 1697 | PARSEOP_CLOCKPHASE_SECOND {$$ = TrCreateLeafNode (PARSEOP_CLOCKPHASE_SECOND);} 1698 ; 1699 1700 ClockPolarityKeyword 1701 : PARSEOP_CLOCKPOLARITY_LOW {$$ = TrCreateLeafNode (PARSEOP_CLOCKPOLARITY_LOW);} 1702 | PARSEOP_CLOCKPOLARITY_HIGH {$$ = TrCreateLeafNode (PARSEOP_CLOCKPOLARITY_HIGH);} 1703 ; 1704 1705 DecodeKeyword 1706 : PARSEOP_DECODETYPE_POS {$$ = TrCreateLeafNode (PARSEOP_DECODETYPE_POS);} 1707 | PARSEOP_DECODETYPE_SUB {$$ = TrCreateLeafNode (PARSEOP_DECODETYPE_SUB);} 1708 ; 1709 1710 DevicePolarityKeyword 1711 : PARSEOP_DEVICEPOLARITY_LOW {$$ = TrCreateLeafNode (PARSEOP_DEVICEPOLARITY_LOW);} 1712 | PARSEOP_DEVICEPOLARITY_HIGH {$$ = TrCreateLeafNode (PARSEOP_DEVICEPOLARITY_HIGH);} 1713 ; 1714 1715 DMATypeKeyword 1716 : PARSEOP_DMATYPE_A {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_A);} 1717 | PARSEOP_DMATYPE_COMPATIBILITY {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_COMPATIBILITY);} 1718 | PARSEOP_DMATYPE_B {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_B);} 1719 | PARSEOP_DMATYPE_F {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_F);} 1720 ; 1721 1722 EndianKeyword 1723 : PARSEOP_ENDIAN_LITTLE {$$ = TrCreateLeafNode (PARSEOP_ENDIAN_LITTLE);} 1724 | PARSEOP_ENDIAN_BIG {$$ = TrCreateLeafNode (PARSEOP_ENDIAN_BIG);} 1725 ; 1726 1727 FlowControlKeyword 1728 : PARSEOP_FLOWCONTROL_HW {$$ = TrCreateLeafNode (PARSEOP_FLOWCONTROL_HW);} 1729 | PARSEOP_FLOWCONTROL_NONE {$$ = TrCreateLeafNode (PARSEOP_FLOWCONTROL_NONE);} 1730 | PARSEOP_FLOWCONTROL_SW {$$ = TrCreateLeafNode (PARSEOP_FLOWCONTROL_SW);} 1731 ; 1732 1733 InterruptLevel 1734 : PARSEOP_INTLEVEL_ACTIVEBOTH {$$ = TrCreateLeafNode (PARSEOP_INTLEVEL_ACTIVEBOTH);} 1735 | PARSEOP_INTLEVEL_ACTIVEHIGH {$$ = TrCreateLeafNode (PARSEOP_INTLEVEL_ACTIVEHIGH);} 1736 | PARSEOP_INTLEVEL_ACTIVELOW {$$ = TrCreateLeafNode (PARSEOP_INTLEVEL_ACTIVELOW);} 1737 ; 1738 1739 InterruptTypeKeyword 1740 : PARSEOP_INTTYPE_EDGE {$$ = TrCreateLeafNode (PARSEOP_INTTYPE_EDGE);} 1741 | PARSEOP_INTTYPE_LEVEL {$$ = TrCreateLeafNode (PARSEOP_INTTYPE_LEVEL);} 1742 ; 1743 1744 IODecodeKeyword 1745 : PARSEOP_IODECODETYPE_16 {$$ = TrCreateLeafNode (PARSEOP_IODECODETYPE_16);} 1746 | PARSEOP_IODECODETYPE_10 {$$ = TrCreateLeafNode (PARSEOP_IODECODETYPE_10);} 1747 ; 1748 1749 IoRestrictionKeyword 1750 : PARSEOP_IORESTRICT_IN {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_IN);} 1751 | PARSEOP_IORESTRICT_OUT {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_OUT);} 1752 | PARSEOP_IORESTRICT_NONE {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_NONE);} 1753 | PARSEOP_IORESTRICT_PRESERVE {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_PRESERVE);} 1754 ; 1755 1756 LockRuleKeyword 1757 : PARSEOP_LOCKRULE_LOCK {$$ = TrCreateLeafNode (PARSEOP_LOCKRULE_LOCK);} 1758 | PARSEOP_LOCKRULE_NOLOCK {$$ = TrCreateLeafNode (PARSEOP_LOCKRULE_NOLOCK);} 1759 ; 1760 1761 MatchOpKeyword 1762 : PARSEOP_MATCHTYPE_MTR {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MTR);} 1763 | PARSEOP_MATCHTYPE_MEQ {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MEQ);} 1764 | PARSEOP_MATCHTYPE_MLE {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MLE);} 1765 | PARSEOP_MATCHTYPE_MLT {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MLT);} 1766 | PARSEOP_MATCHTYPE_MGE {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MGE);} 1767 | PARSEOP_MATCHTYPE_MGT {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MGT);} 1768 ; 1769 1770 MaxKeyword 1771 : PARSEOP_MAXTYPE_FIXED {$$ = TrCreateLeafNode (PARSEOP_MAXTYPE_FIXED);} 1772 | PARSEOP_MAXTYPE_NOTFIXED {$$ = TrCreateLeafNode (PARSEOP_MAXTYPE_NOTFIXED);} 1773 ; 1774 1775 MemTypeKeyword 1776 : PARSEOP_MEMTYPE_CACHEABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_CACHEABLE);} 1777 | PARSEOP_MEMTYPE_WRITECOMBINING {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_WRITECOMBINING);} 1778 | PARSEOP_MEMTYPE_PREFETCHABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_PREFETCHABLE);} 1779 | PARSEOP_MEMTYPE_NONCACHEABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_NONCACHEABLE);} 1780 ; 1781 1782 MinKeyword 1783 : PARSEOP_MINTYPE_FIXED {$$ = TrCreateLeafNode (PARSEOP_MINTYPE_FIXED);} 1784 | PARSEOP_MINTYPE_NOTFIXED {$$ = TrCreateLeafNode (PARSEOP_MINTYPE_NOTFIXED);} 1785 ; 1786 1787 ObjectTypeKeyword 1788 : PARSEOP_OBJECTTYPE_UNK {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_UNK);} 1789 | PARSEOP_OBJECTTYPE_INT {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_INT);} 1790 | PARSEOP_OBJECTTYPE_STR {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_STR);} 1791 | PARSEOP_OBJECTTYPE_BUF {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_BUF);} 1792 | PARSEOP_OBJECTTYPE_PKG {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_PKG);} 1793 | PARSEOP_OBJECTTYPE_FLD {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_FLD);} 1794 | PARSEOP_OBJECTTYPE_DEV {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_DEV);} 1795 | PARSEOP_OBJECTTYPE_EVT {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_EVT);} 1796 | PARSEOP_OBJECTTYPE_MTH {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_MTH);} 1797 | PARSEOP_OBJECTTYPE_MTX {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_MTX);} 1798 | PARSEOP_OBJECTTYPE_OPR {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_OPR);} 1799 | PARSEOP_OBJECTTYPE_POW {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_POW);} 1800 | PARSEOP_OBJECTTYPE_PRO {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_PRO);} 1801 | PARSEOP_OBJECTTYPE_THZ {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_THZ);} 1802 | PARSEOP_OBJECTTYPE_BFF {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_BFF);} 1803 | PARSEOP_OBJECTTYPE_DDB {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_DDB);} 1804 ; 1805 1806 ParityTypeKeyword 1807 : PARSEOP_PARITYTYPE_SPACE {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_SPACE);} 1808 | PARSEOP_PARITYTYPE_MARK {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_MARK);} 1809 | PARSEOP_PARITYTYPE_ODD {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_ODD);} 1810 | PARSEOP_PARITYTYPE_EVEN {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_EVEN);} 1811 | PARSEOP_PARITYTYPE_NONE {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_NONE);} 1812 ; 1813 1814 PinConfigByte 1815 : PinConfigKeyword {$$ = $1;} 1816 | ByteConstExpr {$$ = UtCheckIntegerRange ($1, 0x80, 0xFF);} 1817 ; 1818 1819 PinConfigKeyword 1820 : PARSEOP_PIN_NOPULL {$$ = TrCreateLeafNode (PARSEOP_PIN_NOPULL);} 1821 | PARSEOP_PIN_PULLDOWN {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLDOWN);} 1822 | PARSEOP_PIN_PULLUP {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLUP);} 1823 | PARSEOP_PIN_PULLDEFAULT {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLDEFAULT);} 1824 ; 1825 1826 RangeTypeKeyword 1827 : PARSEOP_RANGETYPE_ISAONLY {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_ISAONLY);} 1828 | PARSEOP_RANGETYPE_NONISAONLY {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_NONISAONLY);} 1829 | PARSEOP_RANGETYPE_ENTIRE {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_ENTIRE);} 1830 ; 1831 1832 RegionSpaceKeyword 1833 : PARSEOP_REGIONSPACE_IO {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_IO);} 1834 | PARSEOP_REGIONSPACE_MEM {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_MEM);} 1835 | PARSEOP_REGIONSPACE_PCI {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCI);} 1836 | PARSEOP_REGIONSPACE_EC {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_EC);} 1837 | PARSEOP_REGIONSPACE_SMBUS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_SMBUS);} 1838 | PARSEOP_REGIONSPACE_CMOS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_CMOS);} 1839 | PARSEOP_REGIONSPACE_PCIBAR {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCIBAR);} 1840 | PARSEOP_REGIONSPACE_IPMI {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_IPMI);} 1841 | PARSEOP_REGIONSPACE_GPIO {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_GPIO);} 1842 | PARSEOP_REGIONSPACE_GSBUS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_GSBUS);} 1843 | PARSEOP_REGIONSPACE_PCC {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCC);} 1844 | PARSEOP_REGIONSPACE_FFIXEDHW {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_FFIXEDHW);} 1845 ; 1846 1847 ResourceTypeKeyword 1848 : PARSEOP_RESOURCETYPE_CONSUMER {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_CONSUMER);} 1849 | PARSEOP_RESOURCETYPE_PRODUCER {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_PRODUCER);} 1850 ; 1851 1852 SerializeRuleKeyword 1853 : PARSEOP_SERIALIZERULE_SERIAL {$$ = TrCreateLeafNode (PARSEOP_SERIALIZERULE_SERIAL);} 1854 | PARSEOP_SERIALIZERULE_NOTSERIAL {$$ = TrCreateLeafNode (PARSEOP_SERIALIZERULE_NOTSERIAL);} 1855 ; 1856 1857 ShareTypeKeyword 1858 : PARSEOP_SHARETYPE_SHARED {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_SHARED);} 1859 | PARSEOP_SHARETYPE_EXCLUSIVE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_EXCLUSIVE);} 1860 | PARSEOP_SHARETYPE_SHAREDWAKE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_SHAREDWAKE);} 1861 | PARSEOP_SHARETYPE_EXCLUSIVEWAKE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_EXCLUSIVEWAKE);} 1862 ; 1863 1864 SlaveModeKeyword 1865 : PARSEOP_SLAVEMODE_CONTROLLERINIT {$$ = TrCreateLeafNode (PARSEOP_SLAVEMODE_CONTROLLERINIT);} 1866 | PARSEOP_SLAVEMODE_DEVICEINIT {$$ = TrCreateLeafNode (PARSEOP_SLAVEMODE_DEVICEINIT);} 1867 ; 1868 1869 StopBitsKeyword 1870 : PARSEOP_STOPBITS_TWO {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_TWO);} 1871 | PARSEOP_STOPBITS_ONEPLUSHALF {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ONEPLUSHALF);} 1872 | PARSEOP_STOPBITS_ONE {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ONE);} 1873 | PARSEOP_STOPBITS_ZERO {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ZERO);} 1874 ; 1875 1876 TranslationKeyword 1877 : PARSEOP_TRANSLATIONTYPE_SPARSE {$$ = TrCreateLeafNode (PARSEOP_TRANSLATIONTYPE_SPARSE);} 1878 | PARSEOP_TRANSLATIONTYPE_DENSE {$$ = TrCreateLeafNode (PARSEOP_TRANSLATIONTYPE_DENSE);} 1879 ; 1880 1881 TypeKeyword 1882 : PARSEOP_TYPE_TRANSLATION {$$ = TrCreateLeafNode (PARSEOP_TYPE_TRANSLATION);} 1883 | PARSEOP_TYPE_STATIC {$$ = TrCreateLeafNode (PARSEOP_TYPE_STATIC);} 1884 ; 1885 1886 UpdateRuleKeyword 1887 : PARSEOP_UPDATERULE_PRESERVE {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_PRESERVE);} 1888 | PARSEOP_UPDATERULE_ONES {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_ONES);} 1889 | PARSEOP_UPDATERULE_ZEROS {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_ZEROS);} 1890 ; 1891 1892 WireModeKeyword 1893 : PARSEOP_WIREMODE_FOUR {$$ = TrCreateLeafNode (PARSEOP_WIREMODE_FOUR);} 1894 | PARSEOP_WIREMODE_THREE {$$ = TrCreateLeafNode (PARSEOP_WIREMODE_THREE);} 1895 ; 1896 1897 XferSizeKeyword 1898 : PARSEOP_XFERSIZE_8 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_8, 0);} 1899 | PARSEOP_XFERSIZE_16 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_16, 1);} 1900 | PARSEOP_XFERSIZE_32 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_32, 2);} 1901 | PARSEOP_XFERSIZE_64 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_64, 3);} 1902 | PARSEOP_XFERSIZE_128 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_128, 4);} 1903 | PARSEOP_XFERSIZE_256 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_256, 5);} 1904 ; 1905 1906 XferTypeKeyword 1907 : PARSEOP_XFERTYPE_8 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_8);} 1908 | PARSEOP_XFERTYPE_8_16 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_8_16);} 1909 | PARSEOP_XFERTYPE_16 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_16);} 1910 ; 1911 1912 1913 /******* Miscellaneous Types **************************************************/ 1914 1915 1916 SuperName 1917 : NameString {} 1918 | ArgTerm {} 1919 | LocalTerm {} 1920 | DebugTerm {} 1921 | Type6Opcode {} 1922 1923 /* For ObjectType: SuperName except for UserTerm (method invocation) */ 1924 1925 ObjectTypeName 1926 : NameString {} 1927 | ArgTerm {} 1928 | LocalTerm {} 1929 | DebugTerm {} 1930 | RefOfTerm {} 1931 | DerefOfTerm {} 1932 | IndexTerm {} 1933 1934 /* | UserTerm {} */ /* Caused reduce/reduce with Type6Opcode->UserTerm */ 1935 ; 1936 1937 ArgTerm 1938 : PARSEOP_ARG0 {$$ = TrCreateLeafNode (PARSEOP_ARG0);} 1939 | PARSEOP_ARG1 {$$ = TrCreateLeafNode (PARSEOP_ARG1);} 1940 | PARSEOP_ARG2 {$$ = TrCreateLeafNode (PARSEOP_ARG2);} 1941 | PARSEOP_ARG3 {$$ = TrCreateLeafNode (PARSEOP_ARG3);} 1942 | PARSEOP_ARG4 {$$ = TrCreateLeafNode (PARSEOP_ARG4);} 1943 | PARSEOP_ARG5 {$$ = TrCreateLeafNode (PARSEOP_ARG5);} 1944 | PARSEOP_ARG6 {$$ = TrCreateLeafNode (PARSEOP_ARG6);} 1945 ; 1946 1947 LocalTerm 1948 : PARSEOP_LOCAL0 {$$ = TrCreateLeafNode (PARSEOP_LOCAL0);} 1949 | PARSEOP_LOCAL1 {$$ = TrCreateLeafNode (PARSEOP_LOCAL1);} 1950 | PARSEOP_LOCAL2 {$$ = TrCreateLeafNode (PARSEOP_LOCAL2);} 1951 | PARSEOP_LOCAL3 {$$ = TrCreateLeafNode (PARSEOP_LOCAL3);} 1952 | PARSEOP_LOCAL4 {$$ = TrCreateLeafNode (PARSEOP_LOCAL4);} 1953 | PARSEOP_LOCAL5 {$$ = TrCreateLeafNode (PARSEOP_LOCAL5);} 1954 | PARSEOP_LOCAL6 {$$ = TrCreateLeafNode (PARSEOP_LOCAL6);} 1955 | PARSEOP_LOCAL7 {$$ = TrCreateLeafNode (PARSEOP_LOCAL7);} 1956 ; 1957 1958 DebugTerm 1959 : PARSEOP_DEBUG {$$ = TrCreateLeafNode (PARSEOP_DEBUG);} 1960 ; 1961 1962 1963 ByteConst 1964 : Integer {$$ = TrUpdateNode (PARSEOP_BYTECONST, $1);} 1965 ; 1966 1967 WordConst 1968 : Integer {$$ = TrUpdateNode (PARSEOP_WORDCONST, $1);} 1969 ; 1970 1971 DWordConst 1972 : Integer {$$ = TrUpdateNode (PARSEOP_DWORDCONST, $1);} 1973 ; 1974 1975 QWordConst 1976 : Integer {$$ = TrUpdateNode (PARSEOP_QWORDCONST, $1);} 1977 ; 1978 1979 Integer 1980 : PARSEOP_INTEGER {$$ = TrCreateValuedLeafNode (PARSEOP_INTEGER, AslCompilerlval.i);} 1981 ; 1982 1983 String 1984 : PARSEOP_STRING_LITERAL {$$ = TrCreateValuedLeafNode (PARSEOP_STRING_LITERAL, (ACPI_NATIVE_INT) AslCompilerlval.s);} 1985 ; 1986 1987 ConstTerm 1988 : ConstExprTerm {} 1989 | PARSEOP_REVISION {$$ = TrCreateLeafNode (PARSEOP_REVISION);} 1990 ; 1991 1992 ConstExprTerm 1993 : PARSEOP_ZERO {$$ = TrCreateValuedLeafNode (PARSEOP_ZERO, 0);} 1994 | PARSEOP_ONE {$$ = TrCreateValuedLeafNode (PARSEOP_ONE, 1);} 1995 | PARSEOP_ONES {$$ = TrCreateValuedLeafNode (PARSEOP_ONES, ACPI_UINT64_MAX);} 1996 | PARSEOP___DATE__ {$$ = TrCreateConstantLeafNode (PARSEOP___DATE__);} 1997 | PARSEOP___FILE__ {$$ = TrCreateConstantLeafNode (PARSEOP___FILE__);} 1998 | PARSEOP___LINE__ {$$ = TrCreateConstantLeafNode (PARSEOP___LINE__);} 1999 | PARSEOP___PATH__ {$$ = TrCreateConstantLeafNode (PARSEOP___PATH__);} 2000 ; 2001 2002 /* 2003 * The NODE_COMPILE_TIME_CONST flag in the following constant expressions 2004 * enables compile-time constant folding to reduce the Type3Opcodes/Type2IntegerOpcodes 2005 * to simple integers. It is an error if these types of expressions cannot be 2006 * reduced, since the AML grammar for ****ConstExpr requires a simple constant. 2007 * Note: The required byte length of the constant is passed through to the 2008 * constant folding code in the node AmlLength field. 2009 */ 2010 ByteConstExpr 2011 : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 1);} 2012 | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 1);} 2013 | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_BYTECONST, $1);} 2014 | ByteConst {} 2015 ; 2016 2017 WordConstExpr 2018 : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 2);} 2019 | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 2);} 2020 | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_WORDCONST, $1);} 2021 | WordConst {} 2022 ; 2023 2024 DWordConstExpr 2025 : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 4);} 2026 | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 4);} 2027 | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_DWORDCONST, $1);} 2028 | DWordConst {} 2029 ; 2030 2031 QWordConstExpr 2032 : Type3Opcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 8);} 2033 | Type2IntegerOpcode {$$ = TrSetNodeFlags ($1, NODE_COMPILE_TIME_CONST); TrSetNodeAmlLength ($1, 8);} 2034 | ConstExprTerm {$$ = TrUpdateNode (PARSEOP_QWORDCONST, $1);} 2035 | QWordConst {} 2036 ; 2037 2038 /* OptionalCount must appear before ByteList or an incorrect reduction will result */ 2039 2040 OptionalCount 2041 : {$$ = TrCreateLeafNode (PARSEOP_ONES);} /* Placeholder is a OnesOp object */ 2042 | ',' {$$ = TrCreateLeafNode (PARSEOP_ONES);} /* Placeholder is a OnesOp object */ 2043 | ',' TermArg {$$ = $2;} 2044 ; 2045 2046 BufferTerm 2047 : PARSEOP_BUFFER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_BUFFER);} 2048 OptionalTermArg 2049 ')' '{' 2050 BufferTermData '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} 2051 | PARSEOP_BUFFER '(' 2052 error ')' {$$ = AslDoError(); yyclearin;} 2053 ; 2054 2055 BufferTermData 2056 : ByteList {} 2057 | StringData {} 2058 ; 2059 2060 ByteList 2061 : {$$ = NULL;} 2062 | ByteConstExpr 2063 | ByteList ',' /* Allows a trailing comma at list end */ 2064 | ByteList ',' 2065 ByteConstExpr {$$ = TrLinkPeerNode ($1,$3);} 2066 ; 2067 2068 DataBufferTerm 2069 : PARSEOP_DATABUFFER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DATABUFFER);} 2070 OptionalWordConst 2071 ')' '{' 2072 ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} 2073 | PARSEOP_DATABUFFER '(' 2074 error ')' {$$ = AslDoError(); yyclearin;} 2075 ; 2076 2077 DWordList 2078 : {$$ = NULL;} 2079 | DWordConstExpr 2080 | DWordList ',' /* Allows a trailing comma at list end */ 2081 | DWordList ',' 2082 DWordConstExpr {$$ = TrLinkPeerNode ($1,$3);} 2083 ; 2084 2085 PackageTerm 2086 : PARSEOP_PACKAGE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_VAR_PACKAGE);} 2087 VarPackageLengthTerm 2088 ')' '{' 2089 PackageList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} 2090 | PARSEOP_PACKAGE '(' 2091 error ')' {$$ = AslDoError(); yyclearin;} 2092 ; 2093 2094 PackageList 2095 : {$$ = NULL;} 2096 | PackageElement 2097 | PackageList ',' /* Allows a trailing comma at list end */ 2098 | PackageList ',' 2099 PackageElement {$$ = TrLinkPeerNode ($1,$3);} 2100 ; 2101 2102 PackageElement 2103 : DataObject {} 2104 | NameString {} 2105 ; 2106 2107 VarPackageLengthTerm 2108 : {$$ = TrCreateLeafNode (PARSEOP_DEFAULT_ARG);} 2109 | TermArg {$$ = $1;} 2110 ; 2111 2112 2113 /******* Macros ***********************************************/ 2114 2115 2116 EISAIDTerm 2117 : PARSEOP_EISAID '(' 2118 StringData ')' {$$ = TrUpdateNode (PARSEOP_EISAID, $3);} 2119 | PARSEOP_EISAID '(' 2120 error ')' {$$ = AslDoError(); yyclearin;} 2121 ; 2122 2123 UnicodeTerm 2124 : PARSEOP_UNICODE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UNICODE);} 2125 StringData 2126 ')' {$$ = TrLinkChildren ($<n>3,2,0,$4);} 2127 | PARSEOP_UNICODE '(' 2128 error ')' {$$ = AslDoError(); yyclearin;} 2129 ; 2130 2131 2132 /******* Resources and Memory ***********************************************/ 2133 2134 2135 /* 2136 * Note: Create two default nodes to allow conversion to a Buffer AML opcode 2137 * Also, insert the EndTag at the end of the template. 2138 */ 2139 ResourceTemplateTerm 2140 : PARSEOP_RESOURCETEMPLATE '(' ')' 2141 '{' 2142 ResourceMacroList '}' {$$ = TrCreateNode (PARSEOP_RESOURCETEMPLATE,4, 2143 TrCreateLeafNode (PARSEOP_DEFAULT_ARG), 2144 TrCreateLeafNode (PARSEOP_DEFAULT_ARG), 2145 $5, 2146 TrCreateLeafNode (PARSEOP_ENDTAG));} 2147 ; 2148 2149 ResourceMacroList 2150 : {$$ = NULL;} 2151 | ResourceMacroList 2152 ResourceMacroTerm {$$ = TrLinkPeerNode ($1,$2);} 2153 ; 2154 2155 ResourceMacroTerm 2156 : DMATerm {} 2157 | DWordIOTerm {} 2158 | DWordMemoryTerm {} 2159 | DWordSpaceTerm {} 2160 | EndDependentFnTerm {} 2161 | ExtendedIOTerm {} 2162 | ExtendedMemoryTerm {} 2163 | ExtendedSpaceTerm {} 2164 | FixedDmaTerm {} 2165 | FixedIOTerm {} 2166 | GpioIntTerm {} 2167 | GpioIoTerm {} 2168 | I2cSerialBusTerm {} 2169 | InterruptTerm {} 2170 | IOTerm {} 2171 | IRQNoFlagsTerm {} 2172 | IRQTerm {} 2173 | Memory24Term {} 2174 | Memory32FixedTerm {} 2175 | Memory32Term {} 2176 | QWordIOTerm {} 2177 | QWordMemoryTerm {} 2178 | QWordSpaceTerm {} 2179 | RegisterTerm {} 2180 | SpiSerialBusTerm {} 2181 | StartDependentFnNoPriTerm {} 2182 | StartDependentFnTerm {} 2183 | UartSerialBusTerm {} 2184 | VendorLongTerm {} 2185 | VendorShortTerm {} 2186 | WordBusNumberTerm {} 2187 | WordIOTerm {} 2188 | WordSpaceTerm {} 2189 ; 2190 2191 DMATerm 2192 : PARSEOP_DMA '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DMA);} 2193 DMATypeKeyword 2194 OptionalBusMasterKeyword 2195 ',' XferTypeKeyword 2196 OptionalNameString_Last 2197 ')' '{' 2198 ByteList '}' {$$ = TrLinkChildren ($<n>3,5,$4,$5,$7,$8,$11);} 2199 | PARSEOP_DMA '(' 2200 error ')' {$$ = AslDoError(); yyclearin;} 2201 ; 2202 2203 DWordIOTerm 2204 : PARSEOP_DWORDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DWORDIO);} 2205 OptionalResourceType_First 2206 OptionalMinType 2207 OptionalMaxType 2208 OptionalDecodeType 2209 OptionalRangeType 2210 ',' DWordConstExpr 2211 ',' DWordConstExpr 2212 ',' DWordConstExpr 2213 ',' DWordConstExpr 2214 ',' DWordConstExpr 2215 OptionalByteConstExpr 2216 OptionalStringData 2217 OptionalNameString 2218 OptionalType 2219 OptionalTranslationType_Last 2220 ')' {$$ = TrLinkChildren ($<n>3,15,$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22,$23);} 2221 | PARSEOP_DWORDIO '(' 2222 error ')' {$$ = AslDoError(); yyclearin;} 2223 ; 2224 2225 DWordMemoryTerm 2226 : PARSEOP_DWORDMEMORY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DWORDMEMORY);} 2227 OptionalResourceType_First 2228 OptionalDecodeType 2229 OptionalMinType 2230 OptionalMaxType 2231 OptionalMemType 2232 ',' OptionalReadWriteKeyword 2233 ',' DWordConstExpr 2234 ',' DWordConstExpr 2235 ',' DWordConstExpr 2236 ',' DWordConstExpr 2237 ',' DWordConstExpr 2238 OptionalByteConstExpr 2239 OptionalStringData 2240 OptionalNameString 2241 OptionalAddressRange 2242 OptionalType_Last 2243 ')' {$$ = TrLinkChildren ($<n>3,16,$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$20,$21,$22,$23,$24,$25);} 2244 | PARSEOP_DWORDMEMORY '(' 2245 error ')' {$$ = AslDoError(); yyclearin;} 2246 ; 2247 2248 DWordSpaceTerm 2249 : PARSEOP_DWORDSPACE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DWORDSPACE);} 2250 ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} 2251 OptionalResourceType 2252 OptionalDecodeType 2253 OptionalMinType 2254 OptionalMaxType 2255 ',' ByteConstExpr 2256 ',' DWordConstExpr 2257 ',' DWordConstExpr 2258 ',' DWordConstExpr 2259 ',' DWordConstExpr 2260 ',' DWordConstExpr 2261 OptionalByteConstExpr 2262 OptionalStringData 2263 OptionalNameString_Last 2264 ')' {$$ = TrLinkChildren ($<n>3,14,$4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23,$24);} 2265 | PARSEOP_DWORDSPACE '(' 2266 error ')' {$$ = AslDoError(); yyclearin;} 2267 ; 2268 2269 2270 EndDependentFnTerm 2271 : PARSEOP_ENDDEPENDENTFN '(' 2272 ')' {$$ = TrCreateLeafNode (PARSEOP_ENDDEPENDENTFN);} 2273 | PARSEOP_ENDDEPENDENTFN '(' 2274 error ')' {$$ = AslDoError(); yyclearin;} 2275 ; 2276 2277 ExtendedIOTerm 2278 : PARSEOP_EXTENDEDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_EXTENDEDIO);} 2279 OptionalResourceType_First 2280 OptionalMinType 2281 OptionalMaxType 2282 OptionalDecodeType 2283 OptionalRangeType 2284 ',' QWordConstExpr 2285 ',' QWordConstExpr 2286 ',' QWordConstExpr 2287 ',' QWordConstExpr 2288 ',' QWordConstExpr 2289 OptionalQWordConstExpr 2290 OptionalNameString 2291 OptionalType 2292 OptionalTranslationType_Last 2293 ')' {$$ = TrLinkChildren ($<n>3,14,$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22);} 2294 | PARSEOP_EXTENDEDIO '(' 2295 error ')' {$$ = AslDoError(); yyclearin;} 2296 ; 2297 2298 ExtendedMemoryTerm 2299 : PARSEOP_EXTENDEDMEMORY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_EXTENDEDMEMORY);} 2300 OptionalResourceType_First 2301 OptionalDecodeType 2302 OptionalMinType 2303 OptionalMaxType 2304 OptionalMemType 2305 ',' OptionalReadWriteKeyword 2306 ',' QWordConstExpr 2307 ',' QWordConstExpr 2308 ',' QWordConstExpr 2309 ',' QWordConstExpr 2310 ',' QWordConstExpr 2311 OptionalQWordConstExpr 2312 OptionalNameString 2313 OptionalAddressRange 2314 OptionalType_Last 2315 ')' {$$ = TrLinkChildren ($<n>3,15,$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$20,$21,$22,$23,$24);} 2316 | PARSEOP_EXTENDEDMEMORY '(' 2317 error ')' {$$ = AslDoError(); yyclearin;} 2318 ; 2319 2320 ExtendedSpaceTerm 2321 : PARSEOP_EXTENDEDSPACE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_EXTENDEDSPACE);} 2322 ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} 2323 OptionalResourceType 2324 OptionalDecodeType 2325 OptionalMinType 2326 OptionalMaxType 2327 ',' ByteConstExpr 2328 ',' QWordConstExpr 2329 ',' QWordConstExpr 2330 ',' QWordConstExpr 2331 ',' QWordConstExpr 2332 ',' QWordConstExpr 2333 OptionalQWordConstExpr 2334 OptionalNameString_Last 2335 ')' {$$ = TrLinkChildren ($<n>3,13,$4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23);} 2336 | PARSEOP_EXTENDEDSPACE '(' 2337 error ')' {$$ = AslDoError(); yyclearin;} 2338 ; 2339 2340 FixedDmaTerm 2341 : PARSEOP_FIXEDDMA '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FIXEDDMA);} 2342 WordConstExpr /* 04: DMA RequestLines */ 2343 ',' WordConstExpr /* 06: DMA Channels */ 2344 OptionalXferSize /* 07: DMA TransferSize */ 2345 OptionalNameString /* 08: DescriptorName */ 2346 ')' {$$ = TrLinkChildren ($<n>3,4,$4,$6,$7,$8);} 2347 | PARSEOP_FIXEDDMA '(' 2348 error ')' {$$ = AslDoError(); yyclearin;} 2349 ; 2350 2351 FixedIOTerm 2352 : PARSEOP_FIXEDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FIXEDIO);} 2353 WordConstExpr 2354 ',' ByteConstExpr 2355 OptionalNameString_Last 2356 ')' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);} 2357 | PARSEOP_FIXEDIO '(' 2358 error ')' {$$ = AslDoError(); yyclearin;} 2359 ; 2360 2361 GpioIntTerm 2362 : PARSEOP_GPIO_INT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_GPIO_INT);} 2363 InterruptTypeKeyword /* 04: InterruptType */ 2364 ',' InterruptLevel /* 06: InterruptLevel */ 2365 OptionalShareType /* 07: SharedType */ 2366 ',' PinConfigByte /* 09: PinConfig */ 2367 OptionalWordConstExpr /* 10: DebounceTimeout */ 2368 ',' StringData /* 12: ResourceSource */ 2369 OptionalByteConstExpr /* 13: ResourceSourceIndex */ 2370 OptionalResourceType /* 14: ResourceType */ 2371 OptionalNameString /* 15: DescriptorName */ 2372 OptionalBuffer_Last /* 16: VendorData */ 2373 ')' '{' 2374 DWordConstExpr '}' {$$ = TrLinkChildren ($<n>3,11,$4,$6,$7,$9,$10,$12,$13,$14,$15,$16,$19);} 2375 | PARSEOP_GPIO_INT '(' 2376 error ')' {$$ = AslDoError(); yyclearin;} 2377 ; 2378 2379 GpioIoTerm 2380 : PARSEOP_GPIO_IO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_GPIO_IO);} 2381 OptionalShareType_First /* 04: SharedType */ 2382 ',' PinConfigByte /* 06: PinConfig */ 2383 OptionalWordConstExpr /* 07: DebounceTimeout */ 2384 OptionalWordConstExpr /* 08: DriveStrength */ 2385 OptionalIoRestriction /* 09: IoRestriction */ 2386 ',' StringData /* 11: ResourceSource */ 2387 OptionalByteConstExpr /* 12: ResourceSourceIndex */ 2388 OptionalResourceType /* 13: ResourceType */ 2389 OptionalNameString /* 14: DescriptorName */ 2390 OptionalBuffer_Last /* 15: VendorData */ 2391 ')' '{' 2392 DWordList '}' {$$ = TrLinkChildren ($<n>3,11,$4,$6,$7,$8,$9,$11,$12,$13,$14,$15,$18);} 2393 | PARSEOP_GPIO_IO '(' 2394 error ')' {$$ = AslDoError(); yyclearin;} 2395 ; 2396 2397 I2cSerialBusTerm 2398 : PARSEOP_I2C_SERIALBUS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_I2C_SERIALBUS);} 2399 WordConstExpr /* 04: SlaveAddress */ 2400 OptionalSlaveMode /* 05: SlaveMode */ 2401 ',' DWordConstExpr /* 07: ConnectionSpeed */ 2402 OptionalAddressingMode /* 08: AddressingMode */ 2403 ',' StringData /* 10: ResourceSource */ 2404 OptionalByteConstExpr /* 11: ResourceSourceIndex */ 2405 OptionalResourceType /* 12: ResourceType */ 2406 OptionalNameString /* 13: DescriptorName */ 2407 OptionalBuffer_Last /* 14: VendorData */ 2408 ')' {$$ = TrLinkChildren ($<n>3,9,$4,$5,$7,$8,$10,$11,$12,$13,$14);} 2409 | PARSEOP_I2C_SERIALBUS '(' 2410 error ')' {$$ = AslDoError(); yyclearin;} 2411 ; 2412 2413 InterruptTerm 2414 : PARSEOP_INTERRUPT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INTERRUPT);} 2415 OptionalResourceType_First 2416 ',' InterruptTypeKeyword 2417 ',' InterruptLevel 2418 OptionalShareType 2419 OptionalByteConstExpr 2420 OptionalStringData 2421 OptionalNameString_Last 2422 ')' '{' 2423 DWordList '}' {$$ = TrLinkChildren ($<n>3,8,$4,$6,$8,$9,$10,$11,$12,$15);} 2424 | PARSEOP_INTERRUPT '(' 2425 error ')' {$$ = AslDoError(); yyclearin;} 2426 ; 2427 2428 IOTerm 2429 : PARSEOP_IO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_IO);} 2430 IODecodeKeyword 2431 ',' WordConstExpr 2432 ',' WordConstExpr 2433 ',' ByteConstExpr 2434 ',' ByteConstExpr 2435 OptionalNameString_Last 2436 ')' {$$ = TrLinkChildren ($<n>3,6,$4,$6,$8,$10,$12,$13);} 2437 | PARSEOP_IO '(' 2438 error ')' {$$ = AslDoError(); yyclearin;} 2439 ; 2440 2441 IRQNoFlagsTerm 2442 : PARSEOP_IRQNOFLAGS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_IRQNOFLAGS);} 2443 OptionalNameString_First 2444 ')' '{' 2445 ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} 2446 | PARSEOP_IRQNOFLAGS '(' 2447 error ')' {$$ = AslDoError(); yyclearin;} 2448 ; 2449 2450 IRQTerm 2451 : PARSEOP_IRQ '(' {$<n>$ = TrCreateLeafNode (PARSEOP_IRQ);} 2452 InterruptTypeKeyword 2453 ',' InterruptLevel 2454 OptionalShareType 2455 OptionalNameString_Last 2456 ')' '{' 2457 ByteList '}' {$$ = TrLinkChildren ($<n>3,5,$4,$6,$7,$8,$11);} 2458 | PARSEOP_IRQ '(' 2459 error ')' {$$ = AslDoError(); yyclearin;} 2460 ; 2461 2462 Memory24Term 2463 : PARSEOP_MEMORY24 '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MEMORY24);} 2464 OptionalReadWriteKeyword 2465 ',' WordConstExpr 2466 ',' WordConstExpr 2467 ',' WordConstExpr 2468 ',' WordConstExpr 2469 OptionalNameString_Last 2470 ')' {$$ = TrLinkChildren ($<n>3,6,$4,$6,$8,$10,$12,$13);} 2471 | PARSEOP_MEMORY24 '(' 2472 error ')' {$$ = AslDoError(); yyclearin;} 2473 ; 2474 2475 Memory32FixedTerm 2476 : PARSEOP_MEMORY32FIXED '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MEMORY32FIXED);} 2477 OptionalReadWriteKeyword 2478 ',' DWordConstExpr 2479 ',' DWordConstExpr 2480 OptionalNameString_Last 2481 ')' {$$ = TrLinkChildren ($<n>3,4,$4,$6,$8,$9);} 2482 | PARSEOP_MEMORY32FIXED '(' 2483 error ')' {$$ = AslDoError(); yyclearin;} 2484 ; 2485 2486 Memory32Term 2487 : PARSEOP_MEMORY32 '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MEMORY32);} 2488 OptionalReadWriteKeyword 2489 ',' DWordConstExpr 2490 ',' DWordConstExpr 2491 ',' DWordConstExpr 2492 ',' DWordConstExpr 2493 OptionalNameString_Last 2494 ')' {$$ = TrLinkChildren ($<n>3,6,$4,$6,$8,$10,$12,$13);} 2495 | PARSEOP_MEMORY32 '(' 2496 error ')' {$$ = AslDoError(); yyclearin;} 2497 ; 2498 2499 QWordIOTerm 2500 : PARSEOP_QWORDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDIO);} 2501 OptionalResourceType_First 2502 OptionalMinType 2503 OptionalMaxType 2504 OptionalDecodeType 2505 OptionalRangeType 2506 ',' QWordConstExpr 2507 ',' QWordConstExpr 2508 ',' QWordConstExpr 2509 ',' QWordConstExpr 2510 ',' QWordConstExpr 2511 OptionalByteConstExpr 2512 OptionalStringData 2513 OptionalNameString 2514 OptionalType 2515 OptionalTranslationType_Last 2516 ')' {$$ = TrLinkChildren ($<n>3,15,$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22,$23);} 2517 | PARSEOP_QWORDIO '(' 2518 error ')' {$$ = AslDoError(); yyclearin;} 2519 ; 2520 2521 QWordMemoryTerm 2522 : PARSEOP_QWORDMEMORY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDMEMORY);} 2523 OptionalResourceType_First 2524 OptionalDecodeType 2525 OptionalMinType 2526 OptionalMaxType 2527 OptionalMemType 2528 ',' OptionalReadWriteKeyword 2529 ',' QWordConstExpr 2530 ',' QWordConstExpr 2531 ',' QWordConstExpr 2532 ',' QWordConstExpr 2533 ',' QWordConstExpr 2534 OptionalByteConstExpr 2535 OptionalStringData 2536 OptionalNameString 2537 OptionalAddressRange 2538 OptionalType_Last 2539 ')' {$$ = TrLinkChildren ($<n>3,16,$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$20,$21,$22,$23,$24,$25);} 2540 | PARSEOP_QWORDMEMORY '(' 2541 error ')' {$$ = AslDoError(); yyclearin;} 2542 ; 2543 2544 QWordSpaceTerm 2545 : PARSEOP_QWORDSPACE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_QWORDSPACE);} 2546 ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} 2547 OptionalResourceType 2548 OptionalDecodeType 2549 OptionalMinType 2550 OptionalMaxType 2551 ',' ByteConstExpr 2552 ',' QWordConstExpr 2553 ',' QWordConstExpr 2554 ',' QWordConstExpr 2555 ',' QWordConstExpr 2556 ',' QWordConstExpr 2557 OptionalByteConstExpr 2558 OptionalStringData 2559 OptionalNameString_Last 2560 ')' {$$ = TrLinkChildren ($<n>3,14,$4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23,$24);} 2561 | PARSEOP_QWORDSPACE '(' 2562 error ')' {$$ = AslDoError(); yyclearin;} 2563 ; 2564 2565 RegisterTerm 2566 : PARSEOP_REGISTER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_REGISTER);} 2567 AddressSpaceKeyword 2568 ',' ByteConstExpr 2569 ',' ByteConstExpr 2570 ',' QWordConstExpr 2571 OptionalAccessSize 2572 OptionalNameString_Last 2573 ')' {$$ = TrLinkChildren ($<n>3,6,$4,$6,$8,$10,$11,$12);} 2574 | PARSEOP_REGISTER '(' 2575 error ')' {$$ = AslDoError(); yyclearin;} 2576 ; 2577 2578 SpiSerialBusTerm 2579 : PARSEOP_SPI_SERIALBUS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SPI_SERIALBUS);} 2580 WordConstExpr /* 04: DeviceSelection */ 2581 OptionalDevicePolarity /* 05: DevicePolarity */ 2582 OptionalWireMode /* 06: WireMode */ 2583 ',' ByteConstExpr /* 08: DataBitLength */ 2584 OptionalSlaveMode /* 09: SlaveMode */ 2585 ',' DWordConstExpr /* 11: ConnectionSpeed */ 2586 ',' ClockPolarityKeyword /* 13: ClockPolarity */ 2587 ',' ClockPhaseKeyword /* 15: ClockPhase */ 2588 ',' StringData /* 17: ResourceSource */ 2589 OptionalByteConstExpr /* 18: ResourceSourceIndex */ 2590 OptionalResourceType /* 19: ResourceType */ 2591 OptionalNameString /* 20: DescriptorName */ 2592 OptionalBuffer_Last /* 21: VendorData */ 2593 ')' {$$ = TrLinkChildren ($<n>3,13,$4,$5,$6,$8,$9,$11,$13,$15,$17,$18,$19,$20,$21);} 2594 | PARSEOP_SPI_SERIALBUS '(' 2595 error ')' {$$ = AslDoError(); yyclearin;} 2596 ; 2597 2598 StartDependentFnNoPriTerm 2599 : PARSEOP_STARTDEPENDENTFN_NOPRI '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STARTDEPENDENTFN_NOPRI);} 2600 ')' '{' 2601 ResourceMacroList '}' {$$ = TrLinkChildren ($<n>3,1,$6);} 2602 | PARSEOP_STARTDEPENDENTFN_NOPRI '(' 2603 error ')' {$$ = AslDoError(); yyclearin;} 2604 ; 2605 2606 StartDependentFnTerm 2607 : PARSEOP_STARTDEPENDENTFN '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STARTDEPENDENTFN);} 2608 ByteConstExpr 2609 ',' ByteConstExpr 2610 ')' '{' 2611 ResourceMacroList '}' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$9);} 2612 | PARSEOP_STARTDEPENDENTFN '(' 2613 error ')' {$$ = AslDoError(); yyclearin;} 2614 ; 2615 2616 UartSerialBusTerm 2617 : PARSEOP_UART_SERIALBUS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UART_SERIALBUS);} 2618 DWordConstExpr /* 04: ConnectionSpeed */ 2619 OptionalBitsPerByte /* 05: BitsPerByte */ 2620 OptionalStopBits /* 06: StopBits */ 2621 ',' ByteConstExpr /* 08: LinesInUse */ 2622 OptionalEndian /* 09: Endianess */ 2623 OptionalParityType /* 10: Parity */ 2624 OptionalFlowControl /* 11: FlowControl */ 2625 ',' WordConstExpr /* 13: Rx BufferSize */ 2626 ',' WordConstExpr /* 15: Tx BufferSize */ 2627 ',' StringData /* 17: ResourceSource */ 2628 OptionalByteConstExpr /* 18: ResourceSourceIndex */ 2629 OptionalResourceType /* 19: ResourceType */ 2630 OptionalNameString /* 20: DescriptorName */ 2631 OptionalBuffer_Last /* 21: VendorData */ 2632 ')' {$$ = TrLinkChildren ($<n>3,14,$4,$5,$6,$8,$9,$10,$11,$13,$15,$17,$18,$19,$20,$21);} 2633 | PARSEOP_UART_SERIALBUS '(' 2634 error ')' {$$ = AslDoError(); yyclearin;} 2635 ; 2636 2637 VendorLongTerm 2638 : PARSEOP_VENDORLONG '(' {$<n>$ = TrCreateLeafNode (PARSEOP_VENDORLONG);} 2639 OptionalNameString_First 2640 ')' '{' 2641 ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} 2642 | PARSEOP_VENDORLONG '(' 2643 error ')' {$$ = AslDoError(); yyclearin;} 2644 ; 2645 2646 VendorShortTerm 2647 : PARSEOP_VENDORSHORT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_VENDORSHORT);} 2648 OptionalNameString_First 2649 ')' '{' 2650 ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} 2651 | PARSEOP_VENDORSHORT '(' 2652 error ')' {$$ = AslDoError(); yyclearin;} 2653 ; 2654 2655 WordBusNumberTerm 2656 : PARSEOP_WORDBUSNUMBER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WORDBUSNUMBER);} 2657 OptionalResourceType_First 2658 OptionalMinType 2659 OptionalMaxType 2660 OptionalDecodeType 2661 ',' WordConstExpr 2662 ',' WordConstExpr 2663 ',' WordConstExpr 2664 ',' WordConstExpr 2665 ',' WordConstExpr 2666 OptionalByteConstExpr 2667 OptionalStringData 2668 OptionalNameString_Last 2669 ')' {$$ = TrLinkChildren ($<n>3,12,$4,$5,$6,$7,$9,$11,$13,$15,$17,$18,$19,$20);} 2670 | PARSEOP_WORDBUSNUMBER '(' 2671 error ')' {$$ = AslDoError(); yyclearin;} 2672 ; 2673 2674 WordIOTerm 2675 : PARSEOP_WORDIO '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WORDIO);} 2676 OptionalResourceType_First 2677 OptionalMinType 2678 OptionalMaxType 2679 OptionalDecodeType 2680 OptionalRangeType 2681 ',' WordConstExpr 2682 ',' WordConstExpr 2683 ',' WordConstExpr 2684 ',' WordConstExpr 2685 ',' WordConstExpr 2686 OptionalByteConstExpr 2687 OptionalStringData 2688 OptionalNameString 2689 OptionalType 2690 OptionalTranslationType_Last 2691 ')' {$$ = TrLinkChildren ($<n>3,15,$4,$5,$6,$7,$8,$10,$12,$14,$16,$18,$19,$20,$21,$22,$23);} 2692 | PARSEOP_WORDIO '(' 2693 error ')' {$$ = AslDoError(); yyclearin;} 2694 ; 2695 2696 WordSpaceTerm 2697 : PARSEOP_WORDSPACE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WORDSPACE);} 2698 ByteConstExpr {UtCheckIntegerRange ($4, 0xC0, 0xFF);} 2699 OptionalResourceType 2700 OptionalDecodeType 2701 OptionalMinType 2702 OptionalMaxType 2703 ',' ByteConstExpr 2704 ',' WordConstExpr 2705 ',' WordConstExpr 2706 ',' WordConstExpr 2707 ',' WordConstExpr 2708 ',' WordConstExpr 2709 OptionalByteConstExpr 2710 OptionalStringData 2711 OptionalNameString_Last 2712 ')' {$$ = TrLinkChildren ($<n>3,14,$4,$6,$7,$8,$9,$11,$13,$15,$17,$19,$21,$22,$23,$24);} 2713 | PARSEOP_WORDSPACE '(' 2714 error ')' {$$ = AslDoError(); yyclearin;} 2715 ; 2716 2717 2718 /******* Object References ***********************************************/ 2719 2720 /* Allow IO, DMA, IRQ Resource macro names to also be used as identifiers */ 2721 2722 NameString 2723 : NameSeg {} 2724 | PARSEOP_NAMESTRING {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) AslCompilerlval.s);} 2725 | PARSEOP_IO {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "IO");} 2726 | PARSEOP_DMA {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "DMA");} 2727 | PARSEOP_IRQ {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "IRQ");} 2728 ; 2729 2730 NameSeg 2731 : PARSEOP_NAMESEG {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESEG, (ACPI_NATIVE_INT) AslCompilerlval.s);} 2732 ; 2733 2734 2735 /******* Helper rules ****************************************************/ 2736 2737 2738 AmlPackageLengthTerm 2739 : Integer {$$ = TrUpdateNode (PARSEOP_PACKAGE_LENGTH,(ACPI_PARSE_OBJECT *) $1);} 2740 ; 2741 2742 NameStringItem 2743 : ',' NameString {$$ = $2;} 2744 | ',' error {$$ = AslDoError (); yyclearin;} 2745 ; 2746 2747 TermArgItem 2748 : ',' TermArg {$$ = $2;} 2749 | ',' error {$$ = AslDoError (); yyclearin;} 2750 ; 2751 2752 OptionalBusMasterKeyword 2753 : ',' {$$ = TrCreateLeafNode (PARSEOP_BUSMASTERTYPE_MASTER);} 2754 | ',' PARSEOP_BUSMASTERTYPE_MASTER {$$ = TrCreateLeafNode (PARSEOP_BUSMASTERTYPE_MASTER);} 2755 | ',' PARSEOP_BUSMASTERTYPE_NOTMASTER {$$ = TrCreateLeafNode (PARSEOP_BUSMASTERTYPE_NOTMASTER);} 2756 ; 2757 2758 OptionalAccessAttribTerm 2759 : {$$ = NULL;} 2760 | ',' {$$ = NULL;} 2761 | ',' ByteConstExpr {$$ = $2;} 2762 | ',' AccessAttribKeyword {$$ = $2;} 2763 ; 2764 2765 OptionalAccessSize 2766 : {$$ = TrCreateValuedLeafNode (PARSEOP_BYTECONST, 0);} 2767 | ',' {$$ = TrCreateValuedLeafNode (PARSEOP_BYTECONST, 0);} 2768 | ',' ByteConstExpr {$$ = $2;} 2769 ; 2770 2771 OptionalAddressingMode 2772 : ',' {$$ = NULL;} 2773 | ',' AddressingModeKeyword {$$ = $2;} 2774 ; 2775 2776 OptionalAddressRange 2777 : {$$ = NULL;} 2778 | ',' {$$ = NULL;} 2779 | ',' AddressKeyword {$$ = $2;} 2780 ; 2781 2782 OptionalBitsPerByte 2783 : ',' {$$ = NULL;} 2784 | ',' BitsPerByteKeyword {$$ = $2;} 2785 ; 2786 2787 OptionalBuffer_Last 2788 : {$$ = NULL;} 2789 | ',' {$$ = NULL;} 2790 | ',' DataBufferTerm {$$ = $2;} 2791 ; 2792 2793 OptionalByteConstExpr 2794 : {$$ = NULL;} 2795 | ',' {$$ = NULL;} 2796 | ',' ByteConstExpr {$$ = $2;} 2797 ; 2798 2799 OptionalDecodeType 2800 : ',' {$$ = NULL;} 2801 | ',' DecodeKeyword {$$ = $2;} 2802 ; 2803 2804 OptionalDevicePolarity 2805 : ',' {$$ = NULL;} 2806 | ',' DevicePolarityKeyword {$$ = $2;} 2807 ; 2808 2809 OptionalDWordConstExpr 2810 : {$$ = NULL;} 2811 | ',' {$$ = NULL;} 2812 | ',' DWordConstExpr {$$ = $2;} 2813 ; 2814 2815 OptionalEndian 2816 : ',' {$$ = NULL;} 2817 | ',' EndianKeyword {$$ = $2;} 2818 ; 2819 2820 OptionalFlowControl 2821 : ',' {$$ = NULL;} 2822 | ',' FlowControlKeyword {$$ = $2;} 2823 ; 2824 2825 OptionalIoRestriction 2826 : ',' {$$ = NULL;} 2827 | ',' IoRestrictionKeyword {$$ = $2;} 2828 ; 2829 2830 OptionalListString 2831 : {$$ = TrCreateValuedLeafNode (PARSEOP_STRING_LITERAL, ACPI_TO_INTEGER (""));} /* Placeholder is a NULL string */ 2832 | ',' {$$ = TrCreateValuedLeafNode (PARSEOP_STRING_LITERAL, ACPI_TO_INTEGER (""));} /* Placeholder is a NULL string */ 2833 | ',' TermArg {$$ = $2;} 2834 ; 2835 2836 OptionalMaxType 2837 : ',' {$$ = NULL;} 2838 | ',' MaxKeyword {$$ = $2;} 2839 ; 2840 2841 OptionalMemType 2842 : ',' {$$ = NULL;} 2843 | ',' MemTypeKeyword {$$ = $2;} 2844 ; 2845 2846 OptionalMinType 2847 : ',' {$$ = NULL;} 2848 | ',' MinKeyword {$$ = $2;} 2849 ; 2850 2851 OptionalNameString 2852 : {$$ = NULL;} 2853 | ',' {$$ = NULL;} 2854 | ',' NameString {$$ = $2;} 2855 ; 2856 2857 OptionalNameString_Last 2858 : {$$ = NULL;} 2859 | ',' {$$ = NULL;} 2860 | ',' NameString {$$ = $2;} 2861 ; 2862 2863 OptionalNameString_First 2864 : {$$ = TrCreateLeafNode (PARSEOP_ZERO);} 2865 | NameString {$$ = $1;} 2866 ; 2867 2868 OptionalObjectTypeKeyword 2869 : {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_UNK);} 2870 | ',' ObjectTypeKeyword {$$ = $2;} 2871 ; 2872 2873 OptionalParityType 2874 : ',' {$$ = NULL;} 2875 | ',' ParityTypeKeyword {$$ = $2;} 2876 ; 2877 2878 OptionalQWordConstExpr 2879 : {$$ = NULL;} 2880 | ',' {$$ = NULL;} 2881 | ',' QWordConstExpr {$$ = $2;} 2882 ; 2883 2884 OptionalRangeType 2885 : ',' {$$ = NULL;} 2886 | ',' RangeTypeKeyword {$$ = $2;} 2887 ; 2888 2889 OptionalReadWriteKeyword 2890 : {$$ = TrCreateLeafNode (PARSEOP_READWRITETYPE_BOTH);} 2891 | PARSEOP_READWRITETYPE_BOTH {$$ = TrCreateLeafNode (PARSEOP_READWRITETYPE_BOTH);} 2892 | PARSEOP_READWRITETYPE_READONLY {$$ = TrCreateLeafNode (PARSEOP_READWRITETYPE_READONLY);} 2893 ; 2894 2895 OptionalReference 2896 : {$$ = TrCreateLeafNode (PARSEOP_ZERO);} /* Placeholder is a ZeroOp object */ 2897 | ',' {$$ = TrCreateLeafNode (PARSEOP_ZERO);} /* Placeholder is a ZeroOp object */ 2898 | ',' TermArg {$$ = $2;} 2899 ; 2900 2901 OptionalResourceType_First 2902 : {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_CONSUMER);} 2903 | ResourceTypeKeyword {$$ = $1;} 2904 ; 2905 2906 OptionalResourceType 2907 : {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_CONSUMER);} 2908 | ',' {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_CONSUMER);} 2909 | ',' ResourceTypeKeyword {$$ = $2;} 2910 ; 2911 2912 OptionalReturnArg 2913 : {$$ = TrSetNodeFlags (TrCreateLeafNode (PARSEOP_ZERO), NODE_IS_NULL_RETURN);} /* Placeholder is a ZeroOp object */ 2914 | TermArg {$$ = $1;} 2915 ; 2916 2917 OptionalSerializeRuleKeyword 2918 : {$$ = NULL;} 2919 | ',' {$$ = NULL;} 2920 | ',' SerializeRuleKeyword {$$ = $2;} 2921 ; 2922 2923 OptionalSlaveMode 2924 : ',' {$$ = NULL;} 2925 | ',' SlaveModeKeyword {$$ = $2;} 2926 ; 2927 2928 OptionalShareType 2929 : {$$ = NULL;} 2930 | ',' {$$ = NULL;} 2931 | ',' ShareTypeKeyword {$$ = $2;} 2932 ; 2933 2934 OptionalShareType_First 2935 : {$$ = NULL;} 2936 | ShareTypeKeyword {$$ = $1;} 2937 ; 2938 2939 OptionalStopBits 2940 : ',' {$$ = NULL;} 2941 | ',' StopBitsKeyword {$$ = $2;} 2942 ; 2943 2944 OptionalStringData 2945 : {$$ = NULL;} 2946 | ',' {$$ = NULL;} 2947 | ',' StringData {$$ = $2;} 2948 ; 2949 2950 OptionalTermArg 2951 : {$$ = NULL;} 2952 | TermArg {$$ = $1;} 2953 ; 2954 2955 OptionalType 2956 : {$$ = NULL;} 2957 | ',' {$$ = NULL;} 2958 | ',' TypeKeyword {$$ = $2;} 2959 ; 2960 2961 OptionalType_Last 2962 : {$$ = NULL;} 2963 | ',' {$$ = NULL;} 2964 | ',' TypeKeyword {$$ = $2;} 2965 ; 2966 2967 OptionalTranslationType_Last 2968 : {$$ = NULL;} 2969 | ',' {$$ = NULL;} 2970 | ',' TranslationKeyword {$$ = $2;} 2971 ; 2972 2973 OptionalWireMode 2974 : ',' {$$ = NULL;} 2975 | ',' WireModeKeyword {$$ = $2;} 2976 ; 2977 2978 OptionalWordConst 2979 : {$$ = NULL;} 2980 | WordConst {$$ = $1;} 2981 ; 2982 2983 OptionalWordConstExpr 2984 : ',' {$$ = NULL;} 2985 | ',' WordConstExpr {$$ = $2;} 2986 ; 2987 2988 OptionalXferSize 2989 : {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_32, 2);} 2990 | ',' {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_32, 2);} 2991 | ',' XferSizeKeyword {$$ = $2;} 2992 ; 2993