]> gerrit.simantics Code Review - simantics/platform.git/blob
e44a18879df0a6368c7060dfaa817efe9c5e02bf
[simantics/platform.git] /
1 package org.simantics.scl.compiler.internal.parsing.declarations;
2
3 import gnu.trove.map.hash.THashMap;
4
5 import java.util.ArrayList;
6
7 import org.simantics.scl.compiler.elaboration.query.Query;
8
9 public class DRuleAst extends DeclarationAst {
10     public final boolean isAbstract;
11     public final String name;
12     public final String[] extendsNames;
13     private final THashMap<String, ArrayList<Query>> sectionMap =
14             new THashMap<String, ArrayList<Query>>(4);
15     public boolean alreadyProcessing;
16
17     public DRuleAst(boolean isAbstract, String name, String[] extendsNames) {
18         this.isAbstract = isAbstract;
19         this.name = name;
20         this.extendsNames = extendsNames;
21     }
22     
23     public ArrayList<Query> getSection(String sectionName) {
24         ArrayList<Query> result = sectionMap.get(sectionName);
25         if(result == null) {
26             result = new ArrayList<Query>(4);
27             sectionMap.put(sectionName, result);
28         }
29         return result;
30     }
31     
32     public THashMap<String, ArrayList<Query>> getSections() {
33         return sectionMap;
34     }
35 }