可能重复:
How to create a plagiarism detector of c++ files
a simple lexer.cpp to convert a simle c++ file to a sequence of tokens
我有一个项目“c ++文件的剽窃检测器”
需要知道如何将c ++文件转换为这样的标记序列:
int factorial(int n) {
if (n == 0) return 1 ;
else return n * factorial(n-1) ;
}
进入那个:
Int, factorial, (, int, n, ), {, if, (, n, ==, 0, ), return, 1, ;, else, return, n, *, factorial, (, n, -, 1, ), ;, }