Commit ad10bbac authored by Paff's avatar Paff
Browse files

bug fix prettyprinter

parent 7d82b9f8
......@@ -64,7 +64,7 @@ public final class MontiSecArcConstants extends Interfaces2Constants {
/**
* Argument for Analysis configuration
*/
public static final String ARG_ANALYSISCONFPATH = "-analsisconfpath";
public static final String ARG_ANALYSISCONFPATH = "-analysisconfpath";
/**
* name for pep entry
......
package secarc.prettyprint;
import secarc._ast.ASTMCCompilationUnit;
import secarc._ast.ASTSecArcCPE;
import secarc._ast.ASTSecArcConfiguration;
import secarc._ast.ASTSecArcConnector;
import secarc._ast.ASTSecArcFilter;
import secarc._ast.ASTSecArcFilterComponent;
import secarc._ast.ASTSecArcFilterSubComponent;
import secarc._ast.ASTSecArcIdentity;
import secarc._ast.ASTSecArcPEP;
import secarc._ast.ASTSecArcPort;
import secarc._ast.ASTSecArcRefRole;
import secarc._ast.ASTSecArcRole;
import secarc._ast.ASTSecArcRoleInterface;
import secarc._ast.ASTSecArcSimpleConnector;
import secarc._ast.ASTSecArcTrustlevelRelation;
import secarc._ast.ASTSecMontiArcAutoConnect;
import mc.ast.ASTNode;
import mc.ast.AbstractVisitor;
import mc.ast.ConcretePrettyPrinter;
......@@ -28,7 +34,6 @@ import mc.umlp.arcd._ast.ASTArcPort;
import mc.umlp.arcd._ast.ASTArcSimpleConnector;
import mc.umlp.arcd._ast.ASTArcSubComponent;
import mc.umlp.arcd._ast.ASTArcSubComponentInstance;
import mc.umlp.arcd.prettyprint.ArchitectureDiagramPrettyPrinterConcreteVisitor;
/**
*
......@@ -45,7 +50,7 @@ import mc.umlp.arcd.prettyprint.ArchitectureDiagramPrettyPrinterConcreteVisitor;
public class MontiSecArcConcretePrettyPrinter extends ConcretePrettyPrinter {
private static final Class<?>[] RESPONSIBLE_CLASSES = new Class[] {
mc.umlp.arcd._ast.ASTMCCompilationUnit.class,
ASTMCCompilationUnit.class,
ASTArcComponent.class, ASTArcComponentHead.class,
ASTArcComponentBody.class, ASTArcElement.class, ASTArcElementList.class,
ASTArcSubComponent.class,
......@@ -55,7 +60,9 @@ public class MontiSecArcConcretePrettyPrinter extends ConcretePrettyPrinter {
ASTSecArcIdentity.class, ASTSecArcTrustlevelRelation.class,
ASTSecArcConfiguration.class, ASTSecArcCPE.class, ASTSecArcFilter.class,
ASTSecArcPEP.class, ASTSecArcRole.class, ASTSecArcRefRole.class,
ASTSecArcRoleInterface.class
ASTSecArcRoleInterface.class, ASTSecArcFilterComponent.class, ASTSecArcConnector.class,
ASTSecArcSimpleConnector.class, ASTSecMontiArcAutoConnect.class, ASTSecArcFilterSubComponent.class,
ASTSecArcPort.class,
};
@Override
......
......@@ -51,8 +51,8 @@ public class MontiSecArcPrettyPrintWorkflow extends DSLWorkflow<MontiSecArcRoot>
// init and run the acutal visitor
PrettyPrinter p = new PrettyPrinter();
p.addConcretePrettyPrinter(new MontiSecArcConcretePrettyPrinter());
p.addConcretePrettyPrinter(new JavaDSLConcretePrettyPrinter());
p.addConcretePrettyPrinter(new OCLConcretePrettyPrinter());
// p.addConcretePrettyPrinter(new JavaDSLConcretePrettyPrinter());
// p.addConcretePrettyPrinter(new OCLConcretePrettyPrinter());
p.prettyPrint(ast, f.getContent());
}
......
......@@ -60,7 +60,7 @@ public class MontiSecArcPrettyPrinterConcreteVisitor extends MontiArcPrettyPrint
} else {
this.printer.print("-");
}
this.printer.print(a.getValue());
this.printer.print(a.getValue().getValue());
this.printer.print(" ");
this.printer.print(a.getReason());
this.printer.println(";");
......@@ -93,15 +93,14 @@ public class MontiSecArcPrettyPrinterConcreteVisitor extends MontiArcPrettyPrint
printComment(a.get_PostComments());
}
@Override
public void ownVisit(ASTArcConnector a) {
public void ownVisit(ASTSecArcConnector a) {
printComment(a.get_PreComments());
if (a.getStereotype() != null) {
visitExternal(a.getStereotype());
printer.print(" ");
}
this.printer.print("connect ");
if(((ASTSecArcConnector) a).isEncrypted()) {
if(a.isEncrypted()) {
this.printer.print("encrypted ");
} else {
this.printer.print("unencrypted ");
......@@ -119,10 +118,9 @@ public class MontiSecArcPrettyPrinterConcreteVisitor extends MontiArcPrettyPrint
printComment(a.get_PostComments());
}
@Override
public void ownVisit(ASTArcSimpleConnector sc) {
public void ownVisit(ASTSecArcSimpleConnector sc) {
visitExternal(sc.getStereotype());
if(((ASTSecArcSimpleConnector) sc).isEncrypted()) {
if(sc.isEncrypted()) {
this.printer.print("encrypted ");
} else {
this.printer.print("unencrypted ");
......@@ -138,14 +136,13 @@ public class MontiSecArcPrettyPrinterConcreteVisitor extends MontiArcPrettyPrint
}
@Override
public void ownVisit(ASTMontiArcAutoConnect completion) {
public void ownVisit(ASTSecMontiArcAutoConnect completion) {
printer.print("autoconnect ");
if (completion.getStereotype() != null) {
getVisitor().startVisit(completion.getStereotype());
printer.print(" ");
}
if(((ASTSecMontiArcAutoConnect) completion).isEncrypted()) {
if(completion.isEncrypted()) {
this.printer.print("encrypted ");
} else {
this.printer.print("unencrypted ");
......@@ -162,8 +159,7 @@ public class MontiSecArcPrettyPrinterConcreteVisitor extends MontiArcPrettyPrint
printer.println(";");
}
@Override
public void ownVisit(ASTArcComponent component) {
public void ownVisit(ASTSecArcFilterComponent component) {
printComment(component.get_PreComments());
if (component.getStereotype() != null) {
this.startVisit(component.getStereotype());
......@@ -171,8 +167,8 @@ public class MontiSecArcPrettyPrinterConcreteVisitor extends MontiArcPrettyPrint
}
this.printer.print("component " + component.getName());
if(((ASTSecArcFilterComponent) component).getSecArcFilter() != null) {
this.printFilter(((ASTSecArcFilterComponent) component).getSecArcFilter());
if(component.getSecArcFilter() != null) {
this.printFilter((component).getSecArcFilter());
}
if (component.getInstanceName() != null) {
printer.print(" ");
......@@ -183,15 +179,14 @@ public class MontiSecArcPrettyPrinterConcreteVisitor extends MontiArcPrettyPrint
printComment(component.get_PostComments());
}
@Override
public void ownVisit(ASTArcSubComponent ref) {
public void ownVisit(ASTSecArcFilterSubComponent ref) {
if (ref.getStereotype() != null) {
visitExternal(ref.getStereotype());
printer.print(" ");
}
printer.print("component ");
if(((ASTSecArcFilterSubComponent) ref).getSecArcFilter() != null) {
this.printFilter(((ASTSecArcFilterSubComponent) ref).getSecArcFilter());
if(ref.getSecArcFilter() != null) {
this.printFilter(ref.getSecArcFilter());
}
getVisitor().startVisit(ref.getType());
if (ref.getArguments() != null && !ref.getArguments().isEmpty()) {
......@@ -215,17 +210,16 @@ public class MontiSecArcPrettyPrinterConcreteVisitor extends MontiArcPrettyPrint
printer.println(";");
}
@Override
public void ownVisit(ASTArcPort a) {
public void ownVisit(ASTSecArcPort a) {
printComment(a.get_PreComments());
if (a.getStereotype() != null) {
getVisitor().startVisit(a.getStereotype());
}
if(((ASTSecArcPort) a).isCritical()) {
if(a.isCritical()) {
this.printer.print("critcal ");
}
if(((ASTSecArcPort) a).getSecArcFilter() != null) {
this.printFilter(((ASTSecArcPort) a).getSecArcFilter());
if(a.getSecArcFilter() != null) {
this.printFilter(a.getSecArcFilter());
}
if (a.isIncoming()) {
this.printer.print("in ");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment