Deleted Added
sdiff udiff text old ( 151937 ) new ( 167802 )
full compact
1
2%{
3/******************************************************************************
4 *
5 * Module Name: aslcompiler.l - Flex input file
6 * $Revision: 1.74 $
7 *
8 *****************************************************************************/
9
10/******************************************************************************
11 *
12 * 1. Copyright Notice
13 *
14 * Some or all of this work - Copyright (c) 1999 - 2005, Intel Corp.
15 * All rights reserved.
16 *
17 * 2. License
18 *
19 * 2.1. This is your license from Intel Corp. under its intellectual property
20 * rights. You may have additional license terms from the party that provided
21 * you this software, covering your right to use that party's intellectual
22 * property rights.

--- 551 unchanged lines hidden (view full) ---

574
575 /* Point the parser to the popped file */
576
577 yy_delete_buffer (YY_CURRENT_BUFFER);
578 yy_switch_to_buffer (Fnode->State);
579
580 /* All done with this node */
581
582 ACPI_MEM_FREE (Fnode);
583 return 0;
584}
585
586
587/*******************************************************************************
588 *
589 * FUNCTION: AslPushInputFileStack
590 *

--- 330 unchanged lines hidden (view full) ---

921#define ASL_NORMAL_CHAR 0
922#define ASL_ESCAPE_SEQUENCE 1
923#define ASL_OCTAL_CONSTANT 2
924#define ASL_HEX_CONSTANT 3
925
926char
927literal (void)
928{
929 char *s = MsgBuffer;
930 char *CleanString;
931 char StringChar;
932 UINT32 State = ASL_NORMAL_CHAR;
933 UINT32 i = 0;
934 UINT8 Digit;
935 UINT8 StringLength = 0;
936 char ConvertBuffer[4];
937
938
939 /*
940 * Eat chars until end-of-literal.
941 * NOTE: Put back the original surrounding quotes into the
942 * source line buffer.
943 */
944 InsertLineBuffer ('\"');
945 while ((StringChar = (char) input()) != EOF)
946 {
947 StringLength++;
948 if (StringLength == ACPI_MAX_STRING_CONVERSION)
949 {
950 /* Emit error only once, but keep going */
951
952 AslCommonError (ASL_ERROR, ASL_MSG_STRING_LENGTH,
953 Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
954 Gbl_CurrentLineOffset, Gbl_CurrentColumn,
955 Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
956 }
957
958 InsertLineBuffer (StringChar);
959
960DoCharacter:
961
962 switch (State)
963 {
964 case ASL_NORMAL_CHAR:
965

--- 102 unchanged lines hidden (view full) ---

1068 {
1069 AslCommonError (ASL_WARNING, ASL_MSG_INVALID_STRING,
1070 Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
1071 Gbl_CurrentLineOffset, Gbl_CurrentColumn,
1072 Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
1073 }
1074 else
1075 {
1076 *s = (char) Digit;
1077 s++;
1078 }
1079
1080 State = ASL_NORMAL_CHAR;
1081 goto DoCharacter;
1082 break;
1083 }
1084
1085 /* Append another digit of the constant */

--- 23 unchanged lines hidden (view full) ---

1109 {
1110 AslCommonError (ASL_WARNING, ASL_MSG_INVALID_STRING,
1111 Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
1112 Gbl_CurrentLineOffset, Gbl_CurrentColumn,
1113 Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
1114 }
1115 else
1116 {
1117 *s = (char) Digit;
1118 s++;
1119 }
1120
1121 State = ASL_NORMAL_CHAR;
1122 goto DoCharacter;
1123 break;
1124 }
1125
1126 /* Append another digit of the constant */
1127
1128 ConvertBuffer[i] = StringChar;
1129 i++;
1130 continue;
1131 }
1132
1133 /* Save the finished character */
1134
1135 *s = StringChar;
1136 s++;
1137 }
1138
1139 /*
1140 * Premature End-Of-File
1141 */
1142 AslCommonError (ASL_ERROR, ASL_MSG_EARLY_EOF,
1143 Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
1144 Gbl_CurrentLineOffset, Gbl_CurrentColumn,
1145 Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
1146 return (FALSE);
1147
1148
1149CompletedString:
1150 /*
1151 * Null terminate the input string and copy string to a new buffer
1152 */
1153 *s = 0;
1154
1155 CleanString = UtGetStringBuffer (strlen (MsgBuffer) + 1);
1156 if (!CleanString)
1157 {
1158 AslCommonError (ASL_ERROR, ASL_MSG_MEMORY_ALLOCATION,
1159 Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
1160 Gbl_CurrentLineOffset, Gbl_CurrentColumn,
1161 Gbl_Files[ASL_FILE_INPUT].Filename, NULL);
1162 return (FALSE);
1163 }
1164
1165 ACPI_STRCPY (CleanString, MsgBuffer);
1166 AslCompilerlval.s = CleanString;
1167 return (TRUE);
1168}
1169
1170