Rename LexerToken methods to be more consistent

llvm-svn: 38970
This commit is contained in:
Chris Lattner 2006-10-14 05:19:39 +00:00
parent 8c2048710d
commit 509d3c00ed
2 changed files with 18 additions and 18 deletions

View File

@ -124,12 +124,12 @@ public:
/// the preprocessor.
void Lex(LexerToken &Result) {
// Start a new token.
Result.StartToken();
Result.startToken();
// NOTE, any changes here should also change code after calls to
// Preprocessor::HandleDirective
if (IsAtStartOfLine) {
Result.SetFlag(LexerToken::StartOfLine);
Result.setFlag(LexerToken::StartOfLine);
IsAtStartOfLine = false;
}
@ -185,8 +185,8 @@ private:
/// addition, since tokens cannot overlap, this also updates BufferPtr to be
/// TokEnd.
void FormTokenWithChars(LexerToken &Result, const char *TokEnd) {
Result.SetLocation(getSourceLocation(BufferPtr));
Result.SetLength(TokEnd-BufferPtr);
Result.setLocation(getSourceLocation(BufferPtr));
Result.setLength(TokEnd-BufferPtr);
BufferPtr = TokEnd;
}

View File

@ -52,45 +52,45 @@ public:
};
tok::TokenKind getKind() const { return Kind; }
void SetKind(tok::TokenKind K) { Kind = K; }
void setKind(tok::TokenKind K) { Kind = K; }
/// getLocation - Return a source location identifier for the specified
/// offset in the current file.
SourceLocation getLocation() const { return Loc; }
unsigned getLength() const { return Length; }
void SetLocation(SourceLocation L) { Loc = L; }
void SetLength(unsigned Len) { Length = Len; }
void setLocation(SourceLocation L) { Loc = L; }
void setLength(unsigned Len) { Length = Len; }
/// StartToken - Reset all flags to cleared.
/// startToken - Reset all flags to cleared.
///
void StartToken() {
void startToken() {
Flags = 0;
IdentInfo = 0;
Loc = SourceLocation();
}
IdentifierInfo *getIdentifierInfo() const { return IdentInfo; }
void SetIdentifierInfo(IdentifierInfo *II) {
void setIdentifierInfo(IdentifierInfo *II) {
IdentInfo = II;
}
/// SetFlag - Set the specified flag.
void SetFlag(TokenFlags Flag) {
/// setFlag - Set the specified flag.
void setFlag(TokenFlags Flag) {
Flags |= Flag;
}
/// ClearFlag - Unset the specified flag.
void ClearFlag(TokenFlags Flag) {
/// clearFlag - Unset the specified flag.
void clearFlag(TokenFlags Flag) {
Flags &= ~Flag;
}
/// SetFlagValue - Set a flag to either true or false.
void SetFlagValue(TokenFlags Flag, bool Val) {
/// setFlagValue - Set a flag to either true or false.
void setFlagValue(TokenFlags Flag, bool Val) {
if (Val)
SetFlag(Flag);
setFlag(Flag);
else
ClearFlag(Flag);
clearFlag(Flag);
}
/// isAtStartOfLine - Return true if this token is at the start of a line.