Skip to content

Commit ad1eb5b

Browse files
author
Manuel Leduc
committed
gives access to generic dsl properties
1 parent ffda463 commit ad1eb5b

File tree

1 file changed

+15
-4
lines changed
  • plugins/org.eclipse.emf.ecoretools.ale.core/src/org/eclipse/emf/ecoretools/ale/core/parser

1 file changed

+15
-4
lines changed

plugins/org.eclipse.emf.ecoretools.ale.core/src/org/eclipse/emf/ecoretools/ale/core/parser/Dsl.java

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public class Dsl {
2727
String sourceFile;
2828
List<String> allSyntaxes = new ArrayList<>();
2929
List<String> allSemantics = new ArrayList<>();
30+
private Properties dslProp;
3031

3132
public Dsl(List<String> syntaxes, List<String> semantics) {
3233
this.allSyntaxes.addAll(syntaxes);
@@ -40,17 +41,17 @@ public Dsl(String dslFile) throws FileNotFoundException {
4041

4142
public Dsl(InputStream input) {
4243

43-
Properties dslProp = new Properties();
44+
this.dslProp = new Properties();
4445
try {
45-
dslProp.load(input);
46+
getDslProp().load(input);
4647
input.close();
4748
} catch (IOException e) {
4849
// TODO Throw the exception: it cannot be handled here
4950
e.printStackTrace();
5051
}
5152

52-
String allSyntaxes = (String) dslProp.get("syntax");
53-
String allBehaviors = (String) dslProp.get("behavior");
53+
String allSyntaxes = (String) getDslProp().get("syntax");
54+
String allBehaviors = (String) getDslProp().get("behavior");
5455

5556
if(allSyntaxes != null && allBehaviors != null) {
5657
String[] syntaxes = allSyntaxes.split(",");
@@ -94,4 +95,14 @@ public void save() {
9495
protected List<String> trim(String[] uris) {
9596
return Arrays.asList(uris).stream().map(s->s.trim()).collect(toList());
9697
}
98+
99+
public Properties getDslProp() {
100+
return dslProp;
101+
}
102+
103+
public String getSourceFile() {
104+
return sourceFile;
105+
}
106+
107+
97108
}

0 commit comments

Comments
 (0)