diff options
Diffstat (limited to 'Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/ApplicationConfiguration.xtext')
-rw-r--r-- | Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/ApplicationConfiguration.xtext | 127 |
1 files changed, 127 insertions, 0 deletions
diff --git a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/ApplicationConfiguration.xtext b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/ApplicationConfiguration.xtext new file mode 100644 index 00000000..ed83419f --- /dev/null +++ b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/ApplicationConfiguration.xtext | |||
@@ -0,0 +1,127 @@ | |||
1 | grammar hu.bme.mit.inf.dslreasoner.application.ApplicationConfiguration with org.eclipse.xtext.common.Terminals | ||
2 | |||
3 | import "http://www.eclipse.org/emf/2002/Ecore" as ecore | ||
4 | import "http://www.eclipse.org/viatra/query/patternlanguage/PatternLanguage" as viatra | ||
5 | generate applicationConfiguration "http://www.bme.hu/mit/inf/dslreasoner/application/ApplicationConfiguration" | ||
6 | |||
7 | ConfigurationScript: | ||
8 | (imports += Import)* | ||
9 | (commands += Command)* | ||
10 | ; | ||
11 | |||
12 | Command : | ||
13 | Declaration | ||
14 | //| Task | ||
15 | ; | ||
16 | Declaration : | ||
17 | // FileDeclaration | | ||
18 | MetamodelDeclaration | ||
19 | // | PartialModelDeclaration | ||
20 | // | GraphPatternDeclaration | ||
21 | // | SolverConfig | ||
22 | ; | ||
23 | |||
24 | /////////////////////////////////////////////////// | ||
25 | // Imports | ||
26 | /////////////////////////////////////////////////// | ||
27 | |||
28 | Import: EPackageImport | ViatraImport; | ||
29 | |||
30 | EPackageImport: "import" "epackage" importedPackage=[ecore::EPackage|STRING]; | ||
31 | ViatraImport: "import" "viatra" importedViatra=[viatra::PatternModel|STRING]; | ||
32 | |||
33 | /////////////////////////////////////////////////// | ||
34 | // Files and Folders | ||
35 | /////////////////////////////////////////////////// | ||
36 | /* | ||
37 | FileSpecification: path = STRING; | ||
38 | FileDeclaration: 'file' name = ID '=' specification = FileSpecification; | ||
39 | |||
40 | FileReference: referred = [FileDeclaration]; | ||
41 | File: FileSpecification | FileReference; | ||
42 | */ | ||
43 | /////////////////////////////////////////////////// | ||
44 | // Metamodel | ||
45 | /////////////////////////////////////////////////// | ||
46 | |||
47 | MetamodelSpecification: '{' (entries += MetamodelEntry) (',' entries += MetamodelEntry)* '}'; | ||
48 | MetamodelEntry: MetamodelElement | AllPackageEntry; | ||
49 | AllPackageEntry: "package" package=[ecore::EPackage] ("excluding" '{'exclusion +=MetamodelElement (',' exclusion +=MetamodelElement)*'}')?; | ||
50 | MetamodelElement: (package=[ecore::EPackage] '::')? classifier = [ecore::EClassifier] ('.' feature= [ecore::ENamedElement])?; | ||
51 | |||
52 | MetamodelDeclaration: 'metamodel' name = ID specification = MetamodelSpecification; | ||
53 | MetamodelReference: referred = [MetamodelDeclaration]; | ||
54 | Metamodel: MetamodelReference | MetamodelSpecification; | ||
55 | |||
56 | /////////////////////////////////////////////////// | ||
57 | // Partial Model | ||
58 | /////////////////////////////////////////////////// | ||
59 | /* | ||
60 | PartialModelEntry: path = File; | ||
61 | PartialModelSpecification: entry += PartialModelEntry ('+' entry += PartialModelEntry)*; | ||
62 | PartialModelDeclaration: 'partial-model' name = ID '=' specification = PartialModelSpecification; | ||
63 | PartialModelReference : referred = [PartialModelDeclaration]; | ||
64 | PartialModel: PartialModelSpecification | PartialModelReference; | ||
65 | */ | ||
66 | /////////////////////////////////////////////////// | ||
67 | // Patterns | ||
68 | /////////////////////////////////////////////////// | ||
69 | /* | ||
70 | PatternSpecification: '{' entries += PatternEntry (',' entries += PatternEntry)* '}'; | ||
71 | PatternEntry: PatternElement | AllPatternEntry; | ||
72 | AllPatternEntry: package = [viatra::PatternModel] ('excluding' '{' exclusuion += PatternElement (',' exclusuion += PatternElement)* '}')?; | ||
73 | PatternElement: pattern = [viatra::Pattern]; | ||
74 | |||
75 | GraphPatternDeclaration: 'patterns' name = ID specification = PatternSpecification; | ||
76 | GraphPatternReference: referred = [GraphPatternDeclaration]; | ||
77 | GraphPattern: GraphPatternReference|PatternSpecification; | ||
78 | */ | ||
79 | /////////////////////////////////////////////////// | ||
80 | // SolverConfig | ||
81 | /////////////////////////////////////////////////// | ||
82 | /* | ||
83 | SolverConfig : SMTSolverConfig | AlloySolverConfig | ViatraSolverConfig; | ||
84 | |||
85 | SMTSolverConfig: | ||
86 | 'smt-solver-config' name = ID '{' | ||
87 | 'solver-path' '=' solverPath = File | ||
88 | '}' | ||
89 | ; | ||
90 | |||
91 | AlloySolverConfig: | ||
92 | 'alloy-solver-config' name = ID '{' | ||
93 | ('symmetry' '=' symmetry=INT)? | ||
94 | '}' | ||
95 | ; | ||
96 | |||
97 | ViatraSolverConfig: | ||
98 | 'viatra-solver-config' name = ID '{' | ||
99 | ('statecoding' '=' statecoding = ViatraStatecoder)? & | ||
100 | ('type-inferencing' '=' typeinferencing = ViatraTypeInferencing)? & | ||
101 | ('backtrack-chance' '=' backtrackChance = INT)? | ||
102 | '}' | ||
103 | ; | ||
104 | enum ViatraStatecoder: neighbourhood | identifier; | ||
105 | enum ViatraTypeInferencing: preliminary | online; | ||
106 | |||
107 | Solver: SMTSolver | AlloySolver | ViatraSolver; | ||
108 | |||
109 | SMTSolver: 'smt-solver' '(' (config = [SMTSolverConfig]) ')'; | ||
110 | AlloySolver: 'alloy-solver' {AlloySolver} '(' (config = [AlloySolverConfig]|'default') ')'; | ||
111 | ViatraSolver: 'viatra-solver' {ViatraSolver} '(' (config= [ViatraSolverConfig]|'default')')'; | ||
112 | |||
113 | Task: GenerationTask; | ||
114 | |||
115 | GenerationTask: 'generate' '{' | ||
116 | ('metamodel' '=' metamodel = Metamodel) & | ||
117 | ('partial-model' '=' partialModel = PartialModel)? & | ||
118 | ('patterns' '=' patterns = GraphPattern)? & | ||
119 | ('new-objects' '=' size = INT) & | ||
120 | ('number' '=' number= INT)? & | ||
121 | ('runs' '=' runs = INT)? | ||
122 | 'target-folder' '=' tagetFolder = File | ||
123 | 'debug-folder' '=' debugFolder = File | ||
124 | ('log' '=' targetLogFile = File)? | ||
125 | ('statistics' '=' targetStatisticsFile = File)? | ||
126 | '}' | ||
127 | ;*/ \ No newline at end of file | ||