Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: d0fd26a2c9b0a8b06ea64a3add04b460df4ed6b6 (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
/*******************************************************************************
 * Copyright (c) 2003, 2004 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Common Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/cpl-v10.html
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.cdt.core.parser;

import java.util.Map;

import org.eclipse.cdt.core.parser.ast.IASTFactory;
import org.eclipse.cdt.internal.core.parser.scanner.IScannerContext;

/**
 * @author jcamelon
 *
 */
public interface IScanner  extends IFilenameProvider {

	public static final String __CPLUSPLUS = "__cplusplus"; //$NON-NLS-1$
	public static final String __STDC_VERSION__ = "__STDC_VERSION__"; //$NON-NLS-1$
	public static final String __STDC_HOSTED__ = "__STDC_HOSTED__"; //$NON-NLS-1$
	public static final String __STDC__ = "__STDC__"; //$NON-NLS-1$
	public static final String __FILE__ = "__FILE__"; //$NON-NLS-1$
	public static final String __TIME__ = "__TIME__"; //$NON-NLS-1$
	public static final String __DATE__ = "__DATE__"; //$NON-NLS-1$
	public static final String __LINE__ = "__LINE__"; //$NON-NLS-1$
	
	public static final int tPOUNDPOUND = -6;
	public static final int tPOUND      = -7;
	
	public void setOffsetBoundary( int offset );
	
	public void setASTFactory( IASTFactory f );
	public void addDefinition(String key, IMacroDescriptor macroToBeAdded );
	public void addDefinition(String key, String value); 
	public IMacroDescriptor getDefinition(String key);
	public Map 				getDefinitions();

	public String[] getIncludePaths();
	public void overwriteIncludePath( String [] newIncludePaths );
	
	public IToken nextToken() throws ScannerException, EndOfFileException;
	public IToken nextToken( boolean next ) throws ScannerException, EndOfFileException;
			
	public int  getCount();
	public int  getDepth();

	public IToken nextTokenForStringizing() throws ScannerException, EndOfFileException;
	public void setTokenizingMacroReplacementList(boolean b);
	public void setThrowExceptionOnBadCharacterRead( boolean throwOnBad );

	/**
	 * @return
	 */
	public boolean isOnTopContext();
	public void setScannerContext(IScannerContext context);

}

Back to the top