[PATCH] MIR Parsing: Introduce a MI Lexing class.
Sean Silva
chisophugis at gmail.com
Thu Jun 18 17:52:49 PDT 2015
REPOSITORY
rL LLVM
================
Comment at: lib/CodeGen/MIRParser/MIParser.cpp:29
@@ -27,3 +28,3 @@
-class MIParser {
+class MIParser : public MILexer {
SourceMgr &SM;
----------------
Is there a reason you chose is-a instead of has-a here? I don't think I've ever seen a parser implemented as a subclass of the lexer.
================
Comment at: lib/CodeGen/MIRParser/MIParser.cpp:70
@@ -60,1 +69,3 @@
+
+void MIParser::lex() { MILexer::lex(Token); }
----------------
This lex() function don't seem to be buying you very much. It seems like it might as well just contain a call to a free function equivalent of what is currently the member function MILexer::lexToken. E.g. it could just be `void MIParser::lex() { CurrentSource = lexToken(CurrentSource, Token, ErrorCallback); }`.
http://reviews.llvm.org/D10521
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list