diff --git a/core/org.eclipse.cdt.core/parser/ChangeLog-parser b/core/org.eclipse.cdt.core/parser/ChangeLog-parser index a2a2baa045e..63d44007c0b 100644 --- a/core/org.eclipse.cdt.core/parser/ChangeLog-parser +++ b/core/org.eclipse.cdt.core/parser/ChangeLog-parser @@ -1,3 +1,6 @@ +2004-01-23 John Camelon + Added support for content assist in the scanner.. + 2004-01-22 John Camelon Added token, scanner and problem subpackages to org.eclipse.cdt.internal.core.parser. diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/OffsetLimitReachedException.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/OffsetLimitReachedException.java index 3bd27e8dda9..6a653bdb1fa 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/OffsetLimitReachedException.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/OffsetLimitReachedException.java @@ -10,16 +10,26 @@ ***********************************************************************/ package org.eclipse.cdt.core.parser; +import org.eclipse.cdt.core.parser.ast.IASTCompletionNode; + /** * @author jcamelon */ public class OffsetLimitReachedException extends EndOfFileException { + private final IASTCompletionNode node; private final IToken finalToken; - + + public OffsetLimitReachedException( IASTCompletionNode node ) + { + this.node = node; + finalToken = null; + } + public OffsetLimitReachedException( IToken token ) { finalToken = token; + node = null; } /** @@ -28,5 +38,17 @@ public class OffsetLimitReachedException extends EndOfFileException { public IToken getFinalToken() { return finalToken; } + + /** + * @return returns the IASTCompletionNode + */ + public IASTCompletionNode getCompletionNode() + { + return node; + } + + /** + * @author jcamelon + */ } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/Scanner.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/Scanner.java index 00c4cfd940e..03302ce510a 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/Scanner.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/Scanner.java @@ -1194,6 +1194,7 @@ public class Scanner implements IScanner { c = getChar(); continue; case PreprocessorDirectives.IF : + //TODO add in content assist stuff here // get the rest of the line int currentOffset = getCurrentOffset(); String expression = getRestOfPreprocessorLine(); @@ -1210,6 +1211,7 @@ public class Scanner implements IScanner { case PreprocessorDirectives.IFDEF : + //TODO add in content assist stuff here skipOverWhitespace(); if (getDefinition(getNextIdentifier()) == null) { // not defined @@ -1234,6 +1236,7 @@ public class Scanner implements IScanner { continue; case PreprocessorDirectives.IFNDEF : + //TODO add in content assist stuff here skipOverWhitespace(); if (getDefinition(getNextIdentifier()) != null) { // not defined @@ -1247,6 +1250,7 @@ public class Scanner implements IScanner { continue; case PreprocessorDirectives.ELSE : + //TODO add in content assist stuff here try { passOnToClient = branches.poundelse(); @@ -1264,6 +1268,7 @@ public class Scanner implements IScanner { continue; case PreprocessorDirectives.ELIF : + //TODO add in content assist stuff here int co = getCurrentOffset(); String elsifExpression = getRestOfPreprocessorLine().trim(); @@ -1291,7 +1296,6 @@ public class Scanner implements IScanner { continue; case PreprocessorDirectives.LINE : - //TO DO skipOverTextUntilNewline(); c = getChar(); continue; @@ -1839,7 +1843,7 @@ public class Scanner implements IScanner { if( finalToken.getEndOffset() == offsetLimit ) throw new OffsetLimitReachedException(finalToken); - throw new OffsetLimitReachedException( null ); + throw new OffsetLimitReachedException( (IToken)null ); }