• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java IASTDeclaration类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.eclipse.cdt.core.dom.ast.IASTDeclaration的典型用法代码示例。如果您正苦于以下问题:Java IASTDeclaration类的具体用法?Java IASTDeclaration怎么用?Java IASTDeclaration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IASTDeclaration类属于org.eclipse.cdt.core.dom.ast包,在下文中一共展示了IASTDeclaration类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: visit

import org.eclipse.cdt.core.dom.ast.IASTDeclaration; //导入依赖的package包/类
@Override
public int visit(IASTDeclaration node) {
	/* ********************************************************************************************
	 * BE CAREFULL: The order of the tests is important because choices are not mutually exclusive
	 * ex: ICPPASTFunctionDefinition is a sub-interface of IASTFunctionDefinition
	 * ******************************************************************************************** */
	if (node instanceof IASTSimpleDeclaration) {
		return visit((IASTSimpleDeclaration)node);
	}
	else if (node instanceof ICPPASTFunctionDefinition) {
		return visit((ICPPASTFunctionDefinition)node);
	}
	else if (node instanceof IASTFunctionDefinition) {
		return visit((IASTFunctionDefinition)node);
	}
	else if (node instanceof ICPPASTTemplateDeclaration) {
		return visit((ICPPASTTemplateDeclaration)node);
	}
	else if (node instanceof ICPPASTVisibilityLabel) {
		return visit((ICPPASTVisibilityLabel)node);
	}
	//else ICPPASTUsingDirective, ...

	return super.visit(node);
}
 
开发者ID:Synectique,项目名称:VerveineC-Cpp,代码行数:26,代码来源:AbstractDispatcherVisitor.java


示例2: visit

import org.eclipse.cdt.core.dom.ast.IASTDeclaration; //导入依赖的package包/类
@Override
protected int visit(ICPPASTCompositeTypeSpecifier node) {
	Class fmx;

	/* Gets the key (IBinding) of the node to recover the famix type entity */
	super.visit(node);

	fmx = (Class) dico.getEntityByKey(nodeBnd);

	this.getContext().push(fmx);
	for (IASTDeclaration decl : node.getDeclarations(/*includeInactive*/true)) {
		decl.accept(this);
	}
	returnedEntity = getContext().pop();

	return PROCESS_SKIP;
}
 
开发者ID:Synectique,项目名称:VerveineC-Cpp,代码行数:18,代码来源:AbstractRefVisitor.java


示例3: visit

import org.eclipse.cdt.core.dom.ast.IASTDeclaration; //导入依赖的package包/类
@Override
protected int visit(ICPPASTCompositeTypeSpecifier node) {
	Class fmx;

	/* Gets the key (IBinding) of the node to recover the famix type entity */
	super.visit(node);

	fmx = (Class) dico.getEntityByKey(nodeBnd);

	/*
	 * Visiting possible template methods
	 */
	this.getContext().push(fmx);
	for (IASTDeclaration decl : node.getDeclarations(/*includeInactive*/true)) {
		decl.accept(this);
	}
	returnedEntity = getContext().pop();

	return PROCESS_SKIP;
}
 
开发者ID:Synectique,项目名称:VerveineC-Cpp,代码行数:21,代码来源:TemplateParameterDefVisitor.java


示例4: visit

import org.eclipse.cdt.core.dom.ast.IASTDeclaration; //导入依赖的package包/类
/** Visiting a struct in C
 * similar to C++ but no template
 */
@Override
protected int visit(ICASTCompositeTypeSpecifier node) {
	Class fmx;

	// compute nodeName and binding
	super.visit(node);
	fmx = dico.ensureFamixClass(nodeBnd, "struct "+nodeName.toString(), (ContainerEntity)getContext().top());

	fmx.setIsStub(false);  // used to say TRUE if could not find a binding. Not too sure ... 
	dico.addSourceAnchor(fmx, filename, node.getFileLocation());

	this.getContext().push(fmx);
	for (IASTDeclaration decl : node.getDeclarations(/*includeInactive*/true)) {
		decl.accept(this);
	}
	returnedEntity = getContext().pop();

	return PROCESS_SKIP;
}
 
开发者ID:Synectique,项目名称:VerveineC-Cpp,代码行数:23,代码来源:TypeDefVisitor.java


示例5: visit

import org.eclipse.cdt.core.dom.ast.IASTDeclaration; //导入依赖的package包/类
@Override
public int visit(ICPPASTNamespaceDefinition node) {
	Namespace fmx;
	nodeName = node.getName();
	if (! nodeName.toString().equals("")) {
		nodeBnd = resolver.getBinding(nodeName);

		fmx = dico.ensureFamixNamespace(nodeBnd, nodeName.toString(), (Namespace) this.getContext().top());
		fmx.setIsStub(false);

		this.getContext().push(fmx);
	}

	for (IASTDeclaration decl : node.getDeclarations()) {
		decl.accept(this);
	}

	if (! nodeName.toString().equals("")) {
		getContext().pop();
	}

	return PROCESS_SKIP;
}
 
开发者ID:Synectique,项目名称:VerveineC-Cpp,代码行数:24,代码来源:NamespaceDefVisitor.java


示例6: visit

import org.eclipse.cdt.core.dom.ast.IASTDeclaration; //导入依赖的package包/类
@Override
protected int visit(IASTCompositeTypeSpecifier node) {
	Class fmx;

	super.visit(node);
	fmx = (Class) dico.getEntityByKey(nodeBnd);

	this.getContext().push(fmx);
	for (IASTDeclaration decl : node.getDeclarations(/*includeInactive*/true)) {
		decl.accept(this);
	}
	returnedEntity = getContext().pop();

	return PROCESS_SKIP;
}
 
开发者ID:Synectique,项目名称:VerveineC-Cpp,代码行数:16,代码来源:ClassMemberDefVisitor.java


示例7: visit

import org.eclipse.cdt.core.dom.ast.IASTDeclaration; //导入依赖的package包/类
public int visit(ICASTKnRFunctionDeclarator declarator) {
	err("CKnRFunctionDeclarator: " + declarator.getRawSignature());
	IASTName[] names = declarator.getParameterNames();
	IASTDeclaration[] declarations = declarator.getParameterDeclarations();
	Map<IASTName, IASTDeclarator> map = new HashMap<IASTName, IASTDeclarator>();
	for (IASTName name : names)
		map.put(name, declarator.getDeclaratorForParameterName(name));
	// TODO: implement
	// check add getDeclarator, getParameterNames, getParameterDeclarations

	throw new RuntimeException("NYI");
}
 
开发者ID:cwi-swat,项目名称:clair,代码行数:13,代码来源:Parser.java


示例8: visit

import org.eclipse.cdt.core.dom.ast.IASTDeclaration; //导入依赖的package包/类
public int visit(IASTDeclaration declaration) {
    if (declaration instanceof IASTFunctionDefinition) {
        functionDefinitions.add((IASTFunctionDefinition) declaration);
    }

    return PROCESS_CONTINUE;
}
 
开发者ID:magicsky,项目名称:sya,代码行数:8,代码来源:ASTFunctionDefinitionVisitor.java


示例9: main

import org.eclipse.cdt.core.dom.ast.IASTDeclaration; //导入依赖的package包/类
public static void main(String[] args) throws IOException {

        String sourceFile = "/Users/wul/Downloads/cppcheck-1.63/cli/main.cpp";

        IASTTranslationUnitCore astTranslationUnitCore = new ASTTranslationUnitCore();
        IASTTranslationUnit astTranslationUnit = astTranslationUnitCore.parseFile(
            sourceFile, ParserLanguage.CPP, false, false
        );
        System.out.println(astTranslationUnit.getFilePath());
        ASTDeclarationsVisitor astDeclarationsVisitor = new ASTDeclarationsVisitor();
        astTranslationUnit.accept(astDeclarationsVisitor);
        for (IASTDeclaration declaration: astDeclarationsVisitor.getDeclarations()) {
            System.out.println(declaration.getRawSignature());
        }
    }
 
开发者ID:magicsky,项目名称:sya,代码行数:16,代码来源:DoCheck.java


示例10: visit

import org.eclipse.cdt.core.dom.ast.IASTDeclaration; //导入依赖的package包/类
public int visit(IASTDeclaration decl) {
	
	if ("IASTTranslationUnit.OWNED_DECLARATION - IASTDeclaration for IASTTranslationUnit".equals(decl.getPropertyInParent().getName()))
    { 
		curDecl = cnt; //设置当前函数块的序号		
    }
	
//	System.out.println("Visiting decl: " + decl.getRawSignature());
      //    System.out.println(decl.getPropertyInParent().getName());
	setThings(decl.getPropertyInParent().getName(),"Visiting decl: " + decl.getRawSignature());
	return PROCESS_CONTINUE;
}
 
开发者ID:elenno,项目名称:simtest,代码行数:13,代码来源:ASTVISITOR.java


示例11: problemDeclaration

import org.eclipse.cdt.core.dom.ast.IASTDeclaration; //导入依赖的package包/类
@Override
protected IASTDeclaration[] problemDeclaration(int offset, BacktrackException bt, DeclarationOptions option) {
	try {
		switch (LT(1)) {
		case IProCToken.tEXEC:

			switch (LT(2)) {
			case IProCToken.tSQL:
			case IProCToken.tORACLE:
			case IProCToken.tTOOLS:
			case IProCToken.tIAF:
				IASTStatement stmt = getNodeFactory().newCompoundStatement();

				// skip to semicolon or END-EXEC
				int endOfProc = IToken.tSEMI;
				IToken t = consume();
				while (true) {
					switch (t.getType()) {
					case IProCToken.tEXECUTE:
						switch (LT(1)) {
						case IProCToken.tDECLARE:
						case IProCToken.tBEGIN:
							endOfProc = IProCToken.tEND_EXEC;
							break;
						}
						break;
					}

					final int type = t.getType();

					if (type == IToken.tIDENTIFIER || type >= IProCToken.FIRST_IProCToken) {
						final int p_offset = t.getOffset();
						final int p_endOffset = t.getEndOffset();
						final int p_length = t.getLength();

						IASTName name = getNodeFactory().newName(t.getCharImage());
						((ASTNode) name).setOffsetAndLength(p_offset, p_length);

						IBinding binding = new ProCBinding(name);
						name.setBinding(binding);

						IASTLabelStatement label_statement = getNodeFactory().newLabelStatement(name, null);
						setRange(label_statement, p_offset, p_endOffset);
						label_statement.setParent(stmt);
						((IASTCompoundStatement) stmt).addStatement(label_statement);
					}

					if (type == endOfProc) {
						break;
					}

					t = consume();
				}
				return new IASTDeclaration[] {};
			}
		}
	} catch (EndOfFileException e) {
		return new IASTDeclaration[] {};
	}
	return super.problemDeclaration(offset, bt, option);
}
 
开发者ID:buntatsu,项目名称:cdt-proc,代码行数:62,代码来源:ProCSourceParser.java


示例12: visit

import org.eclipse.cdt.core.dom.ast.IASTDeclaration; //导入依赖的package包/类
public int visit(IASTDeclaration declaration) {
    declarations.add(declaration);
    return PROCESS_CONTINUE;
}
 
开发者ID:magicsky,项目名称:sya,代码行数:5,代码来源:ASTDeclarationsVisitor.java


示例13: leave

import org.eclipse.cdt.core.dom.ast.IASTDeclaration; //导入依赖的package包/类
public int leave(IASTDeclaration decl) {
	unsetThings();
	//System.out.println("Leaving decl: " + decl.getRawSignature());
	
	return PROCESS_CONTINUE;
}
 
开发者ID:elenno,项目名称:simtest,代码行数:7,代码来源:ASTVISITOR.java



注:本文中的org.eclipse.cdt.core.dom.ast.IASTDeclaration类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java IJsonSerializable类代码示例发布时间:2022-05-22
下一篇:
Java RspList类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap