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 @@
#include <asn1fix_export.h> /* other exportable stuff from libasn1fix */
/*
* Checks that the given string is not a reserved C/C++ keyword.
* ISO/IEC 9899:1999 (C99), A.1.2
* Checks that the given string is not a reserved C/C++ keyword [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[] = {
"auto", "break", "case", "char", "const", "continue", "default",
"do", "double", "else", "enum", "extern", "float", "for", "goto",
"if", "inline", "int", "long", "register", "restrict", "return",
"short", "signed", "sizeof", "static", "struct", "switch", "typedef",
"union", "unsigned", "void", "volatile", "while",
"_Bool", "_Complex", "_Imaginary",
/* C++ */
"class", "explicit", "bool", "mutable",
"template", "typeid", "typename", "and", "and_eq",
"or", "or_eq", "xor", "xor_eq", "not", "not_eq",
"bitor", "compl", "bitand",
"const_cast", "dynamic_cast", "reinterpret_cast",
"static_cast", "true", "false", "namespace", "using",
"throw", "try", "catch"
/* C */
"auto", "break", "case", "char", "const", "continue", "default", "do",
"double", "else", "enum", "extern", "float", "for", "goto", "if",
"inline", "int", "long", "register", "restrict", "return", "short",
"signed", "sizeof", "static", "struct", "switch", "typedef", "union",
"unsigned", "void", "volatile", "while",
/* C++ */
"alignas", "alignof", "and", "and_eq", "asm", "bitand", "bitor", "bool",
"catch", "char16_t", "char32_t", "class", "compl", "const_cast",
"constexpr", "decltype", "delete", "delete", "dynamic_cast",
"explicit", "export", "false", "friend", "mutable", "namespace", "new",
"noexcept", "not", "not_eq", "nullptr", "operator", "or", "or_eq",
"private", "protected", "public", "reinterpret_cast", "static_assert",
"static_cast", "template", "this", "thread_local", "throw", "true", "try",
"typeid", "typename", "using", "virtual", "wchar_t", "xor", "xor_eq"
};
static int
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