Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: a68aa347e250f143bc9f46953dd093ec0dbb6081 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/*******************************************************************************
 * Copyright (c) 2006, 2007 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
 *******************************************************************************/
package org.eclipse.cdt.core.dom.parser.upc;

import org.eclipse.cdt.core.dom.ast.c.ICASTCompositeTypeSpecifier;
import org.eclipse.cdt.core.dom.ast.c.ICASTElaboratedTypeSpecifier;
import org.eclipse.cdt.core.dom.ast.c.ICASTEnumerationSpecifier;
import org.eclipse.cdt.core.dom.ast.c.ICASTSimpleDeclSpecifier;
import org.eclipse.cdt.core.dom.ast.c.ICASTTypedefNameSpecifier;
import org.eclipse.cdt.core.dom.parser.c99.C99ASTNodeFactory;
import org.eclipse.cdt.core.dom.upc.ast.IUPCASTForallStatement;
import org.eclipse.cdt.core.dom.upc.ast.IUPCASTKeywordExpression;
import org.eclipse.cdt.core.dom.upc.ast.IUPCASTSizeofExpression;
import org.eclipse.cdt.core.dom.upc.ast.IUPCASTSynchronizationStatement;
import org.eclipse.cdt.internal.core.dom.parser.upc.ast.UPCASTCompositeTypeSpecifier;
import org.eclipse.cdt.internal.core.dom.parser.upc.ast.UPCASTElaboratedTypeSpecifier;
import org.eclipse.cdt.internal.core.dom.parser.upc.ast.UPCASTEnumerationSpecifier;
import org.eclipse.cdt.internal.core.dom.parser.upc.ast.UPCASTForallStatement;
import org.eclipse.cdt.internal.core.dom.parser.upc.ast.UPCASTKeywordExpression;
import org.eclipse.cdt.internal.core.dom.parser.upc.ast.UPCASTSimpleDeclSpecifier;
import org.eclipse.cdt.internal.core.dom.parser.upc.ast.UPCASTSizeofExpression;
import org.eclipse.cdt.internal.core.dom.parser.upc.ast.UPCASTSynchronizationStatement;
import org.eclipse.cdt.internal.core.dom.parser.upc.ast.UPCASTTypedefNameSpecifier;


/**
 * Creates AST nodes that are specific to the UPC parser.
 * 
 * The methods in ASTNodeFactory that build nodes for declaration
 * specifiers are overridden here to replace thos nodes with the UPC nodes for
 * declaration specifiers. These UPC specific nodes add support
 * for 'strict', 'relaxed' and 'shared'.
 */
public class UPCASTNodeFactory extends C99ASTNodeFactory {

	public IUPCASTKeywordExpression newKeywordExpression() {
		return new UPCASTKeywordExpression();
	}
	
	public IUPCASTSizeofExpression newSizeofExpression() {
		return new UPCASTSizeofExpression();
	}
	
	public IUPCASTSynchronizationStatement newSyncronizationStatment() {
		return new UPCASTSynchronizationStatement();
	}
	
	public IUPCASTForallStatement newForallStatement() {
		return new UPCASTForallStatement();
	}

	/**
	 * Override to return UPC version of decl specifier.
	 */
	public ICASTSimpleDeclSpecifier newCSimpleDeclSpecifier() {
		return new UPCASTSimpleDeclSpecifier();
	}
	
	public ICASTCompositeTypeSpecifier newCCompositeTypeSpecifier() {
		return new UPCASTCompositeTypeSpecifier();
	}
	
	public ICASTElaboratedTypeSpecifier newCElaboratedTypeSpecifier() {
		return new UPCASTElaboratedTypeSpecifier();
	}
	
	public ICASTEnumerationSpecifier newCEnumerationSpecifier() {
		return new UPCASTEnumerationSpecifier();
	}
	
	public ICASTTypedefNameSpecifier newCTypedefNameSpecifier() {
		return new UPCASTTypedefNameSpecifier();
	}

}

Back to the top