Search in sources :

Example 1 with SourcePositionTag

use of soot.tagkit.SourcePositionTag in project soot by Sable.

the class JavaAttribute method printAttributeTag.

private void printAttributeTag(Tag t) {
    if (t instanceof LineNumberTag) {
        int lnNum = (new Integer(((LineNumberTag) t).toString())).intValue();
        printJavaLnAttr(lnNum, lnNum);
    } else if (t instanceof JimpleLineNumberTag) {
        JimpleLineNumberTag jlnTag = (JimpleLineNumberTag) t;
        printJimpleLnAttr(jlnTag.getStartLineNumber(), jlnTag.getEndLineNumber());
    } else /*else if (t instanceof SourceLineNumberTag) {
            SourceLineNumberTag jlnTag = (SourceLineNumberTag)t; 
			printJavaLnAttr(jlnTag.getStartLineNumber(), jlnTag.getEndLineNumber());
		}*/
    if (t instanceof LinkTag) {
        LinkTag lt = (LinkTag) t;
        Host h = lt.getLink();
        printLinkAttr(formatForXML(lt.toString()), getJimpleLnOfHost(h), getJavaLnOfHost(h), lt.getClassName());
    } else if (t instanceof StringTag) {
        printTextAttr(formatForXML(((StringTag) t).toString()));
    } else if (t instanceof SourcePositionTag) {
        SourcePositionTag pt = (SourcePositionTag) t;
        printSourcePositionAttr(pt.getStartOffset(), pt.getEndOffset());
    } else if (t instanceof PositionTag) {
        PositionTag pt = (PositionTag) t;
        printJimplePositionAttr(pt.getStartOffset(), pt.getEndOffset());
    } else if (t instanceof ColorTag) {
        ColorTag ct = (ColorTag) t;
        printColorAttr(ct.getRed(), ct.getGreen(), ct.getBlue(), ct.isForeground());
    } else {
        printTextAttr(t.toString());
    }
}
Also used : StringTag(soot.tagkit.StringTag) SourcePositionTag(soot.tagkit.SourcePositionTag) JimpleLineNumberTag(soot.tagkit.JimpleLineNumberTag) LineNumberTag(soot.tagkit.LineNumberTag) JimpleLineNumberTag(soot.tagkit.JimpleLineNumberTag) LinkTag(soot.tagkit.LinkTag) ColorTag(soot.tagkit.ColorTag) SourcePositionTag(soot.tagkit.SourcePositionTag) PositionTag(soot.tagkit.PositionTag) Host(soot.tagkit.Host)

Aggregations

ColorTag (soot.tagkit.ColorTag)1 Host (soot.tagkit.Host)1 JimpleLineNumberTag (soot.tagkit.JimpleLineNumberTag)1 LineNumberTag (soot.tagkit.LineNumberTag)1 LinkTag (soot.tagkit.LinkTag)1 PositionTag (soot.tagkit.PositionTag)1 SourcePositionTag (soot.tagkit.SourcePositionTag)1 StringTag (soot.tagkit.StringTag)1