diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2014-05-05 08:15:46 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2014-05-05 08:15:46 +0000 |
commit | f3a4e6b8796f8358ff85a7a50d1a14fe0e5642b1 (patch) | |
tree | e276e4ec4cfea846de0153bd339774262f17fb79 /cparser/pre_parser.mly | |
parent | 7a93de2caaa6e1adca77b1d33d1e97f5d30e52ae (diff) | |
download | compcert-f3a4e6b8796f8358ff85a7a50d1a14fe0e5642b1.tar.gz compcert-f3a4e6b8796f8358ff85a7a50d1a14fe0e5642b1.zip |
Treat all identifiers as VAR_NAME by default (i.e. if not bound by a typedef). This produces better error messages for unbound variable names (proper error message in Elab rather than cryptic syntax error in pre_parser).
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2477 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'cparser/pre_parser.mly')
-rw-r--r-- | cparser/pre_parser.mly | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/cparser/pre_parser.mly b/cparser/pre_parser.mly index c7c807a8..a33c5923 100644 --- a/cparser/pre_parser.mly +++ b/cparser/pre_parser.mly @@ -38,7 +38,7 @@ %} %token<string * Pre_parser_aux.identifier_type ref * Cabs.cabsloc> - VAR_NAME TYPEDEF_NAME UNKNOWN_NAME + VAR_NAME TYPEDEF_NAME %token<Cabs.constant * Cabs.cabsloc> CONSTANT %token<string * Cabs.cabsloc> STRING_LITERAL PRAGMA @@ -81,7 +81,6 @@ when a is a TYPEDEF_NAME. It is specified by 6.7.5.3 11. general_identifier: | i = VAR_NAME | i = TYPEDEF_NAME -| i = UNKNOWN_NAME { i } string_literals_list: @@ -443,7 +442,6 @@ gcc_attribute: | gcc_attribute_word LPAREN argument_expression_list? RPAREN {} | gcc_attribute_word LPAREN i = TYPEDEF_NAME COMMA argument_expression_list RPAREN -| gcc_attribute_word LPAREN i = UNKNOWN_NAME COMMA argument_expression_list RPAREN (* This is to emulate GCC's attribute syntax : we make this identifier a var name identifier, so that the parser will see it as a variable reference *) |