diff options
author | Yann Herklotz <ymherklotz@gmail.com> | 2017-02-11 14:31:25 +0000 |
---|---|---|
committer | Yann Herklotz <ymherklotz@gmail.com> | 2017-02-11 14:31:25 +0000 |
commit | 508f7883308ff3ca204e1017b27dcbeb9b71dd8f (patch) | |
tree | 2446ffee9f06098d7aa1cbee8827319da2595cbf /c_lexer | |
parent | 5159d8989078316157f860f65bb108e63300beb2 (diff) | |
download | Compiler-508f7883308ff3ca204e1017b27dcbeb9b71dd8f.tar.gz Compiler-508f7883308ff3ca204e1017b27dcbeb9b71dd8f.zip |
Finished lexer for the parser
Diffstat (limited to 'c_lexer')
-rw-r--r-- | c_lexer/src/c_lexer.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/c_lexer/src/c_lexer.cpp b/c_lexer/src/c_lexer.cpp index e01d73f..0e9f021 100644 --- a/c_lexer/src/c_lexer.cpp +++ b/c_lexer/src/c_lexer.cpp @@ -1,7 +1,11 @@ #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 + "}"; +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; + return tmp; } |