xref: /illumos-gate/usr/src/cmd/acpi/iasl/aslcompiler.l (revision 8942719269eba26304a9de8478e842928c665dfc)
1 %{
2 /******************************************************************************
3  *
4  * Module Name: aslcompiler.l - Flex/lex input file
5  *
6  *****************************************************************************/
7 
8 /******************************************************************************
9  *
10  * 1. Copyright Notice
11  *
12  * Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
13  * All rights reserved.
14  *
15  * 2. License
16  *
17  * 2.1. This is your license from Intel Corp. under its intellectual property
18  * rights. You may have additional license terms from the party that provided
19  * you this software, covering your right to use that party's intellectual
20  * property rights.
21  *
22  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
23  * copy of the source code appearing in this file ("Covered Code") an
24  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
25  * base code distributed originally by Intel ("Original Intel Code") to copy,
26  * make derivatives, distribute, use and display any portion of the Covered
27  * Code in any form, with the right to sublicense such rights; and
28  *
29  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
30  * license (with the right to sublicense), under only those claims of Intel
31  * patents that are infringed by the Original Intel Code, to make, use, sell,
32  * offer to sell, and import the Covered Code and derivative works thereof
33  * solely to the minimum extent necessary to exercise the above copyright
34  * license, and in no event shall the patent license extend to any additions
35  * to or modifications of the Original Intel Code. No other license or right
36  * is granted directly or by implication, estoppel or otherwise;
37  *
38  * The above copyright and patent license is granted only if the following
39  * conditions are met:
40  *
41  * 3. Conditions
42  *
43  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
44  * Redistribution of source code of any substantial portion of the Covered
45  * Code or modification with rights to further distribute source must include
46  * the above Copyright Notice, the above License, this list of Conditions,
47  * and the following Disclaimer and Export Compliance provision. In addition,
48  * Licensee must cause all Covered Code to which Licensee contributes to
49  * contain a file documenting the changes Licensee made to create that Covered
50  * Code and the date of any change. Licensee must include in that file the
51  * documentation of any changes made by any predecessor Licensee. Licensee
52  * must include a prominent statement that the modification is derived,
53  * directly or indirectly, from Original Intel Code.
54  *
55  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
56  * Redistribution of source code of any substantial portion of the Covered
57  * Code or modification without rights to further distribute source must
58  * include the following Disclaimer and Export Compliance provision in the
59  * documentation and/or other materials provided with distribution. In
60  * addition, Licensee may not authorize further sublicense of source of any
61  * portion of the Covered Code, and must include terms to the effect that the
62  * license from Licensee to its licensee is limited to the intellectual
63  * property embodied in the software Licensee provides to its licensee, and
64  * not to intellectual property embodied in modifications its licensee may
65  * make.
66  *
67  * 3.3. Redistribution of Executable. Redistribution in executable form of any
68  * substantial portion of the Covered Code or modification must reproduce the
69  * above Copyright Notice, and the following Disclaimer and Export Compliance
70  * provision in the documentation and/or other materials provided with the
71  * distribution.
72  *
73  * 3.4. Intel retains all right, title, and interest in and to the Original
74  * Intel Code.
75  *
76  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
77  * Intel shall be used in advertising or otherwise to promote the sale, use or
78  * other dealings in products derived from or relating to the Covered Code
79  * without prior written authorization from Intel.
80  *
81  * 4. Disclaimer and Export Compliance
82  *
83  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
84  * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
85  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
86  * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
87  * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
88  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
89  * PARTICULAR PURPOSE.
90  *
91  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
92  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
93  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
94  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
95  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
96  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
97  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
98  * LIMITED REMEDY.
99  *
100  * 4.3. Licensee shall not export, either directly or indirectly, any of this
101  * software or system incorporating such software without first obtaining any
102  * required license or other approval from the U. S. Department of Commerce or
103  * any other agency or department of the United States Government. In the
104  * event Licensee exports any such software from the United States or
105  * re-exports any such software from a foreign destination, Licensee shall
106  * ensure that the distribution and export/re-export of the software is in
107  * compliance with all laws, regulations, orders, or other restrictions of the
108  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
109  * any of its subsidiaries will export/re-export any technical data, process,
110  * software, or service, directly or indirectly, to any country for which the
111  * United States government or any agency thereof requires an export license,
112  * other governmental approval, or letter of assurance, without first obtaining
113  * such license, approval or letter.
114  *
115  *****************************************************************************
116  *
117  * Alternatively, you may choose to be licensed under the terms of the
118  * following license:
119  *
120  * Redistribution and use in source and binary forms, with or without
121  * modification, are permitted provided that the following conditions
122  * are met:
123  * 1. Redistributions of source code must retain the above copyright
124  *    notice, this list of conditions, and the following disclaimer,
125  *    without modification.
126  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
127  *    substantially similar to the "NO WARRANTY" disclaimer below
128  *    ("Disclaimer") and any redistribution must be conditioned upon
129  *    including a substantially similar Disclaimer requirement for further
130  *    binary redistribution.
131  * 3. Neither the names of the above-listed copyright holders nor the names
132  *    of any contributors may be used to endorse or promote products derived
133  *    from this software without specific prior written permission.
134  *
135  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
136  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
137  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
138  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
139  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
140  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
141  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
142  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
143  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
144  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
145  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
146  *
147  * Alternatively, you may choose to be licensed under the terms of the
148  * GNU General Public License ("GPL") version 2 as published by the Free
149  * Software Foundation.
150  *
151  *****************************************************************************/
152 
153 #include "aslcompiler.h"
154 #include "aslcompiler.y.h"
155 #include "acconvert.h"
156 
157 #include <stdlib.h>
158 #include <string.h>
159 
160 extern YYSTYPE AslCompilerlval;
161 
162 /*
163  * Generation:  Use the following command line:
164  *
165  * flex.exe -PAslCompiler -i -o$(InputPath).c $(InputPath)
166  *
167  * -i: Scanner must be case-insensitive
168  */
169 
170 #define _COMPONENT          ACPI_COMPILER
171         ACPI_MODULE_NAME    ("aslscanner")
172 
173 
174 /* Local prototypes */
175 
176 static void
177 AslDoLineDirective (void);
178 
179 static BOOLEAN
180 AslDoComment (void);
181 
182 static BOOLEAN
183 AslDoCommentType2 (void);
184 
185 static char
186 AslDoStringLiteral (void);
187 
188 static void
189 count (int type);
190 
191 
192 /*! [Begin] no source code translation */
193 
194 %}
195     /* Definitions */
196 
197 LeadNameChar                [A-Za-z_]
198 DigitChar                   [0-9]
199 OctalChar                   [0-7]
200 HexDigitChar                [A-Fa-f0-9]
201 RootChar                    [\\]
202 Nothing                     []
203 
204 NameChar                    [A-Za-z_0-9]
205 NameSeg1                    {LeadNameChar}{NameChar}
206 NameSeg2                    {LeadNameChar}{NameChar}{NameChar}
207 NameSeg3                    {LeadNameChar}{NameChar}{NameChar}{NameChar}
208 NameSeg                     {LeadNameChar}|{NameSeg1}|{NameSeg2}|{NameSeg3}
209 
210 NameString                  {RootChar}|{RootChar}{NamePath}|[\^]+{NamePath}|{NonEmptyNamePath}
211 NamePath                    {NonEmptyNamePath}?
212 NonEmptyNamePath            {NameSeg}{NamePathTail}*
213 NamePathTail                [.]{NameSeg}
214 
215 %%
216     /* Rules */
217 
218 [ ]                         { count (0); }
219 [\n]                        { count (0); } /* Handle files with both LF and CR/LF */
220 [\r]                        { count (0); } /* termination on both Unix and Windows */
221 [ \t]                       { count (0); }
222 
223 
224 "/*"                        { if (!AslDoComment ()) {yyterminate ();} }
225 "//"                        { if (!AslDoCommentType2 ()) {yyterminate ();} }
226 
227 "\""                        { if (AslDoStringLiteral ()) {return (PARSEOP_STRING_LITERAL);}
228                               else {yyterminate ();} }
229 ";"                         { count (0); return(';'); }
230 
231     /* ASL Extension: Standard C operators */
232 
233 "~"                         { count (3); return (PARSEOP_EXP_NOT); }
234 "!"                         { count (3); return (PARSEOP_EXP_LOGICAL_NOT); }
235 "*"                         { count (3); return (PARSEOP_EXP_MULTIPLY); }
236 "/"                         { count (3); return (PARSEOP_EXP_DIVIDE); }
237 "%"                         { count (3); return (PARSEOP_EXP_MODULO); }
238 "+"                         { count (3); return (PARSEOP_EXP_ADD); }
239 "-"                         { count (3); return (PARSEOP_EXP_SUBTRACT); }
240 ">>"                        { count (3); return (PARSEOP_EXP_SHIFT_RIGHT); }
241 "<<"                        { count (3); return (PARSEOP_EXP_SHIFT_LEFT); }
242 "<"                         { count (3); return (PARSEOP_EXP_LESS); }
243 ">"                         { count (3); return (PARSEOP_EXP_GREATER); }
244 "&"                         { count (3); return (PARSEOP_EXP_AND); }
245 "<="                        { count (3); return (PARSEOP_EXP_LESS_EQUAL); }
246 ">="                        { count (3); return (PARSEOP_EXP_GREATER_EQUAL); }
247 "=="                        { count (3); return (PARSEOP_EXP_EQUAL); }
248 "!="                        { count (3); return (PARSEOP_EXP_NOT_EQUAL); }
249 "|"                         { count (3); return (PARSEOP_EXP_OR); }
250 "&&"                        { count (3); return (PARSEOP_EXP_LOGICAL_AND); }
251 "||"                        { count (3); return (PARSEOP_EXP_LOGICAL_OR); }
252 "++"                        { count (3); return (PARSEOP_EXP_INCREMENT); }
253 "--"                        { count (3); return (PARSEOP_EXP_DECREMENT); }
254 "^ "                        { count (3); return (PARSEOP_EXP_XOR); }
255 
256     /* ASL Extension: Standard C assignment operators */
257 
258 "="                         { count (3); return (PARSEOP_EXP_EQUALS); }
259 "+="                        { count (3); return (PARSEOP_EXP_ADD_EQ); }
260 "-="                        { count (3); return (PARSEOP_EXP_SUB_EQ); }
261 "*="                        { count (3); return (PARSEOP_EXP_MUL_EQ); }
262 "/="                        { count (3); return (PARSEOP_EXP_DIV_EQ); }
263 "%="                        { count (3); return (PARSEOP_EXP_MOD_EQ); }
264 "<<="                       { count (3); return (PARSEOP_EXP_SHL_EQ); }
265 ">>="                       { count (3); return (PARSEOP_EXP_SHR_EQ); }
266 "&="                        { count (3); return (PARSEOP_EXP_AND_EQ); }
267 "^="                        { count (3); return (PARSEOP_EXP_XOR_EQ); }
268 "|="                        { count (3); return (PARSEOP_EXP_OR_EQ); }
269 
270 "["                         { count (3); return (PARSEOP_EXP_INDEX_LEFT); }
271 "]"                         { count (0); return (PARSEOP_EXP_INDEX_RIGHT); }
272 "("                         { count (0); return (PARSEOP_OPEN_PAREN); }
273 ")"                         { count (0); return (PARSEOP_CLOSE_PAREN); }
274 
275 "{"                         { count (0); return ('{'); }
276 "}"                         { count (0); return ('}'); }
277 ","                         { count (0); return (','); }
278 
279 
280     /*
281      * Begin standard ASL grammar
282      */
283 [0-9][a-zA-Z0-9]*            { AslCompilerlval.i = UtDoConstant ((char *) AslCompilertext);
284                                 count (1); return (PARSEOP_INTEGER); }
285 
286 "Include"                   { count (1); return (PARSEOP_INCLUDE); }
287 "External"                  { count (1); return (PARSEOP_EXTERNAL); }
288 
289  /*
290   * The #line directive is emitted by the preprocessor and handled
291   * here in the main iASL lexer - simply set the line number and
292   * optionally the current filename.
293   */
294 "#line"                     { AslDoLineDirective ();}
295 
296 
297  /****************************************************************************
298   *
299   * Main ASL operators
300   *
301   ****************************************************************************/
302 
303 "AccessAs"                  { count (1); return (PARSEOP_ACCESSAS); }
304 "Acquire"                   { count (3); return (PARSEOP_ACQUIRE); }
305 "Add"                       { count (3); return (PARSEOP_ADD); }
306 "Alias"                     { count (2); return (PARSEOP_ALIAS); }
307 "And"                       { count (3); return (PARSEOP_AND); }
308 "BankField"                 { count (2); return (PARSEOP_BANKFIELD); }
309 "Break"                     { count (3); return (PARSEOP_BREAK); }
310 "BreakPoint"                { count (3); return (PARSEOP_BREAKPOINT); }
311 "Buffer"                    { count (1); return (PARSEOP_BUFFER); }
312 "Case"                      { count (3); return (PARSEOP_CASE); }
313 "Concatenate"               { count (3); return (PARSEOP_CONCATENATE); }
314 "ConcatenateResTemplate"    { count (3); return (PARSEOP_CONCATENATERESTEMPLATE); }
315 "CondRefOf"                 { count (3); return (PARSEOP_CONDREFOF); }
316 "Connection"                { count (2); return (PARSEOP_CONNECTION); }
317 "Continue"                  { count (3); return (PARSEOP_CONTINUE); }
318 "CopyObject"                { count (3); return (PARSEOP_COPYOBJECT); }
319 "CreateBitField"            { count (2); return (PARSEOP_CREATEBITFIELD); }
320 "CreateByteField"           { count (2); return (PARSEOP_CREATEBYTEFIELD); }
321 "CreateDWordField"          { count (2); return (PARSEOP_CREATEDWORDFIELD); }
322 "CreateField"               { count (2); return (PARSEOP_CREATEFIELD); }
323 "CreateQWordField"          { count (2); return (PARSEOP_CREATEQWORDFIELD); }
324 "CreateWordField"           { count (2); return (PARSEOP_CREATEWORDFIELD); }
325 "DataTableRegion"           { count (2); return (PARSEOP_DATATABLEREGION); }
326 "Debug"                     { count (1); return (PARSEOP_DEBUG); }
327 "Decrement"                 { count (3); return (PARSEOP_DECREMENT); }
328 "Default"                   { count (3); return (PARSEOP_DEFAULT); }
329 "DefinitionBlock"           { count (1); return (PARSEOP_DEFINITION_BLOCK); }
330 "DeRefOf"                   { count (3); return (PARSEOP_DEREFOF); }
331 "Device"                    { count (2); return (PARSEOP_DEVICE); }
332 "Divide"                    { count (3); return (PARSEOP_DIVIDE); }
333 "Eisaid"                    { count (1); return (PARSEOP_EISAID); }
334 "Else"                      { count (3); return (PARSEOP_ELSE); }
335 "ElseIf"                    { count (3); return (PARSEOP_ELSEIF); }
336 "Event"                     { count (2); return (PARSEOP_EVENT); }
337 "Fatal"                     { count (3); return (PARSEOP_FATAL); }
338 "Field"                     { count (2); return (PARSEOP_FIELD); }
339 "FindSetLeftBit"            { count (3); return (PARSEOP_FINDSETLEFTBIT); }
340 "FindSetRightBit"           { count (3); return (PARSEOP_FINDSETRIGHTBIT); }
341 "FromBcd"                   { count (3); return (PARSEOP_FROMBCD); }
342 "Function"                  { count (2); return (PARSEOP_FUNCTION); }
343 "If"                        { count (3); return (PARSEOP_IF); }
344 "Increment"                 { count (3); return (PARSEOP_INCREMENT); }
345 "Index"                     { count (3); return (PARSEOP_INDEX); }
346 "IndexField"                { count (2); return (PARSEOP_INDEXFIELD); }
347 "LAnd"                      { count (3); return (PARSEOP_LAND); }
348 "LEqual"                    { count (3); return (PARSEOP_LEQUAL); }
349 "LGreater"                  { count (3); return (PARSEOP_LGREATER); }
350 "LGreaterEqual"             { count (3); return (PARSEOP_LGREATEREQUAL); }
351 "LLess"                     { count (3); return (PARSEOP_LLESS); }
352 "LLessEqual"                { count (3); return (PARSEOP_LLESSEQUAL); }
353 "LNot"                      { count (3); return (PARSEOP_LNOT); }
354 "LNotEqual"                 { count (3); return (PARSEOP_LNOTEQUAL); }
355 "Load"                      { count (3); return (PARSEOP_LOAD); }
356 "LoadTable"                 { count (3); return (PARSEOP_LOADTABLE); }
357 "LOr"                       { count (3); return (PARSEOP_LOR); }
358 "Match"                     { count (3); return (PARSEOP_MATCH); }
359 "Method"                    { count (2); return (PARSEOP_METHOD); }
360 "Mid"                       { count (3); return (PARSEOP_MID); }
361 "Mod"                       { count (3); return (PARSEOP_MOD); }
362 "Multiply"                  { count (3); return (PARSEOP_MULTIPLY); }
363 "Mutex"                     { count (2); return (PARSEOP_MUTEX); }
364 "Name"                      { count (2); return (PARSEOP_NAME); }
365 "NAnd"                      { count (3); return (PARSEOP_NAND); }
366 "Noop"                      { if (!AcpiGbl_IgnoreNoopOperator) {count (3); return (PARSEOP_NOOP);} }
367 "NOr"                       { count (3); return (PARSEOP_NOR); }
368 "Not"                       { count (3); return (PARSEOP_NOT); }
369 "Notify"                    { count (3); return (PARSEOP_NOTIFY); }
370 "ObjectType"                { count (3); return (PARSEOP_OBJECTTYPE); }
371 "Offset"                    { count (1); return (PARSEOP_OFFSET); }
372 "One"                       { count (1); return (PARSEOP_ONE); }
373 "Ones"                      { count (1); return (PARSEOP_ONES); }
374 "OperationRegion"           { count (2); return (PARSEOP_OPERATIONREGION); }
375 "Or"                        { count (3); return (PARSEOP_OR); }
376 "Package"                   { count (1); return (PARSEOP_PACKAGE); }
377 "PowerResource"             { count (2); return (PARSEOP_POWERRESOURCE); }
378 "Processor"                 { count (2); return (PARSEOP_PROCESSOR); }
379 "RefOf"                     { count (3); return (PARSEOP_REFOF); }
380 "Release"                   { count (3); return (PARSEOP_RELEASE); }
381 "Reset"                     { count (3); return (PARSEOP_RESET); }
382 "Return"                    { count (3); return (PARSEOP_RETURN); }
383 "Revision"                  { count (1); return (PARSEOP_REVISION); }
384 "Scope"                     { count (2); return (PARSEOP_SCOPE); }
385 "ShiftLeft"                 { count (3); return (PARSEOP_SHIFTLEFT); }
386 "ShiftRight"                { count (3); return (PARSEOP_SHIFTRIGHT); }
387 "Signal"                    { count (3); return (PARSEOP_SIGNAL); }
388 "SizeOf"                    { count (3); return (PARSEOP_SIZEOF); }
389 "Sleep"                     { count (3); return (PARSEOP_SLEEP); }
390 "Stall"                     { count (3); return (PARSEOP_STALL); }
391 "Store"                     { count (3); return (PARSEOP_STORE); }
392 "Subtract"                  { count (3); return (PARSEOP_SUBTRACT); }
393 "Switch"                    { count (3); return (PARSEOP_SWITCH); }
394 "ThermalZone"               { count (2); return (PARSEOP_THERMALZONE); }
395 "Timer"                     { count (3); return (PARSEOP_TIMER); }
396 "ToBcd"                     { count (3); return (PARSEOP_TOBCD); }
397 "ToBuffer"                  { count (3); return (PARSEOP_TOBUFFER); }
398 "ToDecimalString"           { count (3); return (PARSEOP_TODECIMALSTRING); }
399 "ToHexString"               { count (3); return (PARSEOP_TOHEXSTRING); }
400 "ToInteger"                 { count (3); return (PARSEOP_TOINTEGER); }
401 "ToString"                  { count (3); return (PARSEOP_TOSTRING); }
402 "ToUuid"                    { count (1); return (PARSEOP_TOUUID); }
403 "Unicode"                   { count (1); return (PARSEOP_UNICODE); }
404 "Unload"                    { count (3); return (PARSEOP_UNLOAD); }
405 "Wait"                      { count (3); return (PARSEOP_WAIT); }
406 "While"                     { count (3); return (PARSEOP_WHILE); }
407 "XOr"                       { count (3); return (PARSEOP_XOR); }
408 "Zero"                      { count (1); return (PARSEOP_ZERO); }
409 
410     /* Control method arguments and locals */
411 
412 "Arg0"                      { count (1); return (PARSEOP_ARG0); }
413 "Arg1"                      { count (1); return (PARSEOP_ARG1); }
414 "Arg2"                      { count (1); return (PARSEOP_ARG2); }
415 "Arg3"                      { count (1); return (PARSEOP_ARG3); }
416 "Arg4"                      { count (1); return (PARSEOP_ARG4); }
417 "Arg5"                      { count (1); return (PARSEOP_ARG5); }
418 "Arg6"                      { count (1); return (PARSEOP_ARG6); }
419 "Local0"                    { count (1); return (PARSEOP_LOCAL0); }
420 "Local1"                    { count (1); return (PARSEOP_LOCAL1); }
421 "Local2"                    { count (1); return (PARSEOP_LOCAL2); }
422 "Local3"                    { count (1); return (PARSEOP_LOCAL3); }
423 "Local4"                    { count (1); return (PARSEOP_LOCAL4); }
424 "Local5"                    { count (1); return (PARSEOP_LOCAL5); }
425 "Local6"                    { count (1); return (PARSEOP_LOCAL6); }
426 "Local7"                    { count (1); return (PARSEOP_LOCAL7); }
427 
428 
429  /****************************************************************************
430   *
431   * Resource Descriptor macros
432   *
433   ****************************************************************************/
434 
435 "ResourceTemplate"          { count (1); return (PARSEOP_RESOURCETEMPLATE); }
436 "RawDataBuffer"             { count (1); return (PARSEOP_DATABUFFER); }
437 
438 "DMA"                       { count (1); return (PARSEOP_DMA); }
439 "DWordIO"                   { count (1); return (PARSEOP_DWORDIO); }
440 "DWordMemory"               { count (1); return (PARSEOP_DWORDMEMORY); }
441 "DWordSpace"                { count (1); return (PARSEOP_DWORDSPACE); }
442 "EndDependentFn"            { count (1); return (PARSEOP_ENDDEPENDENTFN); }
443 "ExtendedIO"                { count (1); return (PARSEOP_EXTENDEDIO); }
444 "ExtendedMemory"            { count (1); return (PARSEOP_EXTENDEDMEMORY); }
445 "ExtendedSpace"             { count (1); return (PARSEOP_EXTENDEDSPACE); }
446 "FixedDma"                  { count (1); return (PARSEOP_FIXEDDMA); }
447 "FixedIO"                   { count (1); return (PARSEOP_FIXEDIO); }
448 "GpioInt"                   { count (1); return (PARSEOP_GPIO_INT); }
449 "GpioIo"                    { count (1); return (PARSEOP_GPIO_IO); }
450 "I2cSerialBus"              { count (1); return (PARSEOP_I2C_SERIALBUS); }
451 "I2cSerialBusV2"            { count (1); return (PARSEOP_I2C_SERIALBUS_V2); }
452 "Interrupt"                 { count (1); return (PARSEOP_INTERRUPT); }
453 "IO"                        { count (1); return (PARSEOP_IO); }
454 "IRQ"                       { count (1); return (PARSEOP_IRQ); }
455 "IRQNoFlags"                { count (1); return (PARSEOP_IRQNOFLAGS); }
456 "Memory24"                  { count (1); return (PARSEOP_MEMORY24); }
457 "Memory32"                  { count (1); return (PARSEOP_MEMORY32); }
458 "Memory32Fixed"             { count (1); return (PARSEOP_MEMORY32FIXED); }
459 "PinConfig"                 { count (1); return (PARSEOP_PINCONFIG); }
460 "PinFunction"               { count (1); return (PARSEOP_PINFUNCTION); }
461 "PinGroup"                  { count (1); return (PARSEOP_PINGROUP); }
462 "PinGroupConfig"            { count (1); return (PARSEOP_PINGROUPCONFIG); }
463 "PinGroupFunction"          { count (1); return (PARSEOP_PINGROUPFUNCTION); }
464 "QWordIO"                   { count (1); return (PARSEOP_QWORDIO); }
465 "QWordMemory"               { count (1); return (PARSEOP_QWORDMEMORY); }
466 "QWordSpace"                { count (1); return (PARSEOP_QWORDSPACE); }
467 "Register"                  { count (1); return (PARSEOP_REGISTER); }
468 "SpiSerialBus"              { count (1); return (PARSEOP_SPI_SERIALBUS); }
469 "SpiSerialBusV2"            { count (1); return (PARSEOP_SPI_SERIALBUS_V2); }
470 "StartDependentFn"          { count (1); return (PARSEOP_STARTDEPENDENTFN); }
471 "StartDependentFnNoPri"     { count (1); return (PARSEOP_STARTDEPENDENTFN_NOPRI); }
472 "UartSerialBus"             { count (1); return (PARSEOP_UART_SERIALBUS); }
473 "UartSerialBusV2"           { count (1); return (PARSEOP_UART_SERIALBUS_V2); }
474 "VendorLong"                { count (1); return (PARSEOP_VENDORLONG); }
475 "VendorShort"               { count (1); return (PARSEOP_VENDORSHORT); }
476 "WordBusNumber"             { count (1); return (PARSEOP_WORDBUSNUMBER); }
477 "WordIO"                    { count (1); return (PARSEOP_WORDIO); }
478 "WordSpace"                 { count (1); return (PARSEOP_WORDSPACE); }
479 
480 
481  /****************************************************************************
482   *
483   * Keywords used as arguments to ASL operators and macros
484   *
485   ****************************************************************************/
486 
487     /*  AccessAttribKeyword: Serial Bus Attributes (ACPI 5.0) */
488 
489 "AttribQuick"               { count (0); return (PARSEOP_ACCESSATTRIB_QUICK); }
490 "AttribSendReceive"         { count (0); return (PARSEOP_ACCESSATTRIB_SND_RCV); }
491 "AttribByte"                { count (0); return (PARSEOP_ACCESSATTRIB_BYTE); }
492 "AttribWord"                { count (0); return (PARSEOP_ACCESSATTRIB_WORD); }
493 "AttribBlock"               { count (0); return (PARSEOP_ACCESSATTRIB_BLOCK); }
494 "AttribProcessCall"         { count (0); return (PARSEOP_ACCESSATTRIB_WORD_CALL); }
495 "AttribBlockProcessCall"    { count (0); return (PARSEOP_ACCESSATTRIB_BLOCK_CALL); }
496 
497     /* AccessAttribKeyword: Legacy synonyms for above (pre-ACPI 5.0) */
498 
499 "SMBQuick"                  { count (0); return (PARSEOP_ACCESSATTRIB_QUICK); }
500 "SMBSendReceive"            { count (0); return (PARSEOP_ACCESSATTRIB_SND_RCV); }
501 "SMBByte"                   { count (0); return (PARSEOP_ACCESSATTRIB_BYTE); }
502 "SMBWord"                   { count (0); return (PARSEOP_ACCESSATTRIB_WORD); }
503 "SMBBlock"                  { count (0); return (PARSEOP_ACCESSATTRIB_BLOCK); }
504 "SMBProcessCall"            { count (0); return (PARSEOP_ACCESSATTRIB_WORD_CALL); }
505 "SMBBlockProcessCall"       { count (0); return (PARSEOP_ACCESSATTRIB_BLOCK_CALL); }
506 
507     /* AccessTypeKeyword: Field Access Types */
508 
509 "AnyAcc"                    { count (0); return (PARSEOP_ACCESSTYPE_ANY); }
510 "ByteAcc"                   { count (0); return (PARSEOP_ACCESSTYPE_BYTE); }
511 "WordAcc"                   { count (0); return (PARSEOP_ACCESSTYPE_WORD); }
512 "DWordAcc"                  { count (0); return (PARSEOP_ACCESSTYPE_DWORD); }
513 "QWordAcc"                  { count (0); return (PARSEOP_ACCESSTYPE_QWORD); }
514 "BufferAcc"                 { count (0); return (PARSEOP_ACCESSTYPE_BUF); }
515 
516     /* AddressingModeKeyword: Mode - Resource Descriptors (ACPI 5.0) */
517 
518 "AddressingMode7Bit"        { count (0); return (PARSEOP_ADDRESSINGMODE_7BIT); }
519 "AddressingMode10Bit"       { count (0); return (PARSEOP_ADDRESSINGMODE_10BIT); }
520 
521     /* AddressKeyword: ACPI memory range types */
522 
523 "AddressRangeMemory"        { count (0); return (PARSEOP_ADDRESSTYPE_MEMORY); }
524 "AddressRangeReserved"      { count (0); return (PARSEOP_ADDRESSTYPE_RESERVED); }
525 "AddressRangeNVS"           { count (0); return (PARSEOP_ADDRESSTYPE_NVS); }
526 "AddressRangeACPI"          { count (0); return (PARSEOP_ADDRESSTYPE_ACPI); }
527 
528     /* BusMasterKeyword: DMA Bus Mastering */
529 
530 "BusMaster"                 { count (0); return (PARSEOP_BUSMASTERTYPE_MASTER); }
531 "NotBusMaster"              { count (0); return (PARSEOP_BUSMASTERTYPE_NOTMASTER); }
532 
533     /* ByteLengthKeyword: Bits per Byte - Resource Descriptors (ACPI 5.0) */
534 
535 "DataBitsFive"              { count (0); return (PARSEOP_BITSPERBYTE_FIVE); }
536 "DataBitsSix"               { count (0); return (PARSEOP_BITSPERBYTE_SIX); }
537 "DataBitsSeven"             { count (0); return (PARSEOP_BITSPERBYTE_SEVEN); }
538 "DataBitsEight"             { count (0); return (PARSEOP_BITSPERBYTE_EIGHT); }
539 "DataBitsNine"              { count (0); return (PARSEOP_BITSPERBYTE_NINE); }
540 
541     /* ClockPhaseKeyword: Resource Descriptors (ACPI 5.0) */
542 
543 "ClockPhaseFirst"           { count (0); return (PARSEOP_CLOCKPHASE_FIRST); }
544 "ClockPhaseSecond"          { count (0); return (PARSEOP_CLOCKPHASE_SECOND); }
545 
546     /* ClockPolarityKeyword: Resource Descriptors (ACPI 5.0) */
547 
548 "ClockPolarityLow"          { count (0); return (PARSEOP_CLOCKPOLARITY_LOW); }
549 "ClockPolarityHigh"         { count (0); return (PARSEOP_CLOCKPOLARITY_HIGH); }
550 
551     /* DecodeKeyword: Type of Memory Decoding - Resource Descriptors */
552 
553 "PosDecode"                 { count (0); return (PARSEOP_DECODETYPE_POS); }
554 "SubDecode"                 { count (0); return (PARSEOP_DECODETYPE_SUB); }
555 
556     /* DmaTypeKeyword: DMA Types - DMA Resource Descriptor */
557 
558 "Compatibility"             { count (0); return (PARSEOP_DMATYPE_COMPATIBILITY); }
559 "TypeA"                     { count (0); return (PARSEOP_DMATYPE_A); }
560 "TypeB"                     { count (0); return (PARSEOP_DMATYPE_B); }
561 "TypeF"                     { count (0); return (PARSEOP_DMATYPE_F); }
562 
563     /* EndianKeyword: Endian type - Resource Descriptor (ACPI 5.0) */
564 
565 "LittleEndian"              { count (0); return (PARSEOP_ENDIAN_LITTLE); }
566 "BigEndian"                 { count (0); return (PARSEOP_ENDIAN_BIG); }
567 
568     /* ExtendedAttribKeyword: Bus attributes, AccessAs operator (ACPI 5.0) */
569 
570 "AttribBytes"               { count (0); return (PARSEOP_ACCESSATTRIB_MULTIBYTE); }
571 "AttribRawBytes"            { count (0); return (PARSEOP_ACCESSATTRIB_RAW_BYTES); }
572 "AttribRawProcessBytes"     { count (0); return (PARSEOP_ACCESSATTRIB_RAW_PROCESS); }
573 
574     /* FlowControlKeyword: Resource Descriptors (ACPI 5.0) */
575 
576 "FlowControlHardware"       { count (0); return (PARSEOP_FLOWCONTROL_HW); }
577 "FlowControlNone"           { count (0); return (PARSEOP_FLOWCONTROL_NONE); }
578 "FlowControlXon"            { count (0); return (PARSEOP_FLOWCONTROL_SW); }
579 
580     /* InterruptLevelKeyword: Interrupt Active Types */
581 
582 "ActiveBoth"                { count (0); return (PARSEOP_INTLEVEL_ACTIVEBOTH); }
583 "ActiveHigh"                { count (0); return (PARSEOP_INTLEVEL_ACTIVEHIGH); }
584 "ActiveLow"                 { count (0); return (PARSEOP_INTLEVEL_ACTIVELOW); }
585 
586     /* InterruptTypeKeyword: Interrupt Types */
587 
588 "Edge"                      { count (0); return (PARSEOP_INTTYPE_EDGE); }
589 "Level"                     { count (0); return (PARSEOP_INTTYPE_LEVEL); }
590 
591     /* IoDecodeKeyword: Type of Memory Decoding - Resource Descriptors */
592 
593 "Decode10"                  { count (0); return (PARSEOP_IODECODETYPE_10); }
594 "Decode16"                  { count (0); return (PARSEOP_IODECODETYPE_16); }
595 
596     /* IoRestrictionKeyword: I/O Restriction - GPIO Resource Descriptors (ACPI 5.0) */
597 
598 "IoRestrictionNone"         { count (0); return (PARSEOP_IORESTRICT_NONE); }
599 "IoRestrictionInputOnly"    { count (0); return (PARSEOP_IORESTRICT_IN); }
600 "IoRestrictionOutputOnly"   { count (0); return (PARSEOP_IORESTRICT_OUT); }
601 "IoRestrictionNoneAndPreserve"   { count (0); return (PARSEOP_IORESTRICT_PRESERVE); }
602 
603     /* LockRuleKeyword: Global Lock use for Field Operator */
604 
605 "Lock"                      { count (0); return (PARSEOP_LOCKRULE_LOCK); }
606 "NoLock"                    { count (0); return (PARSEOP_LOCKRULE_NOLOCK); }
607 
608     /* MatchOpKeyword: Types for Match Operator */
609 
610 "MTR"                       { count (0); return (PARSEOP_MATCHTYPE_MTR); }
611 "MEQ"                       { count (0); return (PARSEOP_MATCHTYPE_MEQ); }
612 "MLE"                       { count (0); return (PARSEOP_MATCHTYPE_MLE); }
613 "MLT"                       { count (0); return (PARSEOP_MATCHTYPE_MLT); }
614 "MGE"                       { count (0); return (PARSEOP_MATCHTYPE_MGE); }
615 "MGT"                       { count (0); return (PARSEOP_MATCHTYPE_MGT); }
616 
617     /* MaxKeyword: Max Range Type - Resource Descriptors */
618 
619 "MaxFixed"                  { count (0); return (PARSEOP_MAXTYPE_FIXED); }
620 "MaxNotFixed"               { count (0); return (PARSEOP_MAXTYPE_NOTFIXED); }
621 
622     /* MemTypeKeyword: Memory Types - Resource Descriptors */
623 
624 "Cacheable"                 { count (0); return (PARSEOP_MEMTYPE_CACHEABLE); }
625 "WriteCombining"            { count (0); return (PARSEOP_MEMTYPE_WRITECOMBINING); }
626 "Prefetchable"              { count (0); return (PARSEOP_MEMTYPE_PREFETCHABLE); }
627 "NonCacheable"              { count (0); return (PARSEOP_MEMTYPE_NONCACHEABLE); }
628 
629     /* MinKeyword: Min Range Type - Resource Descriptors */
630 
631 "MinFixed"                  { count (0); return (PARSEOP_MINTYPE_FIXED); }
632 "MinNotFixed"               { count (0); return (PARSEOP_MINTYPE_NOTFIXED); }
633 
634     /* ObjectTypeKeyword: ACPI Object Types */
635 
636 "UnknownObj"                { count (0); return (PARSEOP_OBJECTTYPE_UNK); }
637 "IntObj"                    { count (0); return (PARSEOP_OBJECTTYPE_INT); }
638 "StrObj"                    { count (0); return (PARSEOP_OBJECTTYPE_STR); }
639 "BuffObj"                   { count (0); return (PARSEOP_OBJECTTYPE_BUF); }
640 "PkgObj"                    { count (0); return (PARSEOP_OBJECTTYPE_PKG); }
641 "FieldUnitObj"              { count (0); return (PARSEOP_OBJECTTYPE_FLD); }
642 "DeviceObj"                 { count (0); return (PARSEOP_OBJECTTYPE_DEV); }
643 "EventObj"                  { count (0); return (PARSEOP_OBJECTTYPE_EVT); }
644 "MethodObj"                 { count (0); return (PARSEOP_OBJECTTYPE_MTH); }
645 "MutexObj"                  { count (0); return (PARSEOP_OBJECTTYPE_MTX); }
646 "OpRegionObj"               { count (0); return (PARSEOP_OBJECTTYPE_OPR); }
647 "PowerResObj"               { count (0); return (PARSEOP_OBJECTTYPE_POW); }
648 "ProcessorObj"              { count (0); return (PARSEOP_OBJECTTYPE_PRO); }
649 "ThermalZoneObj"            { count (0); return (PARSEOP_OBJECTTYPE_THZ); }
650 "BuffFieldObj"              { count (0); return (PARSEOP_OBJECTTYPE_BFF); }
651 "DDBHandleObj"              { count (0); return (PARSEOP_OBJECTTYPE_DDB); }
652 
653     /* ParityKeyword: Resource Descriptors (ACPI 5.0) */
654 
655 "ParityTypeSpace"           { count (0); return (PARSEOP_PARITYTYPE_SPACE); }
656 "ParityTypeMark"            { count (0); return (PARSEOP_PARITYTYPE_MARK); }
657 "ParityTypeOdd"             { count (0); return (PARSEOP_PARITYTYPE_ODD); }
658 "ParityTypeEven"            { count (0); return (PARSEOP_PARITYTYPE_EVEN); }
659 "ParityTypeNone"            { count (0); return (PARSEOP_PARITYTYPE_NONE); }
660 
661     /* PinConfigKeyword: Pin Configuration - GPIO Resource Descriptors (ACPI 5.0) */
662 
663 "PullDefault"               { count (0); return (PARSEOP_PIN_PULLDEFAULT); }
664 "PullUp"                    { count (0); return (PARSEOP_PIN_PULLUP); }
665 "PullDown"                  { count (0); return (PARSEOP_PIN_PULLDOWN); }
666 "PullNone"                  { count (0); return (PARSEOP_PIN_NOPULL); }
667 
668     /* PolarityKeyword: Resource Descriptors (ACPI 5.0) */
669 
670 "PolarityLow"               { count (0); return (PARSEOP_DEVICEPOLARITY_LOW); }
671 "PolarityHigh"              { count (0); return (PARSEOP_DEVICEPOLARITY_HIGH); }
672 
673     /* RangeTypeKeyword: I/O Range Types - Resource Descriptors */
674 
675 "ISAOnlyRanges"             { count (0); return (PARSEOP_RANGETYPE_ISAONLY); }
676 "NonISAOnlyRanges"          { count (0); return (PARSEOP_RANGETYPE_NONISAONLY); }
677 "EntireRange"               { count (0); return (PARSEOP_RANGETYPE_ENTIRE); }
678 
679     /* ReadWriteKeyword: Memory Access Types - Resource Descriptors */
680 
681 "ReadWrite"                 { count (0); return (PARSEOP_READWRITETYPE_BOTH); }
682 "ReadOnly"                  { count (0); return (PARSEOP_READWRITETYPE_READONLY); }
683 
684     /* RegionSpaceKeyword: Operation Region Address Space Types */
685 
686 "SystemIO"                  { count (0); return (PARSEOP_REGIONSPACE_IO); }
687 "SystemMemory"              { count (0); return (PARSEOP_REGIONSPACE_MEM); }
688 "PCI_Config"                { count (0); return (PARSEOP_REGIONSPACE_PCI); }
689 "EmbeddedControl"           { count (0); return (PARSEOP_REGIONSPACE_EC); }
690 "SMBus"                     { count (0); return (PARSEOP_REGIONSPACE_SMBUS); }
691 "SystemCMOS"                { count (0); return (PARSEOP_REGIONSPACE_CMOS); }
692 "PciBarTarget"              { count (0); return (PARSEOP_REGIONSPACE_PCIBAR); }
693 "IPMI"                      { count (0); return (PARSEOP_REGIONSPACE_IPMI); }
694 "GeneralPurposeIo"          { count (0); return (PARSEOP_REGIONSPACE_GPIO); }       /* ACPI 5.0 */
695 "GenericSerialBus"          { count (0); return (PARSEOP_REGIONSPACE_GSBUS); }      /* ACPI 5.0 */
696 "PCC"                       { count (0); return (PARSEOP_REGIONSPACE_PCC); }        /* ACPI 5.0 */
697 "FFixedHW"                  { count (0); return (PARSEOP_REGIONSPACE_FFIXEDHW); }
698 
699     /* ResourceTypeKeyword: Resource Usage - Resource Descriptors */
700 
701 "ResourceConsumer"          { count (0); return (PARSEOP_RESOURCETYPE_CONSUMER); }
702 "ResourceProducer"          { count (0); return (PARSEOP_RESOURCETYPE_PRODUCER); }
703 
704     /* SerializeRuleKeyword: Control Method Serialization */
705 
706 "Serialized"                { count (0); return (PARSEOP_SERIALIZERULE_SERIAL); }
707 "NotSerialized"             { count (0); return (PARSEOP_SERIALIZERULE_NOTSERIAL); }
708 
709     /* ShareTypeKeyword: Interrupt Sharing - Resource Descriptors */
710 
711 "Shared"                    { count (0); return (PARSEOP_SHARETYPE_SHARED); }
712 "Exclusive"                 { count (0); return (PARSEOP_SHARETYPE_EXCLUSIVE); }
713 "SharedAndWake"             { count (0); return (PARSEOP_SHARETYPE_SHAREDWAKE); }       /* ACPI 5.0 */
714 "ExclusiveAndWake"          { count (0); return (PARSEOP_SHARETYPE_EXCLUSIVEWAKE); }    /* ACPI 5.0 */
715 
716     /* SlaveModeKeyword: Resource Descriptors (ACPI 5.0) */
717 
718 "ControllerInitiated"       { count (0); return (PARSEOP_SLAVEMODE_CONTROLLERINIT); }
719 "DeviceInitiated"           { count (0); return (PARSEOP_SLAVEMODE_DEVICEINIT); }
720 
721     /* StopBitsKeyword: Resource Descriptors (ACPI 5.0) */
722 
723 "StopBitsOne"               { count (0); return (PARSEOP_STOPBITS_ONE); }
724 "StopBitsOnePlusHalf"       { count (0); return (PARSEOP_STOPBITS_ONEPLUSHALF); }
725 "StopBitsTwo"               { count (0); return (PARSEOP_STOPBITS_TWO); }
726 "StopBitsZero"              { count (0); return (PARSEOP_STOPBITS_ZERO); }
727 
728     /* TransferWidthKeyword: DMA Widths - Fixed DMA Resource Descriptor (ACPI 5.0) */
729 
730 "Width8bit"                 { count (0); return (PARSEOP_XFERSIZE_8); }
731 "Width16bit"                { count (0); return (PARSEOP_XFERSIZE_16); }
732 "Width32bit"                { count (0); return (PARSEOP_XFERSIZE_32); }
733 "Width64bit"                { count (0); return (PARSEOP_XFERSIZE_64); }
734 "Width128bit"               { count (0); return (PARSEOP_XFERSIZE_128); }
735 "Width256bit"               { count (0); return (PARSEOP_XFERSIZE_256); }
736 
737     /* TranslationKeyword: Translation Density Types - Resource Descriptors */
738 
739 "SparseTranslation"         { count (0); return (PARSEOP_TRANSLATIONTYPE_SPARSE); }
740 "DenseTranslation"          { count (0); return (PARSEOP_TRANSLATIONTYPE_DENSE); }
741 
742     /* TypeKeyword: Translation Types - Resource Descriptors */
743 
744 "TypeTranslation"           { count (0); return (PARSEOP_TYPE_TRANSLATION); }
745 "TypeStatic"                { count (0); return (PARSEOP_TYPE_STATIC); }
746 
747     /* UpdateRuleKeyword: Field Update Rules */
748 
749 "Preserve"                  { count (0); return (PARSEOP_UPDATERULE_PRESERVE); }
750 "WriteAsOnes"               { count (0); return (PARSEOP_UPDATERULE_ONES); }
751 "WriteAsZeros"              { count (0); return (PARSEOP_UPDATERULE_ZEROS); }
752 
753     /* WireModeKeyword: SPI Wire Mode - Resource Descriptors (ACPI 5.0) */
754 
755 "FourWireMode"              { count (0); return (PARSEOP_WIREMODE_FOUR); }
756 "ThreeWireMode"             { count (0); return (PARSEOP_WIREMODE_THREE); }
757 
758     /* XferTypeKeyword: DMA Transfer Types */
759 
760 "Transfer8"                 { count (0); return (PARSEOP_XFERTYPE_8); }
761 "Transfer8_16"              { count (0); return (PARSEOP_XFERTYPE_8_16); }
762 "Transfer16"                { count (0); return (PARSEOP_XFERTYPE_16); }
763 
764     /* ToPld macro */
765 
766 "ToPLD"                     { count (0); return (PARSEOP_TOPLD); }
767 
768 "PLD_Revision"              { count (0); return (PARSEOP_PLD_REVISION); }
769 "PLD_IgnoreColor"           { count (0); return (PARSEOP_PLD_IGNORECOLOR); }
770 "PLD_Red"                   { count (0); return (PARSEOP_PLD_RED); }
771 "PLD_Green"                 { count (0); return (PARSEOP_PLD_GREEN); }
772 "PLD_Blue"                  { count (0); return (PARSEOP_PLD_BLUE); }
773 "PLD_Width"                 { count (0); return (PARSEOP_PLD_WIDTH); }
774 "PLD_Height"                { count (0); return (PARSEOP_PLD_HEIGHT); }
775 "PLD_UserVisible"           { count (0); return (PARSEOP_PLD_USERVISIBLE); }
776 "PLD_Dock"                  { count (0); return (PARSEOP_PLD_DOCK); }
777 "PLD_Lid"                   { count (0); return (PARSEOP_PLD_LID); }
778 "PLD_Panel"                 { count (0); return (PARSEOP_PLD_PANEL); }
779 "PLD_VerticalPosition"      { count (0); return (PARSEOP_PLD_VERTICALPOSITION); }
780 "PLD_HorizontalPosition"    { count (0); return (PARSEOP_PLD_HORIZONTALPOSITION); }
781 "PLD_Shape"                 { count (0); return (PARSEOP_PLD_SHAPE); }
782 "PLD_GroupOrientation"      { count (0); return (PARSEOP_PLD_GROUPORIENTATION); }
783 "PLD_GroupToken"            { count (0); return (PARSEOP_PLD_GROUPTOKEN); }
784 "PLD_GroupPosition"         { count (0); return (PARSEOP_PLD_GROUPPOSITION); }
785 "PLD_Bay"                   { count (0); return (PARSEOP_PLD_BAY); }
786 "PLD_Ejectable"             { count (0); return (PARSEOP_PLD_EJECTABLE); }
787 "PLD_EjectRequired"         { count (0); return (PARSEOP_PLD_EJECTREQUIRED); }
788 "PLD_CabinetNumber"         { count (0); return (PARSEOP_PLD_CABINETNUMBER); }
789 "PLD_CardCageNumber"        { count (0); return (PARSEOP_PLD_CARDCAGENUMBER); }
790 "PLD_Reference"             { count (0); return (PARSEOP_PLD_REFERENCE); }
791 "PLD_Rotation"              { count (0); return (PARSEOP_PLD_ROTATION); }
792 "PLD_Order"                 { count (0); return (PARSEOP_PLD_ORDER); }
793 "PLD_Reserved"              { count (0); return (PARSEOP_PLD_RESERVED); }
794 "PLD_VerticalOffset"        { count (0); return (PARSEOP_PLD_VERTICALOFFSET); }
795 "PLD_HorizontalOffset"      { count (0); return (PARSEOP_PLD_HORIZONTALOFFSET); }
796 
797 
798     /* printf debug macros */
799 
800 "printf"                    { count (0); return (PARSEOP_PRINTF); }
801 "fprintf"                   { count (0); return (PARSEOP_FPRINTF); }
802 
803     /* Other macros */
804 
805 "For"                       { count (0); return (PARSEOP_FOR); }
806 
807     /* Predefined compiler names */
808 
809 "__DATE__"                  { count (0); return (PARSEOP___DATE__); }
810 "__FILE__"                  { count (0); return (PARSEOP___FILE__); }
811 "__LINE__"                  { count (0); return (PARSEOP___LINE__); }
812 "__PATH__"                  { count (0); return (PARSEOP___PATH__); }
813 "__METHOD__"                { count (0); return (PARSEOP___METHOD__); }
814 
815 {NameSeg}                   { char *s;
816                                 count (0);
817                                 s=UtLocalCacheCalloc (ACPI_NAME_SIZE + 1);
818                                 if (strcmp (AslCompilertext, "\\"))
819                                 {
820                                     strcpy (s, "____");
821                                     AcpiUtStrupr (AslCompilertext);
822                                 }
823                                 memcpy (s, AslCompilertext, strlen (AslCompilertext));
824                                 AslCompilerlval.s = s;
825                                 DbgPrint (ASL_PARSE_OUTPUT, "NameSeg: %s\n", s);
826                                 return (PARSEOP_NAMESEG); }
827 
828 {NameString}                { char *s;
829                                 count (0);
830                                 s=UtLocalCacheCalloc (strlen (AslCompilertext)+1);
831                                 AcpiUtStrupr (AslCompilertext);
832                                 strcpy (s, AslCompilertext);
833                                 AslCompilerlval.s = s;
834                                 DbgPrint (ASL_PARSE_OUTPUT, "NameString: %s\n", s);
835                                 return (PARSEOP_NAMESTRING); }
836 
837 .                           { count (1);
838                                 if (isprint ((int) *AslCompilertext))
839                                 {
840                                     sprintf (MsgBuffer,
841                                         "Invalid character (%c), expecting ASL keyword or name",
842                                         *AslCompilertext);
843                                 }
844                                 else
845                                 {
846                                     sprintf (MsgBuffer,
847                                         "Invalid character (0x%2.2X), expecting ASL keyword or name",
848                                         *AslCompilertext);
849                                 }
850                                 AslCompilererror (MsgBuffer);}
851 
852 <<EOF>>                     { if (AslPopInputFileStack ())
853                                 {yyterminate();}
854                               else
855                                 {return (PARSEOP_INCLUDE_END);} };
856 
857 %%
858 
859 /*! [End] no source code translation !*/
860 
861 /*
862  * Bring in the scanner support routines
863  */
864 #include "aslsupport.l"
865