I need to save the AST generated by clang to a file and then parse it, which would be difficult with the colour information left in. ![]() The problem isn't that I'm trying to view the syntax-highlighted version (I didn't have a problem viewing it in the first place). I thought maybe if I change the encoding to utf-8 the problem would be fixed so I tried this: clang -Xclang -ast-dump -fsyntax-only main.cpp | iconv -f us-ascii -t UTF-8 > output.txt I thought it might be a problem of encoding, I checked the encoding of the file, file -bi output.txt which outputs text/plain charset=us-ascii. |-TypedefDecl 0x4e465b8 > implicit _uint128_t 'unsigned _int128' When it should really look like this: TranslationUnitDecl 0x4e46020 > ![]() 2008 My favorite tool for this is Jedit (a java based text. However the resulting output.txt file when opened (by gedit and jedit on ubuntu) gives me this: [0 1 32mTranslationUnitDecl[0m[0 33m 0x4192020[0m [0m> [0 33m[0m ![]() The command is: clang -Xclang -ast-dump -fsyntax-only main.cpp > output.txt I am trying to save the output of a command to a file.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |