本文整理匯總了Java中org.eclipse.cdt.core.dom.ast.IASTImplicitName類的典型用法代碼示例。如果您正苦於以下問題:Java IASTImplicitName類的具體用法?Java IASTImplicitName怎麽用?Java IASTImplicitName使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
IASTImplicitName類屬於org.eclipse.cdt.core.dom.ast包,在下文中一共展示了IASTImplicitName類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: visit
import org.eclipse.cdt.core.dom.ast.IASTImplicitName; //導入依賴的package包/類
@Override
public int visit(IASTName name) {
if (name instanceof IASTImplicitName)
visit((IASTImplicitName) name);
else if (name instanceof ICPPASTName)
visit((ICPPASTName) name);
else {
err("No sub-interfaced IASTName? " + name.getClass().getName() + ": " + name.getRawSignature());
throw new RuntimeException("NYI");
}
return PROCESS_ABORT;
}
示例2: testExample
import org.eclipse.cdt.core.dom.ast.IASTImplicitName; //導入依賴的package包/類
public void testExample() {
IASTTranslationUnit translationUnit = parseCPP(getCommentAbove());
ASTNamesVisitor namesVisitor = new ASTNamesVisitor();
translationUnit.accept(namesVisitor);
// &y中的&,因為它被重載了
assertTrue(namesVisitor.getNames().get(namesVisitor.getNames().size() - 2) instanceof IASTImplicitName);
}
示例3: visit
import org.eclipse.cdt.core.dom.ast.IASTImplicitName; //導入依賴的package包/類
@Override
protected int visit(ICPPASTConstructorInitializer node) {
IASTImplicitNameOwner parent = (IASTImplicitNameOwner)node.getParent() ;
NamedEntity fmx = null;
Invocation invok = null;
// if this is an implicit call to a constructor
for (IASTImplicitName candidate : parent.getImplicitNames()) {
IBinding constBnd = null;
constBnd = resolver.getBinding( candidate );
if (constBnd != null) {
fmx = dico.getEntityByKey(constBnd);
if (fmx instanceof BehaviouralEntity) {
break; // we found one method matching the implicit constructor. We are happy for now.
}
}
}
// if we could not get it, try to create a meaningful stub
if (fmx == null) {
// get the name of the called constructor (or attribute initialized)
String mthName = null;
if (parent.getImplicitNames().length > 0) {
mthName = parent.getImplicitNames()[0].toString();
}
else if (parent instanceof ICPPASTConstructorChainInitializer) {
// FIXME what if returnedType == null but should be Attribute ... ?
if ( returnedEntity instanceof Attribute ) { // hopefully set in visit(ICPPASTConstructorChainInitializer)
mthName = ((Attribute)returnedEntity).getDeclaredType().getName();
}
else {
// Constructor name is the name of its class (possibly fully qualified) + name of the class (unqualified)
QualifiedName qualName = new QualifiedName( ((ICPPASTConstructorChainInitializer)parent).getMemberInitializerId().toString() );
mthName = qualName.toString() + QualifiedName.CPP_NAME_SEPARATOR + qualName.unqualifiedName();
}
}
// create the constructor
if (mthName != null) {
fmx = makeStubBehavioural(mthName, node.getArguments().length, /*isMethod*/true);
}
}
if (fmx != null) {
invok = invocationOfBehavioural((BehaviouralEntity) fmx);
returnedEntity = invok;
dico.addSourceAnchor(returnedEntity, filename, node.getFileLocation());
}
visitInvocationArguments(node.getArguments(), invok);
return PROCESS_SKIP;
}