Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我目前正在从这样的文件创建输入流:
pANTLR3_UINT8 inputFile = (pANTLR3_UINT8) "X:/Path/To/File"; pANTLR3_INPUT_STREAM input = antlr3AsciiFileStreamNew(inputFile);
但是,我想改为从 stringstream 创建一个输入流。这可能吗?
这不是直接可能的,但是您可以将 stringstream 转换为字符串并将其用作输入,例如:
input = antlr3StringStreamNew((pANTLR3_UINT8)utf8.c_str(), ANTLR3_ENC_UTF8, utf8.size(), (pANTLR3_UINT8)"sql-script");