use of com.github.javaparser.ast.modules.ModuleDeclaration in project drools by kiegroup.
the class DrlxVisitor method visit.
public void visit(CompilationUnit u, Void arg) {
PackageDeclaration packageDeclaration = u.getPackageDeclaration().orElseThrow(() -> new ParseException("Expected package declaration.", -1));
String pkgName = packageDeclaration.getNameAsString();
builder.name(pkgName);
for (ImportDeclaration i : u.getImports()) {
this.visit(i, null);
}
ModuleDeclaration moduleDeclaration = u.getModule().orElseThrow(() -> new ParseException("Expected unit declaration.", -1));
builder.newUnit().target(String.format("%s.%s", pkgName, moduleDeclaration.getNameAsString()));
for (TypeDeclaration<?> typeDeclaration : u.getTypes()) {
RuleDeclaration rd = (RuleDeclaration) typeDeclaration;
this.visit(rd, null);
}
}
use of com.github.javaparser.ast.modules.ModuleDeclaration in project checker-framework by typetools.
the class JointJavacJavaParserVisitor method visitModule.
@Override
public Void visitModule(ModuleTree javacTree, Node javaParserNode) {
ModuleDeclaration node = castNode(ModuleDeclaration.class, javaParserNode, javacTree);
processModule(javacTree, node);
javacTree.getName().accept(this, node.getName());
return null;
}
use of com.github.javaparser.ast.modules.ModuleDeclaration in project checker-framework by typetools.
the class DoubleJavaParserVisitor method visit.
@Override
public void visit(final ModuleDeclaration node1, final Node other) {
ModuleDeclaration node2 = (ModuleDeclaration) other;
defaultAction(node1, node2);
visitLists(node1.getDirectives(), node2.getDirectives());
node1.getName().accept(this, node2.getName());
}
Aggregations