Composant base loading

This commit is contained in:
jeffcheasey88 2023-07-16 16:00:09 +02:00
parent 8f2e7cffe9
commit 6cb8ecec84

View file

@ -43,8 +43,17 @@ public class ParserComposantGenerator {
public void generate() throws Exception{ public void generate() throws Exception{
SynthaxeComposant synthax = load(); SynthaxeComposant synthax = load();
Map<String, Set<String>> dependency = synthax.dependency(); Map<String, Set<String>> dependency = synthax.dependency();
for(Entry<String, Set<String>> entry : dependency.entrySet()){
System.out.println(entry.getKey()+" - "+entry.getValue()); while(!dependency.isEmpty()){
for(Entry<String, Set<String>> composant : dependency.entrySet()){
if(composant.getValue().isEmpty()){
synthax.composants.get(composant.getKey()).build();
dependency.remove(composant.getKey());
for(Entry<String, Set<String>> entry : dependency.entrySet()) entry.getValue().remove(composant.getKey());
break;
}
}
} }
} }
@ -381,7 +390,11 @@ public class ParserComposantGenerator {
private Map<String, Set<String>> dependency(){ private Map<String, Set<String>> dependency(){
Map<String, Set<String>> map = new HashMap<>(); Map<String, Set<String>> map = new HashMap<>();
for(Entry<String, Composant> entry : this.composants.entrySet()) map.put(entry.getKey(), entry.getValue().dependency()); for(Entry<String, Composant> entry : this.composants.entrySet()){
Set<String> set = entry.getValue().dependency();
set.remove(entry.getKey());
map.put(entry.getKey(), set);
}
return map; return map;
} }
@ -428,6 +441,11 @@ public class ParserComposantGenerator {
return result; return result;
} }
public void build(){
System.out.println("build "+title);
}
public void include(){ public void include(){
if(path == null){ if(path == null){
path = current; path = current;