Added flavors of makeNode() that take Polyglot Positions to identify the position of the CAstNode to be created.

git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1512 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
rmfuhrer 2007-07-19 22:18:27 +00:00
parent 0fba6b0b49
commit e3c6eea00c
1 changed files with 30 additions and 0 deletions

View File

@ -2231,6 +2231,36 @@ public class PolyglotJava2CAstTranslator implements TranslatorToCAst {
return cn;
}
protected CAstNode makeNode(WalkContext wc, Position p, int kind, CAstNode c1) {
CAstNode cn = fFactory.makeNode(kind, c1);
setPos(wc, cn, p);
return cn;
}
protected CAstNode makeNode(WalkContext wc, Position p, int kind, CAstNode c1, CAstNode[] rest) {
CAstNode cn = fFactory.makeNode(kind, c1, rest);
setPos(wc, cn, p);
return cn;
}
protected CAstNode makeNode(WalkContext wc, Position p, int kind, CAstNode c1, CAstNode c2) {
CAstNode cn = fFactory.makeNode(kind, c1, c2);
setPos(wc, cn, p);
return cn;
}
protected CAstNode makeNode(WalkContext wc, Position p, int kind, CAstNode c1, CAstNode c2, CAstNode c3) {
CAstNode cn = fFactory.makeNode(kind, c1, c2, c3);
setPos(wc, cn, p);
return cn;
}
protected CAstNode makeNode(WalkContext wc, Position p, int kind, CAstNode c1, CAstNode c2, CAstNode c3, CAstNode c4) {
CAstNode cn = fFactory.makeNode(kind, c1, c2, c3, c4);
setPos(wc, cn, p);
return cn;
}
public CAstEntity translate(Object ast, String fileName) {
return walkEntity((Node) ast, new RootContext(getTypeDict()));
}