Changeset 5f2f2d7 for src/Parser/ExpressionNode.cc
- Timestamp:
- Jun 8, 2015, 8:56:35 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
- Children:
- 81419b5
- Parents:
- cd623a4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/ExpressionNode.cc
rcd623a4 r5f2f2d7 10 10 // Created On : Sat May 16 13:17:07 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Jun 7 07:58:00 201513 // Update Count : 1 3512 // Last Modified On : Mon Jun 8 17:33:40 2015 13 // Update Count : 147 14 14 // 15 15 … … 93 93 static inline bool checkX( char c ) { return c == 'x' || c == 'X'; } 94 94 95 // Very difficult to separate extra parts of constants during lexing because actions are not allow in the middle of 96 // patterns: 95 // Difficult to separate extra parts of constants during lexing because actions are not allow in the middle of patterns: 97 96 // 98 97 // prefix action constant action suffix … … 130 129 } // if 131 130 } else { // decimal constant ? 132 sscanf( (char *)value.c_str(), "%ll d", &v );131 sscanf( (char *)value.c_str(), "%llu", &v ); 133 132 //printf( "%llu %llu\n", v, v ); 134 133 } // if … … 136 135 if ( v <= INT_MAX ) { // signed int 137 136 size = 0; 138 } else if ( v <= UINT_MAX ) {// unsigned int137 } else if ( v <= UINT_MAX && ! dec ) { // unsigned int 139 138 size = 0; 140 if ( ! dec ) Unsigned = true;// unsigned139 Unsigned = true; // unsigned 141 140 } else if ( v <= LONG_MAX ) { // signed long int 142 141 size = 1; 143 } else if ( v <= ULONG_MAX ) {// signed long int142 } else if ( v <= ULONG_MAX && ( ! dec || LONG_MAX == LLONG_MAX ) ) { // signed long int 144 143 size = 1; 145 if ( ! dec ) Unsigned = true;// unsigned long int144 Unsigned = true; // unsigned long int 146 145 } else if ( v <= LLONG_MAX ) { // signed long long int 147 146 size = 2; 148 } else { // signed long long int147 } else { // unsigned long long int 149 148 size = 2; 150 if ( ! dec ) Unsigned = true;// unsigned long long int149 Unsigned = true; // unsigned long long int 151 150 } // if 152 151 153 152 if ( checkU( value[last] ) ) { // suffix 'u' ? 154 153 Unsigned = true; 155 if ( checkL( value[ last - 1 ] ) ) {// suffix 'l' ?154 if ( last > 0 && checkL( value[ last - 1 ] ) ) { // suffix 'l' ? 156 155 size = 1; 157 if ( checkL( value[ last - 1] ) ) { // suffix 'll' ?156 if ( last > 1 && checkL( value[ last - 2 ] ) ) { // suffix 'll' ? 158 157 size = 2; 159 158 } // if … … 161 160 } else if ( checkL( value[ last ] ) ) { // suffix 'l' ? 162 161 size = 1; 163 if ( checkL( value[ last - 1 ] ) ) {// suffix 'll' ?162 if ( last > 0 && checkL( value[ last - 1 ] ) ) { // suffix 'll' ? 164 163 size = 2; 165 } // if 166 if ( checkU( value[ last - 1 ] ) ) { // suffix 'u' ? 167 Unsigned = true; 164 if ( last > 1 && checkU( value[ last - 2 ] ) ) { // suffix 'u' ? 165 Unsigned = true; 166 } // if 167 } else { 168 if ( last > 0 && checkU( value[ last - 1 ] ) ) { // suffix 'u' ? 169 Unsigned = true; 170 } // if 168 171 } // if 169 172 } // if
Note: See TracChangeset
for help on using the changeset viewer.