This adds the parsing ability to the llvm-rc tool. Currently, it can parse a limited amount of RC statements/resources, but the other ones can be easily added to the tool.
Note that this revision is build on top of D35957.
Paths
| Differential D36340
[llvm-rc] Add .rc scripts parser. ClosedPublic Authored by mnbvmar on Aug 4 2017, 2:35 PM.
Details
Summary This adds the parsing ability to the llvm-rc tool. Currently, it can parse a limited amount of RC statements/resources, but the other ones can be easily added to the tool. Note that this revision is build on top of D35957.
Diff Detail
Event Timeline
Comment Actions Code rewritten a little bit. Now, functions return objects instead of pointers to them. This will make the code more readable. Either now takes also a base result class T and returns unique_ptr<T> (possibly upcasted from the created object). This way, we get dynamic polymorphism "for free." Comment Actions Parser rewritten to a single non-templated class. The new patch supports the same set of resources as before.
Comment Actions This looks MUCH better. Thanks
This revision is now accepted and ready to land.Aug 17 2017, 3:00 PM Closed by commit rL311175: [llvm-rc] Add basic RC scripts parsing ability. (authored by mnbvmar). · Explain WhyAug 18 2017, 10:06 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 109820 llvm/test/tools/llvm-rc/Inputs/parser4.rc
llvm/test/tools/llvm-rc/parser.test
llvm/test/tools/llvm-rc/tokenizer.test
llvm/tools/llvm-rc/CMakeLists.txt
llvm/tools/llvm-rc/ResourceScriptParser.h
llvm/tools/llvm-rc/ResourceScriptParser.cpp
llvm/tools/llvm-rc/ResourceScriptStmt.h
llvm/tools/llvm-rc/ResourceScriptStmt.cpp
llvm/tools/llvm-rc/llvm-rc.cpp
|
Can you choose some more descriptive file names for the rc files? Maybe a short 1-3 word filename that briefly explains what's interesting about this input file. For example, test-parse-error.rc or test-everything.rc or test-stringtable.rc, etc.