|
| 1 | +//==--- DiagnosticLexKinds.td - liblex diagnostics ------------------------===// |
| 2 | +// |
| 3 | +// The LLVM Compiler Infrastructure |
| 4 | +// |
| 5 | +// This file is distributed under the University of Illinois Open Source |
| 6 | +// License. See LICENSE.TXT for details. |
| 7 | +// |
| 8 | +//===----------------------------------------------------------------------===// |
| 9 | + |
| 10 | +//===----------------------------------------------------------------------===// |
| 11 | +// Lexer Diagnostics |
| 12 | +//===----------------------------------------------------------------------===// |
| 13 | + |
| 14 | +let Component = "Lex" in { |
| 15 | + |
| 16 | +def null_in_string : Warning<"null character(s) preserved in string literal">; |
| 17 | +def null_in_char : Warning<"null character(s) preserved in character literal">; |
| 18 | +def null_in_file : Warning<"null character ignored">; |
| 19 | +def warn_nested_block_comment : Warning<"'/*' within block comment">; |
| 20 | +def escaped_newline_block_comment_end : Warning< |
| 21 | + "escaped newline between */ characters at block comment end">; |
| 22 | +def backslash_newline_space : Warning< |
| 23 | + "backslash and newline separated by space">; |
| 24 | + |
| 25 | +def trigraph_ignored : Warning<"trigraph ignored">; |
| 26 | +def trigraph_ignored_block_comment : Warning< |
| 27 | + "ignored trigraph would end block comment">; |
| 28 | +def trigraph_ends_block_comment : Warning<"trigraph ends block comment">; |
| 29 | +def trigraph_converted : Warning<"trigraph converted to '%0' character">; |
| 30 | + |
| 31 | +def ext_multi_line_bcpl_comment : Extension<"multi-line // comment">; |
| 32 | +def ext_bcpl_comment : Extension< |
| 33 | + "// comments are not allowed in this language">; |
| 34 | +def ext_no_newline_eof : Extension<"no newline at end of file">; |
| 35 | +def ext_backslash_newline_eof : Extension<"backslash-newline at end of file">; |
| 36 | +def ext_dollar_in_identifier : Extension<"'$' in identifier">; |
| 37 | +def charize_microsoft_ext : Extension<"@# is a microsoft extension">; |
| 38 | + |
| 39 | +def ext_token_used : Extension<"extension used">; |
| 40 | + |
| 41 | +def err_unterminated_string : Error<"missing terminating '\"' character">; |
| 42 | +def err_unterminated_char : Error<"missing terminating ' character">; |
| 43 | +def err_unterminated_angled_string : Error<"missing terminating '>' character">; |
| 44 | +def err_empty_character : Error<"empty character constant">; |
| 45 | +def err_unterminated_block_comment : Error<"unterminated /* comment">; |
| 46 | +def err_invalid_character_to_charify : Error< |
| 47 | + "invalid argument to convert to character">; |
| 48 | + |
| 49 | +def ext_nonstandard_escape : Extension< |
| 50 | + "use of non-standard escape character '\\%0'">; |
| 51 | +def ext_unknown_escape : Extension<"unknown escape sequence '\\%0'">; |
| 52 | +def err_hex_escape_no_digits : Error<"\\x used with no following hex digits">; |
| 53 | +def err_invalid_decimal_digit : Error<"invalid digit '%0' in decimal constant">; |
| 54 | +def err_invalid_binary_digit : Error<"invalid digit '%0' in binary constant">; |
| 55 | +def err_invalid_octal_digit : Error<"invalid digit '%0' in octal constant">; |
| 56 | +def err_invalid_suffix_integer_constant : Error< |
| 57 | + "invalid suffix '%0' on integer constant">; |
| 58 | +def err_invalid_suffix_float_constant : Error< |
| 59 | + "invalid suffix '%0' on floating constant">; |
| 60 | +def warn_extraneous_wide_char_constant : Warning< |
| 61 | + "extraneous characters in wide character constant ignored">; |
| 62 | +def warn_char_constant_too_large : Warning< |
| 63 | + "character constant too long for its type">; |
| 64 | +def err_exponent_has_no_digits : Error<"exponent has no digits">; |
| 65 | +def ext_imaginary_constant : Extension<"imaginary constants are an extension">; |
| 66 | +def err_hexconstant_requires_exponent : Error< |
| 67 | + "hexadecimal floating constants require an exponent">; |
| 68 | +def ext_hexconstant_invalid : Extension< |
| 69 | + "hexadecimal floating constants are a C99 feature">; |
| 70 | +def ext_binary_literal : Extension<"binary integer literals are an extension">; |
| 71 | +def err_pascal_string_too_long : Error<"Pascal string is too long">; |
| 72 | +def warn_octal_escape_too_large : ExtWarn<"octal escape sequence out of range">; |
| 73 | +def warn_hex_escape_too_large : ExtWarn<"hex escape sequence out of range">; |
| 74 | + |
| 75 | + |
| 76 | +def pp_hash_warning : Warning<"#warning%0">; |
| 77 | +def pp_include_next_in_primary : Warning< |
| 78 | + "#include_next in primary source file">; |
| 79 | +def pp_include_next_absolute_path : Warning<"#include_next with absolute path">; |
| 80 | +def ext_c99_whitespace_required_after_macro_name : Warning< |
| 81 | + "ISO C99 requires whitespace after the macro name">; |
| 82 | +def pp_pragma_once_in_main_file : Warning<"#pragma once in main file">; |
| 83 | +def pp_pragma_sysheader_in_main_file : Warning< |
| 84 | + "#pragma system_header ignored in main file">; |
| 85 | +def pp_poisoning_existing_macro : Warning<"poisoning existing macro">; |
| 86 | +def pp_out_of_date_dependency : Warning< |
| 87 | + "current file is older than dependency %0">; |
| 88 | +def pp_undef_builtin_macro : Warning<"undefining builtin macro">; |
| 89 | +def pp_redef_builtin_macro : Warning<"redefining builtin macro">; |
| 90 | +def pp_invalid_string_literal : Warning< |
| 91 | + "invalid string literal, ignoring final '\\'">; |
| 92 | +def warn_pp_expr_overflow : Warning< |
| 93 | + "integer overflow in preprocessor expression">; |
| 94 | +def warn_pp_convert_lhs_to_positive : Warning< |
| 95 | + "left side of operator converted from negative value to unsigned: %0">; |
| 96 | +def warn_pp_convert_rhs_to_positive : Warning< |
| 97 | + "right side of operator converted from negative value to unsigned: %0">; |
| 98 | + |
| 99 | +def ext_pp_import_directive : Extension<"#import is a language extension">; |
| 100 | +def ext_pp_ident_directive : Extension<"#ident is a language extension">; |
| 101 | +def ext_pp_include_next_directive : Extension< |
| 102 | + "#include_next is a language extension">; |
| 103 | +def ext_pp_warning_directive : Extension<"#warning is a language extension">; |
| 104 | +def ext_pp_extra_tokens_at_eol : Extension< |
| 105 | + "extra tokens at end of %0 directive">; |
| 106 | +def ext_pp_comma_expr : Extension<"comma operator in operand of #if">; |
| 107 | +def ext_pp_bad_vaargs_use : Extension< |
| 108 | + "__VA_ARGS__ can only appear in the expansion of a C99 variadic macro">; |
| 109 | +def ext_pp_macro_redef : Extension<"%0 macro redefined">; |
| 110 | +def ext_variadic_macro : Extension<"variadic macros were introduced in C99">; |
| 111 | +def ext_named_variadic_macro : Extension< |
| 112 | + "named variadic macros are a GNU extension">; |
| 113 | +def ext_embedded_directive : Extension< |
| 114 | + "embedding a directive within macro arguments is not portable">; |
| 115 | +def ext_missing_varargs_arg : Extension< |
| 116 | + "varargs argument missing, but tolerated as an extension">; |
| 117 | +def ext_empty_fnmacro_arg : Extension< |
| 118 | + "empty macro arguments were standardized in C99">; |
| 119 | + |
| 120 | +def ext_pp_base_file : Extension<"__BASE_FILE__ is a language extension">; |
| 121 | +def ext_pp_include_level : Extension< |
| 122 | + "__INCLUDE_LEVEL__ is a language extension">; |
| 123 | +def ext_pp_timestamp : Extension<"__TIMESTAMP__ is a language extension">; |
| 124 | + |
| 125 | +def err_pp_invalid_directive : Error<"invalid preprocessing directive">; |
| 126 | +def err_pp_hash_error : Error<"#error%0">; |
| 127 | +def err_pp_file_not_found : Error<"'%0' file not found">; |
| 128 | +def err_pp_empty_filename : Error<"empty filename">; |
| 129 | +def err_pp_include_too_deep : Error<"#include nested too deeply">; |
| 130 | +def err_pp_expects_filename : Error<"expected \"FILENAME\" or <FILENAME>">; |
| 131 | +def err_pp_macro_not_identifier : Error<"macro names must be identifiers">; |
| 132 | +def err_pp_missing_macro_name : Error<"macro name missing">; |
| 133 | +def err_pp_missing_rparen_in_macro_def : Error< |
| 134 | + "missing ')' in macro parameter list">; |
| 135 | +def err_pp_invalid_tok_in_arg_list : Error< |
| 136 | + "invalid token in macro parameter list">; |
| 137 | +def err_pp_expected_ident_in_arg_list : Error< |
| 138 | + "expected identifier in macro parameter list">; |
| 139 | +def err_pp_expected_comma_in_arg_list : Error< |
| 140 | + "expected comma in macro parameter list">; |
| 141 | +def err_pp_duplicate_name_in_arg_list : Error< |
| 142 | + "duplicate macro parameter name %0">; |
| 143 | +def err_pp_stringize_not_parameter : Error< |
| 144 | + "'#' is not followed by a macro parameter">; |
| 145 | +def err_pp_malformed_ident : Error<"invalid #ident directive">; |
| 146 | +def err_pp_unterminated_conditional : Error< |
| 147 | + "unterminated conditional directive">; |
| 148 | +def pp_err_else_after_else : Error<"#else after #else">; |
| 149 | +def pp_err_elif_after_else : Error<"#elif after #else">; |
| 150 | +def pp_err_else_without_if : Error<"#else without #if">; |
| 151 | +def pp_err_elif_without_if : Error<"#elif without #if">; |
| 152 | +def err_pp_endif_without_if : Error<"#endif without #if">; |
| 153 | +def err_pp_expected_value_in_expr : Error<"expected value in expression">; |
| 154 | +def err_pp_missing_val_before_operator : Error<"missing value before operator">; |
| 155 | +def err_pp_expected_rparen : Error<"expected ')' in preprocessor expression">; |
| 156 | +def err_pp_expected_eol : Error< |
| 157 | + "expected end of line in preprocessor expression">; |
| 158 | +def err_pp_defined_requires_identifier : Error< |
| 159 | + "operator 'defined' requires an identifier">; |
| 160 | +def err_pp_missing_rparen : Error<"missing ')' after 'defined'">; |
| 161 | +def err_pp_colon_without_question : Error<"':' without preceding '?'">; |
| 162 | +def err_pp_division_by_zero : Error< |
| 163 | + "division by zero in preprocessor expression">; |
| 164 | +def err_pp_remainder_by_zero : Error< |
| 165 | + "remainder by zero in preprocessor expression">; |
| 166 | +def err_pp_expr_bad_token_binop : Error< |
| 167 | + "token is not a valid binary operator in a preprocessor subexpression">; |
| 168 | +def err_pp_expr_bad_token_start_expr : Error< |
| 169 | + "invalid token at start of a preprocessor expression">; |
| 170 | +def err_pp_invalid_poison : Error<"can only poison identifier tokens">; |
| 171 | +def err_pp_used_poisoned_id : Error<"attempt to use a poisoned identifier">; |
| 172 | +def err__Pragma_malformed : Error< |
| 173 | + "_Pragma takes a parenthesized string literal">; |
| 174 | +def err_pragma_comment_malformed : Error< |
| 175 | + "pragma comment requires parenthesized identifier and optional string">; |
| 176 | +def err_pragma_comment_unknown_kind : Error<"unknown kind of pragma comment">; |
| 177 | +def err_defined_macro_name : Error<"'defined' cannot be used as a macro name">; |
| 178 | +def err_paste_at_start : Error< |
| 179 | + "'##' cannot appear at start of macro expansion">; |
| 180 | +def err_paste_at_end : Error<"'##' cannot appear at end of macro expansion">; |
| 181 | +def ext_paste_comma : Extension< |
| 182 | + "Use of comma pasting extension is non-portable">; |
| 183 | +def err_unterm_macro_invoc : Error< |
| 184 | + "unterminated function-like macro invocation">; |
| 185 | +def err_too_many_args_in_macro_invoc : Error< |
| 186 | + "too many arguments provided to function-like macro invocation">; |
| 187 | +def err_too_few_args_in_macro_invoc : Error< |
| 188 | + "too few arguments provided to function-like macro invocation">; |
| 189 | +def err_pp_bad_paste : Error< |
| 190 | + "pasting formed '%0', an invalid preprocessing token">; |
| 191 | +def err_pp_operator_used_as_macro_name : Error< |
| 192 | + "C++ operator '%0' cannot be used as a macro name">; |
| 193 | +def err_pp_illegal_floating_literal : Error< |
| 194 | + "floating point literal in preprocessor expression">; |
| 195 | +def err_pp_line_requires_integer : Error< |
| 196 | + "#line directive requires a positive integer argument">; |
| 197 | +def err_pp_line_invalid_filename : Error< |
| 198 | + "invalid filename for #line directive">; |
| 199 | +def err_pp_linemarker_requires_integer : Error< |
| 200 | + "line marker directive requires a positive integer argument">; |
| 201 | +def err_pp_linemarker_invalid_filename : Error< |
| 202 | + "invalid filename for line marker directive">; |
| 203 | +def err_pp_linemarker_invalid_flag : Error< |
| 204 | + "invalid flag line marker directive">; |
| 205 | +def err_pp_linemarker_invalid_pop : Error< |
| 206 | + "invalid line marker flag '2': cannot pop empty include stack">; |
| 207 | +def ext_pp_line_too_big : Extension< |
| 208 | + "C requires #line number to be less than %0, allowed as extension">; |
| 209 | + |
| 210 | +} |
0 commit comments