Small tokenizer-related classes
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2008-cherylfoil@10659 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
c727877cf9
commit
da4e3cd374
1 changed files with 180 additions and 0 deletions
32
Source/DoxygenTranslator/Token.cpp
Normal file
32
Source/DoxygenTranslator/Token.cpp
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
#include "Token.h"
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <list>
|
||||
using namespace std;
|
||||
|
||||
|
||||
Token::Token(int tType, string tString)
|
||||
{
|
||||
tokenType = tType;
|
||||
tokenString = tString;
|
||||
}
|
||||
|
||||
string Token::toString()
|
||||
{
|
||||
if (tokenType == END_LINE){
|
||||
return "{END OF LINE}";
|
||||
}
|
||||
if (tokenType == PARAGRAPH_END){
|
||||
return "{END OF PARAGRAPH}";
|
||||
}
|
||||
if (tokenType == PLAINSTRING){
|
||||
return tokenString;
|
||||
}
|
||||
if (tokenType == COMMAND){
|
||||
return "{COMMAND : " + tokenString+ "}";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
Token:: ~Token(){}
|
||||
Loading…
Reference in a new issue