private Map<String, Set<SourceFileInfo>> initStaticFunctions(CsmProject project){ Map<String, Set<SourceFileInfo>> res = new HashMap<String, Set<SourceFileInfo>>(); for(CsmFile file : project.getAllFiles()){ for(CsmOffsetableDeclaration decl : file.getDeclarations()) { if (CsmKindUtilities.isFileLocalFunction(decl)) { CsmFunction func = (CsmFunction) decl; String name = func.getQualifiedName().toString(); Set<SourceFileInfo> set = res.get(name); if (set == null) { set = new HashSet<SourceFileInfo>(); res.put(name, set); } set.add(new SourceFileInfo(file.getAbsolutePath().toString(), func.getStartPosition().getOffset())); } } } return res; } }
Position startPosition = offsetable.getStartPosition(); Position endPosition = offsetable.getEndPosition(); if (startPosition.getOffset() >= 0 && endPosition.getOffset() >= 0 && startPosition.getOffset() <= endPosition.getOffset() && offsetable.getContainingFile() != null && endPosition.getOffset() < offsetable.getContainingFile().getText().length()) { line = " [" + startPosition.getLine() + ":" + startPosition.getColumn() + "-" + // NOI18N endPosition.getLine() + ":" + endPosition.getColumn() + "]"; // NOI18N } else { line = " bad position! [" + startPosition.getOffset() + "-" + endPosition.getOffset() + "]"; // NOI18N
public DocOffsPositionImpl(CsmOffsetable.Position pos) { if (pos != null) { this.line = pos.getLine(); this.col = pos.getColumn(); this.offset = pos.getOffset(); } else { this.line = -1; this.col = -1; this.offset = 0; } this.doc = null; }
@Override public int getStartOffset() { // start of the file return DUMMY_POSITION.getOffset(); }
@Override public int getStartOffset() { // start of the file return DUMMY_POSITION.getOffset(); }
@Override public int getEndOffset() { // start of the file return DUMMY_POSITION.getOffset(); }
@Override public int getEndOffset() { // DUMMY of the file return DUMMY_POSITION.getOffset(); }
public LineColOffsPositionImpl(CsmOffsetable.Position pos) { if (pos != null) { this.line = pos.getLine(); this.col = pos.getColumn(); this.offset = pos.getOffset(); } else { this.line = 0; this.col = 0; this.offset = 0; } }