Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Kucera2009-01-30 13:31:43 +0000
committerMike Kucera2009-01-30 13:31:43 +0000
commit44907e70565784664cf3c4ab07a658682ff63d96 (patch)
treee78d0cefcf9927c03148b0fe14b383f6d7238e06 /lrparser/org.eclipse.cdt.core.lrparser/grammar/gpp/GPPParser.g
parent8a018e449f2c6a6d9c7186d45b735020d6610e14 (diff)
downloadorg.eclipse.cdt-44907e70565784664cf3c4ab07a658682ff63d96.tar.gz
org.eclipse.cdt-44907e70565784664cf3c4ab07a658682ff63d96.tar.xz
org.eclipse.cdt-44907e70565784664cf3c4ab07a658682ff63d96.zip
added support to LR parsers for GNU extensions typeof and alignof, added ISecondaryParserFactory
Diffstat (limited to 'lrparser/org.eclipse.cdt.core.lrparser/grammar/gpp/GPPParser.g')
-rw-r--r--lrparser/org.eclipse.cdt.core.lrparser/grammar/gpp/GPPParser.g79
1 files changed, 9 insertions, 70 deletions
diff --git a/lrparser/org.eclipse.cdt.core.lrparser/grammar/gpp/GPPParser.g b/lrparser/org.eclipse.cdt.core.lrparser/grammar/gpp/GPPParser.g
index 0939288b92a..22c2ad79dc1 100644
--- a/lrparser/org.eclipse.cdt.core.lrparser/grammar/gpp/GPPParser.g
+++ b/lrparser/org.eclipse.cdt.core.lrparser/grammar/gpp/GPPParser.g
@@ -1,87 +1,26 @@
------------------------------------------------------------------------------------
--- Copyright (c) 2008 IBM Corporation and others.
+----------------------------------------------------------------------------------
+-- Copyright (c) 2008, 2009 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
+-- 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.gpp
%options template=FixedBtParserTemplateD.g
--- For this to work the environment variable LPG_INCLUDE must be set up
--- to point at the directory where the CPPParser.g file is located.
-$Import
- ../cpp/CPPParser.g
-
-$DropRules
-
--- will be replaced by extended asm syntax
-asm_definition
- ::= 'asm' '(' 'stringlit' ')' ';'
-
-
-$End
-
+-- This file is needed because LPG won't allow redefinition of the
+-- start symbol, so CPPGrammar.g cannot define a start symbol.
$Import
- ../gnu/GNUExtensions.g
+ GPPGrammar.g
$End
-$Globals
-/.
- import org.eclipse.cdt.core.dom.lrparser.action.gnu.GNUBuildASTParserAction;
-./
-$End
-
-$Define
-
- $gnu_action_class /. GNUBuildASTParserAction ./
-
-$End
-
-$Rules
-
-
-asm_definition
- ::= extended_asm_declaration
-
-
-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
-
-member_declarator_complete
- ::= attribute_or_decl_specifier_seq member_declarator_complete
- | member_declarator_complete attribute_or_decl_specifier_seq
- | attribute_or_decl_specifier_seq member_declarator_complete attribute_or_decl_specifier_seq
-
-enum_specifier_hook
- ::= attribute_or_decl_specifier_seq
-
-composite_specifier_hook
- ::= attribute_or_decl_specifier_seq
-
-class_name_suffix_hook
- ::= attribute_or_decl_specifier_seq
-
-pointer_hook
- ::= attribute_or_decl_specifier_seq
-
-declarator
- ::= <openscope-ast> ptr_operator_seq attribute_or_decl_specifier_seq direct_declarator
- /. $Build consumeDeclaratorWithPointer(true); $EndBuild ./
-
-elaborated_specifier_hook
- ::= attribute_or_decl_specifier_seq
-
+$Start
+ translation_unit
$End \ No newline at end of file

Back to the top