[PATCH] First revision of the dynamic ASTMatcher library

Richard Smith richard at metafoo.co.uk
Fri May 3 16:53:04 PDT 2013



================
Comment at: include/clang/ASTMatchers/Dynamic/Diagnostics.h:55-69
@@ +54,17 @@
+  enum ErrorType {
+    ET_NONE = 0,
+
+    ET_REGISTRY_NOT_FOUND = 1,
+    ET_REGISTRY_WRONG_ARG_COUNT = 2,
+    ET_REGISTRY_WRONG_ARG_TYPE = 3,
+
+    ET_PARSER_STRING_ERROR = 100,
+    ET_PARSER_MATCHER_ARG_FAILURE = 101,
+    ET_PARSER_MATCHER_FAILURE = 102,
+    ET_PARSER_NO_OPEN_PAREN = 103,
+    ET_PARSER_NO_CLOSE_PAREN = 104,
+    ET_PARSER_NO_COMMA = 105,
+    ET_PARSER_NO_CODE = 106,
+    ET_PARSER_NOT_A_MATCHER = 107,
+    ET_PARSER_INVALID_TOKEN = 108
+  };
----------------
We don't use SHOUTY_NAMES for enumerators in LLVM/Clang; see http://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly

================
Comment at: lib/ASTMatchers/Dynamic/Parser.cpp:31-38
@@ +30,10 @@
+  enum TokenKind {
+    TK_EOF = 0,
+    TK_OPEN_PAREN = 1,
+    TK_CLOSE_PAREN = 2,
+    TK_COMMA = 3,
+    TK_LITERAL = 4,
+    TK_IDENT = 5,
+    TK_INVALID_CHAR = 6,
+    TK_ERROR = 7
+  };
----------------
Likewise


http://llvm-reviews.chandlerc.com/D714

BRANCH
  svn

ARCANIST PROJECT
  clang



More information about the cfe-commits mailing list