1 /******************************************************************************
3 * Module Name: aslsupport.l - Flex/lex scanner C support routines.
4 * NOTE: Included into aslcompile.l, not compiled by itself.
6 *****************************************************************************/
8 /******************************************************************************
12 * Some or all of this work - Copyright (c) 1999 - 2017, Intel Corp.
13 * All rights reserved.
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
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
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;
38 * The above copyright and patent license is granted only if the following
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.
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
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
73 * 3.4. Intel retains all right, title, and interest in and to the Original
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.
81 * 4. Disclaimer and Export Compliance
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
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
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.
115 *****************************************************************************
117 * Alternatively, you may choose to be licensed under the terms of the
120 * Redistribution and use in source and binary forms, with or without
121 * modification, are permitted provided that the following conditions
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.
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.
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.
151 *****************************************************************************/
155 #define ASL_SPACES_PER_TAB 4
157 #define ASL_NORMAL_CHAR 0
158 #define ASL_ESCAPE_SEQUENCE 1
159 #define ASL_OCTAL_CONSTANT 2
160 #define ASL_HEX_CONSTANT 3
164 yyerror (char const *s)
167 AcpiOsPrintf ("YYERROR: %s\n", s);
171 /*******************************************************************************
173 * FUNCTION: AslParserCleanup
175 * Used to delete the current buffer
177 ******************************************************************************/
184 yy_delete_buffer (YY_CURRENT_BUFFER);
188 /*******************************************************************************
190 * FUNCTION: AslDoLineDirective
192 * PARAMETERS: None. Uses input() to access current source code line
194 * RETURN: Updates global line number and filename
196 * DESCRIPTION: Handle #line directives emitted by the preprocessor.
198 * The #line directive is emitted by the preprocesser, and is used to
199 * pass through line numbers from the original source code file to the
200 * preprocessor output file (.i). This allows any compiler-generated
201 * error messages to be displayed with the correct line number.
203 ******************************************************************************/
215 Gbl_HasIncludeFiles = TRUE;
217 /* Eat the entire line that contains the #line directive */
219 Gbl_LineBufPtr = Gbl_CurrentLineBuffer;
221 while ((c = input()) != '\n' && c != EOF)
228 /* First argument is the actual line number */
230 Token = strtok (Gbl_CurrentLineBuffer, " ");
236 /* First argument is the line number */
238 LineNumber = (UINT32) UtDoConstant (Token);
240 /* Emit the appropriate number of newlines */
242 Gbl_CurrentColumn = 0;
243 if (LineNumber > Gbl_CurrentLineNumber)
245 for (i = 0; i < (LineNumber - Gbl_CurrentLineNumber); i++)
247 FlWriteFile (ASL_FILE_SOURCE_OUTPUT, "\n", 1);
252 FlSetLineNumber (LineNumber);
254 /* Second argument is the optional filename (in double quotes) */
256 Token = strtok (NULL, " \"");
259 Filename = ACPI_ALLOCATE_ZEROED (strlen (Token) + 1);
260 strcpy (Filename, Token);
261 FlSetFilename (Filename);
264 /* Third argument is not supported at this time */
268 /* Reset globals for a new line */
270 Gbl_CurrentLineOffset += Gbl_CurrentColumn;
271 Gbl_CurrentColumn = 0;
272 Gbl_LineBufPtr = Gbl_CurrentLineBuffer;
276 /*******************************************************************************
278 * FUNCTION: AslPopInputFileStack
282 * RETURN: 0 if a node was popped, -1 otherwise
284 * DESCRIPTION: Pop the top of the input file stack and point the parser to
285 * the saved parse buffer contained in the fnode. Also, set the
286 * global line counters to the saved values. This function is
287 * called when an include file reaches EOF.
289 ******************************************************************************/
292 AslPopInputFileStack (
295 ASL_FILE_NODE *Fnode;
298 Gbl_PreviousIncludeFilename = Gbl_Files[ASL_FILE_INPUT].Filename;
299 Fnode = Gbl_IncludeFileStack;
300 DbgPrint (ASL_PARSE_OUTPUT,
301 "\nPop InputFile Stack, Fnode %p\n", Fnode);
303 DbgPrint (ASL_PARSE_OUTPUT,
304 "Include: Closing \"%s\"\n\n", Gbl_Files[ASL_FILE_INPUT].Filename);
311 /* Close the current include file */
315 /* Update the top-of-stack */
317 Gbl_IncludeFileStack = Fnode->Next;
319 /* Reset global line counter and filename */
321 Gbl_Files[ASL_FILE_INPUT].Filename = Fnode->Filename;
322 Gbl_CurrentLineNumber = Fnode->CurrentLineNumber;
324 /* Point the parser to the popped file */
326 yy_delete_buffer (YY_CURRENT_BUFFER);
327 yy_switch_to_buffer (Fnode->State);
329 /* All done with this node */
336 /*******************************************************************************
338 * FUNCTION: AslPushInputFileStack
340 * PARAMETERS: InputFile - Open file pointer
341 * Filename - Name of the file
345 * DESCRIPTION: Push the InputFile onto the file stack, and point the parser
346 * to this file. Called when an include file is successfully
349 ******************************************************************************/
352 AslPushInputFileStack (
356 ASL_FILE_NODE *Fnode;
357 YY_BUFFER_STATE State;
360 /* Save the current state in an Fnode */
362 Fnode = UtLocalCalloc (sizeof (ASL_FILE_NODE));
365 Fnode->Next = Gbl_IncludeFileStack;
366 Fnode->State = YY_CURRENT_BUFFER;
367 Fnode->Filename = Gbl_Files[ASL_FILE_INPUT].Filename;
368 Fnode->CurrentLineNumber = Gbl_CurrentLineNumber;
370 /* Push it on the stack */
372 Gbl_IncludeFileStack = Fnode;
374 /* Point the parser to this file */
376 State = yy_create_buffer (InputFile, YY_BUF_SIZE);
377 yy_switch_to_buffer (State);
379 DbgPrint (ASL_PARSE_OUTPUT,
380 "\nPush InputFile Stack, returning %p\n\n", InputFile);
382 /* Reset the global line count and filename */
384 Gbl_Files[ASL_FILE_INPUT].Filename =
385 UtStringCacheCalloc (strlen (Filename) + 1);
387 strcpy (Gbl_Files[ASL_FILE_INPUT].Filename, Filename);
389 Gbl_CurrentLineNumber = 1;
392 /* converter: reset the comment state to STANDARD_COMMENT */
394 Gbl_CommentState.CommentType = STANDARD_COMMENT;
398 /*******************************************************************************
400 * FUNCTION: AslResetCurrentLineBuffer
406 * DESCRIPTION: Reset the Line Buffer to zero, increment global line numbers.
408 ******************************************************************************/
411 AslResetCurrentLineBuffer (
415 if (Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Handle)
417 FlWriteFile (ASL_FILE_SOURCE_OUTPUT, Gbl_CurrentLineBuffer,
418 Gbl_LineBufPtr - Gbl_CurrentLineBuffer);
421 Gbl_CurrentLineOffset += Gbl_CurrentColumn;
422 Gbl_CurrentColumn = 0;
424 Gbl_CurrentLineNumber++;
425 Gbl_LogicalLineNumber++;
426 Gbl_LineBufPtr = Gbl_CurrentLineBuffer;
430 /*******************************************************************************
432 * FUNCTION: AslInsertLineBuffer
434 * PARAMETERS: SourceChar - One char from the input ASL source file
438 * DESCRIPTION: Put one character of the source file into the temp line buffer
440 ******************************************************************************/
443 AslInsertLineBuffer (
450 if (SourceChar == EOF)
455 Gbl_InputByteCount++;
457 /* Handle tabs. Convert to spaces */
459 if (SourceChar == '\t')
462 Count = ASL_SPACES_PER_TAB -
463 (Gbl_CurrentColumn & (ASL_SPACES_PER_TAB-1));
466 for (i = 0; i < Count; i++)
470 /* Insert the character into the line buffer */
472 *Gbl_LineBufPtr = (UINT8) SourceChar;
476 (Gbl_CurrentLineBuffer + (Gbl_LineBufferSize - 1)))
480 * Warning if we have split a long source line.
481 * <Probably overkill>
483 sprintf (MsgBuffer, "Max %u", Gbl_LineBufferSize);
484 AslCommonError (ASL_WARNING, ASL_MSG_LONG_LINE,
485 Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
486 Gbl_CurrentLineOffset, Gbl_CurrentColumn,
487 Gbl_Files[ASL_FILE_INPUT].Filename, MsgBuffer);
490 AslResetCurrentLineBuffer ();
492 else if (SourceChar == '\n')
496 AslResetCurrentLineBuffer ();
499 if (Gbl_CaptureComments)
501 CvProcessCommentState (SourceChar);
507 /*******************************************************************************
511 * PARAMETERS: yytext - Contains the matched keyword.
512 * Type - Keyword/Character type:
513 * 0 = anything except a keyword
514 * 1 = pseudo-keywords
515 * 2 = non-executable ASL keywords
516 * 3 = executable ASL keywords
520 * DESCRIPTION: Count keywords and put them into the line buffer
522 ******************************************************************************/
542 TotalExecutableOpcodes++;
550 for (i = 0; (yytext[i] != 0) && (yytext[i] != EOF); i++)
552 AslInsertLineBuffer (yytext[i]);
558 /*******************************************************************************
560 * FUNCTION: AslDoComment
566 * DESCRIPTION: Process a standard comment.
568 ******************************************************************************/
576 char *StringBuffer = MsgBuffer;
577 char *EndBuffer = MsgBuffer + ASL_MSG_BUFFER_SIZE;
578 ASL_COMMENT_STATE CurrentState = Gbl_CommentState; /* to reference later on */
581 AslInsertLineBuffer ('/');
582 AslInsertLineBuffer ('*');
583 if (Gbl_CaptureComments && CurrentState.CaptureComments)
593 /* Eat chars until end-of-comment */
595 while (((c = input ()) != '*') && (c != EOF))
597 AslInsertLineBuffer (c);
598 if (Gbl_CaptureComments && CurrentState.CaptureComments)
612 * Check for nested comment -- can help catch cases where a previous
613 * comment was accidently left unterminated
615 if ((c1 == '/') && (c == '*'))
617 AslCommonError (ASL_WARNING, ASL_MSG_NESTED_COMMENT,
618 Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
619 Gbl_InputByteCount, Gbl_CurrentColumn,
620 Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
623 /* Comment is closed only if the NEXT character is a slash */
625 AslInsertLineBuffer (c);
626 if (Gbl_CaptureComments && CurrentState.CaptureComments)
632 if (((c1 = input ()) != '/') && (c1 != EOF))
642 if (StringBuffer > EndBuffer)
647 AslInsertLineBuffer (c1);
648 CvProcessComment (CurrentState, StringBuffer, c1);
654 * Premature End-Of-File
656 AslCommonError (ASL_ERROR, ASL_MSG_EARLY_EOF,
657 Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
658 Gbl_CurrentLineOffset, Gbl_CurrentColumn,
659 Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
665 /* Comment was too long */
667 AslCommonError (ASL_ERROR, ASL_MSG_STRING_LENGTH,
668 Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
669 Gbl_CurrentLineOffset, Gbl_CurrentColumn,
670 Gbl_Files[ASL_FILE_INPUT].Filename, "Max length 4096");
676 /*******************************************************************************
678 * FUNCTION: AslDoCommentType2
684 * DESCRIPTION: Process a new "//" comment. Inline comments will be converted
685 * to "/ *" standard comments.
687 ******************************************************************************/
694 char *StringBuffer = MsgBuffer;
695 char *EndBuffer = MsgBuffer + ASL_MSG_BUFFER_SIZE;
696 ASL_COMMENT_STATE CurrentState = Gbl_CommentState;
699 AslInsertLineBuffer ('/');
700 AslInsertLineBuffer ('*');
702 if (Gbl_CaptureComments && CurrentState.CaptureComments)
710 while (((c = input ()) != '\n') && (c != EOF))
712 AslInsertLineBuffer (c);
713 if (Gbl_CaptureComments && CurrentState.CaptureComments)
722 /* End of file is OK, change to newline. Let parser detect EOF later */
727 if (StringBuffer > EndBuffer)
731 AslInsertLineBuffer (c);
733 CvProcessCommentType2 (CurrentState, StringBuffer);
739 /* Comment was too long */
741 AslCommonError (ASL_ERROR, ASL_MSG_STRING_LENGTH,
742 Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
743 Gbl_CurrentLineOffset, Gbl_CurrentColumn,
744 Gbl_Files[ASL_FILE_INPUT].Filename, "Max length 4096");
750 /*******************************************************************************
752 * FUNCTION: AslDoStringLiteral
758 * DESCRIPTION: Process a string literal (surrounded by quotes)
760 ******************************************************************************/
766 char *StringBuffer = MsgBuffer;
767 char *EndBuffer = MsgBuffer + ASL_MSG_BUFFER_SIZE;
770 UINT32 State = ASL_NORMAL_CHAR;
773 char ConvertBuffer[4];
777 * Eat chars until end-of-literal.
778 * NOTE: Put back the original surrounding quotes into the
779 * source line buffer.
781 AslInsertLineBuffer ('\"');
782 while ((StringChar = input()) != EOF)
784 AslInsertLineBuffer (StringChar);
789 case ASL_NORMAL_CHAR:
795 * Special handling for backslash-escape sequence. We will
796 * toss the backslash and translate the escape char(s).
798 State = ASL_ESCAPE_SEQUENCE;
803 /* String terminator */
805 goto CompletedString;
814 case ASL_ESCAPE_SEQUENCE:
816 State = ASL_NORMAL_CHAR;
821 StringChar = 0x07; /* BELL */
826 StringChar = 0x08; /* BACKSPACE */
831 StringChar = 0x0C; /* FORMFEED */
836 StringChar = 0x0A; /* LINEFEED */
841 StringChar = 0x0D; /* CARRIAGE RETURN*/
846 StringChar = 0x09; /* HORIZONTAL TAB */
851 StringChar = 0x0B; /* VERTICAL TAB */
856 State = ASL_HEX_CONSTANT;
860 case '\'': /* Single Quote */
861 case '\"': /* Double Quote */
862 case '\\': /* Backslash */
868 /* Check for an octal digit (0-7) */
870 if (ACPI_IS_OCTAL_DIGIT (StringChar))
872 State = ASL_OCTAL_CONSTANT;
873 ConvertBuffer[0] = StringChar;
878 /* Unknown escape sequence issue warning, but use the character */
880 AslCommonError (ASL_WARNING, ASL_MSG_INVALID_ESCAPE,
881 Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
882 Gbl_CurrentLineOffset, Gbl_CurrentColumn,
883 Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
889 case ASL_OCTAL_CONSTANT:
891 /* Up to three octal digits allowed */
893 if (!ACPI_IS_OCTAL_DIGIT (StringChar) ||
897 * Reached end of the constant. Convert the assembled ASCII
898 * string and resume processing of the next character
900 ConvertBuffer[i] = 0;
901 Digit = (UINT8) strtoul (ConvertBuffer, NULL, 8);
903 /* Check for NULL or non-ascii character (ignore if so) */
905 if ((Digit == 0) || (Digit > ACPI_ASCII_MAX))
907 AslCommonError (ASL_WARNING, ASL_MSG_INVALID_STRING,
908 Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
909 Gbl_CurrentLineOffset, Gbl_CurrentColumn,
910 Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
914 *StringBuffer = (char) Digit;
916 if (StringBuffer >= EndBuffer)
922 State = ASL_NORMAL_CHAR;
927 /* Append another digit of the constant */
929 ConvertBuffer[i] = StringChar;
933 case ASL_HEX_CONSTANT:
935 /* Up to two hex digits allowed */
937 if (!isxdigit (StringChar) ||
941 * Reached end of the constant. Convert the assembled ASCII
942 * string and resume processing of the next character
944 ConvertBuffer[i] = 0;
945 Digit = (UINT8) strtoul (ConvertBuffer, NULL, 16);
947 /* Check for NULL or non-ascii character (ignore if so) */
949 if ((Digit == 0) || (Digit > ACPI_ASCII_MAX))
951 AslCommonError (ASL_WARNING, ASL_MSG_INVALID_STRING,
952 Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
953 Gbl_CurrentLineOffset, Gbl_CurrentColumn,
954 Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
958 *StringBuffer = (char) Digit;
960 if (StringBuffer >= EndBuffer)
966 State = ASL_NORMAL_CHAR;
971 /* Append another digit of the constant */
973 ConvertBuffer[i] = StringChar;
982 /* Save the finished character */
984 *StringBuffer = StringChar;
986 if (StringBuffer >= EndBuffer)
993 * Premature End-Of-File
995 AslCommonError (ASL_ERROR, ASL_MSG_EARLY_EOF,
996 Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
997 Gbl_CurrentLineOffset, Gbl_CurrentColumn,
998 Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
1004 * Null terminate the input string and copy string to a new buffer
1008 CleanString = UtStringCacheCalloc (strlen (MsgBuffer) + 1);
1011 AslCommonError (ASL_ERROR, ASL_MSG_MEMORY_ALLOCATION,
1012 Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
1013 Gbl_CurrentLineOffset, Gbl_CurrentColumn,
1014 Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
1018 strcpy (CleanString, MsgBuffer);
1019 AslCompilerlval.s = CleanString;
1025 /* Literal was too long */
1027 AslCommonError (ASL_ERROR, ASL_MSG_STRING_LENGTH,
1028 Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
1029 Gbl_CurrentLineOffset, Gbl_CurrentColumn,
1030 Gbl_Files[ASL_FILE_INPUT].Filename, "Max length 4096");