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 | 140 |
1 files changed, 75 insertions, 65 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 index ed83419f..1e8fd485 100644 --- 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 | |||
@@ -4,23 +4,19 @@ import "http://www.eclipse.org/emf/2002/Ecore" as ecore | |||
4 | import "http://www.eclipse.org/viatra/query/patternlanguage/PatternLanguage" as viatra | 4 | import "http://www.eclipse.org/viatra/query/patternlanguage/PatternLanguage" as viatra |
5 | generate applicationConfiguration "http://www.bme.hu/mit/inf/dslreasoner/application/ApplicationConfiguration" | 5 | generate applicationConfiguration "http://www.bme.hu/mit/inf/dslreasoner/application/ApplicationConfiguration" |
6 | 6 | ||
7 | |||
7 | ConfigurationScript: | 8 | ConfigurationScript: |
8 | (imports += Import)* | 9 | (imports += Import)* |
9 | (commands += Command)* | 10 | (commands += Command)* |
10 | ; | 11 | ; |
11 | 12 | ||
12 | Command : | 13 | Command : |
13 | Declaration | 14 | Declaration | Task |
14 | //| Task | ||
15 | ; | ||
16 | Declaration : | ||
17 | // FileDeclaration | | ||
18 | MetamodelDeclaration | ||
19 | // | PartialModelDeclaration | ||
20 | // | GraphPatternDeclaration | ||
21 | // | SolverConfig | ||
22 | ; | 15 | ; |
23 | 16 | ||
17 | QualifiedName returns ecore::EString: | ||
18 | ID (=>'.' ID)*; | ||
19 | |||
24 | /////////////////////////////////////////////////// | 20 | /////////////////////////////////////////////////// |
25 | // Imports | 21 | // Imports |
26 | /////////////////////////////////////////////////// | 22 | /////////////////////////////////////////////////// |
@@ -29,25 +25,37 @@ Import: EPackageImport | ViatraImport; | |||
29 | 25 | ||
30 | EPackageImport: "import" "epackage" importedPackage=[ecore::EPackage|STRING]; | 26 | EPackageImport: "import" "epackage" importedPackage=[ecore::EPackage|STRING]; |
31 | ViatraImport: "import" "viatra" importedViatra=[viatra::PatternModel|STRING]; | 27 | ViatraImport: "import" "viatra" importedViatra=[viatra::PatternModel|STRING]; |
28 | |||
29 | /////////////////////////////////////////////////// | ||
30 | // Declaration | ||
31 | /////////////////////////////////////////////////// | ||
32 | |||
33 | Declaration : | ||
34 | FileDeclaration | ||
35 | | MetamodelDeclaration | ||
36 | | PartialModelDeclaration | ||
37 | | GraphPatternDeclaration | ||
38 | | ConfigDeclaration | ||
39 | | ScopeDeclaration | ||
40 | ; | ||
32 | 41 | ||
33 | /////////////////////////////////////////////////// | 42 | /////////////////////////////////////////////////// |
34 | // Files and Folders | 43 | // Files and Folders |
35 | /////////////////////////////////////////////////// | 44 | /////////////////////////////////////////////////// |
36 | /* | 45 | |
37 | FileSpecification: path = STRING; | 46 | FileSpecification: path = STRING; |
38 | FileDeclaration: 'file' name = ID '=' specification = FileSpecification; | 47 | FileDeclaration: 'file' name = ID '=' specification = FileSpecification; |
39 | |||
40 | FileReference: referred = [FileDeclaration]; | 48 | FileReference: referred = [FileDeclaration]; |
41 | File: FileSpecification | FileReference; | 49 | File: FileSpecification | FileReference; |
42 | */ | 50 | |
43 | /////////////////////////////////////////////////// | 51 | /////////////////////////////////////////////////// |
44 | // Metamodel | 52 | // Metamodel |
45 | /////////////////////////////////////////////////// | 53 | /////////////////////////////////////////////////// |
46 | 54 | ||
47 | MetamodelSpecification: '{' (entries += MetamodelEntry) (',' entries += MetamodelEntry)* '}'; | 55 | MetamodelSpecification: '{' (entries += MetamodelEntry) (',' entries += MetamodelEntry)* '}'; |
48 | MetamodelEntry: MetamodelElement | AllPackageEntry; | 56 | MetamodelEntry: MetamodelElement | AllPackageEntry; |
49 | AllPackageEntry: "package" package=[ecore::EPackage] ("excluding" '{'exclusion +=MetamodelElement (',' exclusion +=MetamodelElement)*'}')?; | 57 | AllPackageEntry: "package" package=[ecore::EPackage|QualifiedName] ("excluding" '{'exclusion +=MetamodelElement (',' exclusion +=MetamodelElement)*'}')?; |
50 | MetamodelElement: (package=[ecore::EPackage] '::')? classifier = [ecore::EClassifier] ('.' feature= [ecore::ENamedElement])?; | 58 | MetamodelElement: (package=[ecore::EPackage|QualifiedName] '::')? classifier = [ecore::EClassifier] ('.' feature= [ecore::ENamedElement])?; |
51 | 59 | ||
52 | MetamodelDeclaration: 'metamodel' name = ID specification = MetamodelSpecification; | 60 | MetamodelDeclaration: 'metamodel' name = ID specification = MetamodelSpecification; |
53 | MetamodelReference: referred = [MetamodelDeclaration]; | 61 | MetamodelReference: referred = [MetamodelDeclaration]; |
@@ -56,72 +64,74 @@ Metamodel: MetamodelReference | MetamodelSpecification; | |||
56 | /////////////////////////////////////////////////// | 64 | /////////////////////////////////////////////////// |
57 | // Partial Model | 65 | // Partial Model |
58 | /////////////////////////////////////////////////// | 66 | /////////////////////////////////////////////////// |
59 | /* | 67 | |
60 | PartialModelEntry: path = File; | 68 | PartialModelSpecification: '{' entry += PartialModelEntry (',' entry += PartialModelEntry)? '}'; |
61 | PartialModelSpecification: entry += PartialModelEntry ('+' entry += PartialModelEntry)*; | 69 | PartialModelEntry: ModelEntry | FolderEntry; |
62 | PartialModelDeclaration: 'partial-model' name = ID '=' specification = PartialModelSpecification; | 70 | ModelEntry: path = File; |
71 | FolderEntry: "folder" path = File ("excluding" "{" exclusion += ModelEntry ("," exclusion += ModelEntry)* "}")?; | ||
72 | |||
73 | PartialModelDeclaration: 'models' name = ID specification = PartialModelSpecification; | ||
63 | PartialModelReference : referred = [PartialModelDeclaration]; | 74 | PartialModelReference : referred = [PartialModelDeclaration]; |
64 | PartialModel: PartialModelSpecification | PartialModelReference; | 75 | PartialModel: PartialModelSpecification | PartialModelReference; |
65 | */ | 76 | |
66 | /////////////////////////////////////////////////// | 77 | /////////////////////////////////////////////////// |
67 | // Patterns | 78 | // Patterns |
68 | /////////////////////////////////////////////////// | 79 | /////////////////////////////////////////////////// |
69 | /* | 80 | |
70 | PatternSpecification: '{' entries += PatternEntry (',' entries += PatternEntry)* '}'; | 81 | PatternSpecification: '{' entries += PatternEntry (',' entries += PatternEntry)* '}'; |
71 | PatternEntry: PatternElement | AllPatternEntry; | 82 | PatternEntry: PatternElement | AllPatternEntry; |
72 | AllPatternEntry: package = [viatra::PatternModel] ('excluding' '{' exclusuion += PatternElement (',' exclusuion += PatternElement)* '}')?; | 83 | AllPatternEntry: 'package' package = [viatra::PatternModel|QualifiedName] ('excluding' '{' exclusuion += PatternElement (',' exclusuion += PatternElement)* '}')?; |
73 | PatternElement: pattern = [viatra::Pattern]; | 84 | PatternElement: (package =[viatra::PatternModel|QualifiedName] '::')? pattern = [viatra::Pattern]; |
74 | 85 | ||
75 | GraphPatternDeclaration: 'patterns' name = ID specification = PatternSpecification; | 86 | GraphPatternDeclaration: 'patterns' name = ID specification = PatternSpecification; |
76 | GraphPatternReference: referred = [GraphPatternDeclaration]; | 87 | GraphPatternReference: referred = [GraphPatternDeclaration]; |
77 | GraphPattern: GraphPatternReference|PatternSpecification; | 88 | GraphPattern: GraphPatternReference|PatternSpecification; |
78 | */ | 89 | |
79 | /////////////////////////////////////////////////// | 90 | /////////////////////////////////////////////////// |
80 | // SolverConfig | 91 | // SolverConfig |
81 | /////////////////////////////////////////////////// | 92 | /////////////////////////////////////////////////// |
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 | 93 | ||
109 | SMTSolver: 'smt-solver' '(' (config = [SMTSolverConfig]) ')'; | 94 | ConfigSpecification: {ConfigSpecification}'{' |
110 | AlloySolver: 'alloy-solver' {AlloySolver} '(' (config = [AlloySolverConfig]|'default') ')'; | 95 | (entries += ConfigEntry ("," entries += ConfigEntry)*)? |
111 | ViatraSolver: 'viatra-solver' {ViatraSolver} '(' (config= [ViatraSolverConfig]|'default')')'; | 96 | '}'; |
112 | 97 | ConfigDeclaration : | |
113 | Task: GenerationTask; | 98 | 'config' name = ID specification = ConfigSpecification |
114 | 99 | ; | |
115 | GenerationTask: 'generate' '{' | 100 | ConfigEntry: key = STRING "=" value = STRING; |
116 | ('metamodel' '=' metamodel = Metamodel) & | 101 | ConfigReference: config = [ConfigDeclaration]; |
102 | Config: ConfigSpecification | ConfigReference; | ||
103 | |||
104 | enum Solver: SMTSolver | AlloySolver | ViatraSolver; | ||
105 | |||
106 | ScopeSpecification: {ScopeSpecification} '{' | ||
107 | (scopes += TypeScope (',' scopes += TypeScope)*)? | ||
108 | '}'; | ||
109 | TypeScope: ( min = INT ( greather?='<' | greaterOrEqual?= '<='))? '#' type = TypeReference (( less?='<' | lessOrEqual?= '<=') max = INT)?; | ||
110 | TypeReference: ClassReference | ObjectReference | IntegerReference | RealReference | StringReference; | ||
111 | ClassReference: '[' element = MetamodelElement ']'; | ||
112 | ObjectReference: {ObjectReference} 'Object'; | ||
113 | IntegerReference: {IntegerScope} 'int'; | ||
114 | RealReference: {RealScope} 'real'; | ||
115 | StringReference: {StringScope} 'string'; | ||
116 | |||
117 | ScopeDeclaration: 'scope' name = ID specification = ScopeSpecification; | ||
118 | ScopeReference: referred = [ScopeDeclaration]; | ||
119 | Scope: ScopeSpecification | ScopeReference; | ||
120 | |||
121 | Task: GenerationTask /*| MeasurementTask | ValidationTask*/; | ||
122 | |||
123 | GenerationTask: 'generate' {GenerationTask} '{' | ||
124 | (('metamodel' '=' metamodel = Metamodel)? & | ||
117 | ('partial-model' '=' partialModel = PartialModel)? & | 125 | ('partial-model' '=' partialModel = PartialModel)? & |
118 | ('patterns' '=' patterns = GraphPattern)? & | 126 | ('patterns' '=' patterns = GraphPattern)? & |
119 | ('new-objects' '=' size = INT) & | 127 | ('scope' '=' scope = Scope)? & |
120 | ('number' '=' number= INT)? & | 128 | ('number' '=' number= INT)? & |
121 | ('runs' '=' runs = INT)? | 129 | ('runs' '=' runs = INT)? & |
122 | 'target-folder' '=' tagetFolder = File | 130 | ('solver' '=' solver = Solver)? & |
123 | 'debug-folder' '=' debugFolder = File | 131 | ('config' '=' config = Config)? & |
124 | ('log' '=' targetLogFile = File)? | 132 | ('output' '=' tagetFolder = File)? & |
125 | ('statistics' '=' targetStatisticsFile = File)? | 133 | ('debug' '=' debugFolder = File)? & |
134 | ('log' '=' targetLogFile = File)? & | ||
135 | ('statistics' '=' targetStatisticsFile = File)?) | ||
126 | '}' | 136 | '}' |
127 | ;*/ \ No newline at end of file | 137 | ; \ No newline at end of file |