Category : lexer

I have a lexer that consumes a file character by character, looking for tokens. I tried two methods for NextChar(), the first reads directly from ifstream through ifstream::get(ch), and the second loads the whole file into a std::stringstream to avoid disk I/O overhead. get() method: inline void Scanner::NextChar() { inputStream.get(unscannedChar); currentCol++; while (unscannedChar == ‘ ..

Read more

I am using flexc++ (C++ lexer) to define the regular expressions for a small language. The language defines string literals, just like in C ie ["](.|[^"])*["]. Here Is the problem: The lexer gives me the entire matched sequence including the ["] and [] characters. For example, a string in my language "Testify"foo" will become std::string ..

Read more

As far as I can see, my code has no recursion, but I am getting exception 0xC00000FD. According to Rider For Unreal Engine, it is happening in the main function. It’s being encountered at the decompiled code mov byte ptr [r11], 0x0 It was working fine, then suddenly when I ran it a second time, ..

Read more