Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: a1d5a2732a1de20cb8d65ff433d40eca62f9b384 (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
/*******************************************************************************
 * Copyright (c) 2002, 2013 IBM Corporation and others.
 *
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors:
 *     IBM Rational Software - Initial API and implementation
 *     Anton Leherbauer (Wind River Systems)
 *     Markus Schorn (Wind River Systems)
 *******************************************************************************/
package org.eclipse.cdt.core.parser;

import java.util.Collections;
import java.util.Map;

/**
 * Implementation of the {@link IScannerInfo} interface. Allows to configure the preprocessor.
 */
public class ScannerInfo implements IScannerInfo {
	private final Map<String, String> definedSymbols; 
	private final String[] includePaths; 
	
	public ScannerInfo() {
		this(null, null);
	}
	
	public ScannerInfo(Map<String, String> macroDefinitions) {
		this(macroDefinitions, null);
	}

	public ScannerInfo(Map<String, String> macroDefinitions, String[] includeSearchPath) {
		definedSymbols = macroDefinitions != null ? macroDefinitions : Collections.<String, String>emptyMap();
		includePaths = includeSearchPath != null ? includeSearchPath : new String[] {};
	}
		
    @Override
	public Map<String, String> getDefinedSymbols() {
        return definedSymbols;
    }

    @Override
	public String[] getIncludePaths() {
        return includePaths;
    }
}

Back to the top