diff options
author | Yann Herklotz <ymherklotz@gmail.com> | 2017-02-06 11:02:43 +0000 |
---|---|---|
committer | Yann Herklotz <ymherklotz@gmail.com> | 2017-02-06 11:02:43 +0000 |
commit | bc3afbc163f176e6db5d935953908c8d00d917a5 (patch) | |
tree | 63d1f94e2aca71592eec1d43f73a5c326994c961 /src/c_lexer.cpp | |
parent | 7c188eff520dc659f2ba324e0eb85174ea318c86 (diff) | |
download | Compiler-bc3afbc163f176e6db5d935953908c8d00d917a5.tar.gz Compiler-bc3afbc163f176e6db5d935953908c8d00d917a5.zip |
adding all
Diffstat (limited to 'src/c_lexer.cpp')
-rw-r--r-- | src/c_lexer.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/c_lexer.cpp b/src/c_lexer.cpp new file mode 100644 index 0000000..bc9c0de --- /dev/null +++ b/src/c_lexer.cpp @@ -0,0 +1,12 @@ +#include "c_lexer.hpp" + +std::string toJson(const std::string& classType, const std::string& text, const std::string& strLine, const std::string& srcCol, const std::string& srcLine, const std::string& fName) { + std::string tmp = "{\"Class\":\"" + classType + "\", \"Text\":\"" + text + "\", \"StreamLine\":" + strLine + ", \"SourceFile\":\"" + fName + "\", \"SourceLine\":" + srcLine + ", \"SourceCol\":" + srcCol + "}"; + + return tmp; +} + +void updateSpaceCount(std::string inStr) { + for(unsigned i = 0; i < inStr.size(); ++i) + spaceCount++; +} |