Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'xlc/org.eclipse.cdt.core.lrparser.xlc/grammar/xlc/XlcCPPParser.g')
-rw-r--r--xlc/org.eclipse.cdt.core.lrparser.xlc/grammar/xlc/XlcCPPParser.g60
1 files changed, 60 insertions, 0 deletions
diff --git a/xlc/org.eclipse.cdt.core.lrparser.xlc/grammar/xlc/XlcCPPParser.g b/xlc/org.eclipse.cdt.core.lrparser.xlc/grammar/xlc/XlcCPPParser.g
new file mode 100644
index 00000000000..9e57880a5f5
--- /dev/null
+++ b/xlc/org.eclipse.cdt.core.lrparser.xlc/grammar/xlc/XlcCPPParser.g
@@ -0,0 +1,60 @@
+-----------------------------------------------------------------------------------
+-- Copyright (c) 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
+--
+-- Contributors:
+-- IBM Corporation - initial API and implementation
+-----------------------------------------------------------------------------------
+
+%options la=2
+%options package=org.eclipse.cdt.internal.core.lrparser.xlc.cpp
+%options template=LRParserTemplate.g
+
+
+$Import
+ GPPGrammar.g
+$End
+
+$Import
+ XlcGrammarExtensions.g
+$End
+
+$Globals
+/.
+ import org.eclipse.cdt.core.lrparser.xlc.action.XlcCPPBuildASTParserAction;
+ import org.eclipse.cdt.core.dom.lrparser.action.gnu.GPPSecondaryParserFactory;
+ import org.eclipse.cdt.internal.core.lrparser.xlc.ast.XlcCPPNodeFactory;
+./
+$End
+
+$Define
+
+ $build_action_class /. XlcCPPBuildASTParserAction ./
+ $parser_factory_create_expression /. GPPSecondaryParserFactory.getDefault() ./
+ $node_factory_create_expression /. XlcCPPNodeFactory.getDefault() ./
+
+$End
+
+$Start
+ translation_unit
+$End
+
+$Rules
+
+block_declaration
+ ::= vector_declaration
+
+
+identifier_token
+ ::= 'vector'
+ | 'pixel'
+
+
+specifier_qualifier
+ ::= 'typedef'
+ /. $Build consumeToken(); $EndBuild ./
+
+$End \ No newline at end of file

Back to the top