1 /* 2 ** cdecl -- C gibberish translator 3 ** src/literals.c 4 ** 5 ** Copyright (C) 2017-2021 Paul J. Lucas 6 ** 7 ** This program is free software: you can redistribute it and/or modify 8 ** it under the terms of the GNU General Public License as published by 9 ** the Free Software Foundation, either version 3 of the License, or 10 ** (at your option) any later version. 11 ** 12 ** This program is distributed in the hope that it will be useful, 13 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 14 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 ** GNU General Public License for more details. 16 ** 17 ** You should have received a copy of the GNU General Public License 18 ** along with this program. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 21 /** 22 * @file 23 * Defines constants for cdecl and C/C++ language literals. 24 */ 25 26 // local 27 #include "pjl_config.h" /* must go first */ 28 /// @cond DOXYGEN_IGNORE 29 #define C_LITERALS_INLINE _GL_EXTERN_INLINE 30 /// @endcond 31 #include "literals.h" 32 33 /////////////////////////////////////////////////////////////////////////////// 34 35 // english 36 char const L_ALIGN[] = "align"; 37 char const L_ALIGNED[] = "aligned"; 38 char const L_ALL[] = "all"; 39 char const L_ARRAY[] = "array"; 40 char const L_AS[] = "as"; 41 char const L_BITS[] = "bits"; 42 char const L_BYTES[] = "bytes"; 43 char const L_CAST[] = "cast"; 44 char const L_COMMAND[] = "command"; 45 char const L_COMMANDS[] = "commands"; 46 char const L_DECLARE[] = "declare"; 47 char const L_DEFAULTED[] = "defaulted"; 48 char const L_DEFINE[] = "define"; 49 char const L_DELETED[] = "deleted"; 50 char const L_ENGLISH[] = "english"; 51 char const L_EVAL[] = "eval"; 52 char const L_EVALUATION[] = "evaluation"; 53 char const L_EXIT[] = "exit"; 54 char const L_EXPLAIN[] = "explain"; 55 char const L_EXPR[] = "expr"; 56 char const L_EXPRESSION[] = "expression"; 57 char const L_FUNC[] = "func"; 58 char const L_FUNCTION[] = "function"; 59 char const L_HELP[] = "help"; 60 char const L_INIT[] = "init"; 61 char const L_INITIALIZATION[] = "initialization"; 62 char const L_INTO[] = "into"; 63 char const L_LINKAGE[] = "linkage"; 64 char const L_MBR[] = "mbr"; 65 char const L_MEMBER[] = "member"; 66 char const L_NO[] = "no"; 67 char const H_NON_MBR[] = "non-mbr"; 68 char const H_NON_MEMBER[] = "non-member"; 69 char const L_OF[] = "of"; 70 char const L_OPTIONS[] = "options"; 71 char const L_POINTER[] = "pointer"; 72 char const L_PREDEF[] = "predef"; 73 char const L_PREDEFINED[] = "predefined"; 74 char const L_PTR[] = "ptr"; 75 char const L_Q[] = "q"; 76 char const L_QUIT[] = "quit"; 77 char const L_REF[] = "ref"; 78 char const L_REFERENCE[] = "reference"; 79 char const L_RET[] = "ret"; 80 char const L_RETURNING[] = "returning"; 81 char const L_RVALUE[] = "rvalue"; 82 char const L_SET_COMMAND[] = "set"; 83 char const L_SHOW[] = "show"; 84 char const L_TO[] = "to"; 85 char const L_USER[] = "user"; 86 char const L_VECTOR[] = "vector"; 87 char const L_WIDTH[] = "width"; 88 89 // K&R 90 char const L_AUTO[] = "auto"; 91 char const L_AUTOMATIC[] = "automatic"; 92 char const L_BREAK[] = "break"; 93 char const L_CASE[] = "case"; 94 char const L_CHAR[] = "char"; 95 char const L_CHARACTER[] = "character"; 96 char const L_CONTINUE[] = "continue"; 97 char const L_DEFAULT[] = "default"; 98 char const L_DO[] = "do"; 99 char const L_DOUBLE[] = "double"; 100 char const H_DOUBLE_PRECISION[] = "double-precision"; 101 char const L_ELSE[] = "else"; 102 char const L_EXTERN[] = "extern"; 103 char const L_EXTERNAL[] = "external"; 104 char const L_FLOAT[] = "float"; 105 char const H_FLOATING_POINT[] = "floating-point"; 106 char const L_FOR[] = "for"; 107 char const L_GOTO[] = "goto"; 108 char const L_IF[] = "if"; 109 char const L_INT[] = "int"; 110 char const L_INTEGER[] = "integer"; 111 char const L_LONG[] = "long"; 112 char const L_REGISTER[] = "register"; 113 char const L_RETURN[] = "return"; 114 char const L_SHORT[] = "short"; 115 char const L_SIZEOF[] = "sizeof"; 116 char const L_STATIC[] = "static"; 117 char const L_STRUCT[] = "struct"; 118 char const L_STRUCTURE[] = "structure"; 119 char const L_SWITCH[] = "switch"; 120 char const L_TYPE[] = "type"; 121 char const L_TYPEDEF[] = "typedef"; 122 char const L_UNION[] = "union"; 123 char const L_UNSIGNED[] = "unsigned"; 124 char const L_WHILE[] = "while"; 125 126 // C89 127 char const L_ASM[] = "asm"; 128 char const L_CONST[] = "const"; 129 char const L_CONSTANT[] = "constant"; 130 char const L_ELLIPSIS[] = "..."; 131 char const L_ENUM[] = "enum"; 132 char const L_ENUMERATION[] = "enumeration"; 133 char const L_SIGNED[] = "signed"; 134 char const L_VARARGS[] = "varargs"; 135 char const L_VARIADIC[] = "variadic"; 136 char const L_VOID[] = "void"; 137 char const L_VOLATILE[] = "volatile"; 138 139 // C99 140 char const L__BOOL[] = "_Bool"; 141 char const L__COMPLEX[] = "_Complex"; 142 char const L_COMPLEX[] = "complex"; 143 char const L__IMAGINARY[] = "_Imaginary"; 144 char const L_IMAGINARY[] = "imaginary"; 145 char const L_INLINE[] = "inline"; 146 char const L_LEN[] = "len"; 147 char const L_LENGTH[] = "length"; 148 char const L_RESTRICT[] = "restrict"; 149 char const L_RESTRICTED[] = "restricted"; 150 char const L_VAR[] = "var"; 151 char const L_VARIABLE[] = "variable"; 152 char const L_WCHAR_T[] = "wchar_t"; 153 154 // C11 155 char const L__ALIGNAS[] = "_Alignas"; 156 char const L__ALIGNOF[] = "_Alignof"; 157 char const L__ATOMIC[] = "_Atomic"; 158 char const L_ATOMIC[] = "atomic"; 159 char const L__GENERIC[] = "_Generic"; 160 char const L__NORETURN[] = "_Noreturn"; 161 char const H_NO_RETURN[] = "no-return"; 162 char const H_NON_RETURNING[] = "non-returning"; 163 char const L__STATIC_ASSERT[] = "_Static_assert"; 164 char const L__THREAD_LOCAL[] = "_Thread_local"; 165 char const L_THREAD[] = "thread", L_LOCAL[] = "local"; 166 char const H_THREAD_LOCAL[] = "thread-local"; 167 168 // C++ 169 char const L_BOOL[] = "bool"; 170 char const L_CATCH[] = "catch"; 171 char const L_CLASS[] = "class"; 172 char const L_CONSTRUCTOR[] = "constructor"; 173 char const L_CONST_CAST[] = "const_cast"; 174 char const L_CONV[] = "conv"; 175 char const L_CONVERSION[] = "conversion"; 176 char const L_CTOR[] = "ctor"; 177 char const L_DELETE[] = "delete"; 178 char const L_DESTRUCTOR[] = "destructor"; 179 char const L_DTOR[] = "dtor"; 180 char const L_DYNAMIC[] = "dynamic"; 181 char const L_DYNAMIC_CAST[] = "dynamic_cast"; 182 char const L_EXPLICIT[] = "explicit"; 183 char const L_FALSE[] = "false"; 184 char const L_FRIEND[] = "friend"; 185 char const L_MUTABLE[] = "mutable"; 186 char const L_NAMESPACE[] = "namespace"; 187 char const L_NEW[] = "new"; 188 char const H_NON_THROWING[] = "non-throwing"; 189 char const L_OPER[] = "oper"; 190 char const L_OPERATOR[] = "operator"; 191 char const L_PRIVATE[] = "private"; 192 char const L_PROTECTED[] = "protected"; 193 char const L_PUBLIC[] = "public"; 194 char const L_PURE[] = "pure"; 195 char const L_REINTERPRET[] = "reinterpret"; 196 char const L_REINTERPRET_CAST[] = "reinterpret_cast"; 197 char const L_SCOPE[] = "scope"; 198 char const L_STATIC_CAST[] = "static_cast"; 199 char const L_TEMPLATE[] = "template"; 200 char const L_THIS[] = "this"; 201 char const L_THROW[] = "throw"; 202 char const L_TRUE[] = "true"; 203 char const L_TRY[] = "try"; 204 char const L_TYPEID[] = "typeid"; 205 char const L_TYPENAME[] = "typename"; 206 char const L_USING[] = "using"; 207 char const L_VIRTUAL[] = "virtual"; 208 209 // C++11 210 char const L_ALIGNAS[] = "alignas"; 211 char const L_ALIGNOF[] = "alignof"; 212 char const L_CARRIES[] = "carries", L_DEPENDENCY[] = "dependency"; 213 char const L_CARRIES_DEPENDENCY[] = "carries_dependency"; 214 char const H_CARRIES_DEPENDENCY[] = "carries-dependency"; 215 char const L_CONSTEXPR[] = "constexpr"; 216 char const L_DECLTYPE[] = "decltype"; 217 char const L_FINAL[] = "final"; 218 char const L_LITERAL[] = "literal"; 219 char const L_NOEXCEPT[] = "noexcept"; 220 char const L_EXCEPT[] = "except"; 221 char const H_NO_EXCEPT[] = "no-except"; 222 char const H_NO_EXCEPTION[] = "no-exception"; 223 char const L_NORETURN[] = "noreturn"; 224 char const L_NULLPTR[] = "nullptr"; 225 char const L_OVERRIDE[] = "override"; 226 char const L_OVERRIDDEN[] = "overridden"; 227 char const L_STATIC_ASSERT[] = "static_assert"; 228 char const L_THREAD_LOCAL[] = "thread_local"; 229 char const H_USER_DEF[] = "user-def"; 230 char const H_USER_DEFINED[] = "user-defined"; 231 232 // C11 & C++11 233 char const L_CHAR16_T[] = "char16_t"; 234 char const L_CHAR32_T[] = "char32_t"; 235 236 // C2X & C++14 237 char const L_DEPRECATED[] = "deprecated"; 238 char const L___DEPRECATED__[] = "__deprecated__"; 239 240 // C++17 241 char const L_MAYBE_UNUSED[] = "maybe_unused"; 242 char const L_MAYBE[] = "maybe", L_UNUSED[] = "unused"; 243 char const H_MAYBE_UNUSED[] = "maybe-unused"; 244 char const L___MAYBE_UNUSED__[] = "__maybe_unused__"; 245 char const L_NODISCARD[] = "nodiscard"; 246 char const L_DISCARD[] = "discard"; 247 char const H_NO_DISCARD[] = "no-discard"; 248 char const L___NODISCARD__[] = "__nodiscard__"; 249 char const H_NON_DISCARDABLE[] = "non-discardable"; 250 251 // C++20 252 char const L_CHAR8_T[] = "char8_t"; 253 char const L_CONCEPT[] = "concept"; 254 char const L_CONSTEVAL[] = "consteval"; 255 char const L_CONSTINIT[] = "constinit"; 256 char const L_CO_AWAIT[] = "co_await"; 257 char const L_CO_RETURN[] = "co_return"; 258 char const L_CO_YIELD[] = "co_yield"; 259 char const L_EXPORT[] = "export"; 260 char const L_EXPORTED[] = "exported"; 261 char const L_NO_UNIQUE_ADDRESS[] = "no_unique_address"; 262 char const L_UNIQUE[] = "unique", L_ADDRESS[] = "address"; 263 char const H_NO_UNIQUE_ADDRESS[] = "no-unique-address"; 264 char const H_NON_UNIQUE_ADDRESS[] = "non-unique-address"; 265 char const L_REQUIRES[] = "requires"; 266 267 // Alternative tokens 268 char const L_AND[] = "and"; 269 char const L_AND_EQ[] = "and_eq"; 270 char const L_BITAND[] = "bitand"; 271 char const L_BITOR[] = "bitor"; 272 char const L_COMPL[] = "compl"; 273 char const L_NOT[] = "not"; 274 char const L_NOT_EQ[] = "not_eq"; 275 char const L_OR[] = "or"; 276 char const L_OR_EQ[] = "or_eq"; 277 char const L_XOR[] = "xor"; 278 char const L_XOR_EQ[] = "xor_eq"; 279 280 // Embedded C extensions 281 char const L_EMC__ACCUM[] = "_Accum"; 282 char const L_EMC_ACCUM[] = "accum"; 283 char const L_EMC__FRACT[] = "_Fract"; 284 char const L_EMC_FRACT[] = "fract"; 285 char const L_EMC__SAT[] = "_Sat"; 286 char const L_EMC_SAT[] = "sat"; 287 char const L_EMC_SATURATED[] = "saturated"; 288 289 // Unified Parallel C extensions 290 char const L_UPC_RELAXED[] = "relaxed"; 291 char const L_UPC_SHARED[] = "shared"; 292 char const L_UPC_STRICT[] = "strict"; 293 294 // GNU extensions 295 char const L_GNU___ATTRIBUTE__[] = "__attribute__"; 296 char const L_GNU___AUTO_TYPE[] = "__auto_type"; 297 char const L_GNU___COMPLEX[] = "__complex"; 298 char const L_GNU___COMPLEX__[] = "__complex__"; 299 char const L_GNU___CONST[] = "__const"; 300 char const L_GNU___INLINE[] = "__inline"; 301 char const L_GNU___INLINE__[] = "__inline__"; 302 char const L_GNU___RESTRICT[] = "__restrict"; 303 char const L_GNU___RESTRICT__[] = "__restrict__"; 304 char const L_GNU___SIGNED[] = "__signed"; 305 char const L_GNU___SIGNED__[] = "__signed__"; 306 char const L_GNU___THREAD[] = "__thread"; 307 char const L_GNU___VOLATILE[] = "__volatile"; 308 char const L_GNU___VOLATILE__[] = "__volatile__"; 309 310 // Apple extensions 311 char const L_APPLE___BLOCK[] = "__block"; 312 char const L_APPLE_BLOCK[] = "block"; // English for '^' 313 314 // Microsoft extensions 315 char const L_MSC__ASM[] = "_asm"; 316 char const L_MSC___ASM[] = "__asm"; 317 char const L_MSC__CDECL[] = "_cdecl"; 318 char const L_MSC___CDECL[] = "__cdecl"; 319 char const L_MSC_CDECL[] = "cdecl"; 320 char const L_MSC___CLRCALL[] = "__clrcall"; 321 char const L_MSC_CLRCALL[] = "clrcall"; 322 char const L_MSC__DECLSPEC[] = "_declspec"; 323 char const L_MSC___DECLSPEC[] = "__declspec"; 324 char const L_MSC__FASTCALL[] = "_fastcall"; 325 char const L_MSC___FASTCALL[] = "__fastcall"; 326 char const L_MSC_FASTCALL[] = "fastcall"; 327 char const L_MSC__FORCEINLINE[] = "_forceinline"; 328 char const L_MSC___FORCEINLINE[] = "__forceinline"; 329 char const L_MSC__INLINE[] = "_inline"; 330 char const L_MSC__RESTRICT[] = "_restrict"; 331 char const L_MSC__STDCALL[] = "_stdcall"; 332 char const L_MSC___STDCALL[] = "__stdcall"; 333 char const L_MSC_STDCALL[] = "stdcall"; 334 char const L_MSC___THISCALL[] = "__thiscall"; 335 char const L_MSC_THISCALL[] = "thiscall"; 336 char const L_MSC__VECTORCALL[] = "_vectorcall"; 337 char const L_MSC___VECTORCALL[] = "__vectorcall"; 338 char const L_MSC_VECTORCALL[] = "vectorcall"; 339 char const L_MSC_WINAPI[] = "WINAPI"; 340 341 /////////////////////////////////////////////////////////////////////////////// 342 /* vim:set et sw=2 ts=2: */ 343