本文整理汇总了Java中org.walkmod.javalang.ast.expr.IntegerLiteralExpr类的典型用法代码示例。如果您正苦于以下问题:Java IntegerLiteralExpr类的具体用法?Java IntegerLiteralExpr怎么用?Java IntegerLiteralExpr使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IntegerLiteralExpr类属于org.walkmod.javalang.ast.expr包,在下文中一共展示了IntegerLiteralExpr类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
import org.walkmod.javalang.ast.expr.IntegerLiteralExpr; //导入依赖的package包/类
public void visit(IntegerLiteralExpr n, VisitorContext ctx) {
Object o = ctx.get(NODE_TO_COMPARE_KEY);
if (o != null && o instanceof IntegerLiteralExpr) {
IntegerLiteralExpr aux = (IntegerLiteralExpr) o;
boolean backup = isUpdated();
setIsUpdated(false);
if (n.getValue().equals(aux.getValue())) {
increaseUnmodifiedNodes(IntegerLiteralExpr.class);
} else {
applyUpdate(n, (Node) o);
increaseUpdatedNodes(IntegerLiteralExpr.class);
}
setIsUpdated(backup || isUpdated());
} else if (o != null) {
setIsUpdated(true);
applyUpdate(n, (Node) o);
}
}
示例2: testArgumentList
import org.walkmod.javalang.ast.expr.IntegerLiteralExpr; //导入依赖的package包/类
@Test
public void testArgumentList() throws ParseException {
String code = "public class B{ public void foo(){ print(3); } }";
DefaultJavaParser parser = new DefaultJavaParser();
CompilationUnit cu = parser.parse(code, false);
CompilationUnit cu2 = parser.parse(code, false);
MethodDeclaration md = (MethodDeclaration) cu.getTypes().get(0).getMembers().get(0);
ExpressionStmt stmt = (ExpressionStmt) md.getBody().getStmts().get(0);
MethodCallExpr expr = (MethodCallExpr) stmt.getExpression();
expr.getArgs().add(new IntegerLiteralExpr("4"));
List<Action> actions = getActions(cu2, cu);
Assert.assertEquals(1, actions.size());
Assert.assertEquals(ActionType.REPLACE, actions.get(0).getType());
assertCode(actions, code, "public class B{ public void foo(){ print(3, 4); } }");
}
示例3: visit
import org.walkmod.javalang.ast.expr.IntegerLiteralExpr; //导入依赖的package包/类
public Boolean visit(IntegerLiteralExpr n1, Node arg) {
IntegerLiteralExpr n2 = (IntegerLiteralExpr) arg;
if (!objEquals(n1.getValue(), n2.getValue())) {
return Boolean.FALSE;
}
return Boolean.TRUE;
}
示例4: visit
import org.walkmod.javalang.ast.expr.IntegerLiteralExpr; //导入依赖的package包/类
public void visit(IntegerLiteralExpr n, VisitorContext arg) {
if (preVisitor != null) {
preVisitor.visit(n, arg);
}
super.visit(n, arg);
if (postVisitor != null) {
postVisitor.visit(n, arg);
}
}
示例5: visit
import org.walkmod.javalang.ast.expr.IntegerLiteralExpr; //导入依赖的package包/类
@Override
public void visit(IntegerLiteralExpr n, A arg) {
n.setSymbolData(new SymbolType("int"));
}
示例6: visit
import org.walkmod.javalang.ast.expr.IntegerLiteralExpr; //导入依赖的package包/类
@Override
public Object visit(IntegerLiteralExpr n, Void arg) {
return Long.valueOf(n.getValue());
}
示例7: assertThat
import org.walkmod.javalang.ast.expr.IntegerLiteralExpr; //导入依赖的package包/类
public static IntegerLiteralExprAssert assertThat(IntegerLiteralExpr actual) {
return new IntegerLiteralExprAssert(actual);
}
示例8: asIntegerLiteralExpr
import org.walkmod.javalang.ast.expr.IntegerLiteralExpr; //导入依赖的package包/类
public IntegerLiteralExprAssert asIntegerLiteralExpr() {
return AstAssertions.assertThat(asInstanceOf(IntegerLiteralExpr.class))
.as(navigationDescription("(IntegerLiteralExpr)"));
}
示例9: IntegerLiteralExprAssert
import org.walkmod.javalang.ast.expr.IntegerLiteralExpr; //导入依赖的package包/类
public IntegerLiteralExprAssert(IntegerLiteralExpr actual) {
super(actual, IntegerLiteralExprAssert.class);
}
示例10: visit
import org.walkmod.javalang.ast.expr.IntegerLiteralExpr; //导入依赖的package包/类
public R visit(IntegerLiteralExpr n, A arg) {
return null;
}
示例11: visit
import org.walkmod.javalang.ast.expr.IntegerLiteralExpr; //导入依赖的package包/类
@Override
public Node visit(IntegerLiteralExpr _n, Object _arg) {
IntegerLiteralExpr r = new IntegerLiteralExpr(_n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(),
_n.getEndColumn(), _n.getValue());
return r;
}
示例12: visit
import org.walkmod.javalang.ast.expr.IntegerLiteralExpr; //导入依赖的package包/类
public void visit(IntegerLiteralExpr n, Object arg) {
prepareComments(n);
printPreviousComments(n, arg);
printer.print(n.getValue());
}
示例13: visit
import org.walkmod.javalang.ast.expr.IntegerLiteralExpr; //导入依赖的package包/类
public Node visit(IntegerLiteralExpr n, A arg) {
return n;
}
示例14: visit
import org.walkmod.javalang.ast.expr.IntegerLiteralExpr; //导入依赖的package包/类
public void visit(IntegerLiteralExpr n, A arg) {}
示例15: visit
import org.walkmod.javalang.ast.expr.IntegerLiteralExpr; //导入依赖的package包/类
public R visit(IntegerLiteralExpr n, A arg);