diff options
author | ArenBabikian <aren.babikian@mail.mcgill.ca> | 2020-06-13 19:24:25 -0400 |
---|---|---|
committer | ArenBabikian <aren.babikian@mail.mcgill.ca> | 2020-06-13 19:24:25 -0400 |
commit | 022a1e52e0cf20f64d9cd6685c65d945c04eaecc (patch) | |
tree | c281cd871d008ae63640fbdd9ff5739e273cb224 /Solvers/Alloy-Solver2/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit | |
parent | Merge branch 'Vampire-New' into Vampire-New (diff) | |
download | VIATRA-Generator-022a1e52e0cf20f64d9cd6685c65d945c04eaecc.tar.gz VIATRA-Generator-022a1e52e0cf20f64d9cd6685c65d945c04eaecc.tar.zst VIATRA-Generator-022a1e52e0cf20f64d9cd6685c65d945c04eaecc.zip |
remove Alloy solver copy
Diffstat (limited to 'Solvers/Alloy-Solver2/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit')
8 files changed, 0 insertions, 537 deletions
diff --git a/Solvers/Alloy-Solver2/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/AlloyLanguage.xtext b/Solvers/Alloy-Solver2/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/AlloyLanguage.xtext deleted file mode 100644 index fba3838c..00000000 --- a/Solvers/Alloy-Solver2/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/AlloyLanguage.xtext +++ /dev/null | |||
@@ -1,152 +0,0 @@ | |||
1 | grammar hu.bme.mit.inf.dslreasoner.AlloyLanguage with org.eclipse.xtext.common.Terminals | ||
2 | |||
3 | generate alloyLanguage "http://www.bme.hu/mit/inf/dslreasoner/AlloyLanguage" | ||
4 | |||
5 | ALSDocument: | ||
6 | ( enumDeclarations += ALSEnumDeclaration | | ||
7 | signatureBodies += ALSSignatureBody | | ||
8 | functionDefinitions += ALSFunctionDefinition | | ||
9 | relationDefinitions += ALSRelationDefinition | | ||
10 | factDeclarations += ALSFactDeclaration)+ | ||
11 | runCommand = ALSRunCommand | ||
12 | ; | ||
13 | |||
14 | ////////////////////////////////// | ||
15 | // ALS terminals | ||
16 | ////////////////////////////////// | ||
17 | |||
18 | terminal ID: ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|"'"|'"'|'0'..'9')*; | ||
19 | ALSID: ID; | ||
20 | |||
21 | enum ALSMultiplicity: all | no | some | lone | one | set; | ||
22 | |||
23 | |||
24 | ////////////////////////////////// | ||
25 | // ALS types | ||
26 | ////////////////////////////////// | ||
27 | |||
28 | ALSRelationDeclaration: ALSTypeDeclaration | ALSEnumLiteral | ALSFieldDeclaration | ALSVariableDeclaration; | ||
29 | |||
30 | ALSTypeDeclaration: | ||
31 | ALSEnumDeclaration | ALSSignatureDeclaration | ||
32 | ; | ||
33 | |||
34 | ALSEnumDeclaration: | ||
35 | 'enum' name=ALSID '{' | ||
36 | literal+=ALSEnumLiteral ("," literal+=ALSEnumLiteral)* | ||
37 | '}'; | ||
38 | ALSEnumLiteral: name = ALSID; | ||
39 | |||
40 | ALSSignatureDeclaration: name = ALSID; | ||
41 | |||
42 | ALSSignatureBody: | ||
43 | ((multiplicity = ALSMultiplicity?) & (abstract ?= 'abstract')?) | ||
44 | 'sig' | ||
45 | declarations += ALSSignatureDeclaration (',' declarations += ALSSignatureDeclaration)* | ||
46 | (('extends' supertype = [ALSSignatureDeclaration]) | ||
47 | | | ||
48 | ('in' superset += [ALSSignatureDeclaration] ('+' superset += [ALSSignatureDeclaration])*) )? | ||
49 | '{' (fields+=ALSFieldDeclaration ("," fields+=ALSFieldDeclaration)*)? '}' | ||
50 | ; | ||
51 | |||
52 | ALSFieldDeclaration: | ||
53 | name = ALSID ':' (multiplicity = ALSMultiplicity)? type = ALSTerm | ||
54 | ; | ||
55 | |||
56 | ALSDefinition : ALSFunctionDefinition | ALSRelationDefinition; | ||
57 | |||
58 | ALSFunctionDefinition: | ||
59 | "fun" name = ALSID "[" variables+=ALSVariableDeclaration (',' variables+=ALSVariableDeclaration)* "]" ":" type = ALSTerm | ||
60 | "{" value = ALSTerm "}" | ||
61 | ; | ||
62 | ALSRelationDefinition: | ||
63 | "pred" name = ALSID "[" variables+=ALSVariableDeclaration (',' variables+=ALSVariableDeclaration)* "]" | ||
64 | "{" value = ALSTerm "}" | ||
65 | ; | ||
66 | |||
67 | ALSFactDeclaration: {ALSFactDeclaration} 'fact' (name=ALSID)? '{' (term = ALSTerm) '}' ; | ||
68 | |||
69 | ////////////////////////////////// | ||
70 | // ALS terms | ||
71 | ////////////////////////////////// | ||
72 | ALSTerm: ALSQuantified; | ||
73 | |||
74 | ALSQuantified returns ALSTerm: ({ALSQuantifiedEx} type = ALSMultiplicity | ||
75 | (disj?='disj')? variables+=ALSVariableDeclaration (',' variables+=ALSVariableDeclaration)* '{' expression = ALSTerm '}') | ALSOr; | ||
76 | |||
77 | ALSOr returns ALSTerm: ALSIff ({ALSOr.leftOperand = current} ( "||" | "or" ) rightOperand = ALSIff)?; | ||
78 | ALSIff returns ALSTerm: ALSImpl ({ALSIff.leftOperand = current} ("<=>" | "iff") rightOperand = ALSImpl)?; | ||
79 | ALSImpl returns ALSTerm: ALSAnd ({ALSImpl.leftOperand = current} ("=>" | "implies") rightOperand = ALSAnd ('else' elseOperand = ALSAnd)?)?; | ||
80 | ALSAnd returns ALSTerm: ALSComparison ({ALSAnd.leftOperand = current} ( "&&" | "and" ) rightOperand = ALSComparison)?; | ||
81 | |||
82 | ALSComparison returns ALSTerm: | ||
83 | ALSOverride | ||
84 | (({ALSEquals.leftOperand = current} "=" | | ||
85 | {ALSNotEquals.leftOperand = current} "!=" | | ||
86 | {ALSSubset.leftOperand = current} "in" | | ||
87 | {ALSLess.leftOperand = current} ">" | | ||
88 | {ALSLeq.leftOperand = current} ">=" | | ||
89 | {ALSMore.leftOperand = current} "<" | | ||
90 | {ALSMeq.leftOperand = current} "<=") | ||
91 | rightOperand = ALSOverride)?; | ||
92 | |||
93 | ALSOverride returns ALSTerm: ALSRangeRestrictionRight ({ALSOverride.leftOperand = current} '++' rightOperand = ALSRangeRestrictionRight)?; | ||
94 | |||
95 | ALSRangeRestrictionRight returns ALSTerm: ALSRangeRestrictionLeft ({ALSRangeRestrictionRight.relation = current} ':>' filter = ALSRangeRestrictionLeft)?; | ||
96 | ALSRangeRestrictionLeft returns ALSTerm: ALSJoin ({ALSRangeRestrictionLeft.filter = current} '<:' relation = ALSJoin)?; | ||
97 | ALSJoin returns ALSTerm: ALSMinus ({ALSJoin.leftOperand = current} '.' rightOperand = ALSMinus )*; | ||
98 | |||
99 | ALSMinus returns ALSTerm: ALSPlus ({ALSMinus.leftOperand = current} '-' rightOperand = ALSPlus)*; | ||
100 | ALSPlus returns ALSTerm: ALSIntersection ({ALSPlus.leftOperand = current} '+' rightOperand = ALSIntersection)*; | ||
101 | ALSIntersection returns ALSTerm: ALSDirectProduct ({ALSIntersection.leftOperand = current} '&' rightOperand = ALSDirectProduct)*; | ||
102 | //ALSMultiply returns ALSTerm: ALSDirectProduct ({ALSMultiply.leftOperand = current} '*' rightOperand = ALSDirectProduct)*; | ||
103 | |||
104 | ALSDirectProduct returns ALSTerm: | ||
105 | ALSPreficed | ||
106 | ({ALSDirectProduct.leftOperand = current} (leftMultiplicit = ALSMultiplicity)? | ||
107 | '->' | ||
108 | (rightMultiplicit = ALSMultiplicity)? | ||
109 | rightOperand = ALSPreficed)? | ||
110 | ; | ||
111 | |||
112 | ALSPreficed returns ALSTerm: | ||
113 | {ALSNot}=>("!"|'not') operand = ALSBasicRelationTerm | | ||
114 | {ALSInverseRelation}=>"~" operand = ALSBasicRelationTerm | | ||
115 | {AlSTransitiveClosure} "^" operand = ALSBasicRelationTerm | | ||
116 | {ALSReflectiveTransitiveClosure} "*" operand = ALSBasicRelationTerm | | ||
117 | {ALSCardinality} '#' operand = ALSBasicRelationTerm | | ||
118 | {ALSUnaryMinus} =>'-' operand = ALSBasicRelationTerm | | ||
119 | {ALSSum} 'sum' variables+=ALSVariableDeclaration (',' variables+=ALSVariableDeclaration)* '{' expression = ALSTerm '}' | | ||
120 | // {ALSQuantifiedEx} type = ALSMultiplicity | ||
121 | // (disj?='disj')? variables+=ALSVariableDeclaration (',' variables+=ALSVariableDeclaration)* '{' expression = ALSTerm '}' | | ||
122 | {ALSFunctionCall} (referredDefinition=[ALSDefinition]|referredNumericOperator=ALSNumericOperator) '['params+=ALSTerm (',' params+=ALSTerm)*']' | | ||
123 | ALSBasicRelationTerm; | ||
124 | |||
125 | enum ALSNumericOperator: plus|sub|mul|rem|div; | ||
126 | |||
127 | //ALSVariable: name = ALSID; | ||
128 | ALSVariableDeclaration: name=ALSID ':' range = ALSTerm; | ||
129 | |||
130 | ALSBasicRelationTerm returns ALSTerm: | ||
131 | {ALSNone} 'none'| | ||
132 | {ALSIden} 'iden'| | ||
133 | {ALSUniv} 'univ'| | ||
134 | {ALSInt} 'Int' | | ||
135 | {ALSString} 'String' | | ||
136 | {ALSReference} referred = [ALSRelationDeclaration] | | ||
137 | {ALSNumberLiteral} value = INT| | ||
138 | {ALSStringLiteral} value = STRING| | ||
139 | '(' ALSTerm ')' | ||
140 | ; | ||
141 | |||
142 | ////////////////////////////////// | ||
143 | // ALS Commands and scopes | ||
144 | ////////////////////////////////// | ||
145 | ALSRunCommand: | ||
146 | {ALSRunCommand} 'run' '{' '}' ('for' typeScopes+=ALSTypeScope (',' typeScopes+=ALSTypeScope)*)?; | ||
147 | |||
148 | ALSTypeScope: ALSSigScope | ALSIntScope | ALSStringScope; | ||
149 | |||
150 | ALSSigScope: (exactly?='exactly')? number = INT type = [ALSSignatureDeclaration]; | ||
151 | ALSIntScope: number = INT 'Int'; | ||
152 | ALSStringScope: 'exactly' number = INT 'String'; \ No newline at end of file | ||
diff --git a/Solvers/Alloy-Solver2/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/AlloyLanguageRuntimeModule.java b/Solvers/Alloy-Solver2/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/AlloyLanguageRuntimeModule.java deleted file mode 100644 index 3fd8e2f0..00000000 --- a/Solvers/Alloy-Solver2/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/AlloyLanguageRuntimeModule.java +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | /* | ||
2 | * generated by Xtext | ||
3 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner; | ||
5 | |||
6 | /** | ||
7 | * Use this class to register components to be used at runtime / without the Equinox extension registry. | ||
8 | */ | ||
9 | public class AlloyLanguageRuntimeModule extends hu.bme.mit.inf.dslreasoner.AbstractAlloyLanguageRuntimeModule { | ||
10 | |||
11 | } | ||
diff --git a/Solvers/Alloy-Solver2/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/AlloyLanguageStandaloneSetup.java b/Solvers/Alloy-Solver2/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/AlloyLanguageStandaloneSetup.java deleted file mode 100644 index d3112c3d..00000000 --- a/Solvers/Alloy-Solver2/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/AlloyLanguageStandaloneSetup.java +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | /* | ||
2 | * generated by Xtext | ||
3 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner; | ||
5 | |||
6 | /** | ||
7 | * Initialization support for running Xtext languages | ||
8 | * without equinox extension registry | ||
9 | */ | ||
10 | public class AlloyLanguageStandaloneSetup extends AlloyLanguageStandaloneSetupGenerated{ | ||
11 | |||
12 | public static void doSetup() { | ||
13 | new AlloyLanguageStandaloneSetup().createInjectorAndDoEMFRegistration(); | ||
14 | } | ||
15 | } | ||
16 | |||
diff --git a/Solvers/Alloy-Solver2/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/GenerateAlloyLanguage.mwe2 b/Solvers/Alloy-Solver2/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/GenerateAlloyLanguage.mwe2 deleted file mode 100644 index 0f23b862..00000000 --- a/Solvers/Alloy-Solver2/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/GenerateAlloyLanguage.mwe2 +++ /dev/null | |||
@@ -1,133 +0,0 @@ | |||
1 | module hu.bme.mit.inf.dslreasoner.GenerateAlloyLanguage | ||
2 | |||
3 | import org.eclipse.emf.mwe.utils.* | ||
4 | import org.eclipse.xtext.generator.* | ||
5 | import org.eclipse.xtext.ui.generator.* | ||
6 | |||
7 | var grammarURI = "classpath:/hu/bme/mit/inf/dslreasoner/AlloyLanguage.xtext" | ||
8 | var fileExtensions = "als" | ||
9 | var projectName = "hu.bme.mit.inf.dslreasoner.alloy.language" | ||
10 | var runtimeProject = "../${projectName}" | ||
11 | var generateXtendStub = true | ||
12 | var encoding = "UTF-8" | ||
13 | |||
14 | Workflow { | ||
15 | bean = StandaloneSetup { | ||
16 | scanClassPath = true | ||
17 | platformUri = "${runtimeProject}/.." | ||
18 | // The following two lines can be removed, if Xbase is not used. | ||
19 | registerGeneratedEPackage = "org.eclipse.xtext.xbase.XbasePackage" | ||
20 | registerGenModelFile = "platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel" | ||
21 | } | ||
22 | |||
23 | component = DirectoryCleaner { | ||
24 | directory = "${runtimeProject}/src-gen" | ||
25 | } | ||
26 | |||
27 | component = DirectoryCleaner { | ||
28 | directory = "${runtimeProject}/model/generated" | ||
29 | } | ||
30 | |||
31 | component = DirectoryCleaner { | ||
32 | directory = "${runtimeProject}.ui/src-gen" | ||
33 | } | ||
34 | |||
35 | // component = DirectoryCleaner { | ||
36 | // directory = "${runtimeProject}.tests/src-gen" | ||
37 | // } | ||
38 | |||
39 | component = Generator { | ||
40 | pathRtProject = runtimeProject | ||
41 | pathUiProject = "${runtimeProject}.ui" | ||
42 | //pathTestProject = "${runtimeProject}.tests" | ||
43 | projectNameRt = projectName | ||
44 | projectNameUi = "${projectName}.ui" | ||
45 | encoding = encoding | ||
46 | language = auto-inject { | ||
47 | uri = grammarURI | ||
48 | |||
49 | // Java API to access grammar elements (required by several other fragments) | ||
50 | fragment = grammarAccess.GrammarAccessFragment auto-inject {} | ||
51 | |||
52 | // generates Java API for the generated EPackages | ||
53 | fragment = ecore.EMFGeneratorFragment auto-inject {} | ||
54 | |||
55 | // the old serialization component | ||
56 | // fragment = parseTreeConstructor.ParseTreeConstructorFragment auto-inject {} | ||
57 | |||
58 | // serializer 2.0 | ||
59 | fragment = serializer.SerializerFragment auto-inject { | ||
60 | generateStub = false | ||
61 | } | ||
62 | |||
63 | // a custom ResourceFactory for use with EMF | ||
64 | fragment = resourceFactory.ResourceFactoryFragment auto-inject {} | ||
65 | |||
66 | // The antlr parser generator fragment. | ||
67 | fragment = parser.antlr.XtextAntlrGeneratorFragment auto-inject { | ||
68 | // options = { | ||
69 | // backtrack = true | ||
70 | // } | ||
71 | } | ||
72 | |||
73 | // Xtend-based API for validation | ||
74 | fragment = validation.ValidatorFragment auto-inject { | ||
75 | // composedCheck = "org.eclipse.xtext.validation.ImportUriValidator" | ||
76 | // composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator" | ||
77 | } | ||
78 | |||
79 | // old scoping and exporting API | ||
80 | // fragment = scoping.ImportURIScopingFragment auto-inject {} | ||
81 | // fragment = exporting.SimpleNamesFragment auto-inject {} | ||
82 | |||
83 | // scoping and exporting API | ||
84 | fragment = scoping.ImportNamespacesScopingFragment auto-inject {} | ||
85 | fragment = exporting.QualifiedNamesFragment auto-inject {} | ||
86 | fragment = builder.BuilderIntegrationFragment auto-inject {} | ||
87 | |||
88 | // generator API | ||
89 | fragment = generator.GeneratorFragment auto-inject {} | ||
90 | |||
91 | // formatter API | ||
92 | fragment = formatting.FormatterFragment auto-inject {} | ||
93 | |||
94 | // labeling API | ||
95 | fragment = labeling.LabelProviderFragment auto-inject {} | ||
96 | |||
97 | // outline API | ||
98 | fragment = outline.OutlineTreeProviderFragment auto-inject {} | ||
99 | fragment = outline.QuickOutlineFragment auto-inject {} | ||
100 | |||
101 | // quickfix API | ||
102 | fragment = quickfix.QuickfixProviderFragment auto-inject {} | ||
103 | |||
104 | // content assist API | ||
105 | fragment = contentAssist.ContentAssistFragment auto-inject {} | ||
106 | |||
107 | // generates a more lightweight Antlr parser and lexer tailored for content assist | ||
108 | fragment = parser.antlr.XtextAntlrUiGeneratorFragment auto-inject {} | ||
109 | |||
110 | // generates junit test support classes into Generator#pathTestProject | ||
111 | fragment = junit.Junit4Fragment auto-inject {} | ||
112 | |||
113 | // rename refactoring | ||
114 | fragment = refactoring.RefactorElementNameFragment auto-inject {} | ||
115 | |||
116 | // provides the necessary bindings for java types integration | ||
117 | fragment = types.TypesGeneratorFragment auto-inject {} | ||
118 | |||
119 | // generates the required bindings only if the grammar inherits from Xbase | ||
120 | fragment = xbase.XbaseGeneratorFragment auto-inject {} | ||
121 | |||
122 | // generates the required bindings only if the grammar inherits from Xtype | ||
123 | fragment = xbase.XtypeGeneratorFragment auto-inject {} | ||
124 | |||
125 | // provides a preference page for template proposals | ||
126 | fragment = templates.CodetemplatesGeneratorFragment auto-inject {} | ||
127 | |||
128 | // provides a compare view | ||
129 | fragment = compare.CompareFragment auto-inject {} | ||
130 | } | ||
131 | } | ||
132 | } | ||
133 | |||
diff --git a/Solvers/Alloy-Solver2/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/formatting/AlloyLanguageFormatter.xtend b/Solvers/Alloy-Solver2/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/formatting/AlloyLanguageFormatter.xtend deleted file mode 100644 index e5ce7773..00000000 --- a/Solvers/Alloy-Solver2/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/formatting/AlloyLanguageFormatter.xtend +++ /dev/null | |||
@@ -1,96 +0,0 @@ | |||
1 | /* | ||
2 | * generated by Xtext | ||
3 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.formatting | ||
5 | |||
6 | import com.google.inject.Inject | ||
7 | import hu.bme.mit.inf.dslreasoner.services.AlloyLanguageGrammarAccess | ||
8 | import org.eclipse.xtext.formatting.impl.AbstractDeclarativeFormatter | ||
9 | import org.eclipse.xtext.formatting.impl.FormattingConfig | ||
10 | |||
11 | /** | ||
12 | * This class contains custom formatting description. | ||
13 | * | ||
14 | * see : http://www.eclipse.org/Xtext/documentation.html#formatting | ||
15 | * on how and when to use it | ||
16 | * | ||
17 | * Also see {@link org.eclipse.xtext.xtext.XtextFormattingTokenSerializer} as an example | ||
18 | */ | ||
19 | class AlloyLanguageFormatter extends AbstractDeclarativeFormatter { | ||
20 | |||
21 | @Inject extension AlloyLanguageGrammarAccess | ||
22 | |||
23 | override protected void configureFormatting(FormattingConfig c) { | ||
24 | // It's usually a good idea to activate the following three statements. | ||
25 | // They will add and preserve newlines around comments | ||
26 | c.setLinewrap(0, 1, 2).before(SL_COMMENTRule) | ||
27 | c.setLinewrap(0, 1, 2).before(ML_COMMENTRule) | ||
28 | c.setLinewrap(0, 1, 1).after(ML_COMMENTRule) | ||
29 | |||
30 | c.setAutoLinewrap(100000); | ||
31 | |||
32 | //Signatures | ||
33 | c.setIndentationIncrement.after(ALSSignatureBodyAccess.leftCurlyBracketKeyword_5); | ||
34 | c.setLinewrap.after(ALSSignatureBodyAccess.leftCurlyBracketKeyword_5) | ||
35 | c.setIndentationDecrement.before(ALSSignatureBodyAccess.rightCurlyBracketKeyword_7); | ||
36 | c.setLinewrap.after(ALSSignatureBodyAccess.rightCurlyBracketKeyword_7) | ||
37 | c.setLinewrap.before(ALSSignatureBodyAccess.rightCurlyBracketKeyword_7) | ||
38 | c.setNoSpace.before(ALSSignatureBodyAccess.commaKeyword_3_0) | ||
39 | c.setLinewrap.after(ALSSignatureBodyAccess.commaKeyword_3_0) | ||
40 | c.setNoSpace.before(ALSSignatureBodyAccess.commaKeyword_3_0) | ||
41 | c.setNoSpace.before(ALSSignatureBodyAccess.commaKeyword_6_1_0) | ||
42 | c.setLinewrap.after(ALSSignatureBodyAccess.commaKeyword_6_1_0) | ||
43 | c.setNoSpace.before(ALSSignatureBodyAccess.commaKeyword_6_1_0) | ||
44 | //c.setLinewrap(0,1,2).between(ALSSignatureDeclarationRule,ALSSignatureDeclarationRule) | ||
45 | |||
46 | //Enums | ||
47 | c.setIndentationIncrement.after(ALSEnumDeclarationAccess.leftCurlyBracketKeyword_2) | ||
48 | c.setLinewrap.after(ALSEnumDeclarationAccess.leftCurlyBracketKeyword_2) | ||
49 | c.setIndentationDecrement.before(ALSEnumDeclarationAccess.rightCurlyBracketKeyword_5) | ||
50 | c.setLinewrap.before(ALSEnumDeclarationAccess.rightCurlyBracketKeyword_5) | ||
51 | c.setLinewrap.after(ALSEnumDeclarationAccess.rightCurlyBracketKeyword_5) | ||
52 | c.setNoSpace.before(ALSEnumDeclarationAccess.commaKeyword_4_0) | ||
53 | |||
54 | |||
55 | //facts | ||
56 | c.setIndentationIncrement.after(ALSFactDeclarationAccess.leftCurlyBracketKeyword_3) | ||
57 | c.setLinewrap.after(ALSFactDeclarationAccess.leftCurlyBracketKeyword_3) | ||
58 | c.setIndentationDecrement.before(ALSFactDeclarationAccess.rightCurlyBracketKeyword_5) | ||
59 | c.setLinewrap.before(ALSFactDeclarationAccess.rightCurlyBracketKeyword_5) | ||
60 | c.setLinewrap.after(ALSFactDeclarationAccess.rightCurlyBracketKeyword_5) | ||
61 | |||
62 | //predicates | ||
63 | c.setIndentationIncrement.after(ALSRelationDefinitionAccess.leftCurlyBracketKeyword_6) | ||
64 | c.setLinewrap.after(ALSRelationDefinitionAccess.leftCurlyBracketKeyword_6) | ||
65 | c.setIndentationDecrement.before(ALSRelationDefinitionAccess.rightCurlyBracketKeyword_8) | ||
66 | c.setLinewrap.before(ALSRelationDefinitionAccess.rightCurlyBracketKeyword_8) | ||
67 | c.setLinewrap.after(ALSRelationDefinitionAccess.rightCurlyBracketKeyword_8) | ||
68 | c.setNoSpace.after(ALSRelationDefinitionAccess.leftSquareBracketKeyword_2) | ||
69 | c.setNoSpace.before(ALSRelationDefinitionAccess.rightSquareBracketKeyword_5) | ||
70 | c.setNoSpace.before(ALSRelationDefinitionAccess.commaKeyword_4_0) | ||
71 | |||
72 | // terms | ||
73 | //c.setNoSpace.before(ALSJoinAccess.rightSquareBracketKeyword_1_2_1_3) | ||
74 | c.setNoSpace.before(ALSJoinAccess.fullStopKeyword_1_1) | ||
75 | c.setNoSpace.after(ALSJoinAccess.fullStopKeyword_1_1) | ||
76 | |||
77 | c.setNoSpace.before(ALSDirectProductAccess.hyphenMinusGreaterThanSignKeyword_1_2) | ||
78 | c.setNoSpace.after(ALSDirectProductAccess.hyphenMinusGreaterThanSignKeyword_1_2) | ||
79 | |||
80 | c.setNoSpace.before(ALSVariableDeclarationAccess.colonKeyword_1) | ||
81 | // c.setNoSpace.before(ALSPreficedAccess.commaKeyword_5_3_0) | ||
82 | // c.setNoSpace.before(ALSPreficedAccess.commaKeyword_6_4_0) | ||
83 | // | ||
84 | // c.setIndentationIncrement.after(ALSPreficedAccess.leftCurlyBracketKeyword_5_4) | ||
85 | // c.setLinewrap.after(ALSPreficedAccess.leftCurlyBracketKeyword_5_4) | ||
86 | // c.setLinewrap.before(ALSPreficedAccess.rightCurlyBracketKeyword_5_6) | ||
87 | // c.setIndentationDecrement.before(ALSPreficedAccess.rightCurlyBracketKeyword_5_6) | ||
88 | |||
89 | c.setNoSpace.after(ALSBasicRelationTermAccess.leftParenthesisKeyword_8_0) | ||
90 | c.setNoSpace.before(ALSBasicRelationTermAccess.rightParenthesisKeyword_8_2) | ||
91 | |||
92 | // Quantified expression | ||
93 | c.setNoSpace.before(ALSQuantifiedAccess.commaKeyword_0_4_0) | ||
94 | |||
95 | } | ||
96 | } | ||
diff --git a/Solvers/Alloy-Solver2/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/generator/AlloyLanguageGenerator.xtend b/Solvers/Alloy-Solver2/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/generator/AlloyLanguageGenerator.xtend deleted file mode 100644 index c1ad5629..00000000 --- a/Solvers/Alloy-Solver2/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/generator/AlloyLanguageGenerator.xtend +++ /dev/null | |||
@@ -1,24 +0,0 @@ | |||
1 | /* | ||
2 | * generated by Xtext | ||
3 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.generator | ||
5 | |||
6 | import org.eclipse.emf.ecore.resource.Resource | ||
7 | import org.eclipse.xtext.generator.IGenerator | ||
8 | import org.eclipse.xtext.generator.IFileSystemAccess | ||
9 | |||
10 | /** | ||
11 | * Generates code from your model files on save. | ||
12 | * | ||
13 | * see http://www.eclipse.org/Xtext/documentation.html#TutorialCodeGeneration | ||
14 | */ | ||
15 | class AlloyLanguageGenerator implements IGenerator { | ||
16 | |||
17 | override void doGenerate(Resource resource, IFileSystemAccess fsa) { | ||
18 | // fsa.generateFile('greetings.txt', 'People to greet: ' + | ||
19 | // resource.allContents | ||
20 | // .filter(typeof(Greeting)) | ||
21 | // .map[name] | ||
22 | // .join(', ')) | ||
23 | } | ||
24 | } | ||
diff --git a/Solvers/Alloy-Solver2/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/scoping/AlloyLanguageScopeProvider.xtend b/Solvers/Alloy-Solver2/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/scoping/AlloyLanguageScopeProvider.xtend deleted file mode 100644 index b2333f51..00000000 --- a/Solvers/Alloy-Solver2/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/scoping/AlloyLanguageScopeProvider.xtend +++ /dev/null | |||
@@ -1,81 +0,0 @@ | |||
1 | /* | ||
2 | * generated by Xtext | ||
3 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.scoping | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.alloyLanguage.ALSDefinition | ||
7 | import hu.bme.mit.inf.dslreasoner.alloyLanguage.ALSDocument | ||
8 | import hu.bme.mit.inf.dslreasoner.alloyLanguage.ALSEnumDeclaration | ||
9 | import hu.bme.mit.inf.dslreasoner.alloyLanguage.ALSFunctionCall | ||
10 | import hu.bme.mit.inf.dslreasoner.alloyLanguage.ALSQuantifiedEx | ||
11 | import hu.bme.mit.inf.dslreasoner.alloyLanguage.ALSReference | ||
12 | import hu.bme.mit.inf.dslreasoner.alloyLanguage.ALSRelationDeclaration | ||
13 | import hu.bme.mit.inf.dslreasoner.alloyLanguage.ALSRelationDefinition | ||
14 | import hu.bme.mit.inf.dslreasoner.alloyLanguage.ALSSignatureBody | ||
15 | import hu.bme.mit.inf.dslreasoner.alloyLanguage.ALSSum | ||
16 | import java.util.ArrayList | ||
17 | import java.util.Collections | ||
18 | import java.util.HashSet | ||
19 | import java.util.LinkedList | ||
20 | import java.util.List | ||
21 | import java.util.Set | ||
22 | import org.eclipse.emf.ecore.EObject | ||
23 | import org.eclipse.emf.ecore.EReference | ||
24 | import org.eclipse.xtext.scoping.IScope | ||
25 | import org.eclipse.xtext.scoping.Scopes | ||
26 | import org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider | ||
27 | |||
28 | /** | ||
29 | * This class contains custom scoping description. | ||
30 | * | ||
31 | * see : http://www.eclipse.org/Xtext/documentation.html#scoping | ||
32 | * on how and when to use it | ||
33 | * | ||
34 | */ | ||
35 | class AlloyLanguageScopeProvider extends AbstractDeclarativeScopeProvider { | ||
36 | |||
37 | def public IScope scope_ALSReference_referred(ALSReference alsReferecnce, EReference ref) { | ||
38 | val Set<ALSRelationDeclaration> declarations = new HashSet | ||
39 | |||
40 | val parent = alsReferecnce.getAllParents(ALSDocument).head as ALSDocument | ||
41 | val signatures = parent.signatureBodies.map[ALSSignatureBody x|x.declarations].flatten | ||
42 | declarations+=parent.enumDeclarations | ||
43 | declarations+=signatures | ||
44 | declarations+=parent.enumDeclarations.map[ALSEnumDeclaration x | x.literal].flatten | ||
45 | declarations+=parent.signatureBodies.map[ALSSignatureBody x|x.fields].flatten | ||
46 | |||
47 | declarations+=alsReferecnce.getAllParents(ALSQuantifiedEx).map[ALSQuantifiedEx x | x.variables].flatten | ||
48 | declarations+=alsReferecnce.getAllParents(ALSSum).map[ALSSum x | x.variables].flatten | ||
49 | declarations+=alsReferecnce.getAllParents(ALSRelationDefinition).map[ALSRelationDefinition x | x.variables].flatten | ||
50 | |||
51 | // println("---") | ||
52 | // println(declarations.map[it.name].join(", ")) | ||
53 | |||
54 | return Scopes.scopeFor(declarations) | ||
55 | } | ||
56 | //{ALSFunctionCall} (/*functionName=ALSID |*/ referredDefinition=[ALSDefinition]) | ||
57 | def public IScope scope_ALSFunctionCall_referredDefinition(ALSFunctionCall call, EReference ref) { | ||
58 | val parent = call.<ALSDocument>getAllParents(ALSDocument).head as ALSDocument | ||
59 | val list = new LinkedList<ALSDefinition> | ||
60 | list += parent.relationDefinitions | ||
61 | list += parent.functionDefinitions | ||
62 | //list.forEach[println(it.name + " " + it.eContainer)] | ||
63 | return Scopes.scopeFor(list) | ||
64 | } | ||
65 | |||
66 | def <X extends EObject> List<X> getAllParents(EObject object, Class<X> type) { | ||
67 | if(object.eContainer == null) { | ||
68 | return Collections.EMPTY_LIST | ||
69 | } else { | ||
70 | val container = object.eContainer; | ||
71 | val previousParents = container.getAllParents(type) | ||
72 | if(type.isInstance(container)){ | ||
73 | val res = new ArrayList(previousParents) | ||
74 | res+= container as X | ||
75 | return res | ||
76 | } | ||
77 | else return previousParents | ||
78 | |||
79 | } | ||
80 | } | ||
81 | } | ||
diff --git a/Solvers/Alloy-Solver2/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/validation/AlloyLanguageValidator.xtend b/Solvers/Alloy-Solver2/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/validation/AlloyLanguageValidator.xtend deleted file mode 100644 index daeb9860..00000000 --- a/Solvers/Alloy-Solver2/hu.bme.mit.inf.dslreasoner.alloy.language/src/hu/bme/mit/inf/dslreasoner/validation/AlloyLanguageValidator.xtend +++ /dev/null | |||
@@ -1,24 +0,0 @@ | |||
1 | /* | ||
2 | * generated by Xtext | ||
3 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.validation | ||
5 | //import org.eclipse.xtext.validation.Check | ||
6 | |||
7 | /** | ||
8 | * Custom validation rules. | ||
9 | * | ||
10 | * see http://www.eclipse.org/Xtext/documentation.html#validation | ||
11 | */ | ||
12 | class AlloyLanguageValidator extends AbstractAlloyLanguageValidator { | ||
13 | |||
14 | // public static val INVALID_NAME = 'invalidName' | ||
15 | // | ||
16 | // @Check | ||
17 | // def checkGreetingStartsWithCapital(Greeting greeting) { | ||
18 | // if (!Character.isUpperCase(greeting.name.charAt(0))) { | ||
19 | // warning('Name should start with a capital', | ||
20 | // MyDslPackage.Literals.GREETING__NAME, | ||
21 | // INVALID_NAME) | ||
22 | // } | ||
23 | // } | ||
24 | } | ||