Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] Applied [HEAD] - Isolating the Parser from Eclipse

We have gotten numerous requests (internally and externally) to provide a 
separate jarfile for the CDT parser so that it can be used outside of 
Eclipse. 
This patch addresses this concern, and cleans up the public ParserFactory 
interface a bit. 

To build the standalone cdtparser.jar, all you need to do is the typical 
plugin build: 
select the plugin.xml and right click, selecting the menu action Create 
Ant Build File
select the build.xml file that was generated, right click, selecting the 
menu action Run Ant ... 

If you don't plan on building it and you just want to use it for the time 
being, you will be able to get it from any of our loadbuild distributions 
(for 2.0 only). 

CORE
        Cleaned up the ParserFactory interface to check for validity of 
input arguments. 
        Moved NullSourceElementRequestor and ScannerInfo to public 
interface as requested. 
        Restructured code so that no Eclipse/CDT source outside the parser 
source directory is used.
        Updated parser clients to use new ParserFactory (stand-alone 
parser work item). 

UI & TESTS
        Updated parser clients to use new ParserFactory (stand-alone 
parser work item). 

JohnC


Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui/ChangeLog,v
retrieving revision 1.215
diff -u -r1.215 ChangeLog
--- ChangeLog	5 Nov 2003 18:15:16 -0000	1.215
+++ ChangeLog	5 Nov 2003 23:33:56 -0000
@@ -1,4 +1,7 @@
 2003-11-05 John Camelon
+	Updated parser clients to use new ParserFactory (stand-alone parser work item).  	
+	
+2003-11-05 John Camelon
 	Updated parser clients to use new IProblem strategy.  
 
 2003-10-28 Andrew Niefer
Index: src/org/eclipse/cdt/internal/ui/compare/CStructureCreator.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/compare/CStructureCreator.java,v
retrieving revision 1.7
diff -u -r1.7 CStructureCreator.java
--- src/org/eclipse/cdt/internal/ui/compare/CStructureCreator.java	8 Sep 2003 18:11:00 -0000	1.7
+++ src/org/eclipse/cdt/internal/ui/compare/CStructureCreator.java	5 Nov 2003 23:34:00 -0000
@@ -12,13 +12,14 @@
 import java.io.StringReader;
 
 import org.eclipse.cdt.core.model.ICElement;
+import org.eclipse.cdt.core.parser.ParserUtil;
 import org.eclipse.cdt.core.parser.IParser;
 import org.eclipse.cdt.core.parser.IScanner;
 import org.eclipse.cdt.core.parser.ISourceElementRequestor;
-import org.eclipse.cdt.core.parser.ParserLanguage;
 import org.eclipse.cdt.core.parser.ParserFactory;
+import org.eclipse.cdt.core.parser.ParserLanguage;
 import org.eclipse.cdt.core.parser.ParserMode;
-import org.eclipse.cdt.internal.core.parser.ScannerInfo;
+import org.eclipse.cdt.core.parser.ScannerInfo;
 import org.eclipse.cdt.ui.CUIPlugin;
 import org.eclipse.compare.IEditableContent;
 import org.eclipse.compare.IStreamContentAccessor;
@@ -72,13 +73,15 @@
 			//are bugs while parsing C files, we might want to create a separate Structure
 			//compare for c files, but we'll never be completely right about .h files
 			IScanner scanner =
-				ParserFactory.createScanner(new StringReader(s), "code", new ScannerInfo(), ParserMode.QUICK_PARSE, ParserLanguage.CPP, builder);
-			IParser parser = ParserFactory.createParser(scanner, builder, ParserMode.QUICK_PARSE, ParserLanguage.CPP );
+				ParserFactory.createScanner(new StringReader(s), "code", new ScannerInfo(), ParserMode.QUICK_PARSE, ParserLanguage.CPP, builder,ParserUtil.getParserLogService());
+			IParser parser = ParserFactory.createParser(scanner, builder, ParserMode.QUICK_PARSE, ParserLanguage.CPP, ParserUtil.getParserLogService() );
 			parser.parse();
 		} catch (Exception e) {
 			// What to do when error ?
 			// The CParseTreeBuilder will throw CParseTreeBuilder.ParseError
 			// for acceptProblem.
+			
+			//TODO : New : ParserFactoryException gets thrown by ParserFactory primitives
 		}
 
 		return root;
Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core.tests/ChangeLog,v
retrieving revision 1.138
diff -u -r1.138 ChangeLog
--- ChangeLog	5 Nov 2003 18:15:21 -0000	1.138
+++ ChangeLog	5 Nov 2003 23:33:33 -0000
@@ -1,4 +1,7 @@
 2003-11-05 John Camelon
+	Updated parser clients to use new ParserFactory (stand-alone parser work item).  	
+
+2003-11-05 John Camelon
 	Updated parser clients to use new IProblem strategy.  
 
 2003-10-28 Andrew Niefer
Index: build/org/eclipse/cdt/core/build/managed/tests/ManagedBuildTests.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core.tests/build/org/eclipse/cdt/core/build/managed/tests/ManagedBuildTests.java,v
retrieving revision 1.14
diff -u -r1.14 ManagedBuildTests.java
--- build/org/eclipse/cdt/core/build/managed/tests/ManagedBuildTests.java	1 Oct 2003 23:56:13 -0000	1.14
+++ build/org/eclipse/cdt/core/build/managed/tests/ManagedBuildTests.java	5 Nov 2003 23:33:34 -0000
@@ -28,10 +28,10 @@
 import org.eclipse.cdt.core.parser.IScannerInfoChangeListener;
 import org.eclipse.cdt.core.parser.IScannerInfoProvider;
 import org.eclipse.cdt.core.parser.ISourceElementRequestor;
+import org.eclipse.cdt.core.parser.NullSourceElementRequestor;
 import org.eclipse.cdt.core.parser.ParserFactory;
 import org.eclipse.cdt.core.parser.ParserLanguage;
 import org.eclipse.cdt.core.parser.ParserMode;
-import org.eclipse.cdt.internal.core.parser.NullSourceElementRequestor;
 import org.eclipse.cdt.managedbuilder.core.BuildException;
 import org.eclipse.cdt.managedbuilder.core.IConfiguration;
 import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
@@ -982,9 +982,9 @@
 		ISourceElementRequestor callback = new NullSourceElementRequestor();
 		
 		IScanner scanner = ParserFactory.createScanner( new StringReader( "#include <header.h>\n int A::i = 1;" ), 
-														"TEST", info, ParserMode.COMPLETE_PARSE, ParserLanguage.CPP, callback );
+														"TEST", info, ParserMode.COMPLETE_PARSE, ParserLanguage.CPP, callback, null);
 		
-		IParser parser = ParserFactory.createParser( scanner, callback, ParserMode.COMPLETE_PARSE, ParserLanguage.CPP );
+		IParser parser = ParserFactory.createParser( scanner, callback, ParserMode.COMPLETE_PARSE, ParserLanguage.CPP, null );
 		assertTrue( parser.parse() );
 	}
 	
Index: parser/org/eclipse/cdt/core/parser/tests/AutomatedFramework.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/AutomatedFramework.java,v
retrieving revision 1.2
diff -u -r1.2 AutomatedFramework.java
--- parser/org/eclipse/cdt/core/parser/tests/AutomatedFramework.java	17 Jul 2003 20:15:02 -0000	1.2
+++ parser/org/eclipse/cdt/core/parser/tests/AutomatedFramework.java	5 Nov 2003 23:33:34 -0000
@@ -25,7 +25,7 @@
 import junit.framework.TestSuite;
 
 import org.eclipse.cdt.core.parser.ISourceElementRequestor;
-import org.eclipse.cdt.internal.core.parser.NullSourceElementRequestor;
+import org.eclipse.cdt.core.parser.NullSourceElementRequestor;
 
 /**
  * @author aniefer
Index: parser/org/eclipse/cdt/core/parser/tests/AutomatedTest.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/AutomatedTest.java,v
retrieving revision 1.6
diff -u -r1.6 AutomatedTest.java
--- parser/org/eclipse/cdt/core/parser/tests/AutomatedTest.java	8 Sep 2003 18:10:55 -0000	1.6
+++ parser/org/eclipse/cdt/core/parser/tests/AutomatedTest.java	5 Nov 2003 23:33:34 -0000
@@ -23,10 +23,10 @@
 
 import org.eclipse.cdt.core.parser.ILineOffsetReconciler;
 import org.eclipse.cdt.core.parser.IParser;
-import org.eclipse.cdt.core.parser.ParserLanguage;
 import org.eclipse.cdt.core.parser.ParserFactory;
+import org.eclipse.cdt.core.parser.ParserLanguage;
 import org.eclipse.cdt.core.parser.ParserMode;
-import org.eclipse.cdt.internal.core.parser.ScannerInfo;
+import org.eclipse.cdt.core.parser.ScannerInfo;
 import org.eclipse.core.runtime.Path;
 
 
@@ -58,7 +58,7 @@
 
 			String filePath = file.getCanonicalPath();
 			ParserLanguage language = ((String)natures.get( filePath )).equalsIgnoreCase("cpp") ? ParserLanguage.CPP : ParserLanguage.C;
-			parser = ParserFactory.createParser( ParserFactory.createScanner( new InputStreamReader (stream), filePath, new ScannerInfo(), ParserMode.QUICK_PARSE, language, nullCallback ), nullCallback, ParserMode.QUICK_PARSE, language);
+			parser = ParserFactory.createParser( ParserFactory.createScanner( new InputStreamReader (stream), filePath, new ScannerInfo(), ParserMode.QUICK_PARSE, language, nullCallback, null ), nullCallback, ParserMode.QUICK_PARSE, language, null);
 						
 			mapping = ParserFactory.createLineOffsetReconciler( new InputStreamReader( stream ) );
 			
Index: parser/org/eclipse/cdt/core/parser/tests/BaseASTTest.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/BaseASTTest.java,v
retrieving revision 1.11
diff -u -r1.11 BaseASTTest.java
--- parser/org/eclipse/cdt/core/parser/tests/BaseASTTest.java	24 Oct 2003 17:49:22 -0000	1.11
+++ parser/org/eclipse/cdt/core/parser/tests/BaseASTTest.java	5 Nov 2003 23:33:34 -0000
@@ -17,9 +17,11 @@
 
 import org.eclipse.cdt.core.parser.IParser;
 import org.eclipse.cdt.core.parser.IQuickParseCallback;
-import org.eclipse.cdt.core.parser.ParserLanguage;
 import org.eclipse.cdt.core.parser.ParserFactory;
+import org.eclipse.cdt.core.parser.ParserFactoryException;
+import org.eclipse.cdt.core.parser.ParserLanguage;
 import org.eclipse.cdt.core.parser.ParserMode;
+import org.eclipse.cdt.core.parser.ScannerInfo;
 import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException;
 import org.eclipse.cdt.core.parser.ast.IASTCompilationUnit;
 import org.eclipse.cdt.core.parser.ast.IASTDeclaration;
@@ -29,7 +31,6 @@
 import org.eclipse.cdt.core.parser.ast.IASTTypedefDeclaration;
 import org.eclipse.cdt.core.parser.ast.IASTVariable;
 import org.eclipse.cdt.internal.core.parser.ParserException;
-import org.eclipse.cdt.internal.core.parser.ScannerInfo;
 
 /**
  * @author jcamelon
@@ -45,38 +46,38 @@
 	protected IQuickParseCallback quickParseCallback; 
 	protected IParser parser; 
 	
-	protected IASTCompilationUnit parse( String code, boolean quick, boolean throwExceptionOnError, ParserLanguage lang ) throws ParserException
+	protected IASTCompilationUnit parse( String code, boolean quick, boolean throwExceptionOnError, ParserLanguage lang ) throws ParserException, ParserFactoryException
 	{
 		ParserMode mode = quick ? ParserMode.QUICK_PARSE : ParserMode.COMPLETE_PARSE; 
 		quickParseCallback = ParserFactory.createQuickParseCallback(); 
-		parser = ParserFactory.createParser( ParserFactory.createScanner( new StringReader( code ), "code", new ScannerInfo(), mode, lang, quickParseCallback), quickParseCallback, mode, lang );
+		parser = ParserFactory.createParser( ParserFactory.createScanner( new StringReader( code ), "code", new ScannerInfo(), mode, lang, quickParseCallback, null), quickParseCallback, mode, lang, null );
 		if( ! parser.parse() && throwExceptionOnError )
 			throw new ParserException("Parse failure");
 		return quickParseCallback.getCompilationUnit(); 		
 	}
 	
 	
-	protected IASTCompilationUnit parse( String code, boolean quick, boolean throwExceptionOnError ) throws ParserException
+	protected IASTCompilationUnit parse( String code, boolean quick, boolean throwExceptionOnError ) throws ParserException, ParserFactoryException
 	{
 		return parse( code, quick, throwExceptionOnError, ParserLanguage.CPP );
 	}
 	
-	protected IASTCompilationUnit parse( String code )throws ParserException
+	protected IASTCompilationUnit parse( String code )throws ParserException, ParserFactoryException
 	{
 		return parse( code, true, true );
 	}
 	
-	protected IASTCompilationUnit fullParse( String code ) throws ParserException
+	protected IASTCompilationUnit fullParse( String code ) throws ParserException, ParserFactoryException
 	{
 		return parse( code, false, true );
 	}
 	
-	protected IASTDeclaration assertSoleDeclaration( String code ) throws ParserException
+	protected IASTDeclaration assertSoleDeclaration( String code ) throws ParserException, ParserFactoryException
 	{
 		return assertSoleDeclaration( code, ParserLanguage.CPP );
 	}	
 	
-	protected IASTDeclaration assertSoleDeclaration( String code, ParserLanguage language ) throws ParserException
+	protected IASTDeclaration assertSoleDeclaration( String code, ParserLanguage language ) throws ParserException, ParserFactoryException
 	{
 		Iterator declarationIter = null;
         try
Index: parser/org/eclipse/cdt/core/parser/tests/BaseScannerTest.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/BaseScannerTest.java,v
retrieving revision 1.9
diff -u -r1.9 BaseScannerTest.java
--- parser/org/eclipse/cdt/core/parser/tests/BaseScannerTest.java	5 Nov 2003 18:15:21 -0000	1.9
+++ parser/org/eclipse/cdt/core/parser/tests/BaseScannerTest.java	5 Nov 2003 23:33:34 -0000
@@ -18,12 +18,13 @@
 import org.eclipse.cdt.core.parser.EndOfFile;
 import org.eclipse.cdt.core.parser.IScanner;
 import org.eclipse.cdt.core.parser.IToken;
-import org.eclipse.cdt.core.parser.ParserLanguage;
+import org.eclipse.cdt.core.parser.NullSourceElementRequestor;
 import org.eclipse.cdt.core.parser.ParserFactory;
+import org.eclipse.cdt.core.parser.ParserFactoryException;
+import org.eclipse.cdt.core.parser.ParserLanguage;
 import org.eclipse.cdt.core.parser.ParserMode;
 import org.eclipse.cdt.core.parser.ScannerException;
-import org.eclipse.cdt.internal.core.parser.NullSourceElementRequestor;
-import org.eclipse.cdt.internal.core.parser.ScannerInfo;
+import org.eclipse.cdt.core.parser.ScannerInfo;
 
 /**
  * @author jcamelon
@@ -38,13 +39,13 @@
 		super(x);
 	}
 
-	protected void initializeScanner( String input, ParserMode mode )
+	protected void initializeScanner( String input, ParserMode mode ) throws ParserFactoryException
 	{
-		scanner= ParserFactory.createScanner( new StringReader(input),"TEXT", new ScannerInfo(), mode, ParserLanguage.CPP, new NullSourceElementRequestor( mode ) );
+		scanner= ParserFactory.createScanner( new StringReader(input),"TEXT", new ScannerInfo(), mode, ParserLanguage.CPP, new NullSourceElementRequestor( mode ), null );
 	}
 
 
-	protected void initializeScanner(String input)
+	protected void initializeScanner(String input) throws ParserFactoryException
 	{
        initializeScanner( input, ParserMode.COMPLETE_PARSE );
 	}
Index: parser/org/eclipse/cdt/core/parser/tests/CompleteParseBaseTest.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseBaseTest.java,v
retrieving revision 1.11
diff -u -r1.11 CompleteParseBaseTest.java
--- parser/org/eclipse/cdt/core/parser/tests/CompleteParseBaseTest.java	5 Nov 2003 18:15:21 -0000	1.11
+++ parser/org/eclipse/cdt/core/parser/tests/CompleteParseBaseTest.java	5 Nov 2003 23:33:34 -0000
@@ -26,8 +26,10 @@
 import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate;
 import org.eclipse.cdt.core.parser.ISourceElementRequestor;
 import org.eclipse.cdt.core.parser.ParserFactory;
+import org.eclipse.cdt.core.parser.ParserFactoryException;
 import org.eclipse.cdt.core.parser.ParserLanguage;
 import org.eclipse.cdt.core.parser.ParserMode;
+import org.eclipse.cdt.core.parser.ScannerInfo;
 import org.eclipse.cdt.core.parser.ast.IASTASMDefinition;
 import org.eclipse.cdt.core.parser.ast.IASTAbstractTypeSpecifierDeclaration;
 import org.eclipse.cdt.core.parser.ast.IASTClassReference;
@@ -64,7 +66,6 @@
 import org.eclipse.cdt.core.parser.ast.IASTVariable;
 import org.eclipse.cdt.core.parser.ast.IASTVariableReference;
 import org.eclipse.cdt.internal.core.parser.ParserException;
-import org.eclipse.cdt.internal.core.parser.ScannerInfo;
 
 /**
  * @author jcamelon
@@ -672,22 +673,22 @@
     }
     protected FullParseCallback callback;
     
-    protected IASTScope parse( String code ) throws ParserException
+    protected IASTScope parse( String code ) throws ParserException, ParserFactoryException
     {
     	return parse( code, true, ParserLanguage.CPP );
     }
     
-    protected IASTScope parse( String code, boolean throwOnError ) throws ParserException
+    protected IASTScope parse( String code, boolean throwOnError ) throws ParserException, ParserFactoryException
     {
     	return parse( code, throwOnError, ParserLanguage.CPP );
     }
     
-    protected IASTScope parse(String code, boolean throwOnError, ParserLanguage language) throws ParserException
+    protected IASTScope parse(String code, boolean throwOnError, ParserLanguage language) throws ParserException, ParserFactoryException
     {
     	callback = new FullParseCallback(); 
     	IParser parser = ParserFactory.createParser( 
     		ParserFactory.createScanner( new StringReader( code ), "test-code", new ScannerInfo(),
-    			ParserMode.COMPLETE_PARSE, language, callback ), callback, ParserMode.COMPLETE_PARSE, language	
+    			ParserMode.COMPLETE_PARSE, language, callback, null ), callback, ParserMode.COMPLETE_PARSE, language, null 	
     		);
     	if( ! parser.parse() && throwOnError ) throw new ParserException( "FAILURE");
         return callback.getCompilationUnit();
Index: parser/org/eclipse/cdt/core/parser/tests/ExprEvalTest.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ExprEvalTest.java,v
retrieving revision 1.8
diff -u -r1.8 ExprEvalTest.java
--- parser/org/eclipse/cdt/core/parser/tests/ExprEvalTest.java	8 Sep 2003 18:10:55 -0000	1.8
+++ parser/org/eclipse/cdt/core/parser/tests/ExprEvalTest.java	5 Nov 2003 23:33:34 -0000
@@ -7,12 +7,12 @@
 import junit.framework.TestSuite;
 
 import org.eclipse.cdt.core.parser.IParser;
+import org.eclipse.cdt.core.parser.NullSourceElementRequestor;
 import org.eclipse.cdt.core.parser.ParserLanguage;
 import org.eclipse.cdt.core.parser.ParserFactory;
 import org.eclipse.cdt.core.parser.ParserMode;
 import org.eclipse.cdt.core.parser.ast.IASTExpression;
-import org.eclipse.cdt.internal.core.parser.NullSourceElementRequestor;
-import org.eclipse.cdt.internal.core.parser.ScannerInfo;
+import org.eclipse.cdt.core.parser.ScannerInfo;
 
 public class ExprEvalTest extends TestCase {
 
@@ -27,7 +27,7 @@
 	public void runTest(String code, int expectedValue) throws Exception {
 		
 		final NullSourceElementRequestor nullCallback = new NullSourceElementRequestor();
-        IParser parser = ParserFactory.createParser(ParserFactory.createScanner( new StringReader( code ), null, new ScannerInfo(), null, ParserLanguage.CPP, nullCallback ), nullCallback, ParserMode.QUICK_PARSE, ParserLanguage.CPP );
+        IParser parser = ParserFactory.createParser(ParserFactory.createScanner( new StringReader( code ), getClass().getName(), new ScannerInfo(), null, ParserLanguage.CPP, nullCallback, null ), nullCallback, ParserMode.QUICK_PARSE, ParserLanguage.CPP, null );
 		IASTExpression expression = parser.expression(null);
 		assertEquals(expectedValue, expression.evaluateExpression());
 	}
Index: parser/org/eclipse/cdt/core/parser/tests/FractionalAutomatedTest.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/FractionalAutomatedTest.java,v
retrieving revision 1.6
diff -u -r1.6 FractionalAutomatedTest.java
--- parser/org/eclipse/cdt/core/parser/tests/FractionalAutomatedTest.java	8 Sep 2003 18:10:55 -0000	1.6
+++ parser/org/eclipse/cdt/core/parser/tests/FractionalAutomatedTest.java	5 Nov 2003 23:33:34 -0000
@@ -23,10 +23,10 @@
 import junit.framework.Test;
 
 import org.eclipse.cdt.core.parser.IParser;
-import org.eclipse.cdt.core.parser.ParserLanguage;
 import org.eclipse.cdt.core.parser.ParserFactory;
+import org.eclipse.cdt.core.parser.ParserLanguage;
 import org.eclipse.cdt.core.parser.ParserMode;
-import org.eclipse.cdt.internal.core.parser.ScannerInfo;
+import org.eclipse.cdt.core.parser.ScannerInfo;
 import org.eclipse.core.runtime.Path;
 
 /**
@@ -241,7 +241,7 @@
 				result = null;
 				ParserLanguage language = cppNature ? ParserLanguage.CPP : ParserLanguage.C;
 				IParser parser = ParserFactory.createParser( 
-					ParserFactory.createScanner( new StringReader( code ), null, new ScannerInfo(), ParserMode.QUICK_PARSE, language, nullCallback ), nullCallback, ParserMode.QUICK_PARSE, language);
+					ParserFactory.createScanner( new StringReader( code ), null, new ScannerInfo(), ParserMode.QUICK_PARSE, language, nullCallback, null ), nullCallback, ParserMode.QUICK_PARSE, language, null );
 				
 				parser.parse();
 			} catch ( Exception e ){
Index: parser/org/eclipse/cdt/core/parser/tests/PreprocessorConditionalTest.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/PreprocessorConditionalTest.java,v
retrieving revision 1.4
diff -u -r1.4 PreprocessorConditionalTest.java
--- parser/org/eclipse/cdt/core/parser/tests/PreprocessorConditionalTest.java	8 Sep 2003 18:10:55 -0000	1.4
+++ parser/org/eclipse/cdt/core/parser/tests/PreprocessorConditionalTest.java	5 Nov 2003 23:33:34 -0000
@@ -17,12 +17,12 @@
 import org.eclipse.cdt.core.parser.EndOfFile;
 import org.eclipse.cdt.core.parser.ISourceElementRequestor;
 import org.eclipse.cdt.core.parser.IToken;
-import org.eclipse.cdt.core.parser.ParserLanguage;
+import org.eclipse.cdt.core.parser.NullSourceElementRequestor;
 import org.eclipse.cdt.core.parser.ParserFactory;
+import org.eclipse.cdt.core.parser.ParserLanguage;
 import org.eclipse.cdt.core.parser.ParserMode;
 import org.eclipse.cdt.core.parser.ScannerException;
-import org.eclipse.cdt.internal.core.parser.NullSourceElementRequestor;
-import org.eclipse.cdt.internal.core.parser.ScannerInfo;
+import org.eclipse.cdt.core.parser.ScannerInfo;
 
 /**
  * @author jcamelon
@@ -34,13 +34,13 @@
 	private ISourceElementRequestor nullSourceElementRequestor = new NullSourceElementRequestor();
 
 
-    protected void initializeScanner(String input, Map definitions )
+    protected void initializeScanner(String input, Map definitions ) throws Exception
 	{
-		scanner= ParserFactory.createScanner( new StringReader(input),"TEXT", new ScannerInfo( definitions, null), ParserMode.COMPLETE_PARSE, ParserLanguage.CPP, nullSourceElementRequestor );
+		scanner= ParserFactory.createScanner( new StringReader(input),"TEXT", new ScannerInfo( definitions, null), ParserMode.COMPLETE_PARSE, ParserLanguage.CPP, nullSourceElementRequestor, null );
 	}
 
 
-	protected void evaluateConditionalsPositive( String conditional, Map definitions )
+	protected void evaluateConditionalsPositive( String conditional, Map definitions ) throws Exception
 	{
 		 
 		StringBuffer buff = new StringBuffer(); 
@@ -51,7 +51,7 @@
 		evaluate(); 
 	}
 
-	protected void evaluateConditionalsNegative( String conditional, Map definitions )
+	protected void evaluateConditionalsNegative( String conditional, Map definitions )throws Exception
 	{
 		
 		StringBuffer buff = new StringBuffer(); 
@@ -94,7 +94,7 @@
         super(x);
     }
     
-    public void testConditionals()
+    public void testConditionals()throws Exception
     {
     	Map definitions = new HashMap();
     	definitions.put( "DEFED", "" );
Index: parser/org/eclipse/cdt/core/parser/tests/PreprocessorTest.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/PreprocessorTest.java,v
retrieving revision 1.7
diff -u -r1.7 PreprocessorTest.java
--- parser/org/eclipse/cdt/core/parser/tests/PreprocessorTest.java	15 Sep 2003 22:50:59 -0000	1.7
+++ parser/org/eclipse/cdt/core/parser/tests/PreprocessorTest.java	5 Nov 2003 23:33:34 -0000
@@ -19,12 +19,12 @@
 
 import org.eclipse.cdt.core.parser.IPreprocessor;
 import org.eclipse.cdt.core.parser.ISourceElementRequestor;
+import org.eclipse.cdt.core.parser.NullSourceElementRequestor;
 import org.eclipse.cdt.core.parser.ParserLanguage;
 import org.eclipse.cdt.core.parser.ParserFactory;
 import org.eclipse.cdt.core.parser.ParserMode;
 import org.eclipse.cdt.core.parser.ast.IASTInclusion;
-import org.eclipse.cdt.internal.core.parser.NullSourceElementRequestor;
-import org.eclipse.cdt.internal.core.parser.ScannerInfo;
+import org.eclipse.cdt.core.parser.ScannerInfo;
 
 /**
  * @author jcamelon
@@ -75,7 +75,7 @@
 	public IPreprocessor setupPreprocessor( String text, List includePaths, Map defns, ISourceElementRequestor rq )
 	{
 		IPreprocessor p = ParserFactory.createPreprocessor( new StringReader( text ), "test", new ScannerInfo( defns, 
-				includePaths == null ? null : (String [])includePaths.toArray()), ParserMode.COMPLETE_PARSE, ParserLanguage.CPP, rq );
+				includePaths == null ? null : (String [])includePaths.toArray()), ParserMode.COMPLETE_PARSE, ParserLanguage.CPP, rq, null );
 		return p; 
 	}
 }
Index: parser/org/eclipse/cdt/core/parser/tests/QuickParseASTTests.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/QuickParseASTTests.java,v
retrieving revision 1.25
diff -u -r1.25 QuickParseASTTests.java
--- parser/org/eclipse/cdt/core/parser/tests/QuickParseASTTests.java	5 Nov 2003 18:15:21 -0000	1.25
+++ parser/org/eclipse/cdt/core/parser/tests/QuickParseASTTests.java	5 Nov 2003 23:33:35 -0000
@@ -1800,7 +1800,7 @@
 		parse( "const int x = 4; int y = ::x;");
 	}
 
-    public void testBug40419() throws ParserException
+    public void testBug40419() throws Exception
 	{
 		Writer code = new StringWriter();
 		try
@@ -1849,7 +1849,8 @@
 	public void testBug43644() throws Exception
 	{
 		Iterator i = parse( "void foo();{ int x; }", true, false ).getDeclarations();
-		IASTFunction f = (IASTFunction)i.next(); 
+		IASTFunction f = (IASTFunction)i.next();
+		assertEquals( f.getName(), "foo"); 
 		assertFalse( i.hasNext() );		
 	}
 	
@@ -1894,11 +1895,11 @@
 		writer.write( "};\n" ); 
 		Iterator i = parse( writer.toString() ).getDeclarations();
 		
-		IASTTemplateDeclaration templateDecl = (IASTTemplateDeclaration)i.next(); 
+		assertTrue( i.next() instanceof IASTTemplateDeclaration );  
 		IASTClassSpecifier classB = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier();
 		Iterator members = classB.getDeclarations(); 
-		IASTTemplateDeclaration friend = (IASTTemplateDeclaration)members.next(); 
-		IASTMethod method = (IASTMethod)members.next(); 
+		assertTrue (members.next() instanceof IASTTemplateDeclaration );  
+		assertTrue( members.next() instanceof IASTMethod );  
 		assertFalse( i.hasNext() );
 	}
 
@@ -1910,7 +1911,7 @@
 	public void testBug41935() throws Exception
 	{
 		Iterator i = parse( "namespace A	{  int x; } namespace B = A;" ).getDeclarations();
-		IASTNamespaceDefinition n = (IASTNamespaceDefinition)i.next(); 
+		assertTrue( i.next() instanceof IASTNamespaceDefinition ); 
 		IASTNamespaceAlias a = (IASTNamespaceAlias)i.next();
 		assertEquals( a.getName(), "B" );
 		assertFalse( i.hasNext() );
Index: parser/org/eclipse/cdt/core/parser/tests/ScannerTestCase.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ScannerTestCase.java,v
retrieving revision 1.11
diff -u -r1.11 ScannerTestCase.java
--- parser/org/eclipse/cdt/core/parser/tests/ScannerTestCase.java	5 Nov 2003 18:15:21 -0000	1.11
+++ parser/org/eclipse/cdt/core/parser/tests/ScannerTestCase.java	5 Nov 2003 23:33:35 -0000
@@ -8,6 +8,7 @@
 import org.eclipse.cdt.core.parser.IMacroDescriptor;
 import org.eclipse.cdt.core.parser.IProblem;
 import org.eclipse.cdt.core.parser.IToken;
+import org.eclipse.cdt.core.parser.ParserFactoryException;
 import org.eclipse.cdt.core.parser.ParserMode;
 import org.eclipse.cdt.core.parser.ScannerException;
 import org.eclipse.cdt.internal.core.parser.Token;
@@ -156,7 +157,7 @@
 	public final static int SIZEOF_TRUTHTABLE = 10; 
 
 
-	public void testWeirdStrings()
+	public void testWeirdStrings() throws Exception
 	{
 		try
 		{
@@ -174,7 +175,7 @@
 	}
 	
 	
-	public void testNumerics()
+	public void testNumerics()throws Exception
 	{
 		try
 		{
@@ -205,7 +206,7 @@
 		super(name);
 	}
 
-	public void testPreprocessorDefines()
+	public void testPreprocessorDefines()throws Exception
 	{
 		try
 		{
@@ -848,7 +849,7 @@
 		}
 	}
 
-	public void testQuickScan() throws EndOfFile
+	public void testQuickScan() throws EndOfFile, ParserFactoryException
 	{
 		try
 		{
@@ -924,7 +925,7 @@
 
 	}
 
-	public void testOtherPreprocessorCommands()
+	public void testOtherPreprocessorCommands() throws ParserFactoryException
 	{
 		try
 		{
@@ -1033,7 +1034,7 @@
 		validateEOF();
 	}
 
-	public void testBug35892()
+	public void testBug35892() throws ParserFactoryException
 	{
 		try
 		{
@@ -1064,7 +1065,7 @@
 		validateString( "\\\"\\\\");
 	}
 
-	public void testConditionalWithBraces()
+	public void testConditionalWithBraces() throws ParserFactoryException
 	{
 		try
 		{
Index: parser/org/eclipse/cdt/core/parser/tests/TortureTest.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/TortureTest.java,v
retrieving revision 1.10
diff -u -r1.10 TortureTest.java
--- parser/org/eclipse/cdt/core/parser/tests/TortureTest.java	8 Sep 2003 19:17:45 -0000	1.10
+++ parser/org/eclipse/cdt/core/parser/tests/TortureTest.java	5 Nov 2003 23:33:35 -0000
@@ -27,7 +27,7 @@
 import org.eclipse.cdt.core.parser.ParserFactory;
 import org.eclipse.cdt.core.parser.ParserLanguage;
 import org.eclipse.cdt.core.parser.ParserMode;
-import org.eclipse.cdt.internal.core.parser.ScannerInfo;
+import org.eclipse.cdt.core.parser.ScannerInfo;
 import org.eclipse.core.runtime.Path;
 
 
@@ -280,7 +280,7 @@
 				ParserMode parserMode = quickParse ? ParserMode.QUICK_PARSE : ParserMode.COMPLETE_PARSE;
 				ParserLanguage language = cppNature ? ParserLanguage.CPP : ParserLanguage.C; 
 				parser = ParserFactory.createParser( 
-						ParserFactory.createScanner( new StringReader( code ), null, new ScannerInfo(), parserMode, language, nullCallback ), nullCallback, parserMode, language);
+						ParserFactory.createScanner( new StringReader( code ), null, new ScannerInfo(), parserMode, language, nullCallback, null ), nullCallback, parserMode, language, null);
 		
 				mapping = ParserFactory.createLineOffsetReconciler( new StringReader( code ) );
 	            
Index: search/org/eclipse/cdt/core/search/tests/ParseTestOnSearchFiles.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core.tests/search/org/eclipse/cdt/core/search/tests/ParseTestOnSearchFiles.java,v
retrieving revision 1.2
diff -u -r1.2 ParseTestOnSearchFiles.java
--- search/org/eclipse/cdt/core/search/tests/ParseTestOnSearchFiles.java	8 Sep 2003 18:10:55 -0000	1.2
+++ search/org/eclipse/cdt/core/search/tests/ParseTestOnSearchFiles.java	5 Nov 2003 23:33:37 -0000
@@ -18,11 +18,11 @@
 import org.eclipse.cdt.core.parser.IParser;
 import org.eclipse.cdt.core.parser.IScanner;
 import org.eclipse.cdt.core.parser.ISourceElementRequestor;
-import org.eclipse.cdt.core.parser.ParserLanguage;
+import org.eclipse.cdt.core.parser.NullSourceElementRequestor;
 import org.eclipse.cdt.core.parser.ParserFactory;
+import org.eclipse.cdt.core.parser.ParserLanguage;
 import org.eclipse.cdt.core.parser.ParserMode;
-import org.eclipse.cdt.internal.core.parser.NullSourceElementRequestor;
-import org.eclipse.cdt.internal.core.parser.ScannerInfo;
+import org.eclipse.cdt.core.parser.ScannerInfo;
 import org.eclipse.core.runtime.Path;
 
 /**
@@ -55,11 +55,11 @@
         fileIn = new FileInputStream(name);
 	}
 	
-	public void testParseOfAndrewsFile()
+	public void testParseOfAndrewsFile() throws Exception
 	{
 		ISourceElementRequestor requestor = new NullSourceElementRequestor();
-		IScanner scanner = ParserFactory.createScanner( new InputStreamReader( fileIn ), name, new ScannerInfo(), ParserMode.COMPLETE_PARSE, ParserLanguage.CPP, requestor );
-		IParser parser = ParserFactory.createParser( scanner, requestor, ParserMode.COMPLETE_PARSE, ParserLanguage.CPP );
+		IScanner scanner = ParserFactory.createScanner( new InputStreamReader( fileIn ), name, new ScannerInfo(), ParserMode.COMPLETE_PARSE, ParserLanguage.CPP, requestor, null );
+		IParser parser = ParserFactory.createParser( scanner, requestor, ParserMode.COMPLETE_PARSE, ParserLanguage.CPP, null );
 		assertTrue( parser.parse() );
 	}
 
Index: build.xml
===================================================================
RCS file: build.xml
diff -N build.xml
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ build.xml	5 Nov 2003 23:32:48 -0000
@@ -0,0 +1,179 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="org.eclipse.cdt.core" default="build.jars" basedir=".">
+
+	<property name="bootclasspath" value=""/>
+	<property name="ws" value="win32"/>
+	<property name="os" value="win32"/>
+	<property name="arch" value="x86"/>
+	<property name="javacFailOnError" value="false"/>
+	<property name="javacDebugInfo" value="on"/>
+	<property name="javacVerbose" value="true"/>
+
+	<target name="init" depends="properties">
+		<property name="plugin" value="org.eclipse.cdt.core"/>
+		<property name="version.suffix" value="_1.2.0"/>
+		<property name="full.name" value="${plugin}${version.suffix}"/>
+		<property name="temp.folder" value="${basedir}/temp.folder"/>
+		<property name="plugin.destination" value="${basedir}"/>
+		<property name="build.result.folder" value="${basedir}"/>
+	</target>
+
+	<target name="properties" if="eclipse.running">
+		<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
+	</target>
+
+	<target name="build.update.jar" depends="init" description="Build the plug-in: org.eclipse.cdt.core for an update site.">
+		<delete dir="${temp.folder}"/>
+		<mkdir dir="${temp.folder}"/>
+		<antcall target="build.jars"/>
+		<antcall target="gather.bin.parts">
+			<param name="destination.temp.folder" value="${temp.folder}/"/>
+		</antcall>
+		<zip zipfile="${plugin.destination}/${full.name}.jar" basedir="${temp.folder}/${full.name}" filesonly="false" update="no"/>
+		<delete dir="${temp.folder}"/>
+	</target>
+
+	<target name="gather.bin.parts" depends="init" if="destination.temp.folder">
+		<mkdir dir="${destination.temp.folder}/${full.name}"/>
+		<copy file="${build.result.folder}/cdtparser.jar" todir="${destination.temp.folder}/${full.name}"/>
+		<copy file="${build.result.folder}/cdtcore.jar" todir="${destination.temp.folder}/${full.name}"/>
+		<copy todir="${destination.temp.folder}/${full.name}">
+			<fileset dir="${basedir}" includes="plugin.xml,plugin.properties,about.html"/>
+		</copy>
+	</target>
+
+	<target name="cdtcore.jar" depends="init" unless="cdtcore.jar" description="Create jar: cdtcore.jar.">
+		<property name="destdir" value="${temp.folder}/cdtcore.jar.bin"/>
+		<delete dir="${temp.folder}/cdtcore.jar.bin"/>
+		<mkdir dir="${temp.folder}/cdtcore.jar.bin"/>
+		<!-- compile the source code -->
+		<javac destdir="${temp.folder}/cdtcore.jar.bin" failonerror="${javacFailOnError}" verbose="${javacVerbose}" debug="${javacDebugInfo}" includeAntRuntime="no" bootclasspath="${bootclasspath}" classpath="../org.eclipse.core.boot/bin;../org.eclipse.core.boot/boot.jar;bin;cdtparser.jar;../org.eclipse.core.runtime/bin;../org.eclipse.core.runtime/runtime.jar;../org.apache.xerces/bin;../org.apache.xerces/xmlParserAPIs.jar;../org.apache.xerces/xercesImpl.jar;../org.eclipse.core.resources/bin;../org.eclipse.core.resources/resources.jar;../org.eclipse.core.resources.win32/resources.jar;../org.eclipse.search/bin;../org.eclipse.search/search.jar;../org.eclipse.ui/bin;../org.eclipse.ui/ui.jar;../org.eclipse.update.core/bin;../org.eclipse.update.core/updatecore.jar;../org.eclipse.update.core.win32/updatecore.jar;../org.eclipse.help/bin;../org.eclipse.help/help.jar;../org.apache.lucene/bin;../org.apache.lucene/parser.jar;../org.apache.lucene/lucene-1.2.jar;../org.eclipse.help.appserver/bin;../org.eclipse.help.appserver/appserver.jar;../org.eclipse.swt/bin;../org.eclipse.swt/ws/${ws}/swt.jar;../org.eclipse.swt.win32/ws/${ws}/swt.jar;../org.eclipse.text/bin;../org.eclipse.text/text.jar;../org.eclipse.jface/bin;../org.eclipse.jface/jface.jar;../org.eclipse.jface.text/bin;../org.eclipse.jface.text/jfacetext.jar;../org.eclipse.ui.views/bin;../org.eclipse.ui.views/views.jar;../org.eclipse.ui.workbench/bin;../org.eclipse.ui.workbench/workbench.jar;../org.eclipse.ui.win32/workbench.jar;../org.eclipse.ui.win32/bin;../org.eclipse.ui.win32/workbenchwin32.jar;../org.eclipse.ui.workbench.texteditor/bin;../org.eclipse.ui.workbench.texteditor/texteditor.jar;../org.eclipse.ui.editors/bin;../org.eclipse.ui.editors/editors.jar;../org.eclipse.compare/bin;../org.eclipse.compare/compare.jar;../org.eclipse.debug.core/bin;../org.eclipse.debug.core/dtcore.jar;../org.eclipse.team.core/bin;../org.eclipse.team.core/team.jar">
+			<src path="build/"/>
+			<src path="index/"/>
+			<src path="model/"/>
+			<src path="src/"/>
+			<src path="utils/"/>
+			<src path="search/"/>
+			<src path="dependency/"/>
+		</javac>
+		<!-- copy necessary resources -->
+		<copy todir="${temp.folder}/cdtcore.jar.bin">
+			<fileset dir="build/" excludes="**/*.java"/>
+			<fileset dir="index/" excludes="**/*.java"/>
+			<fileset dir="model/" excludes="**/*.java"/>
+			<fileset dir="src/" excludes="**/*.java"/>
+			<fileset dir="utils/" excludes="**/*.java"/>
+			<fileset dir="search/" excludes="**/*.java"/>
+			<fileset dir="dependency/" excludes="**/*.java"/>
+		</copy>
+		<mkdir dir="${build.result.folder}"/>
+		<jar jarfile="${build.result.folder}/cdtcore.jar" basedir="${temp.folder}/cdtcore.jar.bin"/>
+		<delete dir="${temp.folder}/cdtcore.jar.bin"/>
+	</target>
+
+	<target name="cdtcoresrc.zip" depends="init" unless="cdtcore.jar">
+		<mkdir dir="${build.result.folder}"/>
+		<zip zipfile="${build.result.folder}/cdtcoresrc.zip" filesonly="false" update="no">
+			<fileset dir="build/" includes="**/*.java"/>
+			<fileset dir="index/" includes="**/*.java"/>
+			<fileset dir="model/" includes="**/*.java"/>
+			<fileset dir="src/" includes="**/*.java"/>
+			<fileset dir="utils/" includes="**/*.java"/>
+			<fileset dir="search/" includes="**/*.java"/>
+			<fileset dir="dependency/" includes="**/*.java"/>
+		</zip>
+	</target>
+
+	<target name="cdtparser.jar" depends="init" unless="cdtparser.jar" description="Create jar: cdtparser.jar.">
+		<property name="destdir" value="${temp.folder}/cdtparser.jar.bin"/>
+		<delete dir="${temp.folder}/cdtparser.jar.bin"/>
+		<mkdir dir="${temp.folder}/cdtparser.jar.bin"/>
+		<!-- compile the source code -->
+		<javac destdir="${temp.folder}/cdtparser.jar.bin" failonerror="${javacFailOnError}" verbose="${javacVerbose}" debug="${javacDebugInfo}" includeAntRuntime="no" bootclasspath="${bootclasspath}" classpath="../org.eclipse.core.boot/bin;../org.eclipse.core.boot/boot.jar;bin;cdtcore.jar;../org.eclipse.core.runtime/bin;../org.eclipse.core.runtime/runtime.jar;../org.apache.xerces/bin;../org.apache.xerces/xmlParserAPIs.jar;../org.apache.xerces/xercesImpl.jar;../org.eclipse.core.resources/bin;../org.eclipse.core.resources/resources.jar;../org.eclipse.core.resources.win32/resources.jar;../org.eclipse.search/bin;../org.eclipse.search/search.jar;../org.eclipse.ui/bin;../org.eclipse.ui/ui.jar;../org.eclipse.update.core/bin;../org.eclipse.update.core/updatecore.jar;../org.eclipse.update.core.win32/updatecore.jar;../org.eclipse.help/bin;../org.eclipse.help/help.jar;../org.apache.lucene/bin;../org.apache.lucene/parser.jar;../org.apache.lucene/lucene-1.2.jar;../org.eclipse.help.appserver/bin;../org.eclipse.help.appserver/appserver.jar;../org.eclipse.swt/bin;../org.eclipse.swt/ws/${ws}/swt.jar;../org.eclipse.swt.win32/ws/${ws}/swt.jar;../org.eclipse.text/bin;../org.eclipse.text/text.jar;../org.eclipse.jface/bin;../org.eclipse.jface/jface.jar;../org.eclipse.jface.text/bin;../org.eclipse.jface.text/jfacetext.jar;../org.eclipse.ui.views/bin;../org.eclipse.ui.views/views.jar;../org.eclipse.ui.workbench/bin;../org.eclipse.ui.workbench/workbench.jar;../org.eclipse.ui.win32/workbench.jar;../org.eclipse.ui.win32/bin;../org.eclipse.ui.win32/workbenchwin32.jar;../org.eclipse.ui.workbench.texteditor/bin;../org.eclipse.ui.workbench.texteditor/texteditor.jar;../org.eclipse.ui.editors/bin;../org.eclipse.ui.editors/editors.jar;../org.eclipse.compare/bin;../org.eclipse.compare/compare.jar;../org.eclipse.debug.core/bin;../org.eclipse.debug.core/dtcore.jar;../org.eclipse.team.core/bin;../org.eclipse.team.core/team.jar">
+			<src path="parser/"/>
+		</javac>
+		<!-- copy necessary resources -->
+		<copy todir="${temp.folder}/cdtparser.jar.bin">
+			<fileset dir="parser/" excludes="**/*.java"/>
+		</copy>
+		<mkdir dir="${build.result.folder}"/>
+		<jar jarfile="${build.result.folder}/cdtparser.jar" basedir="${temp.folder}/cdtparser.jar.bin"/>
+		<delete dir="${temp.folder}/cdtparser.jar.bin"/>
+	</target>
+
+	<target name="cdtparsersrc.zip" depends="init" unless="cdtparser.jar">
+		<mkdir dir="${build.result.folder}"/>
+		<zip zipfile="${build.result.folder}/cdtparsersrc.zip" filesonly="false" update="no">
+			<fileset dir="parser/" includes="**/*.java"/>
+		</zip>
+	</target>
+
+	<target name="build.jars" depends="init" description="Build all the jars for the plug-in: org.eclipse.cdt.core.">
+		<available property="cdtcore.jar" file="${build.result.folder}/cdtcore.jar"/>
+		<antcall target="cdtcore.jar"/>
+		<available property="cdtparser.jar" file="${build.result.folder}/cdtparser.jar"/>
+		<antcall target="cdtparser.jar"/>
+	</target>
+
+	<target name="build.sources" depends="init">
+		<available property="cdtcoresrc.zip" file="${build.result.folder}/cdtcoresrc.zip"/>
+		<antcall target="cdtcoresrc.zip"/>
+		<available property="cdtparsersrc.zip" file="${build.result.folder}/cdtparsersrc.zip"/>
+		<antcall target="cdtparsersrc.zip"/>
+	</target>
+
+		<target name="build.zips" depends="init">
+		</target>
+
+	<target name="gather.sources" depends="init" if="destination.temp.folder">
+		<mkdir dir="${destination.temp.folder}/${full.name}"/>
+		<copy file="${build.result.folder}/cdtparsersrc.zip" todir="${destination.temp.folder}/${full.name}"/>
+		<copy file="${build.result.folder}/cdtcoresrc.zip" todir="${destination.temp.folder}/${full.name}"/>
+		<copy todir="${destination.temp.folder}/${full.name}">
+			<fileset dir="${basedir}" includes="about.html,schema/"/>
+		</copy>
+	</target>
+
+	<target name="gather.logs" depends="init" if="destination.temp.folder">
+		<mkdir dir="${destination.temp.folder}/${full.name}"/>
+		<copy file="${temp.folder}/cdtparser.jar.bin.log" todir="${destination.temp.folder}/${full.name}"/>
+		<copy file="${temp.folder}/cdtcore.jar.bin.log" todir="${destination.temp.folder}/${full.name}"/>
+	</target>
+
+	<target name="clean" depends="init" description="Clean the plug-in: org.eclipse.cdt.core of all the zips, jars and logs created.">
+		<delete file="${build.result.folder}/cdtparser.jar"/>
+		<delete file="${build.result.folder}/cdtparsersrc.zip"/>
+		<delete file="${build.result.folder}/cdtcore.jar"/>
+		<delete file="${build.result.folder}/cdtcoresrc.zip"/>
+		<delete file="${plugin.destination}/${full.name}.jar"/>
+		<delete file="${plugin.destination}/${full.name}.zip"/>
+		<delete dir="${temp.folder}"/>
+	</target>
+
+	<target name="refresh" depends="init" if="eclipse.running">
+		<eclipse.convertPath fileSystemPath="C:\eclipse211\HEAD_2\org.eclipse.cdt.core\" property="resourcePath"/>
+		<eclipse.refreshLocal resource="${resourcePath}" depth="infinite"/>
+	</target>
+
+	<target name="zip.plugin" depends="init" description="Create a zip containing all the elements for the plug-in: org.eclipse.cdt.core.">
+		<delete dir="${temp.folder}"/>
+		<mkdir dir="${temp.folder}"/>
+		<antcall target="build.jars"/>
+		<antcall target="build.sources"/>
+		<antcall target="gather.bin.parts">
+			<param name="destination.temp.folder" value="${temp.folder}/"/>
+		</antcall>
+		<antcall target="gather.sources">
+			<param name="destination.temp.folder" value="${temp.folder}/"/>
+		</antcall>
+		<delete>
+			<fileset dir="${temp.folder}" includes="**/*.bin.log"/>
+		</delete>
+		<antcall target="zip.folder"/>
+		<delete dir="${temp.folder}"/>
+	</target>
+	<target name="zip.folder" depends="init">
+		<zip zipfile="${plugin.destination}/${full.name}.zip" basedir="${temp.folder}" filesonly="true" update="no" excludes="**/*.bin.log"/>
+	</target>
+
+</project>
Index: cdtcore.jar
===================================================================
RCS file: cdtcore.jar
diff -N cdtcore.jar
Binary files /dev/null and cdtcore.jar differ
Index: cdtparser.jar
===================================================================
RCS file: cdtparser.jar
diff -N cdtparser.jar
Binary files /dev/null and cdtparser.jar differ
Index: index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexer.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexer.java,v
retrieving revision 1.13
diff -u -r1.13 SourceIndexer.java
--- index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexer.java	1 Oct 2003 22:15:34 -0000	1.13
+++ index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexer.java	5 Nov 2003 23:33:01 -0000
@@ -21,15 +21,17 @@
 import org.eclipse.cdt.core.CCorePlugin;
 import org.eclipse.cdt.core.ICLogConstants;
 import org.eclipse.cdt.core.model.CoreModel;
+import org.eclipse.cdt.core.parser.ParserUtil;
 import org.eclipse.cdt.core.parser.IParser;
 import org.eclipse.cdt.core.parser.IScannerInfo;
 import org.eclipse.cdt.core.parser.IScannerInfoProvider;
+import org.eclipse.cdt.core.parser.ParserFactoryException;
 import org.eclipse.cdt.core.parser.ParserLanguage;
 import org.eclipse.cdt.core.parser.ParserFactory;
 import org.eclipse.cdt.core.parser.ParserMode;
 import org.eclipse.cdt.internal.core.index.IDocument;
 import org.eclipse.cdt.internal.core.model.CModelManager;
-import org.eclipse.cdt.internal.core.parser.ScannerInfo;
+import org.eclipse.cdt.core.parser.ScannerInfo;
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IProject;
 
@@ -84,9 +86,16 @@
 		//C or CPP?
 		ParserLanguage language = CoreModel.getDefault().hasCCNature(currentProject) ? ParserLanguage.CPP : ParserLanguage.C;
 		
-		IParser parser = ParserFactory.createParser( 
-							ParserFactory.createScanner( new StringReader( document.getStringContent() ), resourceFile.getLocation().toOSString(), scanInfo, ParserMode.COMPLETE_PARSE, language, requestor ), 
-							requestor, ParserMode.COMPLETE_PARSE, language );
+		IParser parser = null;
+		
+		try
+		{
+			parser = ParserFactory.createParser( 
+							ParserFactory.createScanner( new StringReader( document.getStringContent() ), resourceFile.getLocation().toOSString(), scanInfo, ParserMode.COMPLETE_PARSE, language, requestor, ParserUtil.getParserLogService() ), 
+							requestor, ParserMode.COMPLETE_PARSE, language, ParserUtil.getParserLogService() );
+		} catch( ParserFactoryException pfe )
+		{
+		}
 		
 		boolean retVal = parser.parse();
 		
Index: model/org/eclipse/cdt/internal/core/model/CModelBuilder.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder.java,v
retrieving revision 1.21
diff -u -r1.21 CModelBuilder.java
--- model/org/eclipse/cdt/internal/core/model/CModelBuilder.java	22 Oct 2003 17:45:55 -0000	1.21
+++ model/org/eclipse/cdt/internal/core/model/CModelBuilder.java	5 Nov 2003 23:33:02 -0000
@@ -22,8 +22,11 @@
 import org.eclipse.cdt.core.parser.IParser;
 import org.eclipse.cdt.core.parser.IQuickParseCallback;
 import org.eclipse.cdt.core.parser.ParserFactory;
+import org.eclipse.cdt.core.parser.ParserFactoryException;
 import org.eclipse.cdt.core.parser.ParserLanguage;
 import org.eclipse.cdt.core.parser.ParserMode;
+import org.eclipse.cdt.core.parser.ParserUtil;
+import org.eclipse.cdt.core.parser.ScannerInfo;
 import org.eclipse.cdt.core.parser.ast.ASTClassKind;
 import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException;
 import org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration;
@@ -48,7 +51,6 @@
 import org.eclipse.cdt.core.parser.ast.IASTTypedefDeclaration;
 import org.eclipse.cdt.core.parser.ast.IASTVariable;
 import org.eclipse.cdt.internal.core.parser.ParserException;
-import org.eclipse.cdt.internal.core.parser.ScannerInfo;
 import org.eclipse.cdt.internal.core.parser.util.ASTUtil;
 import org.eclipse.core.resources.IProject;
 
@@ -71,9 +73,18 @@
 		quickParseCallback = ParserFactory.createQuickParseCallback(); 
 		
 		ParserLanguage language = hasCppNature ? ParserLanguage.CPP : ParserLanguage.C;
-		IParser parser = ParserFactory.createParser( 
-			ParserFactory.createScanner( new StringReader( code ), "code", 
-			new ScannerInfo(), mode, language, quickParseCallback), quickParseCallback, mode, language );
+		
+		IParser parser = null;
+		try
+		{
+			parser = ParserFactory.createParser( 
+				ParserFactory.createScanner( new StringReader( code ), "code", 
+				new ScannerInfo(), mode, language, quickParseCallback, ParserUtil.getParserLogService()), quickParseCallback, mode, language, ParserUtil.getParserLogService() );
+		}
+		catch( ParserFactoryException pfe )
+		{
+			throw new ParserException( "Parser/Scanner construction failure.");
+		}
 		
 		if( ! parser.parse() && throwExceptionOnError )
 			throw new ParserException("Parse failure");
Index: parser/ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/ChangeLog,v
retrieving revision 1.157
diff -u -r1.157 ChangeLog
--- parser/ChangeLog	5 Nov 2003 18:15:11 -0000	1.157
+++ parser/ChangeLog	5 Nov 2003 23:33:03 -0000
@@ -1,4 +1,10 @@
 2003-11-05 John Camelon
+	Cleaned up the ParserFactory interface to check for validity of input arguments.  
+	Moved NullSourceElementRequestor and ScannerInfo to public interface as requested. 
+	Restructured code so that no Eclipse/CDT source outside the parser source directory is used.
+	Updated parser clients to use new ParserFactory (stand-alone parser work item).  	
+
+2003-11-05 John Camelon
 	Removed warnings from parser source tree.  
 	Removed preliminary task tags support to clean up parser interfaces and implementation.   
 	Added preliminary IProblem support to 
Index: parser/org/eclipse/cdt/core/parser/DefaultLogService.java
===================================================================
RCS file: parser/org/eclipse/cdt/core/parser/DefaultLogService.java
diff -N parser/org/eclipse/cdt/core/parser/DefaultLogService.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ parser/org/eclipse/cdt/core/parser/DefaultLogService.java	5 Nov 2003 23:33:03 -0000
@@ -0,0 +1,36 @@
+/**********************************************************************
+ * Copyright (c) 2002,2003 Rational Software Corporation and others.
+ * All rights reserved.   This program and the accompanying materials
+ * are made available under the terms of the Common Public License v0.5
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v05.html
+ * 
+ * Contributors: 
+ * IBM Rational Software - Initial API and implementation
+***********************************************************************/
+package org.eclipse.cdt.core.parser;
+
+/**
+ * @author jcamelon
+ *
+ */
+public class DefaultLogService implements IParserLogService
+{
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.cdt.core.parser.IParserLogService#traceLog(java.lang.String)
+	 */
+	public void traceLog(String message)
+	{
+		// do nothing
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.cdt.core.parser.IParserLogService#errorLog(java.lang.String)
+	 */
+	public void errorLog(String message)
+	{
+		// do nothing
+	}
+
+}
Index: parser/org/eclipse/cdt/core/parser/IParserLogService.java
===================================================================
RCS file: parser/org/eclipse/cdt/core/parser/IParserLogService.java
diff -N parser/org/eclipse/cdt/core/parser/IParserLogService.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ parser/org/eclipse/cdt/core/parser/IParserLogService.java	5 Nov 2003 23:33:03 -0000
@@ -0,0 +1,23 @@
+/**********************************************************************
+ * Copyright (c) 2002,2003 Rational Software Corporation and others.
+ * All rights reserved.   This program and the accompanying materials
+ * are made available under the terms of the Common Public License v0.5
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v05.html
+ * 
+ * Contributors: 
+ * IBM Rational Software - Initial API and implementation
+***********************************************************************/
+package org.eclipse.cdt.core.parser;
+
+/**
+ * @author jcamelon
+ *
+ */
+public interface IParserLogService
+{
+
+	public void traceLog( String message );
+	public void errorLog( String message );
+
+}
Index: parser/org/eclipse/cdt/core/parser/IScannerInfoChangeListener.java
===================================================================
RCS file: parser/org/eclipse/cdt/core/parser/IScannerInfoChangeListener.java
diff -N parser/org/eclipse/cdt/core/parser/IScannerInfoChangeListener.java
--- parser/org/eclipse/cdt/core/parser/IScannerInfoChangeListener.java	4 Jul 2003 18:36:45 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,26 +0,0 @@
-package org.eclipse.cdt.core.parser;
-
-import org.eclipse.core.resources.IResource;
-
-/**********************************************************************
- * Copyright (c) 2002,2003 Rational Software Corporation and others.
- * All rights reserved.   This program and the accompanying materials
- * are made available under the terms of the Common Public License v0.5
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v05.html
- * 
- * Contributors: 
- * IBM Rational Software - Initial API and implementation
-***********************************************************************/
-
-public interface IScannerInfoChangeListener {
-	
-	/**
-	 * The listener must implement this method in order to receive the new 
-	 * information from the provider.
-	 * 
-	 * @param info
-	 */
-	public void changeNotification(IResource project, IScannerInfo info);
-
-}
Index: parser/org/eclipse/cdt/core/parser/IScannerInfoProvider.java
===================================================================
RCS file: parser/org/eclipse/cdt/core/parser/IScannerInfoProvider.java
diff -N parser/org/eclipse/cdt/core/parser/IScannerInfoProvider.java
--- parser/org/eclipse/cdt/core/parser/IScannerInfoProvider.java	13 Aug 2003 17:45:30 -0000	1.3
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,44 +0,0 @@
-package org.eclipse.cdt.core.parser;
-
-import org.eclipse.core.resources.IResource;
-
-/**********************************************************************
- * Copyright (c) 2002,2003 Rational Software Corporation and others.
- * All rights reserved.   This program and the accompanying materials
- * are made available under the terms of the Common Public License v0.5
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v05.html
- * 
- * Contributors: 
- * IBM Rational Software - Initial API and implementation
-***********************************************************************/
-
-public interface IScannerInfoProvider {
-
-	/**
-	 * The receiver will answer the current state of the build information for the 
-	 * resource specified in the argument.
-	 * 
-	 * @param resource
-	 * @return
-	 */
-	public IScannerInfo getScannerInformation(IResource resource); 	
-
-	/**
-	 * The receiver will register the listener specified in the argument
-	 * to receive change notifications when the information for the 
-	 * <code>IResource</code> it is responsible for changes. 
-	 *  
-	 * @param listener
-	 */
-	public void subscribe(IResource resource, IScannerInfoChangeListener listener);
-	
-	/**
-	 * The receiver will no longer notify the listener specified in 
-	 * the argument when information about the reource it is responsible 
-	 * for changes.
-	 * 
-	 * @param listener
-	 */
-	public void unsubscribe(IResource resource, IScannerInfoChangeListener listener);
-}
Index: parser/org/eclipse/cdt/core/parser/NullSourceElementRequestor.java
===================================================================
RCS file: parser/org/eclipse/cdt/core/parser/NullSourceElementRequestor.java
diff -N parser/org/eclipse/cdt/core/parser/NullSourceElementRequestor.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ parser/org/eclipse/cdt/core/parser/NullSourceElementRequestor.java	5 Nov 2003 23:33:03 -0000
@@ -0,0 +1,452 @@
+package org.eclipse.cdt.core.parser;
+
+import org.eclipse.cdt.core.parser.ast.IASTASMDefinition;
+import org.eclipse.cdt.core.parser.ast.IASTAbstractTypeSpecifierDeclaration;
+import org.eclipse.cdt.core.parser.ast.IASTClassReference;
+import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier;
+import org.eclipse.cdt.core.parser.ast.IASTCodeScope;
+import org.eclipse.cdt.core.parser.ast.IASTCompilationUnit;
+import org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier;
+import org.eclipse.cdt.core.parser.ast.IASTEnumerationReference;
+import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier;
+import org.eclipse.cdt.core.parser.ast.IASTEnumeratorReference;
+import org.eclipse.cdt.core.parser.ast.IASTField;
+import org.eclipse.cdt.core.parser.ast.IASTFieldReference;
+import org.eclipse.cdt.core.parser.ast.IASTFunction;
+import org.eclipse.cdt.core.parser.ast.IASTFunctionReference;
+import org.eclipse.cdt.core.parser.ast.IASTInclusion;
+import org.eclipse.cdt.core.parser.ast.IASTLinkageSpecification;
+import org.eclipse.cdt.core.parser.ast.IASTMacro;
+import org.eclipse.cdt.core.parser.ast.IASTMethod;
+import org.eclipse.cdt.core.parser.ast.IASTMethodReference;
+import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition;
+import org.eclipse.cdt.core.parser.ast.IASTNamespaceReference;
+import org.eclipse.cdt.core.parser.ast.IASTParameterReference;
+import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration;
+import org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation;
+import org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization;
+import org.eclipse.cdt.core.parser.ast.IASTTypedefDeclaration;
+import org.eclipse.cdt.core.parser.ast.IASTTypedefReference;
+import org.eclipse.cdt.core.parser.ast.IASTUsingDeclaration;
+import org.eclipse.cdt.core.parser.ast.IASTUsingDirective;
+import org.eclipse.cdt.core.parser.ast.IASTVariable;
+import org.eclipse.cdt.core.parser.ast.IASTVariableReference;
+
+
+public class NullSourceElementRequestor implements ISourceElementRequestor 
+{
+    private ParserMode mode = ParserMode.COMPLETE_PARSE;
+
+	public NullSourceElementRequestor()
+	{
+	}
+
+	public NullSourceElementRequestor( ParserMode mode )
+	{
+		this.mode = mode;
+	}
+	/* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptProblem(org.eclipse.cdt.core.parser.IProblem)
+     */
+    public boolean acceptProblem(IProblem problem)
+    {
+		return DefaultProblemHandler.ruleOnProblem( problem, mode );
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptMacro(org.eclipse.cdt.core.parser.ast.IASTMacro)
+     */
+    public void acceptMacro(IASTMacro macro)
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptVariable(org.eclipse.cdt.core.parser.ast.IASTVariable)
+     */
+    public void acceptVariable(IASTVariable variable)
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptFunctionDeclaration(org.eclipse.cdt.core.parser.ast.IASTFunction)
+     */
+    public void acceptFunctionDeclaration(IASTFunction function)
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptUsingDirective(org.eclipse.cdt.core.parser.ast.IASTUsingDirective)
+     */
+    public void acceptUsingDirective(IASTUsingDirective usageDirective)
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptUsingDeclaration(org.eclipse.cdt.core.parser.ast.IASTUsingDeclaration)
+     */
+    public void acceptUsingDeclaration(IASTUsingDeclaration usageDeclaration)
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptASMDefinition(org.eclipse.cdt.core.parser.ast.IASTASMDefinition)
+     */
+    public void acceptASMDefinition(IASTASMDefinition asmDefinition)
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptTypedef(org.eclipse.cdt.core.parser.ast.IASTTypedef)
+     */
+    public void acceptTypedefDeclaration(IASTTypedefDeclaration typedef)
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptEnumerationSpecifier(org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier)
+     */
+    public void acceptEnumerationSpecifier(IASTEnumerationSpecifier enumeration)
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterFunctionBody(org.eclipse.cdt.core.parser.ast.IASTFunction)
+     */
+    public void enterFunctionBody(IASTFunction function)
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitFunctionBody(org.eclipse.cdt.core.parser.ast.IASTFunction)
+     */
+    public void exitFunctionBody(IASTFunction function)
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterCompilationUnit(org.eclipse.cdt.core.parser.ast.IASTCompilationUnit)
+     */
+    public void enterCompilationUnit(IASTCompilationUnit compilationUnit)
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterInclusion(org.eclipse.cdt.core.parser.ast.IASTInclusion)
+     */
+    public void enterInclusion(IASTInclusion inclusion)
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterNamespaceDefinition(org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition)
+     */
+    public void enterNamespaceDefinition(IASTNamespaceDefinition namespaceDefinition)
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterClassSpecifier(org.eclipse.cdt.core.parser.ast.IASTClassSpecifier)
+     */
+    public void enterClassSpecifier(IASTClassSpecifier classSpecification)
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterLinkageSpecification(org.eclipse.cdt.core.parser.ast.IASTLinkageSpecification)
+     */
+    public void enterLinkageSpecification(IASTLinkageSpecification linkageSpec)
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterTemplateDeclaration(org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration)
+     */
+    public void enterTemplateDeclaration(IASTTemplateDeclaration declaration)
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterTemplateSpecialization(org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization)
+     */
+    public void enterTemplateSpecialization(IASTTemplateSpecialization specialization)
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterTemplateExplicitInstantiation(org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation)
+     */
+    public void enterTemplateInstantiation(IASTTemplateInstantiation instantiation)
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptMethodDeclaration(org.eclipse.cdt.core.parser.ast.IASTMethod)
+     */
+    public void acceptMethodDeclaration(IASTMethod method)
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterMethodBody(org.eclipse.cdt.core.parser.ast.IASTMethod)
+     */
+    public void enterMethodBody(IASTMethod method)
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitMethodBody(org.eclipse.cdt.core.parser.ast.IASTMethod)
+     */
+    public void exitMethodBody(IASTMethod method)
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptField(org.eclipse.cdt.core.parser.ast.IASTField)
+     */
+    public void acceptField(IASTField field)
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptClassReference(org.eclipse.cdt.core.parser.ast.IASTClassReference)
+     */
+    public void acceptClassReference(IASTClassReference reference)
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitTemplateDeclaration(org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration)
+     */
+    public void exitTemplateDeclaration(IASTTemplateDeclaration declaration)
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitTemplateSpecialization(org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization)
+     */
+    public void exitTemplateSpecialization(IASTTemplateSpecialization specialization)
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitTemplateExplicitInstantiation(org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation)
+     */
+    public void exitTemplateExplicitInstantiation(IASTTemplateInstantiation instantiation)
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitLinkageSpecification(org.eclipse.cdt.core.parser.ast.IASTLinkageSpecification)
+     */
+    public void exitLinkageSpecification(IASTLinkageSpecification linkageSpec)
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitClassSpecifier(org.eclipse.cdt.core.parser.ast.IASTClassSpecifier)
+     */
+    public void exitClassSpecifier(IASTClassSpecifier classSpecification)
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitNamespaceDefinition(org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition)
+     */
+    public void exitNamespaceDefinition(IASTNamespaceDefinition namespaceDefinition)
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitInclusion(org.eclipse.cdt.core.parser.ast.IASTInclusion)
+     */
+    public void exitInclusion(IASTInclusion inclusion)
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitCompilationUnit(org.eclipse.cdt.core.parser.ast.IASTCompilationUnit)
+     */
+    public void exitCompilationUnit(IASTCompilationUnit compilationUnit)
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptAbstractTypeSpecDeclaration(org.eclipse.cdt.core.parser.ast.IASTAbstractTypeSpecifierDeclaration)
+     */
+    public void acceptAbstractTypeSpecDeclaration(IASTAbstractTypeSpecifierDeclaration abstractDeclaration)
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptTypedefReference(org.eclipse.cdt.core.parser.ast.IASTTypedefReference)
+     */
+    public void acceptTypedefReference(IASTTypedefReference reference)
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptNamespaceReference(org.eclipse.cdt.core.parser.ast.IASTNamespaceReference)
+     */
+    public void acceptNamespaceReference(IASTNamespaceReference reference)
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptEnumerationReference(org.eclipse.cdt.core.parser.ast.IASTEnumerationReference)
+     */
+    public void acceptEnumerationReference(IASTEnumerationReference reference)
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptVariableReference(org.eclipse.cdt.core.parser.ast.IASTVariableReference)
+     */
+    public void acceptVariableReference(IASTVariableReference reference)
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptFunctionReference(org.eclipse.cdt.core.parser.ast.IASTFunctionReference)
+     */
+    public void acceptFunctionReference(IASTFunctionReference reference)
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptFieldReference(org.eclipse.cdt.core.parser.ast.IASTFieldReference)
+     */
+    public void acceptFieldReference(IASTFieldReference reference)
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptMethodReference(org.eclipse.cdt.core.parser.ast.IASTMethodReference)
+     */
+    public void acceptMethodReference(IASTMethodReference reference)
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptElaboratedForewardDeclaration(org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier)
+     */
+    public void acceptElaboratedForewardDeclaration(IASTElaboratedTypeSpecifier elaboratedType)
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterCodeBlock(org.eclipse.cdt.core.parser.ast.IASTScope)
+	 */
+	public void enterCodeBlock(IASTCodeScope scope) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitCodeBlock(org.eclipse.cdt.core.parser.ast.IASTScope)
+	 */
+	public void exitCodeBlock(IASTCodeScope scope) {
+		// TODO Auto-generated method stub
+		
+	}
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptEnumeratorReference(org.eclipse.cdt.core.parser.ast.IASTEnumerationReference)
+     */
+    public void acceptEnumeratorReference(IASTEnumeratorReference reference)
+    {
+        // TODO Auto-generated method stub
+        
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptParameterReference(org.eclipse.cdt.internal.core.parser.ast.complete.ASTParameterReference)
+     */
+    public void acceptParameterReference(IASTParameterReference reference)
+    {
+        // TODO Auto-generated method stub
+        
+    } 
+}
Index: parser/org/eclipse/cdt/core/parser/ParserFactory.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ParserFactory.java,v
retrieving revision 1.11
diff -u -r1.11 ParserFactory.java
--- parser/org/eclipse/cdt/core/parser/ParserFactory.java	5 Nov 2003 18:15:11 -0000	1.11
+++ parser/org/eclipse/cdt/core/parser/ParserFactory.java	5 Nov 2003 23:33:03 -0000
@@ -14,7 +14,6 @@
 
 import org.eclipse.cdt.core.parser.ast.IASTFactory;
 import org.eclipse.cdt.internal.core.parser.LineOffsetReconciler;
-import org.eclipse.cdt.internal.core.parser.NullSourceElementRequestor;
 import org.eclipse.cdt.internal.core.parser.Parser;
 import org.eclipse.cdt.internal.core.parser.Preprocessor;
 import org.eclipse.cdt.internal.core.parser.QuickParseCallback;
@@ -37,26 +36,34 @@
 			return new CompleteParseASTFactory( language ); 
 	}
 	
-    public static IParser createParser( IScanner scanner, ISourceElementRequestor callback, ParserMode mode, ParserLanguage language )
+    public static IParser createParser( IScanner scanner, ISourceElementRequestor callback, ParserMode mode, ParserLanguage language, IParserLogService log ) throws ParserFactoryException
     {
+    	if( scanner == null ) throw new ParserFactoryException( ParserFactoryException.Kind.NULL_SCANNER );
+		if( language == null ) throw new ParserFactoryException( ParserFactoryException.Kind.NULL_LANGUAGE );
+		IParserLogService logService = ( log == null ) ? createDefaultLogService() : log;
 		ParserMode ourMode = ( (mode == null )? ParserMode.COMPLETE_PARSE : mode ); 
 		ISourceElementRequestor ourCallback = (( callback == null) ? new NullSourceElementRequestor() : callback );   
-		return new Parser( scanner, ourCallback, ourMode, language );
+		return new Parser( scanner, ourCallback, ourMode, language, logService );
     }
  	 	
-    public static IScanner createScanner( Reader input, String fileName, IScannerInfo config, ParserMode mode, ParserLanguage language, ISourceElementRequestor requestor )
+    public static IScanner createScanner( Reader input, String fileName, IScannerInfo config, ParserMode mode, ParserLanguage language, ISourceElementRequestor requestor, IParserLogService log ) throws ParserFactoryException
     {
+    	if( input == null ) throw new ParserFactoryException( ParserFactoryException.Kind.NULL_READER );
+    	if( fileName == null ) throw new ParserFactoryException( ParserFactoryException.Kind.NULL_FILENAME );
+    	if( config == null ) throw new ParserFactoryException( ParserFactoryException.Kind.NULL_CONFIG );
+    	if( language == null ) throw new ParserFactoryException( ParserFactoryException.Kind.NULL_LANGUAGE );
+    	IParserLogService logService = ( log == null ) ? createDefaultLogService() : log;
 		ParserMode ourMode = ( (mode == null )? ParserMode.COMPLETE_PARSE : mode );
 		ISourceElementRequestor ourRequestor = (( requestor == null) ? new NullSourceElementRequestor() : requestor ); 
-		IScanner s = new Scanner( input, fileName, config, ourRequestor, ourMode, language );
+		IScanner s = new Scanner( input, fileName, config, ourRequestor, ourMode, language, logService );
 		return s; 
     }
     
-    public static IPreprocessor createPreprocessor( Reader input, String fileName, IScannerInfo info, ParserMode mode, ParserLanguage language, ISourceElementRequestor requestor )
+    public static IPreprocessor createPreprocessor( Reader input, String fileName, IScannerInfo info, ParserMode mode, ParserLanguage language, ISourceElementRequestor requestor, IParserLogService logService )
     {
 		ParserMode ourMode = ( (mode == null )? ParserMode.COMPLETE_PARSE : mode ); 
 		ISourceElementRequestor ourRequestor = (( requestor == null) ? new NullSourceElementRequestor() : requestor );
-		IPreprocessor s = new Preprocessor( input, fileName, info, ourRequestor, ourMode, language );
+		IPreprocessor s = new Preprocessor( input, fileName, info, ourRequestor, ourMode, language, logService );
 		return s;
     }
 	
@@ -70,4 +77,10 @@
 		return new QuickParseCallback();
 	}
 		
+	public static IParserLogService createDefaultLogService()
+	{
+		return defaultLogService;
+	}
+	
+	private static IParserLogService defaultLogService = new DefaultLogService();
 }
Index: parser/org/eclipse/cdt/core/parser/ParserFactoryException.java
===================================================================
RCS file: parser/org/eclipse/cdt/core/parser/ParserFactoryException.java
diff -N parser/org/eclipse/cdt/core/parser/ParserFactoryException.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ parser/org/eclipse/cdt/core/parser/ParserFactoryException.java	5 Nov 2003 23:33:03 -0000
@@ -0,0 +1,44 @@
+/**********************************************************************
+ * Copyright (c) 2002,2003 Rational Software Corporation and others.
+ * All rights reserved.   This program and the accompanying materials
+ * are made available under the terms of the Common Public License v0.5
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v05.html
+ * 
+ * Contributors: 
+ * IBM Rational Software - Initial API and implementation
+***********************************************************************/
+package org.eclipse.cdt.core.parser;
+
+/**
+ * @author jcamelon
+ *
+ */
+public class ParserFactoryException extends Exception {
+
+	public static class Kind extends Enum {
+		
+		public static final Kind NULL_READER 		= new Kind( 1 );
+		public static final Kind NULL_FILENAME		= new Kind( 2 );
+		public static final Kind NULL_CONFIG			= new Kind( 3 );
+		public static final Kind NULL_LANGUAGE	= new Kind( 4 );
+		public static final Kind NULL_SCANNER		= new Kind( 5 );
+		
+		protected Kind( int arg )
+		{
+			super( arg );
+		}
+	}
+	
+	public ParserFactoryException( Kind e )
+	{
+		kind = e;
+	}
+	
+	public Kind getKind()
+	{
+		return kind;
+	}
+	
+	private Kind kind;	
+}
Index: parser/org/eclipse/cdt/core/parser/ScannerInfo.java
===================================================================
RCS file: parser/org/eclipse/cdt/core/parser/ScannerInfo.java
diff -N parser/org/eclipse/cdt/core/parser/ScannerInfo.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ parser/org/eclipse/cdt/core/parser/ScannerInfo.java	5 Nov 2003 23:33:03 -0000
@@ -0,0 +1,50 @@
+/**********************************************************************
+ * Copyright (c) 2002,2003 Rational Software Corporation and others.
+ * All rights reserved.   This program and the accompanying materials
+ * are made available under the terms of the Common Public License v0.5
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v05.html
+ * 
+ * Contributors: 
+ * IBM Rational Software - Initial API and implementation
+***********************************************************************/
+package org.eclipse.cdt.core.parser;
+
+import java.util.Map;
+
+import org.eclipse.cdt.core.parser.IScannerInfo;
+
+/**
+ * @author jcamelon
+ *
+ */
+public class ScannerInfo implements IScannerInfo
+{
+	private Map definedSymbols = null; 
+	private String [] includePaths = null; 
+	
+	public ScannerInfo()
+	{
+	}
+	
+	public ScannerInfo( Map d, String [] incs )
+	{
+		definedSymbols = d; 
+		includePaths = incs;
+	}
+	
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.IScannerInfo#getDefinedSymbols()
+     */
+    public Map getDefinedSymbols()
+    {
+        return definedSymbols;
+    }
+    /* (non-Javadoc)
+     * @see org.eclipse.cdt.core.parser.IScannerInfo#getIncludePaths()
+     */
+    public String[] getIncludePaths()
+    {
+        return includePaths;
+    }
+}
Index: parser/org/eclipse/cdt/internal/core/parser/NullSourceElementRequestor.java
===================================================================
RCS file: parser/org/eclipse/cdt/internal/core/parser/NullSourceElementRequestor.java
diff -N parser/org/eclipse/cdt/internal/core/parser/NullSourceElementRequestor.java
--- parser/org/eclipse/cdt/internal/core/parser/NullSourceElementRequestor.java	5 Nov 2003 18:15:11 -0000	1.15
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,456 +0,0 @@
-package org.eclipse.cdt.internal.core.parser;
-
-import org.eclipse.cdt.core.parser.DefaultProblemHandler;
-import org.eclipse.cdt.core.parser.IProblem;
-import org.eclipse.cdt.core.parser.ISourceElementRequestor;
-import org.eclipse.cdt.core.parser.ParserMode;
-import org.eclipse.cdt.core.parser.ast.IASTASMDefinition;
-import org.eclipse.cdt.core.parser.ast.IASTAbstractTypeSpecifierDeclaration;
-import org.eclipse.cdt.core.parser.ast.IASTClassReference;
-import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier;
-import org.eclipse.cdt.core.parser.ast.IASTCodeScope;
-import org.eclipse.cdt.core.parser.ast.IASTCompilationUnit;
-import org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier;
-import org.eclipse.cdt.core.parser.ast.IASTEnumerationReference;
-import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier;
-import org.eclipse.cdt.core.parser.ast.IASTEnumeratorReference;
-import org.eclipse.cdt.core.parser.ast.IASTField;
-import org.eclipse.cdt.core.parser.ast.IASTFieldReference;
-import org.eclipse.cdt.core.parser.ast.IASTFunction;
-import org.eclipse.cdt.core.parser.ast.IASTFunctionReference;
-import org.eclipse.cdt.core.parser.ast.IASTInclusion;
-import org.eclipse.cdt.core.parser.ast.IASTLinkageSpecification;
-import org.eclipse.cdt.core.parser.ast.IASTMacro;
-import org.eclipse.cdt.core.parser.ast.IASTMethod;
-import org.eclipse.cdt.core.parser.ast.IASTMethodReference;
-import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition;
-import org.eclipse.cdt.core.parser.ast.IASTNamespaceReference;
-import org.eclipse.cdt.core.parser.ast.IASTParameterReference;
-import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration;
-import org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation;
-import org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization;
-import org.eclipse.cdt.core.parser.ast.IASTTypedefDeclaration;
-import org.eclipse.cdt.core.parser.ast.IASTTypedefReference;
-import org.eclipse.cdt.core.parser.ast.IASTUsingDeclaration;
-import org.eclipse.cdt.core.parser.ast.IASTUsingDirective;
-import org.eclipse.cdt.core.parser.ast.IASTVariable;
-import org.eclipse.cdt.core.parser.ast.IASTVariableReference;
-
-
-public class NullSourceElementRequestor implements ISourceElementRequestor 
-{
-    private ParserMode mode = ParserMode.COMPLETE_PARSE;
-
-	public NullSourceElementRequestor()
-	{
-	}
-
-	public NullSourceElementRequestor( ParserMode mode )
-	{
-		this.mode = mode;
-	}
-	/* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptProblem(org.eclipse.cdt.core.parser.IProblem)
-     */
-    public boolean acceptProblem(IProblem problem)
-    {
-		return DefaultProblemHandler.ruleOnProblem( problem, mode );
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptMacro(org.eclipse.cdt.core.parser.ast.IASTMacro)
-     */
-    public void acceptMacro(IASTMacro macro)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptVariable(org.eclipse.cdt.core.parser.ast.IASTVariable)
-     */
-    public void acceptVariable(IASTVariable variable)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptFunctionDeclaration(org.eclipse.cdt.core.parser.ast.IASTFunction)
-     */
-    public void acceptFunctionDeclaration(IASTFunction function)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptUsingDirective(org.eclipse.cdt.core.parser.ast.IASTUsingDirective)
-     */
-    public void acceptUsingDirective(IASTUsingDirective usageDirective)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptUsingDeclaration(org.eclipse.cdt.core.parser.ast.IASTUsingDeclaration)
-     */
-    public void acceptUsingDeclaration(IASTUsingDeclaration usageDeclaration)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptASMDefinition(org.eclipse.cdt.core.parser.ast.IASTASMDefinition)
-     */
-    public void acceptASMDefinition(IASTASMDefinition asmDefinition)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptTypedef(org.eclipse.cdt.core.parser.ast.IASTTypedef)
-     */
-    public void acceptTypedefDeclaration(IASTTypedefDeclaration typedef)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptEnumerationSpecifier(org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier)
-     */
-    public void acceptEnumerationSpecifier(IASTEnumerationSpecifier enumeration)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterFunctionBody(org.eclipse.cdt.core.parser.ast.IASTFunction)
-     */
-    public void enterFunctionBody(IASTFunction function)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitFunctionBody(org.eclipse.cdt.core.parser.ast.IASTFunction)
-     */
-    public void exitFunctionBody(IASTFunction function)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterCompilationUnit(org.eclipse.cdt.core.parser.ast.IASTCompilationUnit)
-     */
-    public void enterCompilationUnit(IASTCompilationUnit compilationUnit)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterInclusion(org.eclipse.cdt.core.parser.ast.IASTInclusion)
-     */
-    public void enterInclusion(IASTInclusion inclusion)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterNamespaceDefinition(org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition)
-     */
-    public void enterNamespaceDefinition(IASTNamespaceDefinition namespaceDefinition)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterClassSpecifier(org.eclipse.cdt.core.parser.ast.IASTClassSpecifier)
-     */
-    public void enterClassSpecifier(IASTClassSpecifier classSpecification)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterLinkageSpecification(org.eclipse.cdt.core.parser.ast.IASTLinkageSpecification)
-     */
-    public void enterLinkageSpecification(IASTLinkageSpecification linkageSpec)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterTemplateDeclaration(org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration)
-     */
-    public void enterTemplateDeclaration(IASTTemplateDeclaration declaration)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterTemplateSpecialization(org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization)
-     */
-    public void enterTemplateSpecialization(IASTTemplateSpecialization specialization)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterTemplateExplicitInstantiation(org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation)
-     */
-    public void enterTemplateInstantiation(IASTTemplateInstantiation instantiation)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptMethodDeclaration(org.eclipse.cdt.core.parser.ast.IASTMethod)
-     */
-    public void acceptMethodDeclaration(IASTMethod method)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterMethodBody(org.eclipse.cdt.core.parser.ast.IASTMethod)
-     */
-    public void enterMethodBody(IASTMethod method)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitMethodBody(org.eclipse.cdt.core.parser.ast.IASTMethod)
-     */
-    public void exitMethodBody(IASTMethod method)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptField(org.eclipse.cdt.core.parser.ast.IASTField)
-     */
-    public void acceptField(IASTField field)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptClassReference(org.eclipse.cdt.core.parser.ast.IASTClassReference)
-     */
-    public void acceptClassReference(IASTClassReference reference)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitTemplateDeclaration(org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration)
-     */
-    public void exitTemplateDeclaration(IASTTemplateDeclaration declaration)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitTemplateSpecialization(org.eclipse.cdt.core.parser.ast.IASTTemplateSpecialization)
-     */
-    public void exitTemplateSpecialization(IASTTemplateSpecialization specialization)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitTemplateExplicitInstantiation(org.eclipse.cdt.core.parser.ast.IASTTemplateInstantiation)
-     */
-    public void exitTemplateExplicitInstantiation(IASTTemplateInstantiation instantiation)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitLinkageSpecification(org.eclipse.cdt.core.parser.ast.IASTLinkageSpecification)
-     */
-    public void exitLinkageSpecification(IASTLinkageSpecification linkageSpec)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitClassSpecifier(org.eclipse.cdt.core.parser.ast.IASTClassSpecifier)
-     */
-    public void exitClassSpecifier(IASTClassSpecifier classSpecification)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitNamespaceDefinition(org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition)
-     */
-    public void exitNamespaceDefinition(IASTNamespaceDefinition namespaceDefinition)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitInclusion(org.eclipse.cdt.core.parser.ast.IASTInclusion)
-     */
-    public void exitInclusion(IASTInclusion inclusion)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitCompilationUnit(org.eclipse.cdt.core.parser.ast.IASTCompilationUnit)
-     */
-    public void exitCompilationUnit(IASTCompilationUnit compilationUnit)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptAbstractTypeSpecDeclaration(org.eclipse.cdt.core.parser.ast.IASTAbstractTypeSpecifierDeclaration)
-     */
-    public void acceptAbstractTypeSpecDeclaration(IASTAbstractTypeSpecifierDeclaration abstractDeclaration)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-
-
-
-
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptTypedefReference(org.eclipse.cdt.core.parser.ast.IASTTypedefReference)
-     */
-    public void acceptTypedefReference(IASTTypedefReference reference)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptNamespaceReference(org.eclipse.cdt.core.parser.ast.IASTNamespaceReference)
-     */
-    public void acceptNamespaceReference(IASTNamespaceReference reference)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptEnumerationReference(org.eclipse.cdt.core.parser.ast.IASTEnumerationReference)
-     */
-    public void acceptEnumerationReference(IASTEnumerationReference reference)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptVariableReference(org.eclipse.cdt.core.parser.ast.IASTVariableReference)
-     */
-    public void acceptVariableReference(IASTVariableReference reference)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptFunctionReference(org.eclipse.cdt.core.parser.ast.IASTFunctionReference)
-     */
-    public void acceptFunctionReference(IASTFunctionReference reference)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptFieldReference(org.eclipse.cdt.core.parser.ast.IASTFieldReference)
-     */
-    public void acceptFieldReference(IASTFieldReference reference)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptMethodReference(org.eclipse.cdt.core.parser.ast.IASTMethodReference)
-     */
-    public void acceptMethodReference(IASTMethodReference reference)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptElaboratedForewardDeclaration(org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier)
-     */
-    public void acceptElaboratedForewardDeclaration(IASTElaboratedTypeSpecifier elaboratedType)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#enterCodeBlock(org.eclipse.cdt.core.parser.ast.IASTScope)
-	 */
-	public void enterCodeBlock(IASTCodeScope scope) {
-		// TODO Auto-generated method stub
-		
-	}
-
-	/* (non-Javadoc)
-	 * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#exitCodeBlock(org.eclipse.cdt.core.parser.ast.IASTScope)
-	 */
-	public void exitCodeBlock(IASTCodeScope scope) {
-		// TODO Auto-generated method stub
-		
-	}
-
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptEnumeratorReference(org.eclipse.cdt.core.parser.ast.IASTEnumerationReference)
-     */
-    public void acceptEnumeratorReference(IASTEnumeratorReference reference)
-    {
-        // TODO Auto-generated method stub
-        
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.ISourceElementRequestor#acceptParameterReference(org.eclipse.cdt.internal.core.parser.ast.complete.ASTParameterReference)
-     */
-    public void acceptParameterReference(IASTParameterReference reference)
-    {
-        // TODO Auto-generated method stub
-        
-    } 
-}
Index: parser/org/eclipse/cdt/internal/core/parser/Parser.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Parser.java,v
retrieving revision 1.124
diff -u -r1.124 Parser.java
--- parser/org/eclipse/cdt/internal/core/parser/Parser.java	5 Nov 2003 18:15:11 -0000	1.124
+++ parser/org/eclipse/cdt/internal/core/parser/Parser.java	5 Nov 2003 23:33:07 -0000
@@ -14,10 +14,10 @@
 import java.util.List;
 import java.util.Stack;
 
-import org.eclipse.cdt.core.ICLogConstants;
 import org.eclipse.cdt.core.parser.Backtrack;
 import org.eclipse.cdt.core.parser.EndOfFile;
 import org.eclipse.cdt.core.parser.IParser;
+import org.eclipse.cdt.core.parser.IParserLogService;
 import org.eclipse.cdt.core.parser.IScanner;
 import org.eclipse.cdt.core.parser.ISourceElementRequestor;
 import org.eclipse.cdt.core.parser.IToken;
@@ -60,8 +60,6 @@
 import org.eclipse.cdt.core.parser.ast.IASTUsingDirective;
 import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier.ClassNameType;
 import org.eclipse.cdt.core.parser.ast.IASTExpression.Kind;
-import org.eclipse.cdt.internal.core.model.IDebugLogConstants;
-import org.eclipse.cdt.internal.core.model.Util;
 
 /**
  * This is our first implementation of the IParser interface, serving as a parser for
@@ -73,7 +71,8 @@
  */
 public class Parser implements IParser
 {
-    private static final List EMPTY_LIST = new ArrayList();
+    protected final IParserLogService log;
+	private static final List EMPTY_LIST = new ArrayList();
     private static int DEFAULT_OFFSET = -1;
     // sentinel initial value for offsets 
     private int firstErrorOffset = DEFAULT_OFFSET;
@@ -119,7 +118,7 @@
         IScanner scanner,
         ISourceElementRequestor callback,
         ParserMode mode,
-        ParserLanguage language )
+        ParserLanguage language, IParserLogService log )
     {
         this.scanner = scanner;
         requestor = callback;
@@ -127,6 +126,7 @@
         this.language = language;
         astFactory = ParserFactory.createASTFactory( mode, language);
         scanner.setASTFactory(astFactory);
+        this.log = log;
     }
     // counter that keeps track of the number of times Parser.parse() is called
     private static int parseCount = 0;
@@ -140,13 +140,13 @@
         // For the debuglog to take place, you have to call
         // Util.setDebugging(true);
         // Or set debug to true in the core plugin preference 
-        Util.debugLog(
+        log.traceLog(
             "Parse "
                 + (++parseCount)
                 + ": "
                 + (System.currentTimeMillis() - startTime)
                 + "ms"
-                + (parsePassed ? "" : " - parse failure"), IDebugLogConstants.PARSER);
+                + (parsePassed ? "" : " - parse failure") );
         return parsePassed;
     }
 
@@ -2254,9 +2254,9 @@
                                             catch (Backtrack e)
                                             {
                                                 failParse();
-                                                Util.debugLog(
+                                                log.traceLog(
                                                     "Unexpected Token ="
-                                                        + image,IDebugLogConstants.PARSER);
+                                                        + image );
                                                 consume();
                                                 // eat this token anyway
                                                 continue;
@@ -5142,8 +5142,8 @@
         }
         catch (ScannerException e)
         {
-            Util.debugLog( "ScannerException thrown : " + e.getMessage(), IDebugLogConstants.PARSER );
-			org.eclipse.cdt.internal.core.model.Util.log(e, "Scanner Exception: " + e.getMessage() , ICLogConstants.CDT); //$NON-NLS-1$h
+            log.traceLog( "ScannerException thrown : " + e.getProblem().getMessage() );
+			log.errorLog( "Scanner Exception: " + e.getProblem().getMessage()); //$NON-NLS-1$h
             failParse(); 
             return fetchToken();
         }
Index: parser/org/eclipse/cdt/internal/core/parser/Preprocessor.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Preprocessor.java,v
retrieving revision 1.9
diff -u -r1.9 Preprocessor.java
--- parser/org/eclipse/cdt/internal/core/parser/Preprocessor.java	5 Nov 2003 18:15:11 -0000	1.9
+++ parser/org/eclipse/cdt/internal/core/parser/Preprocessor.java	5 Nov 2003 23:33:08 -0000
@@ -12,8 +12,8 @@
 
 import java.io.Reader;
 
-import org.eclipse.cdt.core.ICLogConstants;
 import org.eclipse.cdt.core.parser.EndOfFile;
+import org.eclipse.cdt.core.parser.IParserLogService;
 import org.eclipse.cdt.core.parser.IPreprocessor;
 import org.eclipse.cdt.core.parser.IScannerInfo;
 import org.eclipse.cdt.core.parser.ISourceElementRequestor;
@@ -33,8 +33,8 @@
 	 * @param filename
 	 * @param defns
 	 */
-	public Preprocessor(Reader reader, String filename, IScannerInfo info, ISourceElementRequestor requestor, ParserMode mode, ParserLanguage language ) {
-        super(reader, filename, info, requestor, mode, language );
+	public Preprocessor(Reader reader, String filename, IScannerInfo info, ISourceElementRequestor requestor, ParserMode mode, ParserLanguage language, IParserLogService logService ) {
+        super(reader, filename, info, requestor, mode, language, logService );
     }
 
 	public void process()
@@ -47,8 +47,7 @@
 		catch( ScannerException se )
 		{
 			// callback IProblem here
-			org.eclipse.cdt.internal.core.model.Util.log(se, "Preprocessor Exception", ICLogConstants.CDT); //$NON-NLS-1$h
-			
+			log.errorLog("Preprocessor Exception "+ se.getProblem().getMessage()); //$NON-NLS-1$h
 		}
 		catch( EndOfFile eof )
 		{
Index: parser/org/eclipse/cdt/internal/core/parser/QuickParseCallback.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/QuickParseCallback.java,v
retrieving revision 1.4
diff -u -r1.4 QuickParseCallback.java
--- parser/org/eclipse/cdt/internal/core/parser/QuickParseCallback.java	14 Aug 2003 19:49:44 -0000	1.4
+++ parser/org/eclipse/cdt/internal/core/parser/QuickParseCallback.java	5 Nov 2003 23:33:08 -0000
@@ -15,6 +15,7 @@
 import java.util.List;
 import java.util.NoSuchElementException;
 
+import org.eclipse.cdt.core.parser.*;
 import org.eclipse.cdt.core.parser.IQuickParseCallback;
 import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException;
 import org.eclipse.cdt.core.parser.ast.IASTCompilationUnit;
Index: parser/org/eclipse/cdt/internal/core/parser/Scanner.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Scanner.java,v
retrieving revision 1.63
diff -u -r1.63 Scanner.java
--- parser/org/eclipse/cdt/internal/core/parser/Scanner.java	5 Nov 2003 18:15:11 -0000	1.63
+++ parser/org/eclipse/cdt/internal/core/parser/Scanner.java	5 Nov 2003 23:33:08 -0000
@@ -31,22 +31,23 @@
 import org.eclipse.cdt.core.parser.ILineOffsetReconciler;
 import org.eclipse.cdt.core.parser.IMacroDescriptor;
 import org.eclipse.cdt.core.parser.IParser;
+import org.eclipse.cdt.core.parser.IParserLogService;
 import org.eclipse.cdt.core.parser.IProblem;
 import org.eclipse.cdt.core.parser.IScanner;
 import org.eclipse.cdt.core.parser.IScannerInfo;
 import org.eclipse.cdt.core.parser.ISourceElementRequestor;
 import org.eclipse.cdt.core.parser.IToken;
+import org.eclipse.cdt.core.parser.NullSourceElementRequestor;
 import org.eclipse.cdt.core.parser.ParserFactory;
+import org.eclipse.cdt.core.parser.ParserFactoryException;
 import org.eclipse.cdt.core.parser.ParserLanguage;
 import org.eclipse.cdt.core.parser.ParserMode;
 import org.eclipse.cdt.core.parser.ScannerException;
+import org.eclipse.cdt.core.parser.ScannerInfo;
 import org.eclipse.cdt.core.parser.ast.ExpressionEvaluationException;
 import org.eclipse.cdt.core.parser.ast.IASTExpression;
 import org.eclipse.cdt.core.parser.ast.IASTFactory;
 import org.eclipse.cdt.core.parser.ast.IASTInclusion;
-import org.eclipse.cdt.internal.core.model.IDebugLogConstants;
-import org.eclipse.cdt.internal.core.model.Util;
-
 
 /**
  * @author jcamelon
@@ -55,6 +56,8 @@
 
 public class Scanner implements IScanner {
    
+	protected final IParserLogService log;
+	private final static String SCRATCH = "<scratch>";
 	private Reader backupReader;
 	private IProblemFactory problemFactory = new ScannerProblemFactory();
 
@@ -76,7 +79,8 @@
 			throw new ScannerException( p );
 	}
 
-    public Scanner(Reader reader, String filename, IScannerInfo info, ISourceElementRequestor requestor, ParserMode parserMode, ParserLanguage language ) {
+    public Scanner(Reader reader, String filename, IScannerInfo info, ISourceElementRequestor requestor, ParserMode parserMode, ParserLanguage language, IParserLogService log ) {
+    	this.log = log;
 		this.requestor = requestor;
 		this.mode = parserMode;
 		this.language = language;
@@ -1887,14 +1891,21 @@
 		else
 		{	
 			final NullSourceElementRequestor nullCallback = new NullSourceElementRequestor();
-			IScanner trial =
-				ParserFactory.createScanner(
-					new StringReader(expression + ";"),
-						EXPRESSION,
-						new ScannerInfo( definitions, originalConfig.getIncludePaths()), 
-						ParserMode.QUICK_PARSE, language, nullCallback );
-            IParser parser = ParserFactory.createParser(trial, nullCallback, ParserMode.QUICK_PARSE, language );
- 
+			IParser parser = null;
+			try
+			{
+				IScanner trial =
+					ParserFactory.createScanner(
+						new StringReader(expression + ";"),
+							EXPRESSION,
+							new ScannerInfo( definitions, originalConfig.getIncludePaths()), 
+							ParserMode.QUICK_PARSE, language, nullCallback, log );
+	            parser = ParserFactory.createParser(trial, nullCallback, ParserMode.QUICK_PARSE, language, log );
+			} catch( ParserFactoryException pfe )
+			{
+				// TODO - make INTERNAL IProblem
+				// should never happen
+			}
 			try {
 				IASTExpression exp = parser.expression(null);
 				if( exp.evaluateExpression() == 0 )
@@ -1988,7 +1999,7 @@
 										new ScannerInfo(definitions, originalConfig.getIncludePaths()), 
 										new NullSourceElementRequestor(),
 										mode,
-										language );
+										language, log );
 			IToken t = null;
 			
 			try {
@@ -2142,7 +2153,18 @@
 			
 			if( ! replacementString.equals( "" ) )
 			{
-				IScanner helperScanner = ParserFactory.createScanner( new StringReader(replacementString), null, new ScannerInfo( ), mode, language, new NullSourceElementRequestor() );
+				IScanner helperScanner=null;
+				try {
+					helperScanner =
+						ParserFactory.createScanner(
+							new StringReader(replacementString),
+							SCRATCH,
+							new ScannerInfo(),
+							mode,
+							language,
+							new NullSourceElementRequestor(), log);
+				} catch (ParserFactoryException e1) {
+				}
 				helperScanner.setTokenizingMacroReplacementList( true );
 				IToken t = helperScanner.nextToken(false);
 	
@@ -2227,7 +2249,7 @@
 				return;
 			}
 		} else {
-			Util.debugLog("Scanner : Encountered unexpected character " + ((char) c), IDebugLogConstants.PARSER);
+			log.traceLog("Scanner : Encountered unexpected character " + ((char) c));
 			handleProblem( IProblem.PREPROCESSOR_INVALID_MACRO_DEFN, "#define " + key + (char)c + getRestOfPreprocessorLine(), beginning, false, true, true );
 			return;
 		}
@@ -2266,9 +2288,9 @@
 					if( previousDefinition instanceof String ) 
 					{
 						Scanner previous = new Scanner( new StringReader( (String)previousDefinition ), "redef-test", new ScannerInfo(), new NullSourceElementRequestor(), 
-							mode, language );
+							mode, language, log );
 						Scanner current = new Scanner( new StringReader( (String)newDefinition ), "redef-test", new ScannerInfo(), new NullSourceElementRequestor(), 
-													mode, language );
+													mode, language, log );
 						for ( ; ; )
 						{
 							IToken p = null;
@@ -2309,7 +2331,7 @@
     
     protected Vector getMacroParameters (String params, boolean forStringizing) throws ScannerException {
         
-        Scanner tokenizer  = new Scanner(new StringReader(params), TEXT, new ScannerInfo( definitions, originalConfig.getIncludePaths() ), new NullSourceElementRequestor(), mode, language);
+        Scanner tokenizer  = new Scanner(new StringReader(params), TEXT, new ScannerInfo( definitions, originalConfig.getIncludePaths() ), new NullSourceElementRequestor(), mode, language, log);
         tokenizer.setThrowExceptionOnBadCharacterRead(false);
         Vector parameterValues = new Vector();
         Token t = null;
@@ -2512,9 +2534,9 @@
 			}			
 
 		} else {
-			Util.debugLog(
+			log.traceLog(
 				"Unexpected class stored in definitions table. "
-					+ expansion.getClass().getName(), IDebugLogConstants.PARSER);
+					+ expansion.getClass().getName() );
 		}
 
 	}
Index: parser/org/eclipse/cdt/internal/core/parser/ScannerInfo.java
===================================================================
RCS file: parser/org/eclipse/cdt/internal/core/parser/ScannerInfo.java
diff -N parser/org/eclipse/cdt/internal/core/parser/ScannerInfo.java
--- parser/org/eclipse/cdt/internal/core/parser/ScannerInfo.java	9 Jul 2003 00:47:42 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,50 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2002,2003 Rational Software Corporation and others.
- * All rights reserved.   This program and the accompanying materials
- * are made available under the terms of the Common Public License v0.5
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v05.html
- * 
- * Contributors: 
- * IBM Rational Software - Initial API and implementation
-***********************************************************************/
-package org.eclipse.cdt.internal.core.parser;
-
-import java.util.Map;
-
-import org.eclipse.cdt.core.parser.IScannerInfo;
-
-/**
- * @author jcamelon
- *
- */
-public class ScannerInfo implements IScannerInfo
-{
-	private Map definedSymbols = null; 
-	private String [] includePaths = null; 
-	
-	public ScannerInfo()
-	{
-	}
-	
-	public ScannerInfo( Map d, String [] incs )
-	{
-		definedSymbols = d; 
-		includePaths = incs;
-	}
-	
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.IScannerInfo#getDefinedSymbols()
-     */
-    public Map getDefinedSymbols()
-    {
-        return definedSymbols;
-    }
-    /* (non-Javadoc)
-     * @see org.eclipse.cdt.core.parser.IScannerInfo#getIncludePaths()
-     */
-    public String[] getIncludePaths()
-    {
-        return includePaths;
-    }
-}
Index: search/org/eclipse/cdt/internal/core/search/matching/CSearchPattern.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/CSearchPattern.java,v
retrieving revision 1.29
diff -u -r1.29 CSearchPattern.java
--- search/org/eclipse/cdt/internal/core/search/matching/CSearchPattern.java	5 Nov 2003 18:15:11 -0000	1.29
+++ search/org/eclipse/cdt/internal/core/search/matching/CSearchPattern.java	5 Nov 2003 23:33:11 -0000
@@ -24,10 +24,14 @@
 import org.eclipse.cdt.core.parser.IQuickParseCallback;
 import org.eclipse.cdt.core.parser.IScanner;
 import org.eclipse.cdt.core.parser.IToken;
+import org.eclipse.cdt.core.parser.NullSourceElementRequestor;
 import org.eclipse.cdt.core.parser.ParserFactory;
+import org.eclipse.cdt.core.parser.ParserFactoryException;
 import org.eclipse.cdt.core.parser.ParserLanguage;
 import org.eclipse.cdt.core.parser.ParserMode;
+import org.eclipse.cdt.core.parser.ParserUtil;
 import org.eclipse.cdt.core.parser.ScannerException;
+import org.eclipse.cdt.core.parser.ScannerInfo;
 import org.eclipse.cdt.core.parser.ast.ASTClassKind;
 import org.eclipse.cdt.core.parser.ast.ASTNotImplementedException;
 import org.eclipse.cdt.core.parser.ast.ASTPointerOperator;
@@ -47,8 +51,6 @@
 import org.eclipse.cdt.internal.core.index.IIndex;
 import org.eclipse.cdt.internal.core.index.impl.BlocksIndexInput;
 import org.eclipse.cdt.internal.core.index.impl.IndexInput;
-import org.eclipse.cdt.internal.core.parser.NullSourceElementRequestor;
-import org.eclipse.cdt.internal.core.parser.ScannerInfo;
 import org.eclipse.cdt.internal.core.search.IIndexSearchRequestor;
 import org.eclipse.cdt.internal.core.search.indexing.IIndexConstants;
 import org.eclipse.core.runtime.IProgressMonitor;
@@ -171,7 +173,20 @@
 			return orPattern;
 		}
 		
-		IScanner scanner = ParserFactory.createScanner( new StringReader( patternString ), "TEXT", new ScannerInfo(), ParserMode.QUICK_PARSE, ParserLanguage.CPP, callback );
+		IScanner scanner = null;
+		try {
+			scanner =
+				ParserFactory.createScanner(
+					new StringReader(patternString),
+					"TEXT",
+					new ScannerInfo(),
+					ParserMode.QUICK_PARSE,
+					ParserLanguage.CPP,
+					callback, 
+					ParserUtil.getParserLogService());
+		} catch (ParserFactoryException e) {
+
+		}
 		LinkedList list = scanForNames( scanner, null );
 		
 		char [] name = (char []) list.removeLast();
@@ -229,7 +244,19 @@
 			return orPattern;
 		}
 		
-		IScanner scanner = ParserFactory.createScanner( new StringReader( patternString ), "TEXT", new ScannerInfo(), ParserMode.QUICK_PARSE, ParserLanguage.CPP, callback );
+		IScanner scanner=null;
+		try {
+			scanner =
+				ParserFactory.createScanner(
+					new StringReader(patternString),
+					"TEXT",
+					new ScannerInfo(),
+					ParserMode.QUICK_PARSE,
+					ParserLanguage.CPP,
+					callback,ParserUtil.getParserLogService());
+		} catch (ParserFactoryException e) {
+
+		}
 		LinkedList list = scanForNames( scanner, null );
 		
 		char [] name = (char []) list.removeLast();
@@ -259,7 +286,18 @@
 		String paramString = ( index == -1 ) ? "" : patternString.substring( index );
 		String nameString = ( index == -1 ) ? patternString : patternString.substring( 0, index );
 		
-		IScanner scanner = ParserFactory.createScanner( new StringReader( nameString ), "TEXT", new ScannerInfo(), ParserMode.QUICK_PARSE, ParserLanguage.CPP, callback );
+		IScanner scanner=null;
+		try {
+			scanner =
+				ParserFactory.createScanner(
+					new StringReader(nameString),
+					"TEXT",
+					new ScannerInfo(),
+					ParserMode.QUICK_PARSE,
+					ParserLanguage.CPP,
+					callback,ParserUtil.getParserLogService());
+		} catch (ParserFactoryException e) {
+		}
 		
 		LinkedList names = scanForNames( scanner, null );
 
@@ -306,7 +344,18 @@
 //			return orPattern;
 //		}
 		
-		IScanner scanner = ParserFactory.createScanner( new StringReader( patternString ), "TEXT", new ScannerInfo(), ParserMode.QUICK_PARSE, ParserLanguage.CPP, callback );
+		IScanner scanner =null;
+		try {
+			scanner =
+				ParserFactory.createScanner(
+					new StringReader(patternString),
+					"TEXT",
+					new ScannerInfo(),
+					ParserMode.QUICK_PARSE,
+					ParserLanguage.CPP,
+					callback,ParserUtil.getParserLogService());
+		} catch (ParserFactoryException e1) {
+		}
 		
 		IToken token = null;
 		ASTClassKind kind = null;
@@ -359,9 +408,29 @@
 		
 		String functionString = "void f " + paramString + ";";
 				
-		IScanner scanner = ParserFactory.createScanner( new StringReader( functionString ), "TEXT", new ScannerInfo(), ParserMode.QUICK_PARSE, ParserLanguage.CPP, callback );
+		IScanner scanner=null;
+		try {
+			scanner =
+				ParserFactory.createScanner(
+					new StringReader(functionString),
+					"TEXT",
+					new ScannerInfo(),
+					ParserMode.QUICK_PARSE,
+					ParserLanguage.CPP,
+					callback,ParserUtil.getParserLogService());
+		} catch (ParserFactoryException e1) {
+		}
 		IQuickParseCallback callback = ParserFactory.createQuickParseCallback();			   
-		IParser parser = ParserFactory.createParser( scanner, callback, ParserMode.QUICK_PARSE, ParserLanguage.CPP ); 
+		IParser parser=null;
+		try {
+			parser =
+				ParserFactory.createParser(
+					scanner,
+					callback,
+					ParserMode.QUICK_PARSE,
+					ParserLanguage.CPP, ParserUtil.getParserLogService());
+		} catch (ParserFactoryException e2) {
+		} 
 
 		if( parser.parse() ){
 			IASTCompilationUnit compUnit = callback.getCompilationUnit();
Index: search/org/eclipse/cdt/internal/core/search/matching/MatchLocator.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/MatchLocator.java,v
retrieving revision 1.38
diff -u -r1.38 MatchLocator.java
--- search/org/eclipse/cdt/internal/core/search/matching/MatchLocator.java	5 Nov 2003 18:15:11 -0000	1.38
+++ search/org/eclipse/cdt/internal/core/search/matching/MatchLocator.java	5 Nov 2003 23:33:11 -0000
@@ -35,8 +35,11 @@
 import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate;
 import org.eclipse.cdt.core.parser.ISourceElementRequestor;
 import org.eclipse.cdt.core.parser.ParserFactory;
+import org.eclipse.cdt.core.parser.ParserFactoryException;
 import org.eclipse.cdt.core.parser.ParserLanguage;
 import org.eclipse.cdt.core.parser.ParserMode;
+import org.eclipse.cdt.core.parser.ParserUtil;
+import org.eclipse.cdt.core.parser.ScannerInfo;
 import org.eclipse.cdt.core.parser.ast.IASTASMDefinition;
 import org.eclipse.cdt.core.parser.ast.IASTAbstractTypeSpecifierDeclaration;
 import org.eclipse.cdt.core.parser.ast.IASTClassReference;
@@ -78,7 +81,6 @@
 import org.eclipse.cdt.core.search.ICSearchScope;
 import org.eclipse.cdt.core.search.IMatch;
 import org.eclipse.cdt.internal.core.model.IWorkingCopy;
-import org.eclipse.cdt.internal.core.parser.ScannerInfo;
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IResource;
@@ -434,8 +436,17 @@
 				//TODO no project, what language do we use?
 				language = ParserLanguage.CPP;
 			}
-			IScanner scanner = ParserFactory.createScanner( reader, realPath.toOSString(), scanInfo, ParserMode.COMPLETE_PARSE, language, this );
-			IParser  parser  = ParserFactory.createParser( scanner, this, ParserMode.COMPLETE_PARSE, language );
+			
+			IParser parser = null;
+			try
+			{
+				IScanner scanner = ParserFactory.createScanner( reader, realPath.toOSString(), scanInfo, ParserMode.COMPLETE_PARSE, language, this, ParserUtil.getParserLogService() );
+				parser  = ParserFactory.createParser( scanner, this, ParserMode.COMPLETE_PARSE, language, ParserUtil.getParserLogService() );
+			}
+			catch( ParserFactoryException pfe )
+			{
+				
+			}
 			
 			if (VERBOSE)
 			  MatchLocator.verbose("*** New Search for path: " + pathString);
Index: src/org/eclipse/cdt/core/ICLogConstants.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ICLogConstants.java,v
retrieving revision 1.1
diff -u -r1.1 ICLogConstants.java
--- src/org/eclipse/cdt/core/ICLogConstants.java	1 Oct 2003 13:33:34 -0000	1.1
+++ src/org/eclipse/cdt/core/ICLogConstants.java	5 Nov 2003 23:33:11 -0000
@@ -25,7 +25,6 @@
 	
 	
    public static final LogConst PDE = new LogConst( 1 );
-   
    public static final LogConst CDT = new LogConst( 2 );
    
 }

Back to the top