mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Add IASTTranslationUnit#getParserLanguage() to assist in fixing 100598.
This commit is contained in:
parent
629a1ea350
commit
041d2ab204
3 changed files with 26 additions and 0 deletions
|
@ -10,6 +10,8 @@
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
package org.eclipse.cdt.core.dom.ast;
|
package org.eclipse.cdt.core.dom.ast;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.parser.ParserLanguage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The translation unit represents a compilable unit of source.
|
* The translation unit represents a compilable unit of source.
|
||||||
*
|
*
|
||||||
|
@ -169,8 +171,22 @@ public interface IASTTranslationUnit extends IASTNode {
|
||||||
public IASTInclusionNode [] getInclusions();
|
public IASTInclusionNode [] getInclusions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public IDependencyTree getDependencyTree();
|
public IDependencyTree getDependencyTree();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param offset
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public String getContainingFilename(int offset);
|
public String getContainingFilename(int offset);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public ParserLanguage getParserLanguage();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -35,6 +35,7 @@ import org.eclipse.cdt.core.dom.ast.IMacroBinding;
|
||||||
import org.eclipse.cdt.core.dom.ast.IScope;
|
import org.eclipse.cdt.core.dom.ast.IScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.c.CASTVisitor;
|
import org.eclipse.cdt.core.dom.ast.c.CASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.c.ICASTDesignator;
|
import org.eclipse.cdt.core.dom.ast.c.ICASTDesignator;
|
||||||
|
import org.eclipse.cdt.core.parser.ParserLanguage;
|
||||||
import org.eclipse.cdt.core.parser.ast.IASTEnumerator;
|
import org.eclipse.cdt.core.parser.ast.IASTEnumerator;
|
||||||
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
||||||
|
@ -505,4 +506,8 @@ public class CASTTranslationUnit extends CASTNode implements
|
||||||
return resolver.getContainingFilename( offset );
|
return resolver.getContainingFilename( offset );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ParserLanguage getParserLanguage() {
|
||||||
|
return ParserLanguage.C;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,6 +50,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTOperatorName;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTranslationUnit;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTranslationUnit;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespace;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespace;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPScope;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPScope;
|
||||||
|
import org.eclipse.cdt.core.parser.ParserLanguage;
|
||||||
import org.eclipse.cdt.core.parser.ast.IASTEnumerator;
|
import org.eclipse.cdt.core.parser.ast.IASTEnumerator;
|
||||||
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
||||||
|
@ -558,4 +559,8 @@ public class CPPASTTranslationUnit extends CPPASTNode implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ParserLanguage getParserLanguage() {
|
||||||
|
return ParserLanguage.CPP;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue