Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorqdagans2014-06-20 01:09:30 +0000
committerElena Laskavaia2014-07-06 00:34:13 +0000
commit8649b655701c4e56d00da6ff0f7361ff71572e2b (patch)
tree59f4dea6827b5ff1ca085ff5895644a64004a25c /lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse
parent92c9224591743885ca263ed2d372368e8245b697 (diff)
downloadorg.eclipse.cdt-8649b655701c4e56d00da6ff0f7361ff71572e2b.tar.gz
org.eclipse.cdt-8649b655701c4e56d00da6ff0f7361ff71572e2b.tar.xz
org.eclipse.cdt-8649b655701c4e56d00da6ff0f7361ff71572e2b.zip
Bug 84144 - [Parser2] GCC: labels as values
Add support for GNU goto label references. "http://gcc.gnu.org/onlinedocs/gcc-3.3.2/gcc/Labels-as-Values.html#Labels%20as%20Values GCC extensions to C allow taking the address of labels. These addresses can be used in a goto statement where any expression of type void * is allowed: foo: void* labelPtr = &&foo; goto *labelPtr;", comment from Andrew Niefer Add new classes and necessary changes in existing classes to support the above. Change-Id: I60b64957af3fdfd5463e89c2a36eea13bd280887 Signed-off-by: qdagans <anders.xb.dahlberg@ericsson.com> Reviewed-on: https://git.eclipse.org/r/28826 Tested-by: Hudson CI Reviewed-by: Elena Laskavaia <elaskavaia.cdt@gmail.com>
Diffstat (limited to 'lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse')
-rw-r--r--lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/action/BuildASTParserAction.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/action/BuildASTParserAction.java b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/action/BuildASTParserAction.java
index 0ff7eb74b4..422dfd265f 100644
--- a/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/action/BuildASTParserAction.java
+++ b/lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/action/BuildASTParserAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2010 IBM Corporation and others.
+ * Copyright (c) 2006, 2014 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
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Anders Dahlberg (Ericsson) - bug 84144
*******************************************************************************/
package org.eclipse.cdt.core.dom.lrparser.action;
@@ -44,7 +45,6 @@ import org.eclipse.cdt.core.dom.ast.IASTExpressionStatement;
import org.eclipse.cdt.core.dom.ast.IASTFieldDeclarator;
import org.eclipse.cdt.core.dom.ast.IASTFunctionCallExpression;
import org.eclipse.cdt.core.dom.ast.IASTFunctionDeclarator;
-import org.eclipse.cdt.core.dom.ast.IASTGotoStatement;
import org.eclipse.cdt.core.dom.ast.IASTIdExpression;
import org.eclipse.cdt.core.dom.ast.IASTInitializer;
import org.eclipse.cdt.core.dom.ast.IASTInitializerClause;
@@ -598,7 +598,7 @@ public abstract class BuildASTParserAction extends AbstractParserAction {
*/
public void consumeStatementGoto() {
IASTName name = createName(stream.getRuleTokens().get(1));
- IASTGotoStatement gotoStat = nodeFactory.newGotoStatement(name);
+ IASTStatement gotoStat = nodeFactory.newGotoStatement(name);
setOffsetAndLength(gotoStat);
astStack.push(gotoStat);
}

Back to the top