Commit e0a30392 authored by Lev Walkin's avatar Lev Walkin Committed by GitHub

Merge pull request #118 from gareins/master

Refreshing reserved keywords
parents 860de0bc 11a3d68b
...@@ -5,24 +5,28 @@ ...@@ -5,24 +5,28 @@
#include <asn1fix_export.h> /* other exportable stuff from libasn1fix */ #include <asn1fix_export.h> /* other exportable stuff from libasn1fix */
/* /*
* Checks that the given string is not a reserved C/C++ keyword. * Checks that the given string is not a reserved C/C++ keyword [1],[2].
* ISO/IEC 9899:1999 (C99), A.1.2 * _* keywords not included, since asn1 identifiers cannot begin with hyphen [3]
* [1] ISO/IEC 9899:2011 (C11), 6.4.1
* [2] ISO/IEC 14882:2014 (C++14), 2.12
* [3] ISO/IEC 8824-1:2003 (asn1) 11.3
*/ */
static char *res_kwd[] = { static char *res_kwd[] = {
"auto", "break", "case", "char", "const", "continue", "default", /* C */
"do", "double", "else", "enum", "extern", "float", "for", "goto", "auto", "break", "case", "char", "const", "continue", "default", "do",
"if", "inline", "int", "long", "register", "restrict", "return", "double", "else", "enum", "extern", "float", "for", "goto", "if",
"short", "signed", "sizeof", "static", "struct", "switch", "typedef", "inline", "int", "long", "register", "restrict", "return", "short",
"union", "unsigned", "void", "volatile", "while", "signed", "sizeof", "static", "struct", "switch", "typedef", "union",
"_Bool", "_Complex", "_Imaginary", "unsigned", "void", "volatile", "while",
/* C++ */ /* C++ */
"class", "explicit", "bool", "mutable", "alignas", "alignof", "and", "and_eq", "asm", "bitand", "bitor", "bool",
"template", "typeid", "typename", "and", "and_eq", "catch", "char16_t", "char32_t", "class", "compl", "const_cast",
"or", "or_eq", "xor", "xor_eq", "not", "not_eq", "constexpr", "decltype", "delete", "delete", "dynamic_cast",
"bitor", "compl", "bitand", "explicit", "export", "false", "friend", "mutable", "namespace", "new",
"const_cast", "dynamic_cast", "reinterpret_cast", "noexcept", "not", "not_eq", "nullptr", "operator", "or", "or_eq",
"static_cast", "true", "false", "namespace", "using", "private", "protected", "public", "reinterpret_cast", "static_assert",
"throw", "try", "catch" "static_cast", "template", "this", "thread_local", "throw", "true", "try",
"typeid", "typename", "using", "virtual", "wchar_t", "xor", "xor_eq"
}; };
static int static int
reserved_keyword(const char *str) { reserved_keyword(const char *str) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment