Lines Matching refs:CurPtr
25 CurPtr = nullptr; in AsmLexer()
38 CurPtr = ptr; in setBuffer()
40 CurPtr = CurBuf.begin(); in setBuffer()
50 return AsmToken(AsmToken::Error, StringRef(Loc, CurPtr - Loc)); in ReturnError()
54 if (CurPtr == CurBuf.end()) in getNextChar()
56 return (unsigned char)*CurPtr++; in getNextChar()
66 while (isdigit(*CurPtr)) in LexFloatLiteral()
67 ++CurPtr; in LexFloatLiteral()
72 if (*CurPtr == 'e' || *CurPtr == 'E') { in LexFloatLiteral()
73 ++CurPtr; in LexFloatLiteral()
74 if (*CurPtr == '-' || *CurPtr == '+') in LexFloatLiteral()
75 ++CurPtr; in LexFloatLiteral()
76 while (isdigit(*CurPtr)) in LexFloatLiteral()
77 ++CurPtr; in LexFloatLiteral()
81 StringRef(TokStart, CurPtr - TokStart)); in LexFloatLiteral()
91 assert((*CurPtr == 'p' || *CurPtr == 'P' || *CurPtr == '.') && in LexHexFloatLiteral()
96 if (*CurPtr == '.') { in LexHexFloatLiteral()
97 ++CurPtr; in LexHexFloatLiteral()
99 const char *FracStart = CurPtr; in LexHexFloatLiteral()
100 while (isxdigit(*CurPtr)) in LexHexFloatLiteral()
101 ++CurPtr; in LexHexFloatLiteral()
103 NoFracDigits = CurPtr == FracStart; in LexHexFloatLiteral()
111 if (*CurPtr != 'p' && *CurPtr != 'P') in LexHexFloatLiteral()
114 ++CurPtr; in LexHexFloatLiteral()
116 if (*CurPtr == '+' || *CurPtr == '-') in LexHexFloatLiteral()
117 ++CurPtr; in LexHexFloatLiteral()
120 const char *ExpStart = CurPtr; in LexHexFloatLiteral()
121 while (isdigit(*CurPtr)) in LexHexFloatLiteral()
122 ++CurPtr; in LexHexFloatLiteral()
124 if (CurPtr == ExpStart) in LexHexFloatLiteral()
128 return AsmToken(AsmToken::Real, StringRef(TokStart, CurPtr - TokStart)); in LexHexFloatLiteral()
138 if (CurPtr[-1] == '.' && isdigit(*CurPtr)) { in LexIdentifier()
140 while (isdigit(*CurPtr)) in LexIdentifier()
141 ++CurPtr; in LexIdentifier()
142 if (*CurPtr == 'e' || *CurPtr == 'E' || in LexIdentifier()
143 !IsIdentifierChar(*CurPtr, AllowAtInIdentifier)) in LexIdentifier()
147 while (IsIdentifierChar(*CurPtr, AllowAtInIdentifier)) in LexIdentifier()
148 ++CurPtr; in LexIdentifier()
151 if (CurPtr == TokStart+1 && TokStart[0] == '.') in LexIdentifier()
154 return AsmToken(AsmToken::Identifier, StringRef(TokStart, CurPtr - TokStart)); in LexIdentifier()
160 switch (*CurPtr) { in LexSlash()
165 ++CurPtr; in LexSlash()
173 ++CurPtr; // skip the star. in LexSlash()
174 while (CurPtr != CurBuf.end()) { in LexSlash()
175 switch (*CurPtr++) { in LexSlash()
178 if (*CurPtr != '/') in LexSlash()
180 ++CurPtr; // End the */. in LexSlash()
182 StringRef(TokStart, CurPtr - TokStart)); in LexSlash()
203 StringRef(TokStart, CurPtr - TokStart)); in LexLineComment()
207 StringRef(TokStart, CurPtr - 1 - TokStart)); in LexLineComment()
210 static void SkipIgnoredIntegerSuffix(const char *&CurPtr) { in SkipIgnoredIntegerSuffix() argument
212 if (CurPtr[0] == 'U') in SkipIgnoredIntegerSuffix()
213 ++CurPtr; in SkipIgnoredIntegerSuffix()
214 if (CurPtr[0] == 'L') in SkipIgnoredIntegerSuffix()
215 ++CurPtr; in SkipIgnoredIntegerSuffix()
216 if (CurPtr[0] == 'L') in SkipIgnoredIntegerSuffix()
217 ++CurPtr; in SkipIgnoredIntegerSuffix()
222 static unsigned doLookAhead(const char *&CurPtr, unsigned DefaultRadix) { in doLookAhead() argument
224 const char *LookAhead = CurPtr; in doLookAhead()
237 CurPtr = isHex || !FirstHex ? LookAhead : FirstHex; in doLookAhead()
259 if (CurPtr[-1] != '0' || CurPtr[0] == '.') { in LexDigit()
260 unsigned Radix = doLookAhead(CurPtr, 10); in LexDigit()
263 if (!isHex && (*CurPtr == '.' || *CurPtr == 'e')) { in LexDigit()
264 ++CurPtr; in LexDigit()
268 StringRef Result(TokStart, CurPtr - TokStart); in LexDigit()
277 ++CurPtr; in LexDigit()
281 SkipIgnoredIntegerSuffix(CurPtr); in LexDigit()
286 if ((*CurPtr == 'b') || (*CurPtr == 'B')) { in LexDigit()
287 ++CurPtr; in LexDigit()
289 if (!isdigit(CurPtr[0])) { in LexDigit()
290 --CurPtr; in LexDigit()
291 StringRef Result(TokStart, CurPtr - TokStart); in LexDigit()
294 const char *NumStart = CurPtr; in LexDigit()
295 while (CurPtr[0] == '0' || CurPtr[0] == '1') in LexDigit()
296 ++CurPtr; in LexDigit()
299 if (CurPtr == NumStart) in LexDigit()
302 StringRef Result(TokStart, CurPtr - TokStart); in LexDigit()
310 SkipIgnoredIntegerSuffix(CurPtr); in LexDigit()
315 if ((*CurPtr == 'x') || (*CurPtr == 'X')) { in LexDigit()
316 ++CurPtr; in LexDigit()
317 const char *NumStart = CurPtr; in LexDigit()
318 while (isxdigit(CurPtr[0])) in LexDigit()
319 ++CurPtr; in LexDigit()
323 if (CurPtr[0] == '.' || CurPtr[0] == 'p' || CurPtr[0] == 'P') in LexDigit()
324 return LexHexFloatLiteral(NumStart == CurPtr); in LexDigit()
327 if (CurPtr == NumStart) in LexDigit()
328 return ReturnError(CurPtr-2, "invalid hexadecimal number"); in LexDigit()
331 if (StringRef(TokStart, CurPtr - TokStart).getAsInteger(0, Result)) in LexDigit()
335 if (*CurPtr == 'h' || *CurPtr == 'H') in LexDigit()
336 ++CurPtr; in LexDigit()
340 SkipIgnoredIntegerSuffix(CurPtr); in LexDigit()
342 return intToken(StringRef(TokStart, CurPtr - TokStart), Result); in LexDigit()
347 unsigned Radix = doLookAhead(CurPtr, 8); in LexDigit()
349 StringRef Result(TokStart, CurPtr - TokStart); in LexDigit()
356 ++CurPtr; in LexDigit()
360 SkipIgnoredIntegerSuffix(CurPtr); in LexDigit()
382 StringRef Res = StringRef(TokStart,CurPtr - TokStart); in LexSingleQuote()
417 return AsmToken(AsmToken::String, StringRef(TokStart, CurPtr - TokStart)); in LexQuote()
421 TokStart = CurPtr; in LexUntilEndOfStatement()
423 while (!isAtStartOfComment(CurPtr) && // Start of line comment. in LexUntilEndOfStatement()
424 !isAtStatementSeparator(CurPtr) && // End of statement marker. in LexUntilEndOfStatement()
425 *CurPtr != '\n' && *CurPtr != '\r' && CurPtr != CurBuf.end()) { in LexUntilEndOfStatement()
426 ++CurPtr; in LexUntilEndOfStatement()
428 return StringRef(TokStart, CurPtr-TokStart); in LexUntilEndOfStatement()
432 TokStart = CurPtr; in LexUntilEndOfLine()
434 while (*CurPtr != '\n' && *CurPtr != '\r' && CurPtr != CurBuf.end()) { in LexUntilEndOfLine()
435 ++CurPtr; in LexUntilEndOfLine()
437 return StringRef(TokStart, CurPtr-TokStart); in LexUntilEndOfLine()
443 const char *SavedCurPtr = CurPtr; in peekTokens()
468 CurPtr = SavedCurPtr; in peekTokens()
493 TokStart = CurPtr; in LexToken()
506 CurPtr = TokStart; // reset curPtr; in LexToken()
519 CurPtr += strlen(MAI.getSeparatorString()) - 1; in LexToken()
552 while (*CurPtr == ' ' || *CurPtr == '\t') in LexToken()
553 CurPtr++; in LexToken()
557 return AsmToken(AsmToken::Space, StringRef(TokStart, CurPtr - TokStart)); in LexToken()
579 if (*CurPtr == '=') { in LexToken()
580 ++CurPtr; in LexToken()
585 if (*CurPtr == '|') { in LexToken()
586 ++CurPtr; in LexToken()
592 if (*CurPtr == '&') { in LexToken()
593 ++CurPtr; in LexToken()
598 if (*CurPtr == '=') { in LexToken()
599 ++CurPtr; in LexToken()
614 switch (*CurPtr) { in LexToken()
616 ++CurPtr; in LexToken()
619 ++CurPtr; in LexToken()
622 ++CurPtr; in LexToken()
628 switch (*CurPtr) { in LexToken()
630 ++CurPtr; in LexToken()
633 ++CurPtr; in LexToken()