use of com.github.javaparser.Position in project javaparser by javaparser.
the class ASTParser method NormalAnnotation.
public final NormalAnnotationExpr NormalAnnotation() {
NameExpr name;
List<MemberValuePair> pairs = null;
Position begin;
jj_consume_token(AT);
begin = tokenBegin();
name = Name();
jj_consume_token(LPAREN);
switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case IDENTIFIER:
{
pairs = MemberValuePairs();
break;
}
default:
jj_la1[151] = jj_gen;
;
}
jj_consume_token(RPAREN);
return new NormalAnnotationExpr(range(begin, tokenEnd()), name, pairs);
}
use of com.github.javaparser.Position in project javaparser by javaparser.
the class ASTParser method ContinueStatement.
public final ContinueStmt ContinueStatement() {
String id = null;
Position begin;
jj_consume_token(CONTINUE);
begin = tokenBegin();
switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {
case IDENTIFIER:
{
jj_consume_token(IDENTIFIER);
id = token.image;
break;
}
default:
jj_la1[143] = jj_gen;
;
}
jj_consume_token(SEMICOLON);
return new ContinueStmt(range(begin, tokenEnd()), id);
}
use of com.github.javaparser.Position in project javaparser by javaparser.
the class PrettyPrintVisitor method printArguments.
private void printArguments(final NodeList<Expression> args, final Void arg) {
printer.print("(");
Position cursorRef = printer.getCursor();
if (!isNullOrEmpty(args)) {
for (final Iterator<Expression> i = args.iterator(); i.hasNext(); ) {
final Expression e = i.next();
e.accept(this, arg);
if (i.hasNext()) {
printer.print(",");
if (configuration.isColumnAlignParameters()) {
printer.wrapToColumn(cursorRef.column);
} else {
printer.print(" ");
}
}
}
}
printer.print(")");
}
use of com.github.javaparser.Position in project javaparser by javaparser.
the class ASTParser method WhileStatement.
public final WhileStmt WhileStatement() {
Expression condition;
Statement body;
Position begin;
jj_consume_token(WHILE);
begin = tokenBegin();
jj_consume_token(LPAREN);
condition = Expression();
jj_consume_token(RPAREN);
body = Statement();
return new WhileStmt(range(begin, tokenEnd()), condition, body);
}
use of com.github.javaparser.Position in project javaparser by javaparser.
the class ASTParser method PreDecrementExpression.
public final Expression PreDecrementExpression() {
Expression ret;
Position begin;
jj_consume_token(DECR);
begin = tokenBegin();
ret = UnaryExpression();
ret = new UnaryExpr(range(begin, tokenEnd()), ret, UnaryExpr.Operator.preDecrement);
return ret;
}
Aggregations