io.github.danielnaczo.python3parser.visitors.ast.WithItemVisitor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of python3parser Show documentation
Show all versions of python3parser Show documentation
A Java-based Python3-Parser.
The newest version!
package io.github.danielnaczo.python3parser.visitors.ast;
import io.github.danielnaczo.python3parser.Python3Parser.With_itemContext;
import io.github.danielnaczo.python3parser.model.expr.Expression;
import io.github.danielnaczo.python3parser.model.stmts.compoundStmts.withStmts.WithItem;
public class WithItemVisitor extends GenericUnsupportedCSTVisitor{
@Override
public WithItem visitWith_item(With_itemContext ctx) {
Expression contextExpr = ctx.test().accept(new ExpressionVisitor());
Expression optionalVars = null;
if (ctx.expr() != null) {
optionalVars = ctx.expr().accept(new ExpressionVisitor());
}
return new WithItem(contextExpr, optionalVars);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy