Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Quenio dos Santos
committed
Mar 24, 2017
1 parent
9e60e0a
commit 41552fd
Showing
17 changed files
with
130 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
concept Book | ||
concept Product | ||
{ | ||
quantity: Integer; | ||
} | ||
|
||
concept Book: Product | ||
{ | ||
isbn: String; | ||
title: String; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
Mini-CML Compiler | ||
|
||
Classes: | ||
- mcml.language.ModelElement | ||
- mcml.language.Scope | ||
- mcml.language.PropertyList | ||
|
||
Model(parentScope=not present, elements=[]) | ||
Concept(parentScope=not present, elements=[], name="SomeConcept", abstracted="true") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
...-generator/src/test/resources/java_lang/class/class2__concept_concrete_ancestor_empty.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
class BookImpl implements Book | ||
{ | ||
private final Product product; | ||
private final Intermediate intermediate; | ||
|
||
public BookImpl(String description) | ||
{ | ||
product = Product.create(description); | ||
intermediate = Intermediate.create(product); | ||
} | ||
|
||
public BookImpl(Product product, Intermediate intermediate) | ||
{ | ||
this.product = product; | ||
this.intermediate = intermediate; | ||
} | ||
|
||
public String getDescription() | ||
{ | ||
return product.getDescription(); | ||
} | ||
|
||
public String toString() | ||
{ | ||
return new StringBuilder(Book.class.getSimpleName()) | ||
.append('(') | ||
.append("description=").append(String.format("\"%s\"", getDescription())) | ||
.append(')') | ||
.toString(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
cml-compiler/cml-generator/src/test/resources/java_lang/interface/concept_abstract.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
interface Book | ||
{ | ||
String getTitle(); | ||
|
||
static Book create(String title) | ||
{ | ||
return new BookImpl(title); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 9 additions & 8 deletions
17
java-clients/mcml-compiler/src/main/java/mcml/compiler/Launcher.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
package mcml.compiler; | ||
|
||
import mcml.language.ModelElement; | ||
import mcml.language.PropertyList; | ||
import mcml.language.Scope; | ||
import mcml.language.Concept; | ||
import mcml.language.Model; | ||
|
||
import static java.util.Collections.emptySet; | ||
|
||
public class Launcher | ||
{ | ||
public static void main(final String[] args) | ||
{ | ||
final Model model = Model.create(null, emptySet()); | ||
final Concept concept = Concept.create(null, emptySet(), "SomeConcept", true); | ||
|
||
System.out.println("Mini-CML Compiler"); | ||
System.out.println(); | ||
System.out.println("Classes:"); | ||
System.out.println("- " + ModelElement.class.getName()); | ||
System.out.println("- " + Scope.class.getName()); | ||
System.out.println("- " + PropertyList.class.getName()); | ||
System.out.println(); | ||
System.out.println(model); | ||
System.out.println(concept); | ||
} | ||
} |