Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Kucera2009-01-13 15:28:15 -0500
committerMike Kucera2009-01-13 15:28:15 -0500
commit07a63ee282883e072edaaa0b91afbf0ee0b566fa (patch)
tree36cea78330194ca1440ba017c5d2b75aea630676 /lrparser/org.eclipse.cdt.core.lrparser/grammar/gcc/GCCParser.g
parentad36b7caa4c2dfea4345bb2733b6a261d66465b7 (diff)
downloadorg.eclipse.cdt-07a63ee282883e072edaaa0b91afbf0ee0b566fa.tar.gz
org.eclipse.cdt-07a63ee282883e072edaaa0b91afbf0ee0b566fa.tar.xz
org.eclipse.cdt-07a63ee282883e072edaaa0b91afbf0ee0b566fa.zip
started adding support for GNU extensions to LR parsers
Diffstat (limited to 'lrparser/org.eclipse.cdt.core.lrparser/grammar/gcc/GCCParser.g')
-rw-r--r--lrparser/org.eclipse.cdt.core.lrparser/grammar/gcc/GCCParser.g62
1 files changed, 62 insertions, 0 deletions
diff --git a/lrparser/org.eclipse.cdt.core.lrparser/grammar/gcc/GCCParser.g b/lrparser/org.eclipse.cdt.core.lrparser/grammar/gcc/GCCParser.g
new file mode 100644
index 0000000000..1c9da0f3cd
--- /dev/null
+++ b/lrparser/org.eclipse.cdt.core.lrparser/grammar/gcc/GCCParser.g
@@ -0,0 +1,62 @@
+-----------------------------------------------------------------------------------
+-- Copyright (c) 2006, 2008 IBM Corporation and others.
+-- All rights reserved. This program and the accompanying materials
+-- are made available under the terms of the Eclipse Public License v1.0
+-- which accompanies this distribution, and is available at
+-- http://www.eclipse.org/legal/epl-v10.html
+--
+-- Contributors:
+-- IBM Corporation - initial API and implementation
+-----------------------------------------------------------------------------------
+
+%options la=2
+%options package=org.eclipse.cdt.internal.core.dom.lrparser.gcc
+%options template=FixedBtParserTemplateD.g
+
+
+-- For this to work the environment variable LPG_INCLUDE must be set up
+-- to point at the directory where the C99Parser.g file is located.
+$Import
+ ../c99/C99Parser.g
+$End
+
+$Import
+ ../gnu/GNUExtensions.g
+$End
+
+
+
+-- Hook the extensions into the main grammar.
+$Rules
+
+
+no_type_declaration_specifier
+ ::= attribute_or_decl_specifier
+
+complete_declarator
+ ::= attribute_or_decl_specifier_seq declarator
+ | declarator attribute_or_decl_specifier_seq
+ | attribute_or_decl_specifier_seq declarator attribute_or_decl_specifier_seq
+
+complete_struct_declarator
+ ::= attribute_or_decl_specifier_seq struct_declarator
+ | struct_declarator attribute_or_decl_specifier_seq
+ | attribute_or_decl_specifier_seq struct_declarator attribute_or_decl_specifier_seq
+
+enum_specifier_hook
+ ::= attribute_or_decl_specifier_seq
+
+struct_or_union_specifier_hook
+ ::= attribute_or_decl_specifier_seq
+
+struct_or_union_specifier_suffix_hook
+ ::= attribute_or_decl_specifier_seq
+
+pointer_hook
+ ::= attribute_or_decl_specifier_seq
+
+elaborated_specifier_hook
+ ::= attribute_or_decl_specifier_seq
+
+
+$End \ No newline at end of file

Back to the top