]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - sys/contrib/dev/acpica/compiler/aslcompiler.l
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / sys / contrib / dev / acpica / compiler / aslcompiler.l
1
2 %{
3 /******************************************************************************
4  *
5  * Module Name: aslcompiler.l - Flex input file
6  *
7  *****************************************************************************/
8
9 /******************************************************************************
10  *
11  * 1. Copyright Notice
12  *
13  * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
14  * All rights reserved.
15  *
16  * 2. License
17  *
18  * 2.1. This is your license from Intel Corp. under its intellectual property
19  * rights.  You may have additional license terms from the party that provided
20  * you this software, covering your right to use that party's intellectual
21  * property rights.
22  *
23  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
24  * copy of the source code appearing in this file ("Covered Code") an
25  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
26  * base code distributed originally by Intel ("Original Intel Code") to copy,
27  * make derivatives, distribute, use and display any portion of the Covered
28  * Code in any form, with the right to sublicense such rights; and
29  *
30  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
31  * license (with the right to sublicense), under only those claims of Intel
32  * patents that are infringed by the Original Intel Code, to make, use, sell,
33  * offer to sell, and import the Covered Code and derivative works thereof
34  * solely to the minimum extent necessary to exercise the above copyright
35  * license, and in no event shall the patent license extend to any additions
36  * to or modifications of the Original Intel Code.  No other license or right
37  * is granted directly or by implication, estoppel or otherwise;
38  *
39  * The above copyright and patent license is granted only if the following
40  * conditions are met:
41  *
42  * 3. Conditions
43  *
44  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
45  * Redistribution of source code of any substantial portion of the Covered
46  * Code or modification with rights to further distribute source must include
47  * the above Copyright Notice, the above License, this list of Conditions,
48  * and the following Disclaimer and Export Compliance provision.  In addition,
49  * Licensee must cause all Covered Code to which Licensee contributes to
50  * contain a file documenting the changes Licensee made to create that Covered
51  * Code and the date of any change.  Licensee must include in that file the
52  * documentation of any changes made by any predecessor Licensee.  Licensee
53  * must include a prominent statement that the modification is derived,
54  * directly or indirectly, from Original Intel Code.
55  *
56  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
57  * Redistribution of source code of any substantial portion of the Covered
58  * Code or modification without rights to further distribute source must
59  * include the following Disclaimer and Export Compliance provision in the
60  * documentation and/or other materials provided with distribution.  In
61  * addition, Licensee may not authorize further sublicense of source of any
62  * portion of the Covered Code, and must include terms to the effect that the
63  * license from Licensee to its licensee is limited to the intellectual
64  * property embodied in the software Licensee provides to its licensee, and
65  * not to intellectual property embodied in modifications its licensee may
66  * make.
67  *
68  * 3.3. Redistribution of Executable. Redistribution in executable form of any
69  * substantial portion of the Covered Code or modification must reproduce the
70  * above Copyright Notice, and the following Disclaimer and Export Compliance
71  * provision in the documentation and/or other materials provided with the
72  * distribution.
73  *
74  * 3.4. Intel retains all right, title, and interest in and to the Original
75  * Intel Code.
76  *
77  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
78  * Intel shall be used in advertising or otherwise to promote the sale, use or
79  * other dealings in products derived from or relating to the Covered Code
80  * without prior written authorization from Intel.
81  *
82  * 4. Disclaimer and Export Compliance
83  *
84  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
85  * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
86  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
87  * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
88  * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
89  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
90  * PARTICULAR PURPOSE.
91  *
92  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
93  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
94  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
95  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
96  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
97  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
98  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
99  * LIMITED REMEDY.
100  *
101  * 4.3. Licensee shall not export, either directly or indirectly, any of this
102  * software or system incorporating such software without first obtaining any
103  * required license or other approval from the U. S. Department of Commerce or
104  * any other agency or department of the United States Government.  In the
105  * event Licensee exports any such software from the United States or
106  * re-exports any such software from a foreign destination, Licensee shall
107  * ensure that the distribution and export/re-export of the software is in
108  * compliance with all laws, regulations, orders, or other restrictions of the
109  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
110  * any of its subsidiaries will export/re-export any technical data, process,
111  * software, or service, directly or indirectly, to any country for which the
112  * United States government or any agency thereof requires an export license,
113  * other governmental approval, or letter of assurance, without first obtaining
114  * such license, approval or letter.
115  *
116  *****************************************************************************/
117
118
119 #include <stdlib.h>
120 #include <string.h>
121 #include <contrib/dev/acpica/compiler/aslcompiler.h>
122 #include "aslcompiler.y.h"
123 YYSTYPE AslCompilerlval;
124
125 /*
126  * Generation:  Use the following command line:
127  *
128  * flex.exe -PAslCompiler -i -o$(InputPath).c $(InputPath)
129  *
130  * -i: Scanner must be case-insensitive
131  */
132
133 #define _COMPONENT          ACPI_COMPILER
134         ACPI_MODULE_NAME    ("aslscan")
135 char
136 comment (void);
137 char
138 comment2 (void);
139 void
140 count (int type);
141 char
142 literal (void);
143 void
144 copy (void);
145
146 /*! [Begin] no source code translation */
147
148 %}
149
150
151 LeadNameChar                [A-Za-z_]
152 DigitChar                   [0-9]
153 HexDigitChar                [A-Fa-f0-9]
154 RootChar                    [\\]
155 Nothing                     []
156
157 NameChar                    [A-Za-z_0-9]
158 NameSeg1                    {LeadNameChar}{NameChar}
159 NameSeg2                    {LeadNameChar}{NameChar}{NameChar}
160 NameSeg3                    {LeadNameChar}{NameChar}{NameChar}{NameChar}
161 NameSeg                     {LeadNameChar}|{NameSeg1}|{NameSeg2}|{NameSeg3}
162
163 NameString                  {RootChar}|{RootChar}{NamePath}|[\^]+{NamePath}|{NonEmptyNamePath}
164 NamePath                    {NonEmptyNamePath}?
165 NonEmptyNamePath            {NameSeg}{NamePathTail}*
166 NamePathTail                [.]{NameSeg}
167
168 %%
169
170 [ ]                         { count (0); }
171 [\n]                        { count (0); } /* Handle files with both LF and CR/LF */
172 [\r]                        { count (0); } /* termination on both Unix and Windows */
173 [ \t]                       { count (0); }
174
175
176 "/*"                        { if (!comment ()) yyterminate (); }
177 "//"                        { if (!comment2 ()) yyterminate (); }
178
179 "\""                        { if (literal ()) return (PARSEOP_STRING_LITERAL); else yyterminate (); }
180
181
182 0[xX]{HexDigitChar}+ |
183 {DigitChar}+                { AslCompilerlval.i = UtDoConstant ((char *) AslCompilertext);
184                                 count (1); return (PARSEOP_INTEGER); }
185
186 "Include"                   { count (1); return (PARSEOP_INCLUDE); }
187 "#include"                  { count (1); return (PARSEOP_INCLUDE_CSTYLE); }
188 "#line"                                         { count (1); return (PARSEOP_LINE_CSTYLE); }
189 "External"                  { count (1); return (PARSEOP_EXTERNAL); }
190
191
192 "Ones"                      { count (1); return (PARSEOP_ONES); }
193 "One"                       { count (1); return (PARSEOP_ONE); }
194 "Zero"                      { count (1); return (PARSEOP_ZERO); }
195 "Revision"                  { count (1); return (PARSEOP_REVISION); }
196
197 "Offset"                    { count (1); return (PARSEOP_OFFSET); }
198 "AccessAs"                  { count (1); return (PARSEOP_ACCESSAS); }
199 "BankField"                 { count (2); return (PARSEOP_BANKFIELD); }
200 "CreateBitField"            { count (2); return (PARSEOP_CREATEBITFIELD); }
201 "CreateByteField"           { count (2); return (PARSEOP_CREATEBYTEFIELD); }
202 "CreateDWordField"          { count (2); return (PARSEOP_CREATEDWORDFIELD); }
203 "CreateField"               { count (2); return (PARSEOP_CREATEFIELD); }
204 "CreateQWordField"          { count (2); return (PARSEOP_CREATEQWORDFIELD); }
205 "CreateWordField"           { count (2); return (PARSEOP_CREATEWORDFIELD); }
206 "DataTableRegion"           { count (2); return (PARSEOP_DATATABLEREGION); }
207 "Device"                    { count (2); return (PARSEOP_DEVICE); }
208 "Event"                     { count (2); return (PARSEOP_EVENT); }
209 "Field"                     { count (2); return (PARSEOP_FIELD); }
210 "Function"                  { count (2); return (PARSEOP_FUNCTION); }
211 "IndexField"                { count (2); return (PARSEOP_INDEXFIELD); }
212 "Method"                    { count (2); return (PARSEOP_METHOD); }
213 "Mutex"                     { count (2); return (PARSEOP_MUTEX); }
214 "OperationRegion"           { count (2); return (PARSEOP_OPERATIONREGION); }
215 "PowerResource"             { count (2); return (PARSEOP_POWERRESOURCE); }
216 "Processor"                 { count (2); return (PARSEOP_PROCESSOR); }
217 "ThermalZone"               { count (2); return (PARSEOP_THERMALZONE); }
218 "Alias"                     { count (2); return (PARSEOP_ALIAS); }
219 "Name"                      { count (2); return (PARSEOP_NAME); }
220 "Scope"                     { count (2); return (PARSEOP_SCOPE); }
221 "Break"                     { count (3); return (PARSEOP_BREAK); }
222 "BreakPoint"                { count (3); return (PARSEOP_BREAKPOINT); }
223 "Continue"                  { count (3); return (PARSEOP_CONTINUE); }
224 "Fatal"                     { count (3); return (PARSEOP_FATAL); }
225 "If"                        { count (3); return (PARSEOP_IF); }
226 "Else"                      { count (3); return (PARSEOP_ELSE); }
227 "ElseIf"                    { count (3); return (PARSEOP_ELSEIF); }
228 "Load"                      { count (3); return (PARSEOP_LOAD); }
229 "Noop"                      { count (3); return (PARSEOP_NOOP); }
230 "Notify"                    { count (3); return (PARSEOP_NOTIFY); }
231 "Release"                   { count (3); return (PARSEOP_RELEASE); }
232 "Reset"                     { count (3); return (PARSEOP_RESET); }
233 "Return"                    { count (3); return (PARSEOP_RETURN); }
234 "Signal"                    { count (3); return (PARSEOP_SIGNAL); }
235 "Sleep"                     { count (3); return (PARSEOP_SLEEP); }
236 "Stall"                     { count (3); return (PARSEOP_STALL); }
237 "Switch"                    { count (3); return (PARSEOP_SWITCH); }
238 "Case"                      { count (3); return (PARSEOP_CASE); }
239 "Default"                   { count (3); return (PARSEOP_DEFAULT); }
240 "Unload"                    { count (3); return (PARSEOP_UNLOAD); }
241 "While"                     { count (3); return (PARSEOP_WHILE); }
242
243 "Acquire"                   { count (3); return (PARSEOP_ACQUIRE); }
244 "Add"                       { count (3); return (PARSEOP_ADD); }
245 "And"                       { count (3); return (PARSEOP_AND); }
246 "Concatenate"               { count (3); return (PARSEOP_CONCATENATE); }
247 "ConcatenateResTemplate"    { count (3); return (PARSEOP_CONCATENATERESTEMPLATE); }
248 "CondRefOf"                 { count (3); return (PARSEOP_CONDREFOF); }
249 "CopyObject"                { count (3); return (PARSEOP_COPYOBJECT); }
250 "Decrement"                 { count (3); return (PARSEOP_DECREMENT); }
251 "DeRefOf"                   { count (3); return (PARSEOP_DEREFOF); }
252 "Divide"                    { count (3); return (PARSEOP_DIVIDE); }
253 "FindSetLeftBit"            { count (3); return (PARSEOP_FINDSETLEFTBIT); }
254 "FindSetRightBit"           { count (3); return (PARSEOP_FINDSETRIGHTBIT); }
255 "FromBCD"                   { count (3); return (PARSEOP_FROMBCD); }
256 "Increment"                 { count (3); return (PARSEOP_INCREMENT); }
257 "Index"                     { count (3); return (PARSEOP_INDEX); }
258 "LAnd"                      { count (3); return (PARSEOP_LAND); }
259 "LEqual"                    { count (3); return (PARSEOP_LEQUAL); }
260 "LGreater"                  { count (3); return (PARSEOP_LGREATER); }
261 "LGreaterEqual"             { count (3); return (PARSEOP_LGREATEREQUAL); }
262 "LLess"                     { count (3); return (PARSEOP_LLESS); }
263 "LLessEqual"                { count (3); return (PARSEOP_LLESSEQUAL); }
264 "LNot"                      { count (3); return (PARSEOP_LNOT); }
265 "LNotEqual"                 { count (3); return (PARSEOP_LNOTEQUAL); }
266 "LoadTable"                 { count (3); return (PARSEOP_LOADTABLE); }
267 "LOr"                       { count (3); return (PARSEOP_LOR); }
268 "Match"                     { count (3); return (PARSEOP_MATCH); }
269 "Mid"                       { count (3); return (PARSEOP_MID); }
270 "Mod"                       { count (3); return (PARSEOP_MOD); }
271 "Multiply"                  { count (3); return (PARSEOP_MULTIPLY); }
272 "NAnd"                      { count (3); return (PARSEOP_NAND); }
273 "NOr"                       { count (3); return (PARSEOP_NOR); }
274 "Not"                       { count (3); return (PARSEOP_NOT); }
275 "ObjectType"                { count (3); return (PARSEOP_OBJECTTYPE); }
276 "Or"                        { count (3); return (PARSEOP_OR); }
277 "RefOf"                     { count (3); return (PARSEOP_REFOF); }
278 "ShiftLeft"                 { count (3); return (PARSEOP_SHIFTLEFT); }
279 "ShiftRight"                { count (3); return (PARSEOP_SHIFTRIGHT); }
280 "SizeOf"                    { count (3); return (PARSEOP_SIZEOF); }
281 "Store"                     { count (3); return (PARSEOP_STORE); }
282 "Subtract"                  { count (3); return (PARSEOP_SUBTRACT); }
283 "Timer"                     { count (3); return (PARSEOP_TIMER); }
284 "ToBCD"                     { count (3); return (PARSEOP_TOBCD); }
285 "ToBuffer"                  { count (3); return (PARSEOP_TOBUFFER); }
286 "ToDecimalString"           { count (3); return (PARSEOP_TODECIMALSTRING); }
287 "ToHexString"               { count (3); return (PARSEOP_TOHEXSTRING); }
288 "ToInteger"                 { count (3); return (PARSEOP_TOINTEGER); }
289 "ToString"                  { count (3); return (PARSEOP_TOSTRING); }
290 "Wait"                      { count (3); return (PARSEOP_WAIT); }
291 "XOr"                       { count (3); return (PARSEOP_XOR); }
292
293 "Arg0"                      { count (1); return (PARSEOP_ARG0); }
294 "Arg1"                      { count (1); return (PARSEOP_ARG1); }
295 "Arg2"                      { count (1); return (PARSEOP_ARG2); }
296 "Arg3"                      { count (1); return (PARSEOP_ARG3); }
297 "Arg4"                      { count (1); return (PARSEOP_ARG4); }
298 "Arg5"                      { count (1); return (PARSEOP_ARG5); }
299 "Arg6"                      { count (1); return (PARSEOP_ARG6); }
300
301 "Local0"                    { count (1); return (PARSEOP_LOCAL0); }
302 "Local1"                    { count (1); return (PARSEOP_LOCAL1); }
303 "Local2"                    { count (1); return (PARSEOP_LOCAL2); }
304 "Local3"                    { count (1); return (PARSEOP_LOCAL3); }
305 "Local4"                    { count (1); return (PARSEOP_LOCAL4); }
306 "Local5"                    { count (1); return (PARSEOP_LOCAL5); }
307 "Local6"                    { count (1); return (PARSEOP_LOCAL6); }
308 "Local7"                    { count (1); return (PARSEOP_LOCAL7); }
309
310 "Debug"                     { count (1); return (PARSEOP_DEBUG); }
311
312 "DefinitionBlock"           { count (1); return (PARSEOP_DEFINITIONBLOCK); }
313 "Buffer"                    { count (1); return (PARSEOP_BUFFER); }
314 "Package"                   { count (1); return (PARSEOP_PACKAGE); }
315
316 "EISAID"                    { count (1); return (PARSEOP_EISAID); }
317 "ResourceTemplate"          { count (1); return (PARSEOP_RESOURCETEMPLATE); }
318 "ToUUID"                    { count (1); return (PARSEOP_TOUUID); }
319 "Unicode"                   { count (1); return (PARSEOP_UNICODE); }
320 "DMA"                       { count (1); return (PARSEOP_DMA); }
321 "DWordIO"                   { count (1); return (PARSEOP_DWORDIO); }
322 "DWordMemory"               { count (1); return (PARSEOP_DWORDMEMORY); }
323 "DWordSpace"                { count (1); return (PARSEOP_DWORDSPACE); }
324 "EndDependentFn"            { count (1); return (PARSEOP_ENDDEPENDENTFN); }
325 "ExtendedIO"                { count (1); return (PARSEOP_EXTENDEDIO); }
326 "ExtendedMemory"            { count (1); return (PARSEOP_EXTENDEDMEMORY); }
327 "ExtendedSpace"             { count (1); return (PARSEOP_EXTENDEDSPACE); }
328 "FixedIO"                   { count (1); return (PARSEOP_FIXEDIO); }
329 "Interrupt"                 { count (1); return (PARSEOP_INTERRUPT); }
330 "IO"                        { count (1); return (PARSEOP_IO); }
331 "IRQNoFlags"                { count (1); return (PARSEOP_IRQNOFLAGS); }
332 "IRQ"                       { count (1); return (PARSEOP_IRQ); }
333 "Memory24"                  { count (1); return (PARSEOP_MEMORY24); }
334 "Memory32Fixed"             { count (1); return (PARSEOP_MEMORY32FIXED); }
335 "Memory32"                  { count (1); return (PARSEOP_MEMORY32); }
336 "QWordIO"                   { count (1); return (PARSEOP_QWORDIO); }
337 "QWordMemory"               { count (1); return (PARSEOP_QWORDMEMORY); }
338 "QWordSpace"                { count (1); return (PARSEOP_QWORDSPACE); }
339 "Register"                  { count (1); return (PARSEOP_REGISTER); }
340 "StartDependentFn"          { count (1); return (PARSEOP_STARTDEPENDENTFN); }
341 "StartDependentFnNoPri"     { count (1); return (PARSEOP_STARTDEPENDENTFN_NOPRI); }
342 "VendorLong"                { count (1); return (PARSEOP_VENDORLONG); }
343 "VendorShort"               { count (1); return (PARSEOP_VENDORSHORT); }
344 "WordBusNumber"             { count (1); return (PARSEOP_WORDBUSNUMBER); }
345 "WordIO"                    { count (1); return (PARSEOP_WORDIO); }
346 "WordSpace"                 { count (1); return (PARSEOP_WORDSPACE); }
347
348 "UnknownObj"                { count (0); return (PARSEOP_OBJECTTYPE_UNK); }
349 "IntObj"                    { count (0); return (PARSEOP_OBJECTTYPE_INT); }
350 "StrObj"                    { count (0); return (PARSEOP_OBJECTTYPE_STR); }
351 "BuffObj"                   { count (0); return (PARSEOP_OBJECTTYPE_BUF); }
352 "PkgObj"                    { count (0); return (PARSEOP_OBJECTTYPE_PKG); }
353 "FieldUnitObj"              { count (0); return (PARSEOP_OBJECTTYPE_FLD); }
354 "DeviceObj"                 { count (0); return (PARSEOP_OBJECTTYPE_DEV); }
355 "EventObj"                  { count (0); return (PARSEOP_OBJECTTYPE_EVT); }
356 "MethodObj"                 { count (0); return (PARSEOP_OBJECTTYPE_MTH); }
357 "MutexObj"                  { count (0); return (PARSEOP_OBJECTTYPE_MTX); }
358 "OpRegionObj"               { count (0); return (PARSEOP_OBJECTTYPE_OPR); }
359 "PowerResObj"               { count (0); return (PARSEOP_OBJECTTYPE_POW); }
360 "ProcessorObj"              { count (0); return (PARSEOP_OBJECTTYPE_PRO); }
361 "ThermalZoneObj"            { count (0); return (PARSEOP_OBJECTTYPE_THZ); }
362 "BuffFieldObj"              { count (0); return (PARSEOP_OBJECTTYPE_BFF); }
363 "DDBHandleObj"              { count (0); return (PARSEOP_OBJECTTYPE_DDB); }
364
365 "AnyAcc"                    { count (0); return (PARSEOP_ACCESSTYPE_ANY); }
366 "ByteAcc"                   { count (0); return (PARSEOP_ACCESSTYPE_BYTE); }
367 "WordAcc"                   { count (0); return (PARSEOP_ACCESSTYPE_WORD); }
368 "DWordAcc"                  { count (0); return (PARSEOP_ACCESSTYPE_DWORD); }
369 "QWordAcc"                  { count (0); return (PARSEOP_ACCESSTYPE_QWORD); }
370 "BufferAcc"                 { count (0); return (PARSEOP_ACCESSTYPE_BUF); }
371
372 "Lock"                      { count (0); return (PARSEOP_LOCKRULE_LOCK); }
373 "NoLock"                    { count (0); return (PARSEOP_LOCKRULE_NOLOCK); }
374
375 "Preserve"                  { count (0); return (PARSEOP_UPDATERULE_PRESERVE); }
376 "WriteAsOnes"               { count (0); return (PARSEOP_UPDATERULE_ONES); }
377 "WriteAsZeros"              { count (0); return (PARSEOP_UPDATERULE_ZEROS); }
378
379 "Serialized"                { count (0); return (PARSEOP_SERIALIZERULE_SERIAL); }
380 "NotSerialized"             { count (0); return (PARSEOP_SERIALIZERULE_NOTSERIAL); }
381
382 "SystemIO"                  { count (0); return (PARSEOP_REGIONSPACE_IO); }
383 "SystemMemory"              { count (0); return (PARSEOP_REGIONSPACE_MEM); }
384 "PCI_Config"                { count (0); return (PARSEOP_REGIONSPACE_PCI); }
385 "EmbeddedControl"           { count (0); return (PARSEOP_REGIONSPACE_EC); }
386 "SMBus"                     { count (0); return (PARSEOP_REGIONSPACE_SMBUS); }
387 "SystemCMOS"                { count (0); return (PARSEOP_REGIONSPACE_CMOS); }
388 "PciBarTarget"              { count (0); return (PARSEOP_REGIONSPACE_PCIBAR); }
389 "IPMI"                      { count (0); return (PARSEOP_REGIONSPACE_IPMI); }
390
391 "FFixedHW"                  { count (0); return (PARSEOP_ADDRESSSPACE_FFIXEDHW); }
392
393 "SMBQuick"                  { count (0); return (PARSEOP_ACCESSATTRIB_QUICK); }
394 "SMBSendReceive"            { count (0); return (PARSEOP_ACCESSATTRIB_SND_RCV); }
395 "SMBByte"                   { count (0); return (PARSEOP_ACCESSATTRIB_BYTE); }
396 "SMBWord"                   { count (0); return (PARSEOP_ACCESSATTRIB_WORD); }
397 "SMBBlock"                  { count (0); return (PARSEOP_ACCESSATTRIB_BLOCK); }
398 "SMBProcessCall"            { count (0); return (PARSEOP_ACCESSATTRIB_WORD_CALL); }
399 "SMBBlockProcessCall"       { count (0); return (PARSEOP_ACCESSATTRIB_BLOCK_CALL); }
400
401 "MTR"                       { count (0); return (PARSEOP_MATCHTYPE_MTR); }
402 "MEQ"                       { count (0); return (PARSEOP_MATCHTYPE_MEQ); }
403 "MLE"                       { count (0); return (PARSEOP_MATCHTYPE_MLE); }
404 "MLT"                       { count (0); return (PARSEOP_MATCHTYPE_MLT); }
405 "MGE"                       { count (0); return (PARSEOP_MATCHTYPE_MGE); }
406 "MGT"                       { count (0); return (PARSEOP_MATCHTYPE_MGT); }
407
408 "Compatibility"             { count (0); return (PARSEOP_DMATYPE_COMPATIBILITY); }
409 "TypeA"                     { count (0); return (PARSEOP_DMATYPE_A); }
410 "TypeB"                     { count (0); return (PARSEOP_DMATYPE_B); }
411 "TypeF"                     { count (0); return (PARSEOP_DMATYPE_F); }
412
413 "BusMaster"                 { count (0); return (PARSEOP_BUSMASTERTYPE_MASTER); }
414 "NotBusMaster"              { count (0); return (PARSEOP_BUSMASTERTYPE_NOTMASTER); }
415
416 "Transfer8"                 { count (0); return (PARSEOP_XFERTYPE_8); }
417 "Transfer8_16"              { count (0); return (PARSEOP_XFERTYPE_8_16); }
418 "Transfer16"                { count (0); return (PARSEOP_XFERTYPE_16); }
419
420 "ResourceConsumer"          { count (0); return (PARSEOP_RESOURCETYPE_CONSUMER); }
421 "ResourceProducer"          { count (0); return (PARSEOP_RESOURCETYPE_PRODUCER); }
422
423 "MinFixed"                  { count (0); return (PARSEOP_MINTYPE_FIXED); }
424 "MinNotFixed"               { count (0); return (PARSEOP_MINTYPE_NOTFIXED); }
425
426 "MaxFixed"                  { count (0); return (PARSEOP_MAXTYPE_FIXED); }
427 "MaxNotFixed"               { count (0); return (PARSEOP_MAXTYPE_NOTFIXED); }
428
429 "PosDecode"                 { count (0); return (PARSEOP_DECODETYPE_POS); }
430 "SubDecode"                 { count (0); return (PARSEOP_DECODETYPE_SUB); }
431
432 "ISAOnlyRanges"             { count (0); return (PARSEOP_RANGETYPE_ISAONLY); }
433 "NonISAOnlyRanges"          { count (0); return (PARSEOP_RANGETYPE_NONISAONLY); }
434 "EntireRange"               { count (0); return (PARSEOP_RANGETYPE_ENTIRE); }
435
436 "Cacheable"                 { count (0); return (PARSEOP_MEMTYPE_CACHEABLE); }
437 "WriteCombining"            { count (0); return (PARSEOP_MEMTYPE_WRITECOMBINING); }
438 "Prefetchable"              { count (0); return (PARSEOP_MEMTYPE_PREFETCHABLE); }
439 "NonCacheable"              { count (0); return (PARSEOP_MEMTYPE_NONCACHEABLE); }
440
441 "ReadWrite"                 { count (0); return (PARSEOP_READWRITETYPE_BOTH); }
442 "ReadOnly"                  { count (0); return (PARSEOP_READWRITETYPE_READONLY); }
443
444 "Edge"                      { count (0); return (PARSEOP_INTTYPE_EDGE); }
445 "Level"                     { count (0); return (PARSEOP_INTTYPE_LEVEL); }
446
447 "ActiveHigh"                { count (0); return (PARSEOP_INTLEVEL_ACTIVEHIGH); }
448 "ActiveLow"                 { count (0); return (PARSEOP_INTLEVEL_ACTIVELOW); }
449
450 "Shared"                    { count (0); return (PARSEOP_SHARETYPE_SHARED); }
451 "Exclusive"                 { count (0); return (PARSEOP_SHARETYPE_EXCLUSIVE); }
452
453 "Decode10"                  { count (0); return (PARSEOP_IODECODETYPE_10); }
454 "Decode16"                  { count (0); return (PARSEOP_IODECODETYPE_16); }
455
456 "TypeTranslation"           { count (0); return (PARSEOP_TYPE_TRANSLATION); }
457 "TypeStatic"                { count (0); return (PARSEOP_TYPE_STATIC); }
458
459 "SparseTranslation"         { count (0); return (PARSEOP_TRANSLATIONTYPE_SPARSE); }
460 "DenseTranslation"          { count (0); return (PARSEOP_TRANSLATIONTYPE_DENSE); }
461
462 "AddressRangeMemory"        { count (0); return (PARSEOP_ADDRESSTYPE_MEMORY); }
463 "AddressRangeReserved"      { count (0); return (PARSEOP_ADDRESSTYPE_RESERVED); }
464 "AddressRangeNVS"           { count (0); return (PARSEOP_ADDRESSTYPE_NVS); }
465 "AddressRangeACPI"          { count (0); return (PARSEOP_ADDRESSTYPE_ACPI); }
466
467
468 "{"                         { count (0); return('{'); }
469 "}"                         { count (0); return('}'); }
470 ","                         { count (0); return(','); }
471 "("                         { count (0); return('('); }
472 ")"                         { count (0); return(')'); }
473
474
475 {NameSeg}                   { char *s;
476                                 count (0);
477                                 s=malloc (ACPI_NAME_SIZE + 1);
478                                 if (strcmp (AslCompilertext, "\\"))
479                                 {
480                                     strcpy (s, "____");
481                                     AcpiUtStrupr (AslCompilertext);
482                                 }
483                                 memcpy (s, AslCompilertext, strlen (AslCompilertext));
484                                 AslCompilerlval.s = s;
485                                 DbgPrint (ASL_PARSE_OUTPUT, "NameSeg: %s\n", s);
486                                 return (PARSEOP_NAMESEG); }
487
488 {NameString}                { char *s;
489                                 count (0);
490                                 s=malloc (strlen (AslCompilertext)+1);
491                                 AcpiUtStrupr (AslCompilertext);
492                                 strcpy (s, AslCompilertext);
493                                 s[strlen (AslCompilertext)] = 0;
494                                 AslCompilerlval.s = s;
495                                 DbgPrint (ASL_PARSE_OUTPUT, "NameString: %s\n", s);
496                                 return (PARSEOP_NAMESTRING); }
497
498 "*" |
499 "/"                         { count (1);
500                                 AslCompilererror ("Parse error, expecting ASL keyword or name");}
501
502 .                           { count (1);
503                                 sprintf (MsgBuffer,
504                                     "Invalid character (0x%2.2X), expecting ASL keyword or name",
505                                     *AslCompilertext);
506                                 AslCompilererror (MsgBuffer);}
507
508 <<EOF>>                     { if (AslPopInputFileStack ())
509                                 yyterminate();
510                               else
511                                 return (PARSEOP_INCLUDE_END);};
512
513 %%
514
515 /*! [End] no source code translation !*/
516
517 typedef struct asl_file_node
518 {
519     FILE                    *File;
520     UINT32                  CurrentLineNumber;
521     YY_BUFFER_STATE         State;
522     char                    *Filename;
523     struct asl_file_node    *Next;
524
525 } ASL_FILE_NODE;
526
527 ASL_FILE_NODE               *InputStack = NULL;
528
529
530 /*******************************************************************************
531  *
532  * FUNCTION:    AslPopInputFileStack
533  *
534  * PARAMETERS:  None
535  *
536  * RETURN:      0 if a node was popped, -1 otherwise
537  *
538  * DESCRIPTION: Pop the top of the input file stack and point the parser to
539  *              the saved parse buffer contained in the fnode.  Also, set the
540  *              global line counters to the saved values.  This function is
541  *              called when an include file reaches EOF.
542  *
543  ******************************************************************************/
544
545 int
546 AslPopInputFileStack (
547     void)
548 {
549     ASL_FILE_NODE           *Fnode;
550     FILE                    *InputFile = NULL;
551
552
553     Fnode = InputStack;
554     DbgPrint (ASL_PARSE_OUTPUT, "\nPop InputFile Stack, Fnode %p\n\n", Fnode);
555
556
557     if (!Fnode)
558     {
559         return -1;
560     }
561
562     /* Close the current include file */
563
564     fclose (yyin);
565
566     /* Update the top-of-stack */
567
568     InputStack = Fnode->Next;
569     InputFile = Fnode->File;
570
571     /* Reset global line counter and filename */
572
573     Gbl_Files[ASL_FILE_INPUT].Filename = Fnode->Filename;
574     Gbl_CurrentLineNumber = Fnode->CurrentLineNumber;
575
576     /* Point the parser to the popped file */
577
578     yy_delete_buffer (YY_CURRENT_BUFFER);
579     yy_switch_to_buffer (Fnode->State);
580
581     /* All done with this node */
582
583     ACPI_FREE (Fnode);
584     return 0;
585 }
586
587
588 /*******************************************************************************
589  *
590  * FUNCTION:    AslPushInputFileStack
591  *
592  * PARAMETERS:  InputFile           - Open file pointer
593  *              Filename            - Name of the file
594  *
595  * RETURN:      None
596  *
597  * DESCRIPTION: Push the InputFile onto the file stack, and point the parser
598  *              to this file.  Called when an include file is successfully
599  *              opened.
600  *
601  ******************************************************************************/
602
603 void
604 AslPushInputFileStack (
605     FILE                    *InputFile,
606     char                    *Filename)
607 {
608     ASL_FILE_NODE           *Fnode;
609     YY_BUFFER_STATE         State;
610
611
612     /* Save the current state in an Fnode */
613
614     Fnode = UtLocalCalloc (sizeof (ASL_FILE_NODE));
615
616     Fnode->File                 = yyin;
617     Fnode->Next                 = InputStack;
618     Fnode->State                = YY_CURRENT_BUFFER;
619     Fnode->CurrentLineNumber    = Gbl_CurrentLineNumber;
620     Fnode->Filename             = Gbl_Files[ASL_FILE_INPUT].Filename;
621
622     /* Push it on the stack */
623
624     InputStack = Fnode;
625
626     /* Point the parser to this file */
627
628     State = yy_create_buffer (InputFile, YY_BUF_SIZE);
629     yy_switch_to_buffer (State);
630
631     DbgPrint (ASL_PARSE_OUTPUT, "\nPush InputFile Stack, returning %p\n\n", InputFile);
632
633     /* Reset the global line count and filename */
634
635     Gbl_Files[ASL_FILE_INPUT].Filename = Filename;
636     Gbl_CurrentLineNumber = 1;
637     yyin = InputFile;
638 }
639
640
641 /*******************************************************************************
642  *
643  * FUNCTION:    ResetCurrentLineBuffer
644  *
645  * PARAMETERS:  None
646  *
647  * RETURN:      None
648  *
649  * DESCRIPTION: Reset the Line Buffer to zero, increment global line numbers.
650  *
651  ******************************************************************************/
652
653 void
654 ResetCurrentLineBuffer (
655     void)
656 {
657
658     if (Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Handle)
659     {
660         FlWriteFile (ASL_FILE_SOURCE_OUTPUT, Gbl_CurrentLineBuffer,
661             Gbl_LineBufPtr - Gbl_CurrentLineBuffer);
662     }
663
664     Gbl_CurrentLineOffset += Gbl_CurrentColumn;
665     Gbl_CurrentColumn = 0;
666
667     Gbl_CurrentLineNumber++;
668     Gbl_LogicalLineNumber++;
669     Gbl_LineBufPtr = Gbl_CurrentLineBuffer;
670 }
671
672
673 /*******************************************************************************
674  *
675  * FUNCTION:    InsertLineBuffer
676  *
677  * PARAMETERS:  SourceChar      - One char from the input ASL source file
678  *
679  * RETURN:      None
680  *
681  * DESCRIPTION: Put one character of the source file into the temp line buffer
682  *
683  ******************************************************************************/
684
685 #define ASL_SPACES_PER_TAB  4
686
687 void
688 InsertLineBuffer (
689     int                     SourceChar)
690 {
691     UINT32                  i;
692     UINT32                  Count = 1;
693
694
695     if (SourceChar == EOF)
696     {
697         return;
698     }
699
700     Gbl_InputByteCount++;
701
702     /* Handle tabs.  Convert to spaces */
703
704     if (SourceChar == '\t')
705     {
706         SourceChar = ' ';
707         Count = ASL_SPACES_PER_TAB -
708                     (Gbl_CurrentColumn & (ASL_SPACES_PER_TAB-1));
709     }
710
711
712     for (i = 0; i < Count; i++)
713     {
714         Gbl_CurrentColumn++;
715
716         /* Insert the character into the line buffer */
717
718         *Gbl_LineBufPtr = (UINT8) SourceChar;
719         Gbl_LineBufPtr++;
720
721         if (Gbl_LineBufPtr > (Gbl_CurrentLineBuffer + (ASL_LINE_BUFFER_SIZE - 1)))
722         {
723 #if 0
724             /*
725              * Warning if we have split a long source line.
726              * <Probably overkill>
727              */
728             sprintf (MsgBuffer, "Max %d", ASL_LINE_BUFFER_SIZE);
729             AslCommonError (ASL_WARNING, ASL_MSG_LONG_LINE,
730                             Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
731                             Gbl_CurrentLineOffset, Gbl_CurrentColumn,
732                             Gbl_Files[ASL_FILE_INPUT].Filename, MsgBuffer);
733 #endif
734
735             ResetCurrentLineBuffer ();
736         }
737         else if (SourceChar == '\n')
738         {
739             /* End of line */
740
741             ResetCurrentLineBuffer ();
742         }
743     }
744 }
745
746
747 /*******************************************************************************
748  *
749  * FUNCTION:    count
750  *
751  * PARAMETERS:  yytext      - Contains the matched keyword.
752  *              Type        - Keyword/Character type:
753  *                             0 = anything except a keyword
754  *                             1 = pseudo-keywords
755  *                             2 = non-executable ASL keywords
756  *                             3 = executable ASL keywords
757  *
758  * RETURN:      None
759  *
760  * DESCRIPTION: Count keywords and put them into the line buffer
761  *
762  ******************************************************************************/
763
764 void
765 count (
766     int                 Type)
767 {
768     int                 i;
769
770
771     switch (Type)
772     {
773     case 2:
774         TotalKeywords++;
775         TotalNamedObjects++;
776         break;
777
778     case 3:
779         TotalKeywords++;
780         TotalExecutableOpcodes++;
781         break;
782     }
783
784     for (i = 0; (yytext[i] != 0) && (yytext[i] != EOF); i++)
785     {
786         InsertLineBuffer (yytext[i]);
787         *Gbl_LineBufPtr = 0;
788     }
789 }
790
791
792 /*******************************************************************************
793  *
794  * FUNCTION:    comment
795  *
796  * PARAMETERS:  none
797  *
798  * RETURN:      none
799  *
800  * DESCRIPTION: Process a standard comment.
801  *
802  ******************************************************************************/
803
804 char
805 comment (void)
806 {
807     char                c;
808     char                c1 = 0;
809
810
811     InsertLineBuffer ('/');
812     InsertLineBuffer ('*');
813
814 loop:
815
816     /* Eat chars until end-of-comment */
817
818     while ((c = (char) input()) != '*' && c != EOF)
819     {
820         InsertLineBuffer (c);
821         c1 = c;
822     }
823
824     if (c == EOF)
825     {
826         goto EarlyEOF;
827     }
828
829     /*
830      * Check for nested comment -- can help catch cases where a previous
831      * comment was accidently left unterminated
832      */
833     if ((c1 == '/') && (c == '*'))
834     {
835         AslCommonError (ASL_WARNING, ASL_MSG_NESTED_COMMENT,
836                         Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
837                         Gbl_InputByteCount, Gbl_CurrentColumn,
838                         Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
839     }
840
841     /* Comment is closed only if the NEXT character is a slash */
842
843     InsertLineBuffer (c);
844
845     if ((c1 = (char) input()) != '/' && c1 != EOF)
846     {
847         unput(c1);
848         goto loop;
849     }
850
851     if (c1 == EOF)
852     {
853         goto EarlyEOF;
854     }
855
856     InsertLineBuffer (c1);
857     return TRUE;
858
859
860 EarlyEOF:
861     /*
862      * Premature End-Of-File
863      */
864     AslCommonError (ASL_ERROR, ASL_MSG_EARLY_EOF,
865                     Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
866                     Gbl_CurrentLineOffset, Gbl_CurrentColumn,
867                     Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
868     return (FALSE);
869 }
870
871
872 /*******************************************************************************
873  *
874  * FUNCTION:    comment
875  *
876  * PARAMETERS:  none
877  *
878  * RETURN:      none
879  *
880  * DESCRIPTION: Process a new "//" comment.
881  *
882  ******************************************************************************/
883
884 char
885 comment2 (void)
886 {
887     char                c;
888
889
890     InsertLineBuffer ('/');
891     InsertLineBuffer ('/');
892
893     while ((c = (char) input()) != '\n' && c != EOF)
894     {
895         InsertLineBuffer (c);
896     }
897
898     if (c == EOF)
899     {
900         /* End of file is OK, change to newline. Let parser detect EOF later */
901
902         c = '\n';
903     }
904
905     InsertLineBuffer (c);
906     return (TRUE);
907 }
908
909
910 /*******************************************************************************
911  *
912  * FUNCTION:    literal
913  *
914  * PARAMETERS:  none
915  *
916  * RETURN:      none
917  *
918  * DESCRIPTION: Process a string literal (surrounded by quotes)
919  *
920  ******************************************************************************/
921
922 #define ASL_NORMAL_CHAR         0
923 #define ASL_ESCAPE_SEQUENCE     1
924 #define ASL_OCTAL_CONSTANT      2
925 #define ASL_HEX_CONSTANT        3
926
927 char
928 literal (void)
929 {
930     char                *StringBuffer = MsgBuffer;
931     char                *EndBuffer = MsgBuffer + ASL_MSG_BUFFER_SIZE;
932     char                *CleanString;
933     char                StringChar;
934     UINT32              State = ASL_NORMAL_CHAR;
935     UINT32              i = 0;
936     UINT8               Digit;
937     char                ConvertBuffer[4];
938
939
940     /*
941      * Eat chars until end-of-literal.
942      * NOTE:  Put back the original surrounding quotes into the
943      * source line buffer.
944      */
945     InsertLineBuffer ('\"');
946     while ((StringChar = (char) input()) != EOF)
947     {
948         InsertLineBuffer (StringChar);
949
950 DoCharacter:
951
952         switch (State)
953         {
954         case ASL_NORMAL_CHAR:
955
956             switch (StringChar)
957             {
958             case '\\':
959                 /*
960                  * Special handling for backslash-escape sequence.  We will
961                  * toss the backslash and translate the escape char(s).
962                  */
963                 State = ASL_ESCAPE_SEQUENCE;
964                 continue;
965
966             case '\"':
967
968                 /* String terminator */
969
970                 goto CompletedString;
971             }
972             break;
973
974
975         case ASL_ESCAPE_SEQUENCE:
976
977             State = ASL_NORMAL_CHAR;
978             switch (StringChar)
979             {
980             case 'a':
981                 StringChar = 0x07;      /* BELL */
982                 break;
983
984             case 'b':
985                 StringChar = 0x08;      /* BACKSPACE */
986                 break;
987
988             case 'f':
989                 StringChar = 0x0C;      /* FORMFEED */
990                 break;
991
992             case 'n':
993                 StringChar = 0x0A;      /* LINEFEED */
994                 break;
995
996             case 'r':
997                 StringChar = 0x0D;      /* CARRIAGE RETURN*/
998                 break;
999
1000             case 't':
1001                 StringChar = 0x09;      /* HORIZONTAL TAB */
1002                 break;
1003
1004             case 'v':
1005                 StringChar = 0x0B;      /* VERTICAL TAB */
1006                 break;
1007
1008             case 'x':
1009                 State = ASL_HEX_CONSTANT;
1010                 i = 0;
1011                 continue;
1012
1013             case '\'':                  /* Single Quote */
1014             case '\"':                  /* Double Quote */
1015             case '\\':                  /* Backslash */
1016                 break;
1017
1018             default:
1019
1020                 /* Check for an octal digit (0-7) */
1021
1022                 if (ACPI_IS_OCTAL_DIGIT (StringChar))
1023                 {
1024                     State = ASL_OCTAL_CONSTANT;
1025                     ConvertBuffer[0] = StringChar;
1026                     i = 1;
1027                     continue;
1028                 }
1029
1030                 /* Unknown escape sequence issue warning, but use the character */
1031
1032                 AslCommonError (ASL_WARNING, ASL_MSG_INVALID_ESCAPE,
1033                                 Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
1034                                 Gbl_CurrentLineOffset, Gbl_CurrentColumn,
1035                                 Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
1036                                 break;
1037             }
1038             break;
1039
1040
1041         case ASL_OCTAL_CONSTANT:
1042
1043             /* Up to three octal digits allowed */
1044
1045             if (!ACPI_IS_OCTAL_DIGIT (StringChar) ||
1046                 (i > 2))
1047             {
1048                 /*
1049                  * Reached end of the constant.  Convert the assembled ASCII
1050                  * string and resume processing of the next character
1051                  */
1052                 ConvertBuffer[i] = 0;
1053                 Digit = (UINT8) ACPI_STRTOUL (ConvertBuffer, NULL, 8);
1054
1055                 /* Check for NULL or non-ascii character (ignore if so) */
1056
1057                 if ((Digit == 0) || (Digit > ACPI_ASCII_MAX))
1058                 {
1059                     AslCommonError (ASL_WARNING, ASL_MSG_INVALID_STRING,
1060                                     Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
1061                                     Gbl_CurrentLineOffset, Gbl_CurrentColumn,
1062                                     Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
1063                 }
1064                 else
1065                 {
1066                     *StringBuffer = (char) Digit;
1067                     StringBuffer++;
1068                     if (StringBuffer >= EndBuffer)
1069                     {
1070                         goto BufferOverflow;
1071                     }
1072                 }
1073
1074                 State = ASL_NORMAL_CHAR;
1075                 goto DoCharacter;
1076                 break;
1077             }
1078
1079             /* Append another digit of the constant */
1080
1081             ConvertBuffer[i] = StringChar;
1082             i++;
1083             continue;
1084
1085
1086         case ASL_HEX_CONSTANT:
1087
1088             /* Up to two hex digits allowed */
1089
1090             if (!ACPI_IS_XDIGIT (StringChar) ||
1091                 (i > 1))
1092             {
1093                 /*
1094                  * Reached end of the constant.  Convert the assembled ASCII
1095                  * string and resume processing of the next character
1096                  */
1097                 ConvertBuffer[i] = 0;
1098                 Digit = (UINT8) ACPI_STRTOUL (ConvertBuffer, NULL, 16);
1099
1100                 /* Check for NULL or non-ascii character (ignore if so) */
1101
1102                 if ((Digit == 0) || (Digit > ACPI_ASCII_MAX))
1103                 {
1104                     AslCommonError (ASL_WARNING, ASL_MSG_INVALID_STRING,
1105                                     Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
1106                                     Gbl_CurrentLineOffset, Gbl_CurrentColumn,
1107                                     Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
1108                 }
1109                 else
1110                 {
1111                     *StringBuffer = (char) Digit;
1112                     StringBuffer++;
1113                     if (StringBuffer >= EndBuffer)
1114                     {
1115                         goto BufferOverflow;
1116                     }
1117                 }
1118
1119                 State = ASL_NORMAL_CHAR;
1120                 goto DoCharacter;
1121                 break;
1122             }
1123
1124             /* Append another digit of the constant */
1125
1126             ConvertBuffer[i] = StringChar;
1127             i++;
1128             continue;
1129         }
1130
1131         /* Save the finished character */
1132
1133         *StringBuffer = StringChar;
1134         StringBuffer++;
1135         if (StringBuffer >= EndBuffer)
1136         {
1137             goto BufferOverflow;
1138         }
1139     }
1140
1141     /*
1142      * Premature End-Of-File
1143      */
1144     AslCommonError (ASL_ERROR, ASL_MSG_EARLY_EOF,
1145                     Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
1146                     Gbl_CurrentLineOffset, Gbl_CurrentColumn,
1147                     Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
1148     return (FALSE);
1149
1150
1151 CompletedString:
1152     /*
1153      * Null terminate the input string and copy string to a new buffer
1154      */
1155     *StringBuffer = 0;
1156
1157     CleanString = UtGetStringBuffer (strlen (MsgBuffer) + 1);
1158     if (!CleanString)
1159     {
1160         AslCommonError (ASL_ERROR, ASL_MSG_MEMORY_ALLOCATION,
1161                         Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
1162                         Gbl_CurrentLineOffset, Gbl_CurrentColumn,
1163                         Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
1164         return (FALSE);
1165     }
1166
1167     ACPI_STRCPY (CleanString, MsgBuffer);
1168     AslCompilerlval.s = CleanString;
1169     return (TRUE);
1170
1171
1172 BufferOverflow:
1173
1174     /* Literal was too long */
1175
1176     AslCommonError (ASL_ERROR, ASL_MSG_STRING_LENGTH,
1177                     Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
1178                     Gbl_CurrentLineOffset, Gbl_CurrentColumn,
1179                     Gbl_Files[ASL_FILE_INPUT].Filename, "Max length 4096");
1180     return (FALSE);
1181 }
1182
1183