angievig / coffeeproofofconcept Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU General Public License v3.0
License: GNU General Public License v3.0
There are problems with the JAVADOC format in:
1. In the Parser () and parser (String) methods of the IHlvlParser interface.
2. In the Transformation class with the author.
3. In the CompilationParameters class, in the getSolversJson () method, getOperationsJson (), CompilationParameters ().
4. In the compiler class, in the getSolver method.
5. In the class Splot2HlvlParser, with the Splot2HlvlParser method.
6. In the IhlvlBasicFactory interface, with the getElement, getImplies, getDecomposition, getDecompositionList method.
7. In the FileUtils class (This class is present in two packages, com.coffee.common.utils and com.coffee.modelParsers.utils), with the methods readFileFromDirectory, writeHLVLProgram.
8. In the JsonMng class, with the getfromString method.
There is a small bug with the HLVL transformation rules. because, in some cases, it does not perform the line break.
Example:
This is the XML code:
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n" +
"<featureModel>\r\n" +
" <properties/>\r\n" +
" <struct>\r\n" +
" <and mandatory=\"true\" name=\"EjemploFeatureIDE\">\r\n" +
" <or name=\"Games\">\r\n" +
" <feature name=\"Testris\"/>\r\n" +
" <feature name=\"TRESDCarRace\"/>\r\n" +
" <feature name=\"Chess\"/>\r\n" +
" </or>\r\n" +
" <feature name=\"Task\"/>\r\n" +
" <feature name=\"VideoCall\"/>\r\n" +
" <and mandatory=\"true\" name=\"HardWare\">\r\n" +
" <feature name=\"GPS\"/>\r\n" +
" <feature mandatory=\"true\" name=\"RAM\"/>\r\n" +
" <alt mandatory=\"true\" name=\"Processors\">\r\n" +
" <feature name=\"GPU\"/>\r\n" +
" <feature name=\"CPU\"/>\r\n" +
" </alt>\r\n" +
" <feature mandatory=\"true\" name=\"ScreenResolution\"/>\r\n" +
" <feature name=\"TRESGConector\"/>\r\n" +
" </and>\r\n" +
" </and>\r\n" +
" </struct>\r\n" +
" <constraints>\r\n" +
" <rule>\r\n" +
" <imp>\r\n" +
" <var>TRESGConector</var>\r\n" +
" <var>GPU</var>\r\n" +
" </imp>\r\n" +
" </rule>\r\n" +
" <rule>\r\n" +
" <imp>\r\n" +
" <var>GPS</var>\r\n" +
" <not>\r\n" +
" <var>Chess</var>\r\n" +
" </not>\r\n" +
" </imp>\r\n" +
" </rule>\r\n" +
" </constraints>\r\n" +
" <calculations Auto=\"true\" Constraints=\"true\" Features=\"true\" Redundant=\"true\" Tautology=\"true\"/>\r\n" +
" <comments/>\r\n" +
" <featureOrder userDefined=\"false\"/>\r\n" +
"</featureModel>\r\n" +
""
This are methods that I'm using
public void addGroup(Node n) {
if (n.getNodeName().equals("or")) {
ArrayList<String> names = groupNamesChildrens(n);
HlvlCode.append(" " + converter.getGroup(findNameInNode(n), names, GroupType.Or));
} else if (n.getNodeName().equals("alt")) {
ArrayList<String> names = groupNamesChildrens(n);
HlvlCode.append(" " + converter.getGroup(findNameInNode(n), names, GroupType.And));
}
}
public void addDescomposition(Node n) {
for (int i = 0; i < n.getAttributes().getLength(); i++) {
if (n.getAttributes().item(i).getNodeName().equals("mandatory")
&& (findNameInNode(n.getParentNode()).equals("")) && (!n.getParentNode().getNodeName().equals("or")
&& !n.getParentNode().getNodeName().equals("alt"))) {
HlvlCode.append(" " + converter.getCore(findNameInNode(n)));
} else if (n.getAttributes().item(i).getNodeName().equals("mandatory")
&& (!findNameInNode(n.getParentNode()).equals("")) && (!n.getParentNode().getNodeName().equals("or")
&& !n.getParentNode().getNodeName().equals("alt"))) {
HlvlCode.append(" " + converter.getDecomposition(findNameInNode(n.getParentNode()), findNameInNode(n),
DecompositionType.Mandatory));
} else if ((!findNameInNode(n.getParentNode()).equals("")) && n.getAttributes().getLength() == 1
&& (!n.getParentNode().getNodeName().equals("or")
&& !n.getParentNode().getNodeName().equals("alt"))) {
HlvlCode.append(" " + converter.getDecomposition(findNameInNode(n.getParentNode()), findNameInNode(n),
DecompositionType.Optional));
}
}
}
This is the result
model Auto_generated
elements:
boolean TRESGConector
boolean ScreenResolution
boolean CPU
boolean GPU
boolean Processors
boolean RAM
boolean GPS
boolean HardWare
boolean VideoCall
boolean Task
boolean Chess
boolean TRESDCarRace
boolean Testris
boolean Games
boolean EjemploFeatureIDE
relations:
r0: coreElements(EjemploFeatureIDE)
r1:group(Games,[Testris, TRESDCarRace, Chess])[1,*]
r2:decomposition(EjemploFeatureIDE,[Games])<0>
r3:decomposition(EjemploFeatureIDE,[Task])<0>
r4:decomposition(EjemploFeatureIDE,[VideoCall])<0>
r5:decomposition(EjemploFeatureIDE,[HardWare])<1>
r6:decomposition(HardWare,[GPS])<0>
r7:decomposition(HardWare,[RAM])<1>
r8:group(Processors,[GPU, CPU]) r9:decomposition(HardWare,[Processors])<1>
r10:decomposition(HardWare,[ScreenResolution])<1>
r11:decomposition(HardWare,[TRESGConector])<0>
r12: implies(TRESGConector,GPU)
r13: mutex(GPS, Chess)
There is no line break between R8 and R9
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.