diff options
author | Robert Moore <Robert.Moore@intel.com> | 2016-06-10 10:34:08 -0700 |
---|---|---|
committer | Robert Moore <Robert.Moore@intel.com> | 2016-06-10 10:34:08 -0700 |
commit | 5eb659ffbb4f24265317c971e5567710cbafb789 (patch) | |
tree | d7136e33d92c80046b041d80e96fcef17513098b | |
parent | 3c128da48756d2bdb050653371055707f394a1b0 (diff) | |
download | acpica-5eb659ffbb4f24265317c971e5567710cbafb789.tar.gz |
iASL: Split some of the ASL parse rules files.
Broken into more logical groups of rules.i
-rwxr-xr-x | generate/msvc9/AslCompiler.vcproj | 22 | ||||
-rw-r--r-- | generate/unix/iasl/Makefile | 9 | ||||
-rw-r--r-- | source/compiler/aslcstyle.y | 33 | ||||
-rw-r--r-- | source/compiler/aslhelpers.y | 358 | ||||
-rw-r--r-- | source/compiler/aslkeywords.y | 424 | ||||
-rw-r--r-- | source/compiler/aslparser.y | 6 | ||||
-rw-r--r-- | source/compiler/aslprimaries.y | 1196 | ||||
-rw-r--r-- | source/compiler/aslresources.y | 555 | ||||
-rw-r--r-- | source/compiler/aslrules.y | 1148 | ||||
-rw-r--r-- | source/compiler/asltokens.y | 42 | ||||
-rw-r--r-- | source/compiler/asltypes.y | 51 |
11 files changed, 2185 insertions, 1659 deletions
diff --git a/generate/msvc9/AslCompiler.vcproj b/generate/msvc9/AslCompiler.vcproj index 1ee62c08e..9e6e90c95 100755 --- a/generate/msvc9/AslCompiler.vcproj +++ b/generate/msvc9/AslCompiler.vcproj @@ -2421,6 +2421,14 @@ > </File> <File + RelativePath="..\..\source\compiler\aslhelpers.y" + > + </File> + <File + RelativePath="..\..\source\compiler\aslkeywords.y" + > + </File> + <File RelativePath="..\..\source\compiler\aslparser.y" > <FileConfiguration @@ -2430,7 +2438,7 @@ Name="VCCustomBuildTool" Description="M4 Macro Preprocessor ($(InputPath)) $(InputDir)" CommandLine="c:\GnuWin32\bin\m4 -P -I../../source/compiler ../../source/compiler/$(InputName).y > ./AslCompiler/AslCompiler.y
" - AdditionalDependencies="$(InputDir)aslrules.y;$(InputDir)aslsupport.y;$(InputDir)asltokens.y;$(InputDir)asltypes.y;$(InputDir)aslcstyle.y;$(InputDir)aslresources.y" + AdditionalDependencies="$(InputDir)aslrules.y;$(InputDir)aslsupport.y;$(InputDir)asltokens.y;$(InputDir)asltypes.y;$(InputDir)aslcstyle.y;$(InputDir)aslcstructs.y;$(InputDir)aslresources.y;$(InputDir)aslprimaries.y;$(InputDir)aslkeywords.y;$(InputDir)aslhelpers.y" Outputs=" ./AslCompiler/AslCompiler.y" /> </FileConfiguration> @@ -2441,12 +2449,16 @@ Name="VCCustomBuildTool" Description="M4 Macro Preprocessor ($(InputPath)) > AslCompilerDebug/AslCompilerDebug.y" CommandLine="c:\GnuWin32\bin\m4 -P -I../../source/compiler $(InputPath) > ./AslCompilerDebug/AslCompilerDebug.y
" - AdditionalDependencies="$(InputDir)aslrules.y;$(InputDir)aslsupport.y;$(InputDir)asltokens.y;$(InputDir)asltypes.y;$(InputDir)aslcstyle.y;$(InputDir)aslresources.y" + AdditionalDependencies="$(InputDir)aslrules.y;$(InputDir)aslsupport.y;$(InputDir)asltokens.y;$(InputDir)asltypes.y;$(InputDir)aslcstyle.y;$(InputDir)aslcstructs.y;$(InputDir)aslresources.y;$(InputDir)aslprimaries.y;$(InputDir)aslkeywords.y;$(InputDir)aslhelpers.y" Outputs=" ./AslCompilerDebug/AslCompilerDebug.y" /> </FileConfiguration> </File> <File + RelativePath="..\..\source\compiler\aslprimaries.y" + > + </File> + <File RelativePath="..\..\source\compiler\aslresources.y" > </File> @@ -3619,6 +3631,7 @@ Name="VCCustomBuildTool" Description="Bison - Main compiler parser generation ($(InputPath))" CommandLine="c:\GnuWin32\bin\bison -pAslCompiler -t -d -v --warnings=yacc -oAslCompiler/$(InputName).y.c ./AslCompiler/aslcompiler.y
" + AdditionalDependencies="$(InputDir)aslcstructs.y;$(InputDir)aslcstyle.y;$(InputDir)aslhelpers.y;$(InputDir)aslkeywords.y;$(InputDir)aslparser.y;$(InputDir)aslprimaries.y;$(InputDir)aslrules.y;$(InputDir)aslsupport.y;$(InputDir)asltokens.y;$(InputDir)asltypes.y;$(InputDir)aslresources.y" Outputs="./AslCompiler/$(InputName).y.c;./AslCompiler/$(InputName).y.h" /> </FileConfiguration> @@ -3660,6 +3673,10 @@ </FileConfiguration> </File> <File + RelativePath=".\AslCompiler\AslCompiler.y.output" + > + </File> + <File RelativePath="AslCompilerDebug\AslCompilerDebug.l.c" > <FileConfiguration @@ -3703,6 +3720,7 @@ Name="VCCustomBuildTool" Description="Bison - Main compiler parser generation ($(InputPath)) DEBUG" CommandLine="c:\GnuWin32\bin\bison -pAslCompiler -t -d -v --warnings=yacc -oAslCompilerDebug/AslCompilerDebug.y.c AslCompilerDebug/AslCompilerDebug.y
copy /Y AslCompilerDebug\AslCompilerDebug.y.h AslCompilerDebug\AslCompiler.y.h
" + AdditionalDependencies="$(InputDir)aslcstructs.y;$(InputDir)aslcstyle.y;$(InputDir)aslhelpers.y;$(InputDir)aslkeywords.y;$(InputDir)aslparser.y;$(InputDir)aslprimaries.y;$(InputDir)aslrules.y;$(InputDir)aslsupport.y;$(InputDir)asltokens.y;$(InputDir)asltypes.y;$(InputDir)aslresources.y" Outputs="AslCompilerDebug\AslCompilerDebug.y.c;AslCompilerDebug\AslCompilerDebug.y.h" /> </FileConfiguration> diff --git a/generate/unix/iasl/Makefile b/generate/unix/iasl/Makefile index 73682f801..92e93c70e 100644 --- a/generate/unix/iasl/Makefile +++ b/generate/unix/iasl/Makefile @@ -245,12 +245,15 @@ MISC = \ ASL_PARSER = \ $(ASL_COMPILER)/aslcstyle.y\ + $(ASL_COMPILER)/aslcstructs.y\ + $(ASL_COMPILER)/aslhelpers.y\ $(ASL_COMPILER)/aslparser.y\ + $(ASL_COMPILER)/aslprimaries.y\ $(ASL_COMPILER)/aslresources.y\ + $(ASL_COMPILER)/aslrules.y\ $(ASL_COMPILER)/aslsupport.y\ $(ASL_COMPILER)/asltokens.y\ - $(ASL_COMPILER)/asltypes.y\ - $(ASL_COMPILER)/aslrules.y + $(ASL_COMPILER)/asltypes.y ASL_LEXER = \ $(ASL_COMPILER)/aslcompiler.l\ @@ -277,7 +280,7 @@ include ../Makefile.rules safe_yacc = \ _d=`mktemp -d $(OBJDIR)/$(1).XXXXXX` &&\ cd $$_d &&\ - $(YACC) $(YFLAGS) -d -p$(1) $(abspath $(2)) &&\ + $(YACC) $(YFLAGS) -v -d -p$(1) $(abspath $(2)) &&\ cd - &&\ mv $$_d/y.tab$(suffix $(3)) $(3);\ _r=$$?;\ diff --git a/source/compiler/aslcstyle.y b/source/compiler/aslcstyle.y index f510b8714..305d60d88 100644 --- a/source/compiler/aslcstyle.y +++ b/source/compiler/aslcstyle.y @@ -154,6 +154,13 @@ NoEcho(' * 13) = += -= *= /= %= <<= >>= &= ^= |= */ + +/******************************************************************************* + * + * Basic operations for math and logical expressions. + * + ******************************************************************************/ + Expression /* Unary operators */ @@ -212,33 +219,43 @@ Expression | TermArg PARSEOP_EXP_LOGICAL_OR {$<n>$ = TrCreateLeafNode (PARSEOP_LOR);} TermArg {$$ = TrLinkChildren ($<n>3,2,$1,$4);} - /* Parentheses */ + /* Parentheses */ | '(' TermArg ')' { $$ = $2;} - /* Index term -- "= BUF1[5]" on right-hand side of an equals (source) */ + /* Index term -- "= BUF1[5]" on right-hand side of an equals (source) */ - | SuperName PARSEOP_EXP_INDEX_LEFT TermArg PARSEOP_EXP_INDEX_RIGHT - {$$ = TrCreateLeafNode (PARSEOP_INDEX); + | SuperName PARSEOP_EXP_INDEX_LEFT + TermArg PARSEOP_EXP_INDEX_RIGHT {$$ = TrCreateLeafNode (PARSEOP_INDEX); TrLinkChildren ($$,3,$1,$3,TrCreateNullTarget ());} ; - /* Index term -- "BUF1[5] = " on left-hand side of an equals (target) */ + /* Index term -- "BUF1[5] = " on left-hand side of an equals (target) */ IndexExpTerm - : SuperName PARSEOP_EXP_INDEX_LEFT TermArg PARSEOP_EXP_INDEX_RIGHT - {$$ = TrCreateLeafNode (PARSEOP_INDEX); + : SuperName PARSEOP_EXP_INDEX_LEFT + TermArg PARSEOP_EXP_INDEX_RIGHT {$$ = TrCreateLeafNode (PARSEOP_INDEX); TrLinkChildren ($$,3,$1,$3,TrCreateNullTarget ());} ; + +/******************************************************************************* + * + * All assignment-type operations -- math and logical. Includes simple + * assignment and compound assignments. + * + ******************************************************************************/ + EqualsTerm - /* All assignment-type operations */ + /* Simple Store() operation */ : SuperName PARSEOP_EXP_EQUALS TermArg {$$ = TrCreateAssignmentNode ($1, $3);} + /* Compound assignments -- Add (operand, operand, target) */ + | TermArg PARSEOP_EXP_ADD_EQ {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);} TermArg {$$ = TrLinkChildren ($<n>3,3,$1,$4, TrSetNodeFlags (TrCreateTargetOperand ($1, NULL), NODE_IS_TARGET));} diff --git a/source/compiler/aslhelpers.y b/source/compiler/aslhelpers.y new file mode 100644 index 000000000..ed96eba55 --- /dev/null +++ b/source/compiler/aslhelpers.y @@ -0,0 +1,358 @@ +NoEcho(' +/****************************************************************************** + * + * Module Name: aslhelpers.y - helper and option terms + * + *****************************************************************************/ + +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp. + * All rights reserved. + * + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. + * + * 4. Disclaimer and Export Compliance + * + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A + * PARTICULAR PURPOSE. + * + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY + * LIMITED REMEDY. + * + * 4.3. Licensee shall not export, either directly or indirectly, any of this + * software or system incorporating such software without first obtaining any + * required license or other approval from the U. S. Department of Commerce or + * any other agency or department of the United States Government. In the + * event Licensee exports any such software from the United States or + * re-exports any such software from a foreign destination, Licensee shall + * ensure that the distribution and export/re-export of the software is in + * compliance with all laws, regulations, orders, or other restrictions of the + * U.S. Export Administration Regulations. Licensee agrees that neither it nor + * any of its subsidiaries will export/re-export any technical data, process, + * software, or service, directly or indirectly, to any country for which the + * United States government or any agency thereof requires an export license, + * other governmental approval, or letter of assurance, without first obtaining + * such license, approval or letter. + * + *****************************************************************************/ + +') + + +/******************************************************************************* + * + * ASL Helper Terms + * + ******************************************************************************/ + +OptionalBusMasterKeyword + : ',' {$$ = TrCreateLeafNode ( + PARSEOP_BUSMASTERTYPE_MASTER);} + | ',' PARSEOP_BUSMASTERTYPE_MASTER {$$ = TrCreateLeafNode ( + PARSEOP_BUSMASTERTYPE_MASTER);} + | ',' PARSEOP_BUSMASTERTYPE_NOTMASTER {$$ = TrCreateLeafNode ( + PARSEOP_BUSMASTERTYPE_NOTMASTER);} + ; + +OptionalAccessAttribTerm + : {$$ = NULL;} + | ',' {$$ = NULL;} + | ',' ByteConstExpr {$$ = $2;} + | ',' AccessAttribKeyword {$$ = $2;} + ; + +OptionalAccessSize + : {$$ = TrCreateValuedLeafNode ( + PARSEOP_BYTECONST, 0);} + | ',' {$$ = TrCreateValuedLeafNode ( + PARSEOP_BYTECONST, 0);} + | ',' ByteConstExpr {$$ = $2;} + ; + +OptionalAddressingMode + : ',' {$$ = NULL;} + | ',' AddressingModeKeyword {$$ = $2;} + ; + +OptionalAddressRange + : {$$ = NULL;} + | ',' {$$ = NULL;} + | ',' AddressKeyword {$$ = $2;} + ; + +OptionalBitsPerByte + : ',' {$$ = NULL;} + | ',' BitsPerByteKeyword {$$ = $2;} + ; + +OptionalBuffer_Last + : {$$ = NULL;} + | ',' {$$ = NULL;} + | ',' RawDataBufferTerm {$$ = $2;} + ; + +OptionalByteConstExpr + : {$$ = NULL;} + | ',' {$$ = NULL;} + | ',' ByteConstExpr {$$ = $2;} + ; + +OptionalDecodeType + : ',' {$$ = NULL;} + | ',' DecodeKeyword {$$ = $2;} + ; + +OptionalDevicePolarity + : ',' {$$ = NULL;} + | ',' DevicePolarityKeyword {$$ = $2;} + ; + +OptionalDWordConstExpr + : {$$ = NULL;} + | ',' {$$ = NULL;} + | ',' DWordConstExpr {$$ = $2;} + ; + +OptionalEndian + : ',' {$$ = NULL;} + | ',' EndianKeyword {$$ = $2;} + ; + +OptionalFlowControl + : ',' {$$ = NULL;} + | ',' FlowControlKeyword {$$ = $2;} + ; + +OptionalIoRestriction + : ',' {$$ = NULL;} + | ',' IoRestrictionKeyword {$$ = $2;} + ; + +OptionalListString + : {$$ = TrCreateValuedLeafNode ( + PARSEOP_STRING_LITERAL, + ACPI_TO_INTEGER (""));} /* Placeholder is a NULL string */ + | ',' {$$ = TrCreateValuedLeafNode ( + PARSEOP_STRING_LITERAL, + ACPI_TO_INTEGER (""));} /* Placeholder is a NULL string */ + | ',' TermArg {$$ = $2;} + ; + +OptionalMaxType + : ',' {$$ = NULL;} + | ',' MaxKeyword {$$ = $2;} + ; + +OptionalMemType + : ',' {$$ = NULL;} + | ',' MemTypeKeyword {$$ = $2;} + ; + +OptionalMinType + : ',' {$$ = NULL;} + | ',' MinKeyword {$$ = $2;} + ; + +OptionalNameString + : {$$ = NULL;} + | ',' {$$ = NULL;} + | ',' NameString {$$ = $2;} + ; + +OptionalNameString_Last + : {$$ = NULL;} + | ',' {$$ = NULL;} + | ',' NameString {$$ = $2;} + ; + +OptionalNameString_First + : {$$ = TrCreateLeafNode ( + PARSEOP_ZERO);} + | NameString {$$ = $1;} + ; + +OptionalObjectTypeKeyword + : {$$ = TrCreateLeafNode ( + PARSEOP_OBJECTTYPE_UNK);} + | ',' ObjectTypeKeyword {$$ = $2;} + ; + +OptionalParityType + : ',' {$$ = NULL;} + | ',' ParityTypeKeyword {$$ = $2;} + ; + +OptionalQWordConstExpr + : {$$ = NULL;} + | ',' {$$ = NULL;} + | ',' QWordConstExpr {$$ = $2;} + ; + +OptionalRangeType + : ',' {$$ = NULL;} + | ',' RangeTypeKeyword {$$ = $2;} + ; + +OptionalReadWriteKeyword + : {$$ = TrCreateLeafNode ( + PARSEOP_READWRITETYPE_BOTH);} + | PARSEOP_READWRITETYPE_BOTH {$$ = TrCreateLeafNode ( + PARSEOP_READWRITETYPE_BOTH);} + | PARSEOP_READWRITETYPE_READONLY {$$ = TrCreateLeafNode ( + PARSEOP_READWRITETYPE_READONLY);} + ; + +OptionalResourceType_First + : {$$ = TrCreateLeafNode ( + PARSEOP_RESOURCETYPE_CONSUMER);} + | ResourceTypeKeyword {$$ = $1;} + ; + +OptionalResourceType + : {$$ = TrCreateLeafNode ( + PARSEOP_RESOURCETYPE_CONSUMER);} + | ',' {$$ = TrCreateLeafNode ( + PARSEOP_RESOURCETYPE_CONSUMER);} + | ',' ResourceTypeKeyword {$$ = $2;} + ; + +OptionalSlaveMode + : ',' {$$ = NULL;} + | ',' SlaveModeKeyword {$$ = $2;} + ; + +OptionalShareType + : {$$ = NULL;} + | ',' {$$ = NULL;} + | ',' ShareTypeKeyword {$$ = $2;} + ; + +OptionalShareType_First + : {$$ = NULL;} + | ShareTypeKeyword {$$ = $1;} + ; + +OptionalStopBits + : ',' {$$ = NULL;} + | ',' StopBitsKeyword {$$ = $2;} + ; + +OptionalStringData + : {$$ = NULL;} + | ',' {$$ = NULL;} + | ',' StringData {$$ = $2;} + ; + +OptionalTranslationType_Last + : {$$ = NULL;} + | ',' {$$ = NULL;} + | ',' TranslationKeyword {$$ = $2;} + ; + +OptionalType + : {$$ = NULL;} + | ',' {$$ = NULL;} + | ',' TypeKeyword {$$ = $2;} + ; + +OptionalType_Last + : {$$ = NULL;} + | ',' {$$ = NULL;} + | ',' TypeKeyword {$$ = $2;} + ; + +OptionalWireMode + : ',' {$$ = NULL;} + | ',' WireModeKeyword {$$ = $2;} + ; + +OptionalWordConstExpr + : ',' {$$ = NULL;} + | ',' WordConstExpr {$$ = $2;} + ; + +OptionalXferSize + : {$$ = TrCreateValuedLeafNode ( + PARSEOP_XFERSIZE_32, 2);} + | ',' {$$ = TrCreateValuedLeafNode ( + PARSEOP_XFERSIZE_32, 2);} + | ',' XferSizeKeyword {$$ = $2;} + ; diff --git a/source/compiler/aslkeywords.y b/source/compiler/aslkeywords.y new file mode 100644 index 000000000..644a1a1ff --- /dev/null +++ b/source/compiler/aslkeywords.y @@ -0,0 +1,424 @@ +NoEcho(' +/****************************************************************************** + * + * Module Name: aslkeywords.y - Rules for resource descriptor keywords + * + *****************************************************************************/ + +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp. + * All rights reserved. + * + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. + * + * 4. Disclaimer and Export Compliance + * + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A + * PARTICULAR PURPOSE. + * + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY + * LIMITED REMEDY. + * + * 4.3. Licensee shall not export, either directly or indirectly, any of this + * software or system incorporating such software without first obtaining any + * required license or other approval from the U. S. Department of Commerce or + * any other agency or department of the United States Government. In the + * event Licensee exports any such software from the United States or + * re-exports any such software from a foreign destination, Licensee shall + * ensure that the distribution and export/re-export of the software is in + * compliance with all laws, regulations, orders, or other restrictions of the + * U.S. Export Administration Regulations. Licensee agrees that neither it nor + * any of its subsidiaries will export/re-export any technical data, process, + * software, or service, directly or indirectly, to any country for which the + * United States government or any agency thereof requires an export license, + * other governmental approval, or letter of assurance, without first obtaining + * such license, approval or letter. + * + *****************************************************************************/ + +') + +/******************************************************************************* + * + * ASL Parameter Keyword Terms + * + ******************************************************************************/ + +AccessAttribKeyword + : PARSEOP_ACCESSATTRIB_BLOCK {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_BLOCK);} + | PARSEOP_ACCESSATTRIB_BLOCK_CALL {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_BLOCK_CALL);} + | PARSEOP_ACCESSATTRIB_BYTE {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_BYTE);} + | PARSEOP_ACCESSATTRIB_QUICK {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_QUICK );} + | PARSEOP_ACCESSATTRIB_SND_RCV {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_SND_RCV);} + | PARSEOP_ACCESSATTRIB_WORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_WORD);} + | PARSEOP_ACCESSATTRIB_WORD_CALL {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_WORD_CALL);} + | PARSEOP_ACCESSATTRIB_MULTIBYTE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_MULTIBYTE);} + ByteConst + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_ACCESSATTRIB_RAW_BYTES '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_RAW_BYTES);} + ByteConst + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_ACCESSATTRIB_RAW_PROCESS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_RAW_PROCESS);} + ByteConst + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} + ; + +AccessTypeKeyword + : PARSEOP_ACCESSTYPE_ANY {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_ANY);} + | PARSEOP_ACCESSTYPE_BYTE {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_BYTE);} + | PARSEOP_ACCESSTYPE_WORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_WORD);} + | PARSEOP_ACCESSTYPE_DWORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_DWORD);} + | PARSEOP_ACCESSTYPE_QWORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_QWORD);} + | PARSEOP_ACCESSTYPE_BUF {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_BUF);} + ; + +AddressingModeKeyword + : PARSEOP_ADDRESSINGMODE_7BIT {$$ = TrCreateLeafNode (PARSEOP_ADDRESSINGMODE_7BIT);} + | PARSEOP_ADDRESSINGMODE_10BIT {$$ = TrCreateLeafNode (PARSEOP_ADDRESSINGMODE_10BIT);} + ; + +AddressKeyword + : PARSEOP_ADDRESSTYPE_MEMORY {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_MEMORY);} + | PARSEOP_ADDRESSTYPE_RESERVED {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_RESERVED);} + | PARSEOP_ADDRESSTYPE_NVS {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_NVS);} + | PARSEOP_ADDRESSTYPE_ACPI {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_ACPI);} + ; + +AddressSpaceKeyword + : ByteConst {$$ = UtCheckIntegerRange ($1, 0x0A, 0xFF);} + | RegionSpaceKeyword {} + ; + +BitsPerByteKeyword + : PARSEOP_BITSPERBYTE_FIVE {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_FIVE);} + | PARSEOP_BITSPERBYTE_SIX {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_SIX);} + | PARSEOP_BITSPERBYTE_SEVEN {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_SEVEN);} + | PARSEOP_BITSPERBYTE_EIGHT {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_EIGHT);} + | PARSEOP_BITSPERBYTE_NINE {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_NINE);} + ; + +ClockPhaseKeyword + : PARSEOP_CLOCKPHASE_FIRST {$$ = TrCreateLeafNode (PARSEOP_CLOCKPHASE_FIRST);} + | PARSEOP_CLOCKPHASE_SECOND {$$ = TrCreateLeafNode (PARSEOP_CLOCKPHASE_SECOND);} + ; + +ClockPolarityKeyword + : PARSEOP_CLOCKPOLARITY_LOW {$$ = TrCreateLeafNode (PARSEOP_CLOCKPOLARITY_LOW);} + | PARSEOP_CLOCKPOLARITY_HIGH {$$ = TrCreateLeafNode (PARSEOP_CLOCKPOLARITY_HIGH);} + ; + +DecodeKeyword + : PARSEOP_DECODETYPE_POS {$$ = TrCreateLeafNode (PARSEOP_DECODETYPE_POS);} + | PARSEOP_DECODETYPE_SUB {$$ = TrCreateLeafNode (PARSEOP_DECODETYPE_SUB);} + ; + +DevicePolarityKeyword + : PARSEOP_DEVICEPOLARITY_LOW {$$ = TrCreateLeafNode (PARSEOP_DEVICEPOLARITY_LOW);} + | PARSEOP_DEVICEPOLARITY_HIGH {$$ = TrCreateLeafNode (PARSEOP_DEVICEPOLARITY_HIGH);} + ; + +DMATypeKeyword + : PARSEOP_DMATYPE_A {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_A);} + | PARSEOP_DMATYPE_COMPATIBILITY {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_COMPATIBILITY);} + | PARSEOP_DMATYPE_B {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_B);} + | PARSEOP_DMATYPE_F {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_F);} + ; + +EndianKeyword + : PARSEOP_ENDIAN_LITTLE {$$ = TrCreateLeafNode (PARSEOP_ENDIAN_LITTLE);} + | PARSEOP_ENDIAN_BIG {$$ = TrCreateLeafNode (PARSEOP_ENDIAN_BIG);} + ; + +FlowControlKeyword + : PARSEOP_FLOWCONTROL_HW {$$ = TrCreateLeafNode (PARSEOP_FLOWCONTROL_HW);} + | PARSEOP_FLOWCONTROL_NONE {$$ = TrCreateLeafNode (PARSEOP_FLOWCONTROL_NONE);} + | PARSEOP_FLOWCONTROL_SW {$$ = TrCreateLeafNode (PARSEOP_FLOWCONTROL_SW);} + ; + +InterruptLevel + : PARSEOP_INTLEVEL_ACTIVEBOTH {$$ = TrCreateLeafNode (PARSEOP_INTLEVEL_ACTIVEBOTH);} + | PARSEOP_INTLEVEL_ACTIVEHIGH {$$ = TrCreateLeafNode (PARSEOP_INTLEVEL_ACTIVEHIGH);} + | PARSEOP_INTLEVEL_ACTIVELOW {$$ = TrCreateLeafNode (PARSEOP_INTLEVEL_ACTIVELOW);} + ; + +InterruptTypeKeyword + : PARSEOP_INTTYPE_EDGE {$$ = TrCreateLeafNode (PARSEOP_INTTYPE_EDGE);} + | PARSEOP_INTTYPE_LEVEL {$$ = TrCreateLeafNode (PARSEOP_INTTYPE_LEVEL);} + ; + +IODecodeKeyword + : PARSEOP_IODECODETYPE_16 {$$ = TrCreateLeafNode (PARSEOP_IODECODETYPE_16);} + | PARSEOP_IODECODETYPE_10 {$$ = TrCreateLeafNode (PARSEOP_IODECODETYPE_10);} + ; + +IoRestrictionKeyword + : PARSEOP_IORESTRICT_IN {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_IN);} + | PARSEOP_IORESTRICT_OUT {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_OUT);} + | PARSEOP_IORESTRICT_NONE {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_NONE);} + | PARSEOP_IORESTRICT_PRESERVE {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_PRESERVE);} + ; + +LockRuleKeyword + : PARSEOP_LOCKRULE_LOCK {$$ = TrCreateLeafNode (PARSEOP_LOCKRULE_LOCK);} + | PARSEOP_LOCKRULE_NOLOCK {$$ = TrCreateLeafNode (PARSEOP_LOCKRULE_NOLOCK);} + ; + +MatchOpKeyword + : PARSEOP_MATCHTYPE_MTR {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MTR);} + | PARSEOP_MATCHTYPE_MEQ {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MEQ);} + | PARSEOP_MATCHTYPE_MLE {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MLE);} + | PARSEOP_MATCHTYPE_MLT {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MLT);} + | PARSEOP_MATCHTYPE_MGE {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MGE);} + | PARSEOP_MATCHTYPE_MGT {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MGT);} + ; + +MaxKeyword + : PARSEOP_MAXTYPE_FIXED {$$ = TrCreateLeafNode (PARSEOP_MAXTYPE_FIXED);} + | PARSEOP_MAXTYPE_NOTFIXED {$$ = TrCreateLeafNode (PARSEOP_MAXTYPE_NOTFIXED);} + ; + +MemTypeKeyword + : PARSEOP_MEMTYPE_CACHEABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_CACHEABLE);} + | PARSEOP_MEMTYPE_WRITECOMBINING {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_WRITECOMBINING);} + | PARSEOP_MEMTYPE_PREFETCHABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_PREFETCHABLE);} + | PARSEOP_MEMTYPE_NONCACHEABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_NONCACHEABLE);} + ; + +MinKeyword + : PARSEOP_MINTYPE_FIXED {$$ = TrCreateLeafNode (PARSEOP_MINTYPE_FIXED);} + | PARSEOP_MINTYPE_NOTFIXED {$$ = TrCreateLeafNode (PARSEOP_MINTYPE_NOTFIXED);} + ; + +ObjectTypeKeyword + : PARSEOP_OBJECTTYPE_UNK {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_UNK);} + | PARSEOP_OBJECTTYPE_INT {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_INT);} + | PARSEOP_OBJECTTYPE_STR {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_STR);} + | PARSEOP_OBJECTTYPE_BUF {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_BUF);} + | PARSEOP_OBJECTTYPE_PKG {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_PKG);} + | PARSEOP_OBJECTTYPE_FLD {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_FLD);} + | PARSEOP_OBJECTTYPE_DEV {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_DEV);} + | PARSEOP_OBJECTTYPE_EVT {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_EVT);} + | PARSEOP_OBJECTTYPE_MTH {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_MTH);} + | PARSEOP_OBJECTTYPE_MTX {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_MTX);} + | PARSEOP_OBJECTTYPE_OPR {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_OPR);} + | PARSEOP_OBJECTTYPE_POW {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_POW);} + | PARSEOP_OBJECTTYPE_PRO {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_PRO);} + | PARSEOP_OBJECTTYPE_THZ {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_THZ);} + | PARSEOP_OBJECTTYPE_BFF {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_BFF);} + | PARSEOP_OBJECTTYPE_DDB {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_DDB);} + ; + +ParityTypeKeyword + : PARSEOP_PARITYTYPE_SPACE {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_SPACE);} + | PARSEOP_PARITYTYPE_MARK {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_MARK);} + | PARSEOP_PARITYTYPE_ODD {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_ODD);} + | PARSEOP_PARITYTYPE_EVEN {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_EVEN);} + | PARSEOP_PARITYTYPE_NONE {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_NONE);} + ; + +PinConfigByte + : PinConfigKeyword {$$ = $1;} + | ByteConstExpr {$$ = UtCheckIntegerRange ($1, 0x80, 0xFF);} + ; + +PinConfigKeyword + : PARSEOP_PIN_NOPULL {$$ = TrCreateLeafNode (PARSEOP_PIN_NOPULL);} + | PARSEOP_PIN_PULLDOWN {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLDOWN);} + | PARSEOP_PIN_PULLUP {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLUP);} + | PARSEOP_PIN_PULLDEFAULT {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLDEFAULT);} + ; + +PldKeyword + : PARSEOP_PLD_REVISION {$$ = TrCreateLeafNode (PARSEOP_PLD_REVISION);} + | PARSEOP_PLD_IGNORECOLOR {$$ = TrCreateLeafNode (PARSEOP_PLD_IGNORECOLOR);} + | PARSEOP_PLD_RED {$$ = TrCreateLeafNode (PARSEOP_PLD_RED);} + | PARSEOP_PLD_GREEN {$$ = TrCreateLeafNode (PARSEOP_PLD_GREEN);} + | PARSEOP_PLD_BLUE {$$ = TrCreateLeafNode (PARSEOP_PLD_BLUE);} + | PARSEOP_PLD_WIDTH {$$ = TrCreateLeafNode (PARSEOP_PLD_WIDTH);} + | PARSEOP_PLD_HEIGHT {$$ = TrCreateLeafNode (PARSEOP_PLD_HEIGHT);} + | PARSEOP_PLD_USERVISIBLE {$$ = TrCreateLeafNode (PARSEOP_PLD_USERVISIBLE);} + | PARSEOP_PLD_DOCK {$$ = TrCreateLeafNode (PARSEOP_PLD_DOCK);} + | PARSEOP_PLD_LID {$$ = TrCreateLeafNode (PARSEOP_PLD_LID);} + | PARSEOP_PLD_PANEL {$$ = TrCreateLeafNode (PARSEOP_PLD_PANEL);} + | PARSEOP_PLD_VERTICALPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_VERTICALPOSITION);} + | PARSEOP_PLD_HORIZONTALPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_HORIZONTALPOSITION);} + | PARSEOP_PLD_SHAPE {$$ = TrCreateLeafNode (PARSEOP_PLD_SHAPE);} + | PARSEOP_PLD_GROUPORIENTATION {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPORIENTATION);} + | PARSEOP_PLD_GROUPTOKEN {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPTOKEN);} + | PARSEOP_PLD_GROUPPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPPOSITION);} + | PARSEOP_PLD_BAY {$$ = TrCreateLeafNode (PARSEOP_PLD_BAY);} + | PARSEOP_PLD_EJECTABLE {$$ = TrCreateLeafNode (PARSEOP_PLD_EJECTABLE);} + | PARSEOP_PLD_EJECTREQUIRED {$$ = TrCreateLeafNode (PARSEOP_PLD_EJECTREQUIRED);} + | PARSEOP_PLD_CABINETNUMBER {$$ = TrCreateLeafNode (PARSEOP_PLD_CABINETNUMBER);} + | PARSEOP_PLD_CARDCAGENUMBER {$$ = TrCreateLeafNode (PARSEOP_PLD_CARDCAGENUMBER);} + | PARSEOP_PLD_REFERENCE {$$ = TrCreateLeafNode (PARSEOP_PLD_REFERENCE);} + | PARSEOP_PLD_ROTATION {$$ = TrCreateLeafNode (PARSEOP_PLD_ROTATION);} + | PARSEOP_PLD_ORDER {$$ = TrCreateLeafNode (PARSEOP_PLD_ORDER);} + | PARSEOP_PLD_RESERVED {$$ = TrCreateLeafNode (PARSEOP_PLD_RESERVED);} + | PARSEOP_PLD_VERTICALOFFSET {$$ = TrCreateLeafNode (PARSEOP_PLD_VERTICALOFFSET);} + | PARSEOP_PLD_HORIZONTALOFFSET {$$ = TrCreateLeafNode (PARSEOP_PLD_HORIZONTALOFFSET);} + ; + +RangeTypeKeyword + : PARSEOP_RANGETYPE_ISAONLY {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_ISAONLY);} + | PARSEOP_RANGETYPE_NONISAONLY {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_NONISAONLY);} + | PARSEOP_RANGETYPE_ENTIRE {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_ENTIRE);} + ; + +RegionSpaceKeyword + : PARSEOP_REGIONSPACE_IO {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_IO);} + | PARSEOP_REGIONSPACE_MEM {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_MEM);} + | PARSEOP_REGIONSPACE_PCI {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCI);} + | PARSEOP_REGIONSPACE_EC {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_EC);} + | PARSEOP_REGIONSPACE_SMBUS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_SMBUS);} + | PARSEOP_REGIONSPACE_CMOS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_CMOS);} + | PARSEOP_REGIONSPACE_PCIBAR {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCIBAR);} + | PARSEOP_REGIONSPACE_IPMI {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_IPMI);} + | PARSEOP_REGIONSPACE_GPIO {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_GPIO);} + | PARSEOP_REGIONSPACE_GSBUS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_GSBUS);} + | PARSEOP_REGIONSPACE_PCC {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCC);} + | PARSEOP_REGIONSPACE_FFIXEDHW {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_FFIXEDHW);} + ; + +ResourceTypeKeyword + : PARSEOP_RESOURCETYPE_CONSUMER {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_CONSUMER);} + | PARSEOP_RESOURCETYPE_PRODUCER {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_PRODUCER);} + ; + +SerializeRuleKeyword + : PARSEOP_SERIALIZERULE_SERIAL {$$ = TrCreateLeafNode (PARSEOP_SERIALIZERULE_SERIAL);} + | PARSEOP_SERIALIZERULE_NOTSERIAL {$$ = TrCreateLeafNode (PARSEOP_SERIALIZERULE_NOTSERIAL);} + ; + +ShareTypeKeyword + : PARSEOP_SHARETYPE_SHARED {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_SHARED);} + | PARSEOP_SHARETYPE_EXCLUSIVE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_EXCLUSIVE);} + | PARSEOP_SHARETYPE_SHAREDWAKE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_SHAREDWAKE);} + | PARSEOP_SHARETYPE_EXCLUSIVEWAKE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_EXCLUSIVEWAKE);} + ; + +SlaveModeKeyword + : PARSEOP_SLAVEMODE_CONTROLLERINIT {$$ = TrCreateLeafNode (PARSEOP_SLAVEMODE_CONTROLLERINIT);} + | PARSEOP_SLAVEMODE_DEVICEINIT {$$ = TrCreateLeafNode (PARSEOP_SLAVEMODE_DEVICEINIT);} + ; + +StopBitsKeyword + : PARSEOP_STOPBITS_TWO {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_TWO);} + | PARSEOP_STOPBITS_ONEPLUSHALF {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ONEPLUSHALF);} + | PARSEOP_STOPBITS_ONE {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ONE);} + | PARSEOP_STOPBITS_ZERO {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ZERO);} + ; + +TranslationKeyword + : PARSEOP_TRANSLATIONTYPE_SPARSE {$$ = TrCreateLeafNode (PARSEOP_TRANSLATIONTYPE_SPARSE);} + | PARSEOP_TRANSLATIONTYPE_DENSE {$$ = TrCreateLeafNode (PARSEOP_TRANSLATIONTYPE_DENSE);} + ; + +TypeKeyword + : PARSEOP_TYPE_TRANSLATION {$$ = TrCreateLeafNode (PARSEOP_TYPE_TRANSLATION);} + | PARSEOP_TYPE_STATIC {$$ = TrCreateLeafNode (PARSEOP_TYPE_STATIC);} + ; + +UpdateRuleKeyword + : PARSEOP_UPDATERULE_PRESERVE {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_PRESERVE);} + | PARSEOP_UPDATERULE_ONES {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_ONES);} + | PARSEOP_UPDATERULE_ZEROS {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_ZEROS);} + ; + +WireModeKeyword + : PARSEOP_WIREMODE_FOUR {$$ = TrCreateLeafNode (PARSEOP_WIREMODE_FOUR);} + | PARSEOP_WIREMODE_THREE {$$ = TrCreateLeafNode (PARSEOP_WIREMODE_THREE);} + ; + +XferSizeKeyword + : PARSEOP_XFERSIZE_8 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_8, 0);} + | PARSEOP_XFERSIZE_16 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_16, 1);} + | PARSEOP_XFERSIZE_32 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_32, 2);} + | PARSEOP_XFERSIZE_64 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_64, 3);} + | PARSEOP_XFERSIZE_128 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_128, 4);} + | PARSEOP_XFERSIZE_256 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_256, 5);} + ; + +XferTypeKeyword + : PARSEOP_XFERTYPE_8 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_8);} + | PARSEOP_XFERTYPE_8_16 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_8_16);} + | PARSEOP_XFERTYPE_16 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_16);} + ; diff --git a/source/compiler/aslparser.y b/source/compiler/aslparser.y index 1d6210bf0..cca976bcd 100644 --- a/source/compiler/aslparser.y +++ b/source/compiler/aslparser.y @@ -138,6 +138,7 @@ void * AslLocalAllocate ( unsigned int Size); + /* Bison/yacc configuration */ #define static @@ -171,7 +172,7 @@ AslLocalAllocate ( * These shift/reduce conflicts are expected. There should be zero * reduce/reduce conflicts. */ -%expect 101 +%expect 102 /*! [Begin] no source code translation */ @@ -194,8 +195,11 @@ m4_include(asltypes.y) /* Production rules */ m4_include(aslrules.y) +m4_include(aslprimaries.y) m4_include(aslcstyle.y) +m4_include(aslkeywords.y) m4_include(aslresources.y) +m4_include(aslhelpers.y) %% /*! [End] no source code translation !*/ diff --git a/source/compiler/aslprimaries.y b/source/compiler/aslprimaries.y new file mode 100644 index 000000000..c34781303 --- /dev/null +++ b/source/compiler/aslprimaries.y @@ -0,0 +1,1196 @@ +NoEcho(' +/****************************************************************************** + * + * Module Name: aslprimaries.y - Rules for primary ASL operators + * + *****************************************************************************/ + +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp. + * All rights reserved. + * + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. + * + * 4. Disclaimer and Export Compliance + * + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A + * PARTICULAR PURPOSE. + * + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY + * LIMITED REMEDY. + * + * 4.3. Licensee shall not export, either directly or indirectly, any of this + * software or system incorporating such software without first obtaining any + * required license or other approval from the U. S. Department of Commerce or + * any other agency or department of the United States Government. In the + * event Licensee exports any such software from the United States or + * re-exports any such software from a foreign destination, Licensee shall + * ensure that the distribution and export/re-export of the software is in + * compliance with all laws, regulations, orders, or other restrictions of the + * U.S. Export Administration Regulations. Licensee agrees that neither it nor + * any of its subsidiaries will export/re-export any technical data, process, + * software, or service, directly or indirectly, to any country for which the + * United States government or any agency thereof requires an export license, + * other governmental approval, or letter of assurance, without first obtaining + * such license, approval or letter. + * + *****************************************************************************/ + +') + + +/******************************************************************************* + * + * ASL Primary Terms + * + ******************************************************************************/ + +AccessAsTerm + : PARSEOP_ACCESSAS '(' + AccessTypeKeyword + OptionalAccessAttribTerm + ')' {$$ = TrCreateNode (PARSEOP_ACCESSAS,2,$3,$4);} + | PARSEOP_ACCESSAS '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +AcquireTerm + : PARSEOP_ACQUIRE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACQUIRE);} + SuperName + ',' WordConstExpr + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$6);} + | PARSEOP_ACQUIRE '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +AddTerm + : PARSEOP_ADD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_ADD '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +AliasTerm + : PARSEOP_ALIAS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ALIAS);} + NameString + NameStringItem + ')' {$$ = TrLinkChildren ($<n>3,2,$4, + TrSetNodeFlags ($5, NODE_IS_NAME_DECLARATION));} + | PARSEOP_ALIAS '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +AndTerm + : PARSEOP_AND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_AND);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_AND '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +ArgTerm + : PARSEOP_ARG0 {$$ = TrCreateLeafNode (PARSEOP_ARG0);} + | PARSEOP_ARG1 {$$ = TrCreateLeafNode (PARSEOP_ARG1);} + | PARSEOP_ARG2 {$$ = TrCreateLeafNode (PARSEOP_ARG2);} + | PARSEOP_ARG3 {$$ = TrCreateLeafNode (PARSEOP_ARG3);} + | PARSEOP_ARG4 {$$ = TrCreateLeafNode (PARSEOP_ARG4);} + | PARSEOP_ARG5 {$$ = TrCreateLeafNode (PARSEOP_ARG5);} + | PARSEOP_ARG6 {$$ = TrCreateLeafNode (PARSEOP_ARG6);} + ; + +BankFieldTerm + : PARSEOP_BANKFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_BANKFIELD);} + NameString + NameStringItem + TermArgItem + ',' AccessTypeKeyword + ',' LockRuleKeyword + ',' UpdateRuleKeyword + ')' '{' + FieldUnitList '}' {$$ = TrLinkChildren ($<n>3,7,$4,$5,$6,$8,$10,$12,$15);} + | PARSEOP_BANKFIELD '(' + error ')' '{' error '}' {$$ = AslDoError(); yyclearin;} + ; + +BreakTerm + : PARSEOP_BREAK {$$ = TrCreateNode (PARSEOP_BREAK, 0);} + ; + +BreakPointTerm + : PARSEOP_BREAKPOINT {$$ = TrCreateNode (PARSEOP_BREAKPOINT, 0);} + ; + +BufferTerm + : PARSEOP_BUFFER {$<n>$ = TrCreateLeafNode (PARSEOP_BUFFER);} + OptionalDataCount + '{' BufferTermData '}' {$$ = TrLinkChildren ($<n>2,2,$3,$5);} + ; + +BufferTermData + : ByteList {} + | StringData {} + ; + +CaseTerm + : PARSEOP_CASE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CASE);} + DataObject + ')' '{' + TermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} + | PARSEOP_CASE '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +ConcatTerm + : PARSEOP_CONCATENATE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONCATENATE);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_CONCATENATE '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +ConcatResTerm + : PARSEOP_CONCATENATERESTEMPLATE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONCATENATERESTEMPLATE);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_CONCATENATERESTEMPLATE '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +ConnectionTerm + : PARSEOP_CONNECTION '(' + NameString + ')' {$$ = TrCreateNode (PARSEOP_CONNECTION,1,$3);} + | PARSEOP_CONNECTION '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONNECTION);} + ResourceMacroTerm + ')' {$$ = TrLinkChildren ($<n>3, 1, + TrLinkChildren (TrCreateLeafNode (PARSEOP_RESOURCETEMPLATE), 3, + TrCreateLeafNode (PARSEOP_DEFAULT_ARG), + TrCreateLeafNode (PARSEOP_DEFAULT_ARG), + $4));} + | PARSEOP_CONNECTION '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +CondRefOfTerm + : PARSEOP_CONDREFOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONDREFOF);} + SuperName + Target + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_CONDREFOF '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +ContinueTerm + : PARSEOP_CONTINUE {$$ = TrCreateNode (PARSEOP_CONTINUE, 0);} + ; + +CopyObjectTerm + : PARSEOP_COPYOBJECT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_COPYOBJECT);} + TermArg + ',' SimpleTarget + ')' {$$ = TrLinkChildren ($<n>3,2,$4,TrSetNodeFlags ($6, NODE_IS_TARGET));} + | PARSEOP_COPYOBJECT '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +CreateBitFieldTerm + : PARSEOP_CREATEBITFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEBITFIELD);} + TermArg + TermArgItem + NameStringItem + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));} + | PARSEOP_CREATEBITFIELD '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +CreateByteFieldTerm + : PARSEOP_CREATEBYTEFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEBYTEFIELD);} + TermArg + TermArgItem + NameStringItem + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));} + | PARSEOP_CREATEBYTEFIELD '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +CreateDWordFieldTerm + : PARSEOP_CREATEDWORDFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEDWORDFIELD);} + TermArg + TermArgItem + NameStringItem + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));} + | PARSEOP_CREATEDWORDFIELD '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +CreateFieldTerm + : PARSEOP_CREATEFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEFIELD);} + TermArg + TermArgItem + TermArgItem + NameStringItem + ')' {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6,TrSetNodeFlags ($7, NODE_IS_NAME_DECLARATION));} + | PARSEOP_CREATEFIELD '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +CreateQWordFieldTerm + : PARSEOP_CREATEQWORDFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEQWORDFIELD);} + TermArg + TermArgItem + NameStringItem + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));} + | PARSEOP_CREATEQWORDFIELD '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +CreateWordFieldTerm + : PARSEOP_CREATEWORDFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEWORDFIELD);} + TermArg + TermArgItem + NameStringItem + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));} + | PARSEOP_CREATEWORDFIELD '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +DataRegionTerm + : PARSEOP_DATATABLEREGION '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DATATABLEREGION);} + NameString + TermArgItem + TermArgItem + TermArgItem + ')' {$$ = TrLinkChildren ($<n>3,4,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$5,$6,$7);} + | PARSEOP_DATATABLEREGION '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +DebugTerm + : PARSEOP_DEBUG {$$ = TrCreateLeafNode (PARSEOP_DEBUG);} + ; + +DecTerm + : PARSEOP_DECREMENT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DECREMENT);} + SuperName + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_DECREMENT '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +DefaultTerm + : PARSEOP_DEFAULT '{' {$<n>$ = TrCreateLeafNode (PARSEOP_DEFAULT);} + TermList '}' {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_DEFAULT '{' + error '}' {$$ = AslDoError(); yyclearin;} + ; + +DerefOfTerm + : PARSEOP_DEREFOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DEREFOF);} + TermArg + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_DEREFOF '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +DeviceTerm + : PARSEOP_DEVICE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DEVICE);} + NameString + ')' '{' + TermList '}' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} + | PARSEOP_DEVICE '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +DivideTerm + : PARSEOP_DIVIDE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);} + TermArg + TermArgItem + Target + Target + ')' {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6,$7);} + | PARSEOP_DIVIDE '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +EISAIDTerm + : PARSEOP_EISAID '(' + StringData ')' {$$ = TrUpdateNode (PARSEOP_EISAID, $3);} + | PARSEOP_EISAID '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +ElseIfTerm + : IfTerm ElseTerm {$$ = TrLinkPeerNode ($1,$2);} + ; + +ElseTerm + : {$$ = NULL;} + | PARSEOP_ELSE '{' {$<n>$ = TrCreateLeafNode (PARSEOP_ELSE);} + TermList '}' {$$ = TrLinkChildren ($<n>3,1,$4);} + + | PARSEOP_ELSE '{' + error '}' {$$ = AslDoError(); yyclearin;} + + | PARSEOP_ELSE + error {$$ = AslDoError(); yyclearin;} + + | PARSEOP_ELSEIF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ELSE);} + TermArg {$<n>$ = TrCreateLeafNode (PARSEOP_IF);} + ')' '{' + TermList '}' {TrLinkChildren ($<n>5,2,$4,$8);} + ElseTerm {TrLinkPeerNode ($<n>5,$11);} + {$$ = TrLinkChildren ($<n>3,1,$<n>5);} + + | PARSEOP_ELSEIF '(' + error ')' {$$ = AslDoError(); yyclearin;} + + | PARSEOP_ELSEIF + error {$$ = AslDoError(); yyclearin;} + ; + +EventTerm + : PARSEOP_EVENT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_EVENT);} + NameString + ')' {$$ = TrLinkChildren ($<n>3,1,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION));} + | PARSEOP_EVENT '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +ExternalTerm + : PARSEOP_EXTERNAL '(' + NameString + OptionalObjectTypeKeyword + OptionalParameterTypePackage + OptionalParameterTypesPackage + ')' {$$ = TrCreateNode (PARSEOP_EXTERNAL,4,$3,$4,$5,$6);} + | PARSEOP_EXTERNAL '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +FatalTerm + : PARSEOP_FATAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FATAL);} + ByteConstExpr + ',' DWordConstExpr + TermArgItem + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);} + | PARSEOP_FATAL '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +FieldTerm + : PARSEOP_FIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FIELD);} + NameString + ',' AccessTypeKeyword + ',' LockRuleKeyword + ',' UpdateRuleKeyword + ')' '{' + FieldUnitList '}' {$$ = TrLinkChildren ($<n>3,5,$4,$6,$8,$10,$13);} + | PARSEOP_FIELD '(' + error ')' '{' error '}' {$$ = AslDoError(); yyclearin;} + ; + +FindSetLeftBitTerm + : PARSEOP_FINDSETLEFTBIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FINDSETLEFTBIT);} + TermArg + Target + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_FINDSETLEFTBIT '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +FindSetRightBitTerm + : PARSEOP_FINDSETRIGHTBIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FINDSETRIGHTBIT);} + TermArg + Target + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_FINDSETRIGHTBIT '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + + /* Convert a For() loop to a While() loop */ +ForTerm + : PARSEOP_FOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WHILE);} + OptionalTermArg ',' {} + OptionalPredicate ',' + OptionalTermArg {$<n>$ = TrLinkPeerNode ($4,$<n>3); + TrSetParent ($9,$<n>3);} /* New parent is WHILE */ + ')' '{' TermList '}' {$<n>$ = TrLinkChildren ($<n>3,2,$7,$13);} + {$<n>$ = TrLinkPeerNode ($13,$9); + $$ = $<n>10;} + ; + +OptionalPredicate + : {$$ = TrCreateValuedLeafNode (PARSEOP_INTEGER, 1);} + | TermArg {$$ = $1;} + ; + +FprintfTerm + : PARSEOP_FPRINTF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FPRINTF);} + TermArg ',' + StringData + PrintfArgList + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);} + | PARSEOP_FPRINTF '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +FromBCDTerm + : PARSEOP_FROMBCD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FROMBCD);} + TermArg + Target + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_FROMBCD '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +FunctionTerm + : PARSEOP_FUNCTION '(' {$<n>$ = TrCreateLeafNode (PARSEOP_METHOD);} + NameString + OptionalParameterTypePackage + OptionalParameterTypesPackage + ')' '{' + TermList '}' {$$ = TrLinkChildren ($<n>3,7,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION), + TrCreateValuedLeafNode (PARSEOP_BYTECONST, 0), + TrCreateLeafNode (PARSEOP_SERIALIZERULE_NOTSERIAL), + TrCreateValuedLeafNode (PARSEOP_BYTECONST, 0),$5,$6,$9);} + | PARSEOP_FUNCTION '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +IfTerm + : PARSEOP_IF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_IF);} + TermArg + ')' '{' + TermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} + + | PARSEOP_IF '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +IncludeTerm + : PARSEOP_INCLUDE '(' + String ')' {$$ = TrUpdateNode (PARSEOP_INCLUDE, $3); + FlOpenIncludeFile ($3);} + ; + +IncludeEndTerm + : PARSEOP_INCLUDE_END {$<n>$ = TrCreateLeafNode (PARSEOP_INCLUDE_END); TrSetCurrentFilename ($$);} + ; + +IncTerm + : PARSEOP_INCREMENT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INCREMENT);} + SuperName + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_INCREMENT '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +IndexFieldTerm + : PARSEOP_INDEXFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INDEXFIELD);} + NameString + NameStringItem + ',' AccessTypeKeyword + ',' LockRuleKeyword + ',' UpdateRuleKeyword + ')' '{' + FieldUnitList '}' {$$ = TrLinkChildren ($<n>3,6,$4,$5,$7,$9,$11,$14);} + | PARSEOP_INDEXFIELD '(' + error ')' '{' error '}' {$$ = AslDoError(); yyclearin;} + ; + +IndexTerm + : PARSEOP_INDEX '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INDEX);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_INDEX '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +LAndTerm + : PARSEOP_LAND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LAND);} + TermArg + TermArgItem + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_LAND '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +LEqualTerm + : PARSEOP_LEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);} + TermArg + TermArgItem + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_LEQUAL '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +LGreaterEqualTerm + : PARSEOP_LGREATEREQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);} + TermArg + TermArgItem + ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($<n>3,2,$4,$5));} + | PARSEOP_LGREATEREQUAL '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +LGreaterTerm + : PARSEOP_LGREATER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);} + TermArg + TermArgItem + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_LGREATER '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +LLessEqualTerm + : PARSEOP_LLESSEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);} + TermArg + TermArgItem + ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($<n>3,2,$4,$5));} + | PARSEOP_LLESSEQUAL '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +LLessTerm + : PARSEOP_LLESS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);} + TermArg + TermArgItem + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_LLESS '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +LNotEqualTerm + : PARSEOP_LNOTEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);} + TermArg + TermArgItem + ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($<n>3,2,$4,$5));} + | PARSEOP_LNOTEQUAL '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +LNotTerm + : PARSEOP_LNOT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LNOT);} + TermArg + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_LNOT '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +LoadTableTerm + : PARSEOP_LOADTABLE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LOADTABLE);} + TermArg + TermArgItem + TermArgItem + OptionalListString + OptionalListString + OptionalReference + ')' {$$ = TrLinkChildren ($<n>3,6,$4,$5,$6,$7,$8,$9);} + | PARSEOP_LOADTABLE '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +LoadTerm + : PARSEOP_LOAD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LOAD);} + NameString + RequiredTarget + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_LOAD '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +LocalTerm + : PARSEOP_LOCAL0 {$$ = TrCreateLeafNode (PARSEOP_LOCAL0);} + | PARSEOP_LOCAL1 {$$ = TrCreateLeafNode (PARSEOP_LOCAL1);} + | PARSEOP_LOCAL2 {$$ = TrCreateLeafNode (PARSEOP_LOCAL2);} + | PARSEOP_LOCAL3 {$$ = TrCreateLeafNode (PARSEOP_LOCAL3);} + | PARSEOP_LOCAL4 {$$ = TrCreateLeafNode (PARSEOP_LOCAL4);} + | PARSEOP_LOCAL5 {$$ = TrCreateLeafNode (PARSEOP_LOCAL5);} + | PARSEOP_LOCAL6 {$$ = TrCreateLeafNode (PARSEOP_LOCAL6);} + | PARSEOP_LOCAL7 {$$ = TrCreateLeafNode (PARSEOP_LOCAL7);} + ; + +LOrTerm + : PARSEOP_LOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LOR);} + TermArg + TermArgItem + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_LOR '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +MatchTerm + : PARSEOP_MATCH '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MATCH);} + TermArg + ',' MatchOpKeyword + TermArgItem + ',' MatchOpKeyword + TermArgItem + TermArgItem + ')' {$$ = TrLinkChildren ($<n>3,6,$4,$6,$7,$9,$10,$11);} + | PARSEOP_MATCH '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +MethodTerm + : PARSEOP_METHOD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_METHOD);} + NameString + OptionalByteConstExpr {UtCheckIntegerRange ($5, 0, 7);} + OptionalSerializeRuleKeyword + OptionalByteConstExpr + OptionalParameterTypePackage + OptionalParameterTypesPackage + ')' '{' + TermList '}' {$$ = TrLinkChildren ($<n>3,7,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$5,$7,$8,$9,$10,$13);} + | PARSEOP_METHOD '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +MidTerm + : PARSEOP_MID '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MID);} + TermArg + TermArgItem + TermArgItem + Target + ')' {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6,$7);} + | PARSEOP_MID '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +ModTerm + : PARSEOP_MOD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_MOD '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +MultiplyTerm + : PARSEOP_MULTIPLY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_MULTIPLY '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +MutexTerm + : PARSEOP_MUTEX '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MUTEX);} + NameString + ',' ByteConstExpr + ')' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6);} + | PARSEOP_MUTEX '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +NameTerm + : PARSEOP_NAME '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NAME);} + NameString + ',' DataObject + ')' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6);} + | PARSEOP_NAME '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +NAndTerm + : PARSEOP_NAND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NAND);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_NAND '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +NoOpTerm + : PARSEOP_NOOP {$$ = TrCreateNode (PARSEOP_NOOP, 0);} + ; + +NOrTerm + : PARSEOP_NOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOR);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_NOR '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +NotifyTerm + : PARSEOP_NOTIFY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOTIFY);} + SuperName + TermArgItem + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_NOTIFY '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +NotTerm + : PARSEOP_NOT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOT);} + TermArg + Target + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_NOT '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +ObjectTypeTerm + : PARSEOP_OBJECTTYPE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE);} + ObjectTypeName + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_OBJECTTYPE '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +OffsetTerm + : PARSEOP_OFFSET '(' + AmlPackageLengthTerm + ')' {$$ = TrCreateNode (PARSEOP_OFFSET,1,$3);} + | PARSEOP_OFFSET '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +OpRegionTerm + : PARSEOP_OPERATIONREGION '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OPERATIONREGION);} + NameString + ',' OpRegionSpaceIdTerm + TermArgItem + TermArgItem + ')' {$$ = TrLinkChildren ($<n>3,4,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$7,$8);} + | PARSEOP_OPERATIONREGION '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +OpRegionSpaceIdTerm + : RegionSpaceKeyword {} + | ByteConst {$$ = UtCheckIntegerRange ($1, 0x80, 0xFF);} + ; + +OrTerm + : PARSEOP_OR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OR);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_OR '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +PackageTerm + : PARSEOP_PACKAGE {$<n>$ = TrCreateLeafNode (PARSEOP_VAR_PACKAGE);} + OptionalDataCount + '{' PackageList '}' {$$ = TrLinkChildren ($<n>2,2,$3,$5);} + +PowerResTerm + : PARSEOP_POWERRESOURCE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_POWERRESOURCE);} + NameString + ',' ByteConstExpr + ',' WordConstExpr + ')' '{' + TermList '}' {$$ = TrLinkChildren ($<n>3,4,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$8,$11);} + | PARSEOP_POWERRESOURCE '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +PrintfTerm + : PARSEOP_PRINTF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_PRINTF);} + StringData + PrintfArgList + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_PRINTF '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +PrintfArgList + : {$$ = NULL;} + | TermArg {$$ = $1;} + | PrintfArgList ',' + TermArg {$$ = TrLinkPeerNode ($1, $3);} + ; + +ProcessorTerm + : PARSEOP_PROCESSOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_PROCESSOR);} + NameString + ',' ByteConstExpr + OptionalDWordConstExpr + OptionalByteConstExpr + ')' '{' + TermList '}' {$$ = TrLinkChildren ($<n>3,5,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$7,$8,$11);} + | PARSEOP_PROCESSOR '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +RawDataBufferTerm + : PARSEOP_DATABUFFER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DATABUFFER);} + OptionalWordConst + ')' '{' + ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} + | PARSEOP_DATABUFFER '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +/* + * In RefOf, the node isn't really a target, but we can't keep track of it after + * we've taken a pointer to it. (hard to tell if a local becomes initialized this way.) + */ +RefOfTerm + : PARSEOP_REFOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_REFOF);} + SuperName + ')' {$$ = TrLinkChildren ($<n>3,1,TrSetNodeFlags ($4, NODE_IS_TARGET));} + | PARSEOP_REFOF '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +ReleaseTerm + : PARSEOP_RELEASE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RELEASE);} + SuperName + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_RELEASE '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +ResetTerm + : PARSEOP_RESET '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RESET);} + SuperName + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_RESET '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +ReturnTerm + : PARSEOP_RETURN '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RETURN);} + OptionalReturnArg + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_RETURN {$$ = TrLinkChildren (TrCreateLeafNode (PARSEOP_RETURN),1,TrSetNodeFlags (TrCreateLeafNode (PARSEOP_ZERO), NODE_IS_NULL_RETURN));} + | PARSEOP_RETURN '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +ScopeTerm + : PARSEOP_SCOPE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SCOPE);} + NameString + ')' '{' + TermList '}' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} + | PARSEOP_SCOPE '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +ShiftLeftTerm + : PARSEOP_SHIFTLEFT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_SHIFTLEFT '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +ShiftRightTerm + : PARSEOP_SHIFTRIGHT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_SHIFTRIGHT '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +SignalTerm + : PARSEOP_SIGNAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SIGNAL);} + SuperName + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_SIGNAL '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +SizeOfTerm + : PARSEOP_SIZEOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SIZEOF);} + SuperName + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_SIZEOF '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +SleepTerm + : PARSEOP_SLEEP '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SLEEP);} + TermArg + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_SLEEP '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +StallTerm + : PARSEOP_STALL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STALL);} + TermArg + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_STALL '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +StoreTerm + : PARSEOP_STORE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STORE);} + TermArg + ',' SuperName + ')' {$$ = TrLinkChildren ($<n>3,2,$4,TrSetNodeFlags ($6, NODE_IS_TARGET));} + | PARSEOP_STORE '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +SubtractTerm + : PARSEOP_SUBTRACT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_SUBTRACT '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +SwitchTerm + : PARSEOP_SWITCH '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SWITCH);} + TermArg + ')' '{' + CaseDefaultTermList '}' + {$$ = TrLinkChildren ($<n>3,2,$4,$7);} + | PARSEOP_SWITCH '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +ThermalZoneTerm + : PARSEOP_THERMALZONE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_THERMALZONE);} + NameString + ')' '{' + TermList '}' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} + | PARSEOP_THERMALZONE '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +TimerTerm + : PARSEOP_TIMER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TIMER);} + ')' {$$ = TrLinkChildren ($<n>3,0);} + | PARSEOP_TIMER {$$ = TrLinkChildren (TrCreateLeafNode (PARSEOP_TIMER),0);} + | PARSEOP_TIMER '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +ToBCDTerm + : PARSEOP_TOBCD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOBCD);} + TermArg + Target + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_TOBCD '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +ToBufferTerm + : PARSEOP_TOBUFFER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOBUFFER);} + TermArg + Target + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_TOBUFFER '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +ToDecimalStringTerm + : PARSEOP_TODECIMALSTRING '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TODECIMALSTRING);} + TermArg + Target + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_TODECIMALSTRING '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +ToHexStringTerm + : PARSEOP_TOHEXSTRING '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOHEXSTRING);} + TermArg + Target + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_TOHEXSTRING '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +ToIntegerTerm + : PARSEOP_TOINTEGER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOINTEGER);} + TermArg + Target + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_TOINTEGER '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +ToPLDTerm + : PARSEOP_TOPLD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOPLD);} + PldKeywordList + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_TOPLD '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +PldKeywordList + : {$$ = NULL;} + | PldKeyword + PARSEOP_EXP_EQUALS Integer {$$ = TrLinkChildren ($1,1,$3);} + | PldKeyword + PARSEOP_EXP_EQUALS String {$$ = TrLinkChildren ($1,1,$3);} + | PldKeywordList ',' /* Allows a trailing comma at list end */ + | PldKeywordList ',' + PldKeyword + PARSEOP_EXP_EQUALS Integer {$$ = TrLinkPeerNode ($1,TrLinkChildren ($3,1,$5));} + | PldKeywordList ',' + PldKeyword + PARSEOP_EXP_EQUALS String {$$ = TrLinkPeerNode ($1,TrLinkChildren ($3,1,$5));} + ; + + +ToStringTerm + : PARSEOP_TOSTRING '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOSTRING);} + TermArg + OptionalCount + Target + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_TOSTRING '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +ToUUIDTerm + : PARSEOP_TOUUID '(' + StringData ')' {$$ = TrUpdateNode (PARSEOP_TOUUID, $3);} + | PARSEOP_TOUUID '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +UnicodeTerm + : PARSEOP_UNICODE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UNICODE);} + StringData + ')' {$$ = TrLinkChildren ($<n>3,2,0,$4);} + | PARSEOP_UNICODE '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +UnloadTerm + : PARSEOP_UNLOAD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UNLOAD);} + SuperName + ')' {$$ = TrLinkChildren ($<n>3,1,$4);} + | PARSEOP_UNLOAD '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +WaitTerm + : PARSEOP_WAIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WAIT);} + SuperName + TermArgItem + ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} + | PARSEOP_WAIT '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +XOrTerm + : PARSEOP_XOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);} + TermArg + TermArgItem + Target + ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} + | PARSEOP_XOR '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; + +WhileTerm + : PARSEOP_WHILE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WHILE);} + TermArg + ')' '{' TermList '}' + {$$ = TrLinkChildren ($<n>3,2,$4,$7);} + | PARSEOP_WHILE '(' + error ')' {$$ = AslDoError(); yyclearin;} + ; diff --git a/source/compiler/aslresources.y b/source/compiler/aslresources.y index d3dbe999a..30603fa12 100644 --- a/source/compiler/aslresources.y +++ b/source/compiler/aslresources.y @@ -116,313 +116,6 @@ NoEcho(' ') -/******************************************************************************* - * - * ASL Parameter Keyword Terms - * - ******************************************************************************/ - -AccessAttribKeyword - : PARSEOP_ACCESSATTRIB_BLOCK {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_BLOCK);} - | PARSEOP_ACCESSATTRIB_BLOCK_CALL {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_BLOCK_CALL);} - | PARSEOP_ACCESSATTRIB_BYTE {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_BYTE);} - | PARSEOP_ACCESSATTRIB_QUICK {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_QUICK );} - | PARSEOP_ACCESSATTRIB_SND_RCV {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_SND_RCV);} - | PARSEOP_ACCESSATTRIB_WORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_WORD);} - | PARSEOP_ACCESSATTRIB_WORD_CALL {$$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_WORD_CALL);} - | PARSEOP_ACCESSATTRIB_MULTIBYTE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_MULTIBYTE);} - ByteConst - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_ACCESSATTRIB_RAW_BYTES '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_RAW_BYTES);} - ByteConst - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_ACCESSATTRIB_RAW_PROCESS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACCESSATTRIB_RAW_PROCESS);} - ByteConst - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - ; - -AccessTypeKeyword - : PARSEOP_ACCESSTYPE_ANY {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_ANY);} - | PARSEOP_ACCESSTYPE_BYTE {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_BYTE);} - | PARSEOP_ACCESSTYPE_WORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_WORD);} - | PARSEOP_ACCESSTYPE_DWORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_DWORD);} - | PARSEOP_ACCESSTYPE_QWORD {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_QWORD);} - | PARSEOP_ACCESSTYPE_BUF {$$ = TrCreateLeafNode (PARSEOP_ACCESSTYPE_BUF);} - ; - -AddressingModeKeyword - : PARSEOP_ADDRESSINGMODE_7BIT {$$ = TrCreateLeafNode (PARSEOP_ADDRESSINGMODE_7BIT);} - | PARSEOP_ADDRESSINGMODE_10BIT {$$ = TrCreateLeafNode (PARSEOP_ADDRESSINGMODE_10BIT);} - ; - -AddressKeyword - : PARSEOP_ADDRESSTYPE_MEMORY {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_MEMORY);} - | PARSEOP_ADDRESSTYPE_RESERVED {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_RESERVED);} - | PARSEOP_ADDRESSTYPE_NVS {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_NVS);} - | PARSEOP_ADDRESSTYPE_ACPI {$$ = TrCreateLeafNode (PARSEOP_ADDRESSTYPE_ACPI);} - ; - -AddressSpaceKeyword - : ByteConst {$$ = UtCheckIntegerRange ($1, 0x0A, 0xFF);} - | RegionSpaceKeyword {} - ; - -BitsPerByteKeyword - : PARSEOP_BITSPERBYTE_FIVE {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_FIVE);} - | PARSEOP_BITSPERBYTE_SIX {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_SIX);} - | PARSEOP_BITSPERBYTE_SEVEN {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_SEVEN);} - | PARSEOP_BITSPERBYTE_EIGHT {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_EIGHT);} - | PARSEOP_BITSPERBYTE_NINE {$$ = TrCreateLeafNode (PARSEOP_BITSPERBYTE_NINE);} - ; - -ClockPhaseKeyword - : PARSEOP_CLOCKPHASE_FIRST {$$ = TrCreateLeafNode (PARSEOP_CLOCKPHASE_FIRST);} - | PARSEOP_CLOCKPHASE_SECOND {$$ = TrCreateLeafNode (PARSEOP_CLOCKPHASE_SECOND);} - ; - -ClockPolarityKeyword - : PARSEOP_CLOCKPOLARITY_LOW {$$ = TrCreateLeafNode (PARSEOP_CLOCKPOLARITY_LOW);} - | PARSEOP_CLOCKPOLARITY_HIGH {$$ = TrCreateLeafNode (PARSEOP_CLOCKPOLARITY_HIGH);} - ; - -DecodeKeyword - : PARSEOP_DECODETYPE_POS {$$ = TrCreateLeafNode (PARSEOP_DECODETYPE_POS);} - | PARSEOP_DECODETYPE_SUB {$$ = TrCreateLeafNode (PARSEOP_DECODETYPE_SUB);} - ; - -DevicePolarityKeyword - : PARSEOP_DEVICEPOLARITY_LOW {$$ = TrCreateLeafNode (PARSEOP_DEVICEPOLARITY_LOW);} - | PARSEOP_DEVICEPOLARITY_HIGH {$$ = TrCreateLeafNode (PARSEOP_DEVICEPOLARITY_HIGH);} - ; - -DMATypeKeyword - : PARSEOP_DMATYPE_A {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_A);} - | PARSEOP_DMATYPE_COMPATIBILITY {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_COMPATIBILITY);} - | PARSEOP_DMATYPE_B {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_B);} - | PARSEOP_DMATYPE_F {$$ = TrCreateLeafNode (PARSEOP_DMATYPE_F);} - ; - -EndianKeyword - : PARSEOP_ENDIAN_LITTLE {$$ = TrCreateLeafNode (PARSEOP_ENDIAN_LITTLE);} - | PARSEOP_ENDIAN_BIG {$$ = TrCreateLeafNode (PARSEOP_ENDIAN_BIG);} - ; - -FlowControlKeyword - : PARSEOP_FLOWCONTROL_HW {$$ = TrCreateLeafNode (PARSEOP_FLOWCONTROL_HW);} - | PARSEOP_FLOWCONTROL_NONE {$$ = TrCreateLeafNode (PARSEOP_FLOWCONTROL_NONE);} - | PARSEOP_FLOWCONTROL_SW {$$ = TrCreateLeafNode (PARSEOP_FLOWCONTROL_SW);} - ; - -InterruptLevel - : PARSEOP_INTLEVEL_ACTIVEBOTH {$$ = TrCreateLeafNode (PARSEOP_INTLEVEL_ACTIVEBOTH);} - | PARSEOP_INTLEVEL_ACTIVEHIGH {$$ = TrCreateLeafNode (PARSEOP_INTLEVEL_ACTIVEHIGH);} - | PARSEOP_INTLEVEL_ACTIVELOW {$$ = TrCreateLeafNode (PARSEOP_INTLEVEL_ACTIVELOW);} - ; - -InterruptTypeKeyword - : PARSEOP_INTTYPE_EDGE {$$ = TrCreateLeafNode (PARSEOP_INTTYPE_EDGE);} - | PARSEOP_INTTYPE_LEVEL {$$ = TrCreateLeafNode (PARSEOP_INTTYPE_LEVEL);} - ; - -IODecodeKeyword - : PARSEOP_IODECODETYPE_16 {$$ = TrCreateLeafNode (PARSEOP_IODECODETYPE_16);} - | PARSEOP_IODECODETYPE_10 {$$ = TrCreateLeafNode (PARSEOP_IODECODETYPE_10);} - ; - -IoRestrictionKeyword - : PARSEOP_IORESTRICT_IN {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_IN);} - | PARSEOP_IORESTRICT_OUT {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_OUT);} - | PARSEOP_IORESTRICT_NONE {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_NONE);} - | PARSEOP_IORESTRICT_PRESERVE {$$ = TrCreateLeafNode (PARSEOP_IORESTRICT_PRESERVE);} - ; - -LockRuleKeyword - : PARSEOP_LOCKRULE_LOCK {$$ = TrCreateLeafNode (PARSEOP_LOCKRULE_LOCK);} - | PARSEOP_LOCKRULE_NOLOCK {$$ = TrCreateLeafNode (PARSEOP_LOCKRULE_NOLOCK);} - ; - -MatchOpKeyword - : PARSEOP_MATCHTYPE_MTR {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MTR);} - | PARSEOP_MATCHTYPE_MEQ {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MEQ);} - | PARSEOP_MATCHTYPE_MLE {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MLE);} - | PARSEOP_MATCHTYPE_MLT {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MLT);} - | PARSEOP_MATCHTYPE_MGE {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MGE);} - | PARSEOP_MATCHTYPE_MGT {$$ = TrCreateLeafNode (PARSEOP_MATCHTYPE_MGT);} - ; - -MaxKeyword - : PARSEOP_MAXTYPE_FIXED {$$ = TrCreateLeafNode (PARSEOP_MAXTYPE_FIXED);} - | PARSEOP_MAXTYPE_NOTFIXED {$$ = TrCreateLeafNode (PARSEOP_MAXTYPE_NOTFIXED);} - ; - -MemTypeKeyword - : PARSEOP_MEMTYPE_CACHEABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_CACHEABLE);} - | PARSEOP_MEMTYPE_WRITECOMBINING {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_WRITECOMBINING);} - | PARSEOP_MEMTYPE_PREFETCHABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_PREFETCHABLE);} - | PARSEOP_MEMTYPE_NONCACHEABLE {$$ = TrCreateLeafNode (PARSEOP_MEMTYPE_NONCACHEABLE);} - ; - -MinKeyword - : PARSEOP_MINTYPE_FIXED {$$ = TrCreateLeafNode (PARSEOP_MINTYPE_FIXED);} - | PARSEOP_MINTYPE_NOTFIXED {$$ = TrCreateLeafNode (PARSEOP_MINTYPE_NOTFIXED);} - ; - -ObjectTypeKeyword - : PARSEOP_OBJECTTYPE_UNK {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_UNK);} - | PARSEOP_OBJECTTYPE_INT {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_INT);} - | PARSEOP_OBJECTTYPE_STR {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_STR);} - | PARSEOP_OBJECTTYPE_BUF {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_BUF);} - | PARSEOP_OBJECTTYPE_PKG {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_PKG);} - | PARSEOP_OBJECTTYPE_FLD {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_FLD);} - | PARSEOP_OBJECTTYPE_DEV {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_DEV);} - | PARSEOP_OBJECTTYPE_EVT {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_EVT);} - | PARSEOP_OBJECTTYPE_MTH {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_MTH);} - | PARSEOP_OBJECTTYPE_MTX {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_MTX);} - | PARSEOP_OBJECTTYPE_OPR {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_OPR);} - | PARSEOP_OBJECTTYPE_POW {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_POW);} - | PARSEOP_OBJECTTYPE_PRO {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_PRO);} - | PARSEOP_OBJECTTYPE_THZ {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_THZ);} - | PARSEOP_OBJECTTYPE_BFF {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_BFF);} - | PARSEOP_OBJECTTYPE_DDB {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_DDB);} - ; - -ParityTypeKeyword - : PARSEOP_PARITYTYPE_SPACE {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_SPACE);} - | PARSEOP_PARITYTYPE_MARK {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_MARK);} - | PARSEOP_PARITYTYPE_ODD {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_ODD);} - | PARSEOP_PARITYTYPE_EVEN {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_EVEN);} - | PARSEOP_PARITYTYPE_NONE {$$ = TrCreateLeafNode (PARSEOP_PARITYTYPE_NONE);} - ; - -PinConfigByte - : PinConfigKeyword {$$ = $1;} - | ByteConstExpr {$$ = UtCheckIntegerRange ($1, 0x80, 0xFF);} - ; - -PinConfigKeyword - : PARSEOP_PIN_NOPULL {$$ = TrCreateLeafNode (PARSEOP_PIN_NOPULL);} - | PARSEOP_PIN_PULLDOWN {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLDOWN);} - | PARSEOP_PIN_PULLUP {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLUP);} - | PARSEOP_PIN_PULLDEFAULT {$$ = TrCreateLeafNode (PARSEOP_PIN_PULLDEFAULT);} - ; - -PldKeyword - : PARSEOP_PLD_REVISION {$$ = TrCreateLeafNode (PARSEOP_PLD_REVISION);} - | PARSEOP_PLD_IGNORECOLOR {$$ = TrCreateLeafNode (PARSEOP_PLD_IGNORECOLOR);} - | PARSEOP_PLD_RED {$$ = TrCreateLeafNode (PARSEOP_PLD_RED);} - | PARSEOP_PLD_GREEN {$$ = TrCreateLeafNode (PARSEOP_PLD_GREEN);} - | PARSEOP_PLD_BLUE {$$ = TrCreateLeafNode (PARSEOP_PLD_BLUE);} - | PARSEOP_PLD_WIDTH {$$ = TrCreateLeafNode (PARSEOP_PLD_WIDTH);} - | PARSEOP_PLD_HEIGHT {$$ = TrCreateLeafNode (PARSEOP_PLD_HEIGHT);} - | PARSEOP_PLD_USERVISIBLE {$$ = TrCreateLeafNode (PARSEOP_PLD_USERVISIBLE);} - | PARSEOP_PLD_DOCK {$$ = TrCreateLeafNode (PARSEOP_PLD_DOCK);} - | PARSEOP_PLD_LID {$$ = TrCreateLeafNode (PARSEOP_PLD_LID);} - | PARSEOP_PLD_PANEL {$$ = TrCreateLeafNode (PARSEOP_PLD_PANEL);} - | PARSEOP_PLD_VERTICALPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_VERTICALPOSITION);} - | PARSEOP_PLD_HORIZONTALPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_HORIZONTALPOSITION);} - | PARSEOP_PLD_SHAPE {$$ = TrCreateLeafNode (PARSEOP_PLD_SHAPE);} - | PARSEOP_PLD_GROUPORIENTATION {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPORIENTATION);} - | PARSEOP_PLD_GROUPTOKEN {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPTOKEN);} - | PARSEOP_PLD_GROUPPOSITION {$$ = TrCreateLeafNode (PARSEOP_PLD_GROUPPOSITION);} - | PARSEOP_PLD_BAY {$$ = TrCreateLeafNode (PARSEOP_PLD_BAY);} - | PARSEOP_PLD_EJECTABLE {$$ = TrCreateLeafNode (PARSEOP_PLD_EJECTABLE);} - | PARSEOP_PLD_EJECTREQUIRED {$$ = TrCreateLeafNode (PARSEOP_PLD_EJECTREQUIRED);} - | PARSEOP_PLD_CABINETNUMBER {$$ = TrCreateLeafNode (PARSEOP_PLD_CABINETNUMBER);} - | PARSEOP_PLD_CARDCAGENUMBER {$$ = TrCreateLeafNode (PARSEOP_PLD_CARDCAGENUMBER);} - | PARSEOP_PLD_REFERENCE {$$ = TrCreateLeafNode (PARSEOP_PLD_REFERENCE);} - | PARSEOP_PLD_ROTATION {$$ = TrCreateLeafNode (PARSEOP_PLD_ROTATION);} - | PARSEOP_PLD_ORDER {$$ = TrCreateLeafNode (PARSEOP_PLD_ORDER);} - | PARSEOP_PLD_RESERVED {$$ = TrCreateLeafNode (PARSEOP_PLD_RESERVED);} - | PARSEOP_PLD_VERTICALOFFSET {$$ = TrCreateLeafNode (PARSEOP_PLD_VERTICALOFFSET);} - | PARSEOP_PLD_HORIZONTALOFFSET {$$ = TrCreateLeafNode (PARSEOP_PLD_HORIZONTALOFFSET);} - ; - -RangeTypeKeyword - : PARSEOP_RANGETYPE_ISAONLY {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_ISAONLY);} - | PARSEOP_RANGETYPE_NONISAONLY {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_NONISAONLY);} - | PARSEOP_RANGETYPE_ENTIRE {$$ = TrCreateLeafNode (PARSEOP_RANGETYPE_ENTIRE);} - ; - -RegionSpaceKeyword - : PARSEOP_REGIONSPACE_IO {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_IO);} - | PARSEOP_REGIONSPACE_MEM {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_MEM);} - | PARSEOP_REGIONSPACE_PCI {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCI);} - | PARSEOP_REGIONSPACE_EC {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_EC);} - | PARSEOP_REGIONSPACE_SMBUS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_SMBUS);} - | PARSEOP_REGIONSPACE_CMOS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_CMOS);} - | PARSEOP_REGIONSPACE_PCIBAR {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCIBAR);} - | PARSEOP_REGIONSPACE_IPMI {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_IPMI);} - | PARSEOP_REGIONSPACE_GPIO {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_GPIO);} - | PARSEOP_REGIONSPACE_GSBUS {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_GSBUS);} - | PARSEOP_REGIONSPACE_PCC {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_PCC);} - | PARSEOP_REGIONSPACE_FFIXEDHW {$$ = TrCreateLeafNode (PARSEOP_REGIONSPACE_FFIXEDHW);} - ; - -ResourceTypeKeyword - : PARSEOP_RESOURCETYPE_CONSUMER {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_CONSUMER);} - | PARSEOP_RESOURCETYPE_PRODUCER {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_PRODUCER);} - ; - -SerializeRuleKeyword - : PARSEOP_SERIALIZERULE_SERIAL {$$ = TrCreateLeafNode (PARSEOP_SERIALIZERULE_SERIAL);} - | PARSEOP_SERIALIZERULE_NOTSERIAL {$$ = TrCreateLeafNode (PARSEOP_SERIALIZERULE_NOTSERIAL);} - ; - -ShareTypeKeyword - : PARSEOP_SHARETYPE_SHARED {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_SHARED);} - | PARSEOP_SHARETYPE_EXCLUSIVE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_EXCLUSIVE);} - | PARSEOP_SHARETYPE_SHAREDWAKE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_SHAREDWAKE);} - | PARSEOP_SHARETYPE_EXCLUSIVEWAKE {$$ = TrCreateLeafNode (PARSEOP_SHARETYPE_EXCLUSIVEWAKE);} - ; - -SlaveModeKeyword - : PARSEOP_SLAVEMODE_CONTROLLERINIT {$$ = TrCreateLeafNode (PARSEOP_SLAVEMODE_CONTROLLERINIT);} - | PARSEOP_SLAVEMODE_DEVICEINIT {$$ = TrCreateLeafNode (PARSEOP_SLAVEMODE_DEVICEINIT);} - ; - -StopBitsKeyword - : PARSEOP_STOPBITS_TWO {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_TWO);} - | PARSEOP_STOPBITS_ONEPLUSHALF {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ONEPLUSHALF);} - | PARSEOP_STOPBITS_ONE {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ONE);} - | PARSEOP_STOPBITS_ZERO {$$ = TrCreateLeafNode (PARSEOP_STOPBITS_ZERO);} - ; - -TranslationKeyword - : PARSEOP_TRANSLATIONTYPE_SPARSE {$$ = TrCreateLeafNode (PARSEOP_TRANSLATIONTYPE_SPARSE);} - | PARSEOP_TRANSLATIONTYPE_DENSE {$$ = TrCreateLeafNode (PARSEOP_TRANSLATIONTYPE_DENSE);} - ; - -TypeKeyword - : PARSEOP_TYPE_TRANSLATION {$$ = TrCreateLeafNode (PARSEOP_TYPE_TRANSLATION);} - | PARSEOP_TYPE_STATIC {$$ = TrCreateLeafNode (PARSEOP_TYPE_STATIC);} - ; - -UpdateRuleKeyword - : PARSEOP_UPDATERULE_PRESERVE {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_PRESERVE);} - | PARSEOP_UPDATERULE_ONES {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_ONES);} - | PARSEOP_UPDATERULE_ZEROS {$$ = TrCreateLeafNode (PARSEOP_UPDATERULE_ZEROS);} - ; - -WireModeKeyword - : PARSEOP_WIREMODE_FOUR {$$ = TrCreateLeafNode (PARSEOP_WIREMODE_FOUR);} - | PARSEOP_WIREMODE_THREE {$$ = TrCreateLeafNode (PARSEOP_WIREMODE_THREE);} - ; - -XferSizeKeyword - : PARSEOP_XFERSIZE_8 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_8, 0);} - | PARSEOP_XFERSIZE_16 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_16, 1);} - | PARSEOP_XFERSIZE_32 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_32, 2);} - | PARSEOP_XFERSIZE_64 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_64, 3);} - | PARSEOP_XFERSIZE_128 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_128, 4);} - | PARSEOP_XFERSIZE_256 {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_256, 5);} - ; - -XferTypeKeyword - : PARSEOP_XFERTYPE_8 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_8);} - | PARSEOP_XFERTYPE_8_16 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_8_16);} - | PARSEOP_XFERTYPE_16 {$$ = TrCreateLeafNode (PARSEOP_XFERTYPE_16);} - ; - /******************************************************************************* * @@ -435,15 +128,20 @@ XferTypeKeyword * Also, insert the EndTag at the end of the template. */ ResourceTemplateTerm - : PARSEOP_RESOURCETEMPLATE '(' ')' + : PARSEOP_RESOURCETEMPLATE OptionalParentheses '{' ResourceMacroList '}' {$$ = TrCreateNode (PARSEOP_RESOURCETEMPLATE,4, TrCreateLeafNode (PARSEOP_DEFAULT_ARG), TrCreateLeafNode (PARSEOP_DEFAULT_ARG), - $5, + $4, TrCreateLeafNode (PARSEOP_ENDTAG));} ; +OptionalParentheses + : {$$ = NULL;} + | '(' ')' {$$ = NULL;} + ; + ResourceMacroList : {$$ = NULL;} | ResourceMacroList @@ -1079,242 +777,3 @@ WordSpaceTerm | PARSEOP_WORDSPACE '(' error ')' {$$ = AslDoError(); yyclearin;} ; - - -/******* Object References ***********************************************/ - -/* Allow IO, DMA, IRQ Resource macro names to also be used as identifiers */ - -NameString - : NameSeg {} - | PARSEOP_NAMESTRING {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) AslCompilerlval.s);} - | PARSEOP_IO {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "IO");} - | PARSEOP_DMA {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "DMA");} - | PARSEOP_IRQ {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "IRQ");} - ; - -NameSeg - : PARSEOP_NAMESEG {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESEG, (ACPI_NATIVE_INT) AslCompilerlval.s);} - ; - - -/******************************************************************************* - * - * ASL Helper Terms - * - ******************************************************************************/ - -OptionalBusMasterKeyword - : ',' {$$ = TrCreateLeafNode (PARSEOP_BUSMASTERTYPE_MASTER);} - | ',' PARSEOP_BUSMASTERTYPE_MASTER {$$ = TrCreateLeafNode (PARSEOP_BUSMASTERTYPE_MASTER);} - | ',' PARSEOP_BUSMASTERTYPE_NOTMASTER {$$ = TrCreateLeafNode (PARSEOP_BUSMASTERTYPE_NOTMASTER);} - ; - -OptionalAccessAttribTerm - : {$$ = NULL;} - | ',' {$$ = NULL;} - | ',' ByteConstExpr {$$ = $2;} - | ',' AccessAttribKeyword {$$ = $2;} - ; - -OptionalAccessSize - : {$$ = TrCreateValuedLeafNode (PARSEOP_BYTECONST, 0);} - | ',' {$$ = TrCreateValuedLeafNode (PARSEOP_BYTECONST, 0);} - | ',' ByteConstExpr {$$ = $2;} - ; - -OptionalAddressingMode - : ',' {$$ = NULL;} - | ',' AddressingModeKeyword {$$ = $2;} - ; - -OptionalAddressRange - : {$$ = NULL;} - | ',' {$$ = NULL;} - | ',' AddressKeyword {$$ = $2;} - ; - -OptionalBitsPerByte - : ',' {$$ = NULL;} - | ',' BitsPerByteKeyword {$$ = $2;} - ; - -OptionalBuffer_Last - : {$$ = NULL;} - | ',' {$$ = NULL;} - | ',' RawDataBufferTerm {$$ = $2;} - ; - -OptionalByteConstExpr - : {$$ = NULL;} - | ',' {$$ = NULL;} - | ',' ByteConstExpr {$$ = $2;} - ; - -OptionalDecodeType - : ',' {$$ = NULL;} - | ',' DecodeKeyword {$$ = $2;} - ; - -OptionalDevicePolarity - : ',' {$$ = NULL;} - | ',' DevicePolarityKeyword {$$ = $2;} - ; - -OptionalDWordConstExpr - : {$$ = NULL;} - | ',' {$$ = NULL;} - | ',' DWordConstExpr {$$ = $2;} - ; - -OptionalEndian - : ',' {$$ = NULL;} - | ',' EndianKeyword {$$ = $2;} - ; - -OptionalFlowControl - : ',' {$$ = NULL;} - | ',' FlowControlKeyword {$$ = $2;} - ; - -OptionalIoRestriction - : ',' {$$ = NULL;} - | ',' IoRestrictionKeyword {$$ = $2;} - ; - -OptionalListString - : {$$ = TrCreateValuedLeafNode (PARSEOP_STRING_LITERAL, ACPI_TO_INTEGER (""));} /* Placeholder is a NULL string */ - | ',' {$$ = TrCreateValuedLeafNode (PARSEOP_STRING_LITERAL, ACPI_TO_INTEGER (""));} /* Placeholder is a NULL string */ - | ',' TermArg {$$ = $2;} - ; - -OptionalMaxType - : ',' {$$ = NULL;} - | ',' MaxKeyword {$$ = $2;} - ; - -OptionalMemType - : ',' {$$ = NULL;} - | ',' MemTypeKeyword {$$ = $2;} - ; - -OptionalMinType - : ',' {$$ = NULL;} - | ',' MinKeyword {$$ = $2;} - ; - -OptionalNameString - : {$$ = NULL;} - | ',' {$$ = NULL;} - | ',' NameString {$$ = $2;} - ; - -OptionalNameString_Last - : {$$ = NULL;} - | ',' {$$ = NULL;} - | ',' NameString {$$ = $2;} - ; - -OptionalNameString_First - : {$$ = TrCreateLeafNode (PARSEOP_ZERO);} - | NameString {$$ = $1;} - ; - -OptionalObjectTypeKeyword - : {$$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE_UNK);} - | ',' ObjectTypeKeyword {$$ = $2;} - ; - -OptionalParityType - : ',' {$$ = NULL;} - | ',' ParityTypeKeyword {$$ = $2;} - ; - -OptionalQWordConstExpr - : {$$ = NULL;} - | ',' {$$ = NULL;} - | ',' QWordConstExpr {$$ = $2;} - ; - -OptionalRangeType - : ',' {$$ = NULL;} - | ',' RangeTypeKeyword {$$ = $2;} - ; - -OptionalReadWriteKeyword - : {$$ = TrCreateLeafNode (PARSEOP_READWRITETYPE_BOTH);} - | PARSEOP_READWRITETYPE_BOTH {$$ = TrCreateLeafNode (PARSEOP_READWRITETYPE_BOTH);} - | PARSEOP_READWRITETYPE_READONLY {$$ = TrCreateLeafNode (PARSEOP_READWRITETYPE_READONLY);} - ; - -OptionalResourceType_First - : {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_CONSUMER);} - | ResourceTypeKeyword {$$ = $1;} - ; - -OptionalResourceType - : {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_CONSUMER);} - | ',' {$$ = TrCreateLeafNode (PARSEOP_RESOURCETYPE_CONSUMER);} - | ',' ResourceTypeKeyword {$$ = $2;} - ; - -OptionalSlaveMode - : ',' {$$ = NULL;} - | ',' SlaveModeKeyword {$$ = $2;} - ; - -OptionalShareType - : {$$ = NULL;} - | ',' {$$ = NULL;} - | ',' ShareTypeKeyword {$$ = $2;} - ; - -OptionalShareType_First - : {$$ = NULL;} - | ShareTypeKeyword {$$ = $1;} - ; - -OptionalStopBits - : ',' {$$ = NULL;} - | ',' StopBitsKeyword {$$ = $2;} - ; - -OptionalStringData - : {$$ = NULL;} - | ',' {$$ = NULL;} - | ',' StringData {$$ = $2;} - ; - -OptionalTranslationType_Last - : {$$ = NULL;} - | ',' {$$ = NULL;} - | ',' TranslationKeyword {$$ = $2;} - ; - -OptionalType - : {$$ = NULL;} - | ',' {$$ = NULL;} - | ',' TypeKeyword {$$ = $2;} - ; - -OptionalType_Last - : {$$ = NULL;} - | ',' {$$ = NULL;} - | ',' TypeKeyword {$$ = $2;} - ; - -OptionalWireMode - : ',' {$$ = NULL;} - | ',' WireModeKeyword {$$ = $2;} - ; - -OptionalWordConstExpr - : ',' {$$ = NULL;} - | ',' WordConstExpr {$$ = $2;} - ; - -OptionalXferSize - : {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_32, 2);} - | ',' {$$ = TrCreateValuedLeafNode (PARSEOP_XFERSIZE_32, 2);} - | ',' XferSizeKeyword {$$ = $2;} - ; diff --git a/source/compiler/aslrules.y b/source/compiler/aslrules.y index c4b0fc212..3c8cba76d 100644 --- a/source/compiler/aslrules.y +++ b/source/compiler/aslrules.y @@ -169,12 +169,36 @@ DefinitionBlockList DefinitionBlockList {$$ = TrLinkPeerNodes (2, $1,$2);} ; +/* Allow IO, DMA, IRQ Resource macro and FOR macro names to also be used as identifiers */ + +NameString + : NameSeg {} + | PARSEOP_NAMESTRING {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) $1);} + | PARSEOP_IO {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "IO");} + | PARSEOP_DMA {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "DMA");} + | PARSEOP_IRQ {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "IRQ");} + | PARSEOP_FOR {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESTRING, (ACPI_NATIVE_INT) "FOR");} + ; +/* +NameSeg + : PARSEOP_NAMESEG {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESEG, (ACPI_NATIVE_INT) + TrNormalizeNameSeg ($1));} + ; +*/ + +NameSeg + : PARSEOP_NAMESEG {$$ = TrCreateValuedLeafNode (PARSEOP_NAMESEG, + (ACPI_NATIVE_INT) AslCompilerlval.s);} + ; + + SuperName : NameString {} | ArgTerm {} | LocalTerm {} | DebugTerm {} | Type6Opcode {} + ; Target : {$$ = TrCreateNullTarget ();} /* Placeholder is a ZeroOp object */ @@ -188,6 +212,8 @@ TermArg | NameString {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} | ArgTerm {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} | LocalTerm {$$ = TrSetNodeFlags ($1, NODE_IS_TERM_ARG);} + + ; /* @@ -212,9 +238,26 @@ OptionalCount | ',' TermArg {$$ = $2;} ; -VarPackageLengthTerm - : {$$ = TrCreateLeafNode (PARSEOP_DEFAULT_ARG);} - | TermArg {$$ = $1;} +/* + * Data count for buffers and packages (byte count for buffers, + * element count for packages). + */ +OptionalDataCount + + /* Legacy ASL */ + : {$$ = NULL;} + | '(' TermArg ')' {$$ = $2;} + | '(' ')' {$$ = NULL;} + + /* C-style (ASL+) -- adds equals term */ + + | PARSEOP_EXP_EQUALS {$$ = NULL;} + + | '(' TermArg ')' + PARSEOP_EXP_EQUALS {$$ = $2;} + + | '(' ')' String + PARSEOP_EXP_EQUALS {$$ = NULL;} ; @@ -269,6 +312,7 @@ Object : CompilerDirective {} | NamedObject {} | NameSpaceModifier {} +// | StructureTerm {} ; PackageList @@ -526,6 +570,7 @@ NamedObject NameSpaceModifier : AliasTerm {} | NameTerm {} +// | NameTermAslPlus {} | ScopeTerm {} ; @@ -539,6 +584,7 @@ ObjectTypeName | RefOfTerm {} | DerefOfTerm {} | IndexTerm {} + /* | MethodInvocationTerm {} */ /* Caused reduce/reduce with Type6Opcode->MethodInvocationTerm */ ; @@ -604,6 +650,8 @@ Type2IntegerOpcode /* "Type3" opcodes */ | FromBCDTerm {} | IncTerm {} | IndexTerm {} +// | StructureIndexTerm {} +// | StructurePointerTerm {} | LAndTerm {} | LEqualTerm {} | LGreaterTerm {} @@ -664,6 +712,8 @@ Type4Opcode ; */ +/* Type 5 opcodes are a subset of Type2 opcodes, and return a constant */ + Type5Opcode : ResourceTemplateTerm {} | UnicodeTerm {} @@ -676,1097 +726,14 @@ Type6Opcode | DerefOfTerm {} | IndexTerm {} | IndexExpTerm {} +// | StructureIndexTerm {} +// | StructurePointerTerm {} | MethodInvocationTerm {} ; /******************************************************************************* * - * ASL Primary Terms - * - ******************************************************************************/ - -AccessAsTerm - : PARSEOP_ACCESSAS '(' - AccessTypeKeyword - OptionalAccessAttribTerm - ')' {$$ = TrCreateNode (PARSEOP_ACCESSAS,2,$3,$4);} - | PARSEOP_ACCESSAS '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -AcquireTerm - : PARSEOP_ACQUIRE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ACQUIRE);} - SuperName - ',' WordConstExpr - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$6);} - | PARSEOP_ACQUIRE '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -AddTerm - : PARSEOP_ADD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ADD);} - TermArg - TermArgItem - Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_ADD '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -AliasTerm - : PARSEOP_ALIAS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ALIAS);} - NameString - NameStringItem - ')' {$$ = TrLinkChildren ($<n>3,2,$4, - TrSetNodeFlags ($5, NODE_IS_NAME_DECLARATION));} - | PARSEOP_ALIAS '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -AndTerm - : PARSEOP_AND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_AND);} - TermArg - TermArgItem - Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_AND '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ArgTerm - : PARSEOP_ARG0 {$$ = TrCreateLeafNode (PARSEOP_ARG0);} - | PARSEOP_ARG1 {$$ = TrCreateLeafNode (PARSEOP_ARG1);} - | PARSEOP_ARG2 {$$ = TrCreateLeafNode (PARSEOP_ARG2);} - | PARSEOP_ARG3 {$$ = TrCreateLeafNode (PARSEOP_ARG3);} - | PARSEOP_ARG4 {$$ = TrCreateLeafNode (PARSEOP_ARG4);} - | PARSEOP_ARG5 {$$ = TrCreateLeafNode (PARSEOP_ARG5);} - | PARSEOP_ARG6 {$$ = TrCreateLeafNode (PARSEOP_ARG6);} - ; - -BankFieldTerm - : PARSEOP_BANKFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_BANKFIELD);} - NameString - NameStringItem - TermArgItem - ',' AccessTypeKeyword - ',' LockRuleKeyword - ',' UpdateRuleKeyword - ')' '{' - FieldUnitList '}' {$$ = TrLinkChildren ($<n>3,7,$4,$5,$6,$8,$10,$12,$15);} - | PARSEOP_BANKFIELD '(' - error ')' '{' error '}' {$$ = AslDoError(); yyclearin;} - ; - -BreakTerm - : PARSEOP_BREAK {$$ = TrCreateNode (PARSEOP_BREAK, 0);} - ; - -BreakPointTerm - : PARSEOP_BREAKPOINT {$$ = TrCreateNode (PARSEOP_BREAKPOINT, 0);} - ; - -BufferTerm - : PARSEOP_BUFFER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_BUFFER);} - OptionalBufferLength - ')' '{' - BufferTermData '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} - | PARSEOP_BUFFER '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -BufferTermData - : ByteList {} - | StringData {} - ; - -CaseTerm - : PARSEOP_CASE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CASE);} - DataObject - ')' '{' - TermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} - | PARSEOP_CASE '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ConcatTerm - : PARSEOP_CONCATENATE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONCATENATE);} - TermArg - TermArgItem - Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_CONCATENATE '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ConcatResTerm - : PARSEOP_CONCATENATERESTEMPLATE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONCATENATERESTEMPLATE);} - TermArg - TermArgItem - Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_CONCATENATERESTEMPLATE '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ConnectionTerm - : PARSEOP_CONNECTION '(' - NameString - ')' {$$ = TrCreateNode (PARSEOP_CONNECTION,1,$3);} - | PARSEOP_CONNECTION '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONNECTION);} - ResourceMacroTerm - ')' {$$ = TrLinkChildren ($<n>3, 1, - TrLinkChildren (TrCreateLeafNode (PARSEOP_RESOURCETEMPLATE), 3, - TrCreateLeafNode (PARSEOP_DEFAULT_ARG), - TrCreateLeafNode (PARSEOP_DEFAULT_ARG), - $4));} - | PARSEOP_CONNECTION '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -CondRefOfTerm - : PARSEOP_CONDREFOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CONDREFOF);} - SuperName - Target - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_CONDREFOF '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ContinueTerm - : PARSEOP_CONTINUE {$$ = TrCreateNode (PARSEOP_CONTINUE, 0);} - ; - -CopyObjectTerm - : PARSEOP_COPYOBJECT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_COPYOBJECT);} - TermArg - ',' SimpleTarget - ')' {$$ = TrLinkChildren ($<n>3,2,$4,TrSetNodeFlags ($6, NODE_IS_TARGET));} - | PARSEOP_COPYOBJECT '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -CreateBitFieldTerm - : PARSEOP_CREATEBITFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEBITFIELD);} - TermArg - TermArgItem - NameStringItem - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));} - | PARSEOP_CREATEBITFIELD '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -CreateByteFieldTerm - : PARSEOP_CREATEBYTEFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEBYTEFIELD);} - TermArg - TermArgItem - NameStringItem - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));} - | PARSEOP_CREATEBYTEFIELD '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -CreateDWordFieldTerm - : PARSEOP_CREATEDWORDFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEDWORDFIELD);} - TermArg - TermArgItem - NameStringItem - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));} - | PARSEOP_CREATEDWORDFIELD '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -CreateFieldTerm - : PARSEOP_CREATEFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEFIELD);} - TermArg - TermArgItem - TermArgItem - NameStringItem - ')' {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6,TrSetNodeFlags ($7, NODE_IS_NAME_DECLARATION));} - | PARSEOP_CREATEFIELD '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -CreateQWordFieldTerm - : PARSEOP_CREATEQWORDFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEQWORDFIELD);} - TermArg - TermArgItem - NameStringItem - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));} - | PARSEOP_CREATEQWORDFIELD '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -CreateWordFieldTerm - : PARSEOP_CREATEWORDFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_CREATEWORDFIELD);} - TermArg - TermArgItem - NameStringItem - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,TrSetNodeFlags ($6, NODE_IS_NAME_DECLARATION));} - | PARSEOP_CREATEWORDFIELD '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -DataRegionTerm - : PARSEOP_DATATABLEREGION '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DATATABLEREGION);} - NameString - TermArgItem - TermArgItem - TermArgItem - ')' {$$ = TrLinkChildren ($<n>3,4,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$5,$6,$7);} - | PARSEOP_DATATABLEREGION '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -DebugTerm - : PARSEOP_DEBUG {$$ = TrCreateLeafNode (PARSEOP_DEBUG);} - ; - -DecTerm - : PARSEOP_DECREMENT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DECREMENT);} - SuperName - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_DECREMENT '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -DefaultTerm - : PARSEOP_DEFAULT '{' {$<n>$ = TrCreateLeafNode (PARSEOP_DEFAULT);} - TermList '}' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_DEFAULT '{' - error '}' {$$ = AslDoError(); yyclearin;} - ; - -DerefOfTerm - : PARSEOP_DEREFOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DEREFOF);} - TermArg - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_DEREFOF '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -DeviceTerm - : PARSEOP_DEVICE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DEVICE);} - NameString - ')' '{' - TermList '}' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} - | PARSEOP_DEVICE '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -DivideTerm - : PARSEOP_DIVIDE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DIVIDE);} - TermArg - TermArgItem - Target - Target - ')' {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6,$7);} - | PARSEOP_DIVIDE '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -EISAIDTerm - : PARSEOP_EISAID '(' - StringData ')' {$$ = TrUpdateNode (PARSEOP_EISAID, $3);} - | PARSEOP_EISAID '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ElseIfTerm - : IfTerm ElseTerm {$$ = TrLinkPeerNode ($1,$2);} - ; - -ElseTerm - : {$$ = NULL;} - | PARSEOP_ELSE '{' {$<n>$ = TrCreateLeafNode (PARSEOP_ELSE);} - TermList '}' {$$ = TrLinkChildren ($<n>3,1,$4);} - - | PARSEOP_ELSE '{' - error '}' {$$ = AslDoError(); yyclearin;} - - | PARSEOP_ELSE - error {$$ = AslDoError(); yyclearin;} - - | PARSEOP_ELSEIF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_ELSE);} - TermArg {$<n>$ = TrCreateLeafNode (PARSEOP_IF);} - ')' '{' - TermList '}' {TrLinkChildren ($<n>5,2,$4,$8);} - ElseTerm {TrLinkPeerNode ($<n>5,$11);} - {$$ = TrLinkChildren ($<n>3,1,$<n>5);} - - | PARSEOP_ELSEIF '(' - error ')' {$$ = AslDoError(); yyclearin;} - - | PARSEOP_ELSEIF - error {$$ = AslDoError(); yyclearin;} - ; - -EventTerm - : PARSEOP_EVENT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_EVENT);} - NameString - ')' {$$ = TrLinkChildren ($<n>3,1,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION));} - | PARSEOP_EVENT '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ExternalTerm - : PARSEOP_EXTERNAL '(' - NameString - OptionalObjectTypeKeyword - OptionalParameterTypePackage - OptionalParameterTypesPackage - ')' {$$ = TrCreateNode (PARSEOP_EXTERNAL,4,$3,$4,$5,$6);} - | PARSEOP_EXTERNAL '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -FatalTerm - : PARSEOP_FATAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FATAL);} - ByteConstExpr - ',' DWordConstExpr - TermArgItem - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);} - | PARSEOP_FATAL '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -FieldTerm - : PARSEOP_FIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FIELD);} - NameString - ',' AccessTypeKeyword - ',' LockRuleKeyword - ',' UpdateRuleKeyword - ')' '{' - FieldUnitList '}' {$$ = TrLinkChildren ($<n>3,5,$4,$6,$8,$10,$13);} - | PARSEOP_FIELD '(' - error ')' '{' error '}' {$$ = AslDoError(); yyclearin;} - ; - -FindSetLeftBitTerm - : PARSEOP_FINDSETLEFTBIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FINDSETLEFTBIT);} - TermArg - Target - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_FINDSETLEFTBIT '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -FindSetRightBitTerm - : PARSEOP_FINDSETRIGHTBIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FINDSETRIGHTBIT);} - TermArg - Target - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_FINDSETRIGHTBIT '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - - /* Convert a For() loop to a While() loop */ -ForTerm - : PARSEOP_FOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WHILE);} - OptionalTermArg ',' {} - OptionalPredicate ',' - OptionalTermArg {$<n>$ = TrLinkPeerNode ($4,$<n>3); - TrSetParent ($9,$<n>3);} /* New parent is WHILE */ - ')' '{' TermList '}' {$<n>$ = TrLinkChildren ($<n>3,2,$7,$13);} - {$<n>$ = TrLinkPeerNode ($13,$9); - $$ = $<n>10;} - ; - -OptionalPredicate - : {$$ = TrCreateValuedLeafNode (PARSEOP_INTEGER, 1);} - | TermArg {$$ = $1;} - ; - -FprintfTerm - : PARSEOP_FPRINTF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FPRINTF);} - TermArg ',' - StringData - PrintfArgList - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$6,$7);} - | PARSEOP_FPRINTF '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -FromBCDTerm - : PARSEOP_FROMBCD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_FROMBCD);} - TermArg - Target - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_FROMBCD '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -FunctionTerm - : PARSEOP_FUNCTION '(' {$<n>$ = TrCreateLeafNode (PARSEOP_METHOD);} - NameString - OptionalParameterTypePackage - OptionalParameterTypesPackage - ')' '{' - TermList '}' {$$ = TrLinkChildren ($<n>3,7,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION), - TrCreateValuedLeafNode (PARSEOP_BYTECONST, 0), - TrCreateLeafNode (PARSEOP_SERIALIZERULE_NOTSERIAL), - TrCreateValuedLeafNode (PARSEOP_BYTECONST, 0),$5,$6,$9);} - | PARSEOP_FUNCTION '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -IfTerm - : PARSEOP_IF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_IF);} - TermArg - ')' '{' - TermList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} - - | PARSEOP_IF '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -IncludeTerm - : PARSEOP_INCLUDE '(' - String ')' {$$ = TrUpdateNode (PARSEOP_INCLUDE, $3); - FlOpenIncludeFile ($3);} - ; - -IncludeEndTerm - : PARSEOP_INCLUDE_END {$<n>$ = TrCreateLeafNode (PARSEOP_INCLUDE_END); TrSetCurrentFilename ($$);} - ; - -IncTerm - : PARSEOP_INCREMENT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INCREMENT);} - SuperName - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_INCREMENT '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -IndexFieldTerm - : PARSEOP_INDEXFIELD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INDEXFIELD);} - NameString - NameStringItem - ',' AccessTypeKeyword - ',' LockRuleKeyword - ',' UpdateRuleKeyword - ')' '{' - FieldUnitList '}' {$$ = TrLinkChildren ($<n>3,6,$4,$5,$7,$9,$11,$14);} - | PARSEOP_INDEXFIELD '(' - error ')' '{' error '}' {$$ = AslDoError(); yyclearin;} - ; - -IndexTerm - : PARSEOP_INDEX '(' {$<n>$ = TrCreateLeafNode (PARSEOP_INDEX);} - TermArg - TermArgItem - Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_INDEX '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -LAndTerm - : PARSEOP_LAND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LAND);} - TermArg - TermArgItem - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_LAND '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -LEqualTerm - : PARSEOP_LEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);} - TermArg - TermArgItem - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_LEQUAL '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -LGreaterEqualTerm - : PARSEOP_LGREATEREQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);} - TermArg - TermArgItem - ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($<n>3,2,$4,$5));} - | PARSEOP_LGREATEREQUAL '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -LGreaterTerm - : PARSEOP_LGREATER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);} - TermArg - TermArgItem - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_LGREATER '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -LLessEqualTerm - : PARSEOP_LLESSEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LGREATER);} - TermArg - TermArgItem - ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($<n>3,2,$4,$5));} - | PARSEOP_LLESSEQUAL '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -LLessTerm - : PARSEOP_LLESS '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LLESS);} - TermArg - TermArgItem - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_LLESS '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -LNotEqualTerm - : PARSEOP_LNOTEQUAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LEQUAL);} - TermArg - TermArgItem - ')' {$$ = TrCreateNode (PARSEOP_LNOT, 1, TrLinkChildren ($<n>3,2,$4,$5));} - | PARSEOP_LNOTEQUAL '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -LNotTerm - : PARSEOP_LNOT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LNOT);} - TermArg - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_LNOT '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -LoadTableTerm - : PARSEOP_LOADTABLE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LOADTABLE);} - TermArg - TermArgItem - TermArgItem - OptionalListString - OptionalListString - OptionalReference - ')' {$$ = TrLinkChildren ($<n>3,6,$4,$5,$6,$7,$8,$9);} - | PARSEOP_LOADTABLE '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -LoadTerm - : PARSEOP_LOAD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LOAD);} - NameString - RequiredTarget - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_LOAD '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -LocalTerm - : PARSEOP_LOCAL0 {$$ = TrCreateLeafNode (PARSEOP_LOCAL0);} - | PARSEOP_LOCAL1 {$$ = TrCreateLeafNode (PARSEOP_LOCAL1);} - | PARSEOP_LOCAL2 {$$ = TrCreateLeafNode (PARSEOP_LOCAL2);} - | PARSEOP_LOCAL3 {$$ = TrCreateLeafNode (PARSEOP_LOCAL3);} - | PARSEOP_LOCAL4 {$$ = TrCreateLeafNode (PARSEOP_LOCAL4);} - | PARSEOP_LOCAL5 {$$ = TrCreateLeafNode (PARSEOP_LOCAL5);} - | PARSEOP_LOCAL6 {$$ = TrCreateLeafNode (PARSEOP_LOCAL6);} - | PARSEOP_LOCAL7 {$$ = TrCreateLeafNode (PARSEOP_LOCAL7);} - ; - -LOrTerm - : PARSEOP_LOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_LOR);} - TermArg - TermArgItem - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_LOR '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -MatchTerm - : PARSEOP_MATCH '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MATCH);} - TermArg - ',' MatchOpKeyword - TermArgItem - ',' MatchOpKeyword - TermArgItem - TermArgItem - ')' {$$ = TrLinkChildren ($<n>3,6,$4,$6,$7,$9,$10,$11);} - | PARSEOP_MATCH '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -MethodTerm - : PARSEOP_METHOD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_METHOD);} - NameString - OptionalByteConstExpr {UtCheckIntegerRange ($5, 0, 7);} - OptionalSerializeRuleKeyword - OptionalByteConstExpr - OptionalParameterTypePackage - OptionalParameterTypesPackage - ')' '{' - TermList '}' {$$ = TrLinkChildren ($<n>3,7,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$5,$7,$8,$9,$10,$13);} - | PARSEOP_METHOD '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -MidTerm - : PARSEOP_MID '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MID);} - TermArg - TermArgItem - TermArgItem - Target - ')' {$$ = TrLinkChildren ($<n>3,4,$4,$5,$6,$7);} - | PARSEOP_MID '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ModTerm - : PARSEOP_MOD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MOD);} - TermArg - TermArgItem - Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_MOD '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -MultiplyTerm - : PARSEOP_MULTIPLY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MULTIPLY);} - TermArg - TermArgItem - Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_MULTIPLY '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -MutexTerm - : PARSEOP_MUTEX '(' {$<n>$ = TrCreateLeafNode (PARSEOP_MUTEX);} - NameString - ',' ByteConstExpr - ')' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6);} - | PARSEOP_MUTEX '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -NameTerm - : PARSEOP_NAME '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NAME);} - NameString - ',' DataObject - ')' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6);} - | PARSEOP_NAME '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -NAndTerm - : PARSEOP_NAND '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NAND);} - TermArg - TermArgItem - Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_NAND '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -NoOpTerm - : PARSEOP_NOOP {$$ = TrCreateNode (PARSEOP_NOOP, 0);} - ; - -NOrTerm - : PARSEOP_NOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOR);} - TermArg - TermArgItem - Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_NOR '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -NotifyTerm - : PARSEOP_NOTIFY '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOTIFY);} - SuperName - TermArgItem - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_NOTIFY '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -NotTerm - : PARSEOP_NOT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_NOT);} - TermArg - Target - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_NOT '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ObjectTypeTerm - : PARSEOP_OBJECTTYPE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OBJECTTYPE);} - ObjectTypeName - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_OBJECTTYPE '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -OffsetTerm - : PARSEOP_OFFSET '(' - AmlPackageLengthTerm - ')' {$$ = TrCreateNode (PARSEOP_OFFSET,1,$3);} - | PARSEOP_OFFSET '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -OpRegionTerm - : PARSEOP_OPERATIONREGION '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OPERATIONREGION);} - NameString - ',' OpRegionSpaceIdTerm - TermArgItem - TermArgItem - ')' {$$ = TrLinkChildren ($<n>3,4,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$7,$8);} - | PARSEOP_OPERATIONREGION '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -OpRegionSpaceIdTerm - : RegionSpaceKeyword {} - | ByteConst {$$ = UtCheckIntegerRange ($1, 0x80, 0xFF);} - ; - -OrTerm - : PARSEOP_OR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_OR);} - TermArg - TermArgItem - Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_OR '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -PackageTerm - : PARSEOP_PACKAGE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_VAR_PACKAGE);} - VarPackageLengthTerm - ')' '{' - PackageList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} - | PARSEOP_PACKAGE '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -PowerResTerm - : PARSEOP_POWERRESOURCE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_POWERRESOURCE);} - NameString - ',' ByteConstExpr - ',' WordConstExpr - ')' '{' - TermList '}' {$$ = TrLinkChildren ($<n>3,4,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$8,$11);} - | PARSEOP_POWERRESOURCE '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -PrintfTerm - : PARSEOP_PRINTF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_PRINTF);} - StringData - PrintfArgList - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_PRINTF '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -PrintfArgList - : {$$ = NULL;} - | TermArg {$$ = $1;} - | PrintfArgList ',' - TermArg {$$ = TrLinkPeerNode ($1, $3);} - ; - -ProcessorTerm - : PARSEOP_PROCESSOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_PROCESSOR);} - NameString - ',' ByteConstExpr - OptionalDWordConstExpr - OptionalByteConstExpr - ')' '{' - TermList '}' {$$ = TrLinkChildren ($<n>3,5,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$6,$7,$8,$11);} - | PARSEOP_PROCESSOR '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -RawDataBufferTerm - : PARSEOP_DATABUFFER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DATABUFFER);} - OptionalWordConst - ')' '{' - ByteList '}' {$$ = TrLinkChildren ($<n>3,2,$4,$7);} - | PARSEOP_DATABUFFER '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -/* - * In RefOf, the node isn't really a target, but we can't keep track of it after - * we've taken a pointer to it. (hard to tell if a local becomes initialized this way.) - */ -RefOfTerm - : PARSEOP_REFOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_REFOF);} - SuperName - ')' {$$ = TrLinkChildren ($<n>3,1,TrSetNodeFlags ($4, NODE_IS_TARGET));} - | PARSEOP_REFOF '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ReleaseTerm - : PARSEOP_RELEASE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RELEASE);} - SuperName - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_RELEASE '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ResetTerm - : PARSEOP_RESET '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RESET);} - SuperName - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_RESET '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ReturnTerm - : PARSEOP_RETURN '(' {$<n>$ = TrCreateLeafNode (PARSEOP_RETURN);} - OptionalReturnArg - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_RETURN {$$ = TrLinkChildren (TrCreateLeafNode (PARSEOP_RETURN),1,TrSetNodeFlags (TrCreateLeafNode (PARSEOP_ZERO), NODE_IS_NULL_RETURN));} - | PARSEOP_RETURN '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ScopeTerm - : PARSEOP_SCOPE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SCOPE);} - NameString - ')' '{' - TermList '}' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} - | PARSEOP_SCOPE '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ShiftLeftTerm - : PARSEOP_SHIFTLEFT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTLEFT);} - TermArg - TermArgItem - Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_SHIFTLEFT '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ShiftRightTerm - : PARSEOP_SHIFTRIGHT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SHIFTRIGHT);} - TermArg - TermArgItem - Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_SHIFTRIGHT '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -SignalTerm - : PARSEOP_SIGNAL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SIGNAL);} - SuperName - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_SIGNAL '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -SizeOfTerm - : PARSEOP_SIZEOF '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SIZEOF);} - SuperName - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_SIZEOF '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -SleepTerm - : PARSEOP_SLEEP '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SLEEP);} - TermArg - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_SLEEP '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -StallTerm - : PARSEOP_STALL '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STALL);} - TermArg - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_STALL '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -StoreTerm - : PARSEOP_STORE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_STORE);} - TermArg - ',' SuperName - ')' {$$ = TrLinkChildren ($<n>3,2,$4,TrSetNodeFlags ($6, NODE_IS_TARGET));} - | PARSEOP_STORE '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -SubtractTerm - : PARSEOP_SUBTRACT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SUBTRACT);} - TermArg - TermArgItem - Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_SUBTRACT '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; -SwitchTerm - : PARSEOP_SWITCH '(' {$<n>$ = TrCreateLeafNode (PARSEOP_SWITCH);} - TermArg - ')' '{' - CaseDefaultTermList '}' - {$$ = TrLinkChildren ($<n>3,2,$4,$7);} - | PARSEOP_SWITCH '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ThermalZoneTerm - : PARSEOP_THERMALZONE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_THERMALZONE);} - NameString - ')' '{' - TermList '}' {$$ = TrLinkChildren ($<n>3,2,TrSetNodeFlags ($4, NODE_IS_NAME_DECLARATION),$7);} - | PARSEOP_THERMALZONE '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -TimerTerm - : PARSEOP_TIMER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TIMER);} - ')' {$$ = TrLinkChildren ($<n>3,0);} - | PARSEOP_TIMER {$$ = TrLinkChildren (TrCreateLeafNode (PARSEOP_TIMER),0);} - | PARSEOP_TIMER '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ToBCDTerm - : PARSEOP_TOBCD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOBCD);} - TermArg - Target - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_TOBCD '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ToBufferTerm - : PARSEOP_TOBUFFER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOBUFFER);} - TermArg - Target - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_TOBUFFER '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ToDecimalStringTerm - : PARSEOP_TODECIMALSTRING '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TODECIMALSTRING);} - TermArg - Target - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_TODECIMALSTRING '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ToHexStringTerm - : PARSEOP_TOHEXSTRING '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOHEXSTRING);} - TermArg - Target - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_TOHEXSTRING '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ToIntegerTerm - : PARSEOP_TOINTEGER '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOINTEGER);} - TermArg - Target - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_TOINTEGER '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ToPLDTerm - : PARSEOP_TOPLD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOPLD);} - PldKeywordList - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_TOPLD '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -PldKeywordList - : {$$ = NULL;} - | PldKeyword - PARSEOP_EXP_EQUALS Integer {$$ = TrLinkChildren ($1,1,$3);} - | PldKeyword - PARSEOP_EXP_EQUALS String {$$ = TrLinkChildren ($1,1,$3);} - | PldKeywordList ',' /* Allows a trailing comma at list end */ - | PldKeywordList ',' - PldKeyword - PARSEOP_EXP_EQUALS Integer {$$ = TrLinkPeerNode ($1,TrLinkChildren ($3,1,$5));} - | PldKeywordList ',' - PldKeyword - PARSEOP_EXP_EQUALS String {$$ = TrLinkPeerNode ($1,TrLinkChildren ($3,1,$5));} - ; - - -ToStringTerm - : PARSEOP_TOSTRING '(' {$<n>$ = TrCreateLeafNode (PARSEOP_TOSTRING);} - TermArg - OptionalCount - Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_TOSTRING '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -ToUUIDTerm - : PARSEOP_TOUUID '(' - StringData ')' {$$ = TrUpdateNode (PARSEOP_TOUUID, $3);} - | PARSEOP_TOUUID '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -UnicodeTerm - : PARSEOP_UNICODE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UNICODE);} - StringData - ')' {$$ = TrLinkChildren ($<n>3,2,0,$4);} - | PARSEOP_UNICODE '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -UnloadTerm - : PARSEOP_UNLOAD '(' {$<n>$ = TrCreateLeafNode (PARSEOP_UNLOAD);} - SuperName - ')' {$$ = TrLinkChildren ($<n>3,1,$4);} - | PARSEOP_UNLOAD '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -WaitTerm - : PARSEOP_WAIT '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WAIT);} - SuperName - TermArgItem - ')' {$$ = TrLinkChildren ($<n>3,2,$4,$5);} - | PARSEOP_WAIT '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -XOrTerm - : PARSEOP_XOR '(' {$<n>$ = TrCreateLeafNode (PARSEOP_XOR);} - TermArg - TermArgItem - Target - ')' {$$ = TrLinkChildren ($<n>3,3,$4,$5,$6);} - | PARSEOP_XOR '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - -WhileTerm - : PARSEOP_WHILE '(' {$<n>$ = TrCreateLeafNode (PARSEOP_WHILE);} - TermArg - ')' '{' TermList '}' - {$$ = TrLinkChildren ($<n>3,2,$4,$7);} - | PARSEOP_WHILE '(' - error ')' {$$ = AslDoError(); yyclearin;} - ; - - -/******************************************************************************* - * * ASL Helper Terms * ******************************************************************************/ @@ -1807,11 +774,6 @@ OptionalTermArg | TermArg {$$ = $1;} ; -OptionalBufferLength - : {$$ = NULL;} - | TermArg {$$ = $1;} - ; - OptionalWordConst : {$$ = NULL;} | WordConst {$$ = $1;} diff --git a/source/compiler/asltokens.y b/source/compiler/asltokens.y index 993d0f124..04e21ff4e 100644 --- a/source/compiler/asltokens.y +++ b/source/compiler/asltokens.y @@ -125,6 +125,16 @@ NoEcho(' * *****************************************************************************/ +/* + * Most tokens are defined to return <i>, which is a UINT64. + * + * These tokens return <s>, a pointer to the associated lexed string: + * + * PARSEOP_NAMESEG + * PARSEOP_NAMESTRING + * PARSEOP_STRING_LITERAL + * PARSEOP_STRUCTURE_NAMESTRING + */ %token <i> PARSEOP_ACCESSAS %token <i> PARSEOP_ACCESSATTRIB_BLOCK %token <i> PARSEOP_ACCESSATTRIB_BLOCK_CALL @@ -538,12 +548,42 @@ NoEcho(' %token <i> PARSEOP_FPRINTF %token <i> PARSEOP_FOR +/* Structures */ + +%token <i> PARSEOP_STRUCTURE +%token <s> PARSEOP_STRUCTURE_NAMESTRING +%token <i> PARSEOP_STRUCTURE_TAG +%token <i> PARSEOP_STRUCTURE_ELEMENT +%token <i> PARSEOP_STRUCTURE_INSTANCE +%token <i> PARSEOP_STRUCTURE_REFERENCE +%token <i> PARSEOP_STRUCTURE_POINTER + +/* Top level */ + +%token <i> PARSEOP_ASL_CODE + + +/******************************************************************************* + * + * Tokens below are not in the aslmap.c file + * + ******************************************************************************/ + + +/* Tokens below this are not in the aslmap.c file */ + /* Specific parentheses tokens are not used at this time */ /* PARSEOP_EXP_PAREN_OPEN */ /* PARSEOP_EXP_PAREN_CLOSE */ +/* ASL+ variable creation */ + +%token <i> PARSEOP_INTEGER_TYPE +%token <i> PARSEOP_STRING_TYPE +%token <i> PARSEOP_BUFFER_TYPE +%token <i> PARSEOP_PACKAGE_TYPE +%token <i> PARSEOP_REFERENCE_TYPE -%token <i> PARSEOP_ASL_CODE /* * Special functions. These should probably stay at the end of this diff --git a/source/compiler/asltypes.y b/source/compiler/asltypes.y index 118ad577e..811bed62d 100644 --- a/source/compiler/asltypes.y +++ b/source/compiler/asltypes.y @@ -350,7 +350,6 @@ NoEcho(' %type <n> PackageElement %type <n> PackageList %type <n> PackageTerm -%type <n> VarPackageLengthTerm /* Macros */ @@ -422,9 +421,9 @@ NoEcho(' %type <n> OptionalAddressRange %type <n> OptionalBitsPerByte %type <n> OptionalBuffer_Last -%type <n> OptionalBufferLength %type <n> OptionalByteConstExpr %type <n> OptionalCount +%type <n> OptionalDataCount %type <n> OptionalDecodeType %type <n> OptionalDevicePolarity %type <n> OptionalDWordConstExpr @@ -441,6 +440,7 @@ NoEcho(' %type <n> OptionalObjectTypeKeyword %type <n> OptionalParameterTypePackage %type <n> OptionalParameterTypesPackage +%type <n> OptionalParentheses %type <n> OptionalParityType %type <n> OptionalPredicate %type <n> OptionalQWordConstExpr @@ -465,8 +465,53 @@ NoEcho(' %type <n> OptionalXferSize /* - * C-style expression parser + * ASL+ (C-style) parser */ + +/* Expressions and symbolic operators */ + %type <n> Expression %type <n> EqualsTerm %type <n> IndexExpTerm + +/* ASL+ Named object declaration support */ +/* +%type <n> NameTermAslPlus + +%type <n> BufferBegin +%type <n> BufferEnd +%type <n> PackageBegin +%type <n> PackageEnd +%type <n> OptionalLength +*/ +/* ASL+ Structure declarations */ +/* +%type <n> StructureTerm +%type <n> StructureTermBegin +%type <n> StructureType +%type <n> StructureTag +%type <n> StructureElementList +%type <n> StructureElement +%type <n> StructureElementType +%type <n> OptionalStructureElementType +%type <n> StructureId +*/ +/* Structure instantiantion */ +/* +%type <n> StructureInstanceTerm +%type <n> StructureTagReference +%type <n> StructureInstanceEnd +*/ +/* Pseudo-instantiantion for method Args/Locals */ +/* +%type <n> MethodStructureTerm +%type <n> LocalStructureName +*/ +/* Direct structure references via the Index operator */ +/* +%type <n> StructureReference +%type <n> StructureIndexTerm +%type <n> StructurePointerTerm +%type <n> StructurePointerReference +%type <n> OptionalDefinePointer +*/ |