Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Kucera2009-02-09 15:14:13 +0000
committerMike Kucera2009-02-09 15:14:13 +0000
commitd511f13deec3ad362065f5339f3dd2587e499410 (patch)
tree0011930401893e098f0b54987ba003236ae62837 /lrparser/org.eclipse.cdt.core.lrparser/grammar/cpp
parent1c7f9d1e3410fe074d4990bcacc7a5ac5529a17e (diff)
downloadorg.eclipse.cdt-d511f13deec3ad362065f5339f3dd2587e499410.tar.gz
org.eclipse.cdt-d511f13deec3ad362065f5339f3dd2587e499410.tar.xz
org.eclipse.cdt-d511f13deec3ad362065f5339f3dd2587e499410.zip
fix for bug 195701 for LR parsers, attributes in namespace definition
Diffstat (limited to 'lrparser/org.eclipse.cdt.core.lrparser/grammar/cpp')
-rw-r--r--lrparser/org.eclipse.cdt.core.lrparser/grammar/cpp/CPPGrammar.g21
1 files changed, 8 insertions, 13 deletions
diff --git a/lrparser/org.eclipse.cdt.core.lrparser/grammar/cpp/CPPGrammar.g b/lrparser/org.eclipse.cdt.core.lrparser/grammar/cpp/CPPGrammar.g
index abccb69efab..4b4b91f23d9 100644
--- a/lrparser/org.eclipse.cdt.core.lrparser/grammar/cpp/CPPGrammar.g
+++ b/lrparser/org.eclipse.cdt.core.lrparser/grammar/cpp/CPPGrammar.g
@@ -1001,23 +1001,18 @@ namespace_name
::= identifier_name
-namespace_definition
- ::= named_namespace_definition
- | unnamed_namespace_definition
-
-
-- In the spec grammar this is broken down into original_namespace_definition and extension_namespace_definition.
-- But since we are not tracking identifiers it becomes the same thing, so its simplified here.
-named_namespace_definition
- ::= 'namespace' namespace_name '{' <openscope-ast> declaration_seq_opt '}'
+namespace_definition
+ ::= 'namespace' namespace_name namespace_definition_hook '{' <openscope-ast> declaration_seq_opt '}'
/. $Build consumeNamespaceDefinition(true); $EndBuild ./
-
-
-unnamed_namespace_definition
- ::= 'namespace' '{' <openscope-ast> declaration_seq_opt '}'
+ | 'namespace' namespace_definition_hook '{' <openscope-ast> declaration_seq_opt '}'
/. $Build consumeNamespaceDefinition(false); $EndBuild ./
-
-
+
+namespace_definition_hook
+ ::= $empty
+
+
namespace_alias_definition
::= 'namespace' identifier_token '=' dcolon_opt nested_name_specifier_opt namespace_name ';'
/. $Build consumeNamespaceAliasDefinition(); $EndBuild ./

Back to the top