Skip to content

Commit

Permalink
Project Update: Adding context-based code templates to the language
Browse files Browse the repository at this point in the history
  • Loading branch information
JonnathanRiquelmo committed Oct 20, 2021
1 parent d3a9380 commit 22eee33
Show file tree
Hide file tree
Showing 46 changed files with 105 additions and 32 deletions.
Binary file not shown.
Binary file not shown.

This file was deleted.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions org.xtext.unipampa.erdsl.ui/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="src-gen"/>
<classpathentry kind="src" path="xtend-gen"/>
<classpathentry kind="src" path="templates"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
51 changes: 51 additions & 0 deletions org.xtext.unipampa.erdsl.ui/bin/templates.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates>
<template name="Generate"
description="template for a Generate command"
id="org.xtext.unipampa.erdsl.ErDsl.kw_Generate"
context="org.xtext.unipampa.erdsl.ErDsl.kw_Generate"
enabled="true">Generate ${All};</template>
<template name="Domain" description="template for a Domain"
id="org.xtext.unipampa.erdsl.ErDsl.Domain"
context="org.xtext.unipampa.erdsl.ErDsl.Domain"
enabled="true">Domain ${Name};</template>
<template name="Entities"
description="template for the Entities block"
id="org.xtext.unipampa.erdsl.ErDsl.kw_Entities"
context="org.xtext.unipampa.erdsl.ErDsl.kw_Entities"
enabled="true">Entities {
${Entity1} {
${attribute1} int isIdentifier,
${attribute2} file
}

/* The generalization type can be:
* [1] total/disjoint, [2] total/overlapped, [3] partial/disjoint OR [4] partial/overlapped
*/
${Entity2} is total/disjoint ${Entity1} {
${attribute3} string,
${attribute4} datetime
}
};</template>
<template name="Entity"
description="template for an simple Entity"
id="org.xtext.unipampa.erdsl.ErDsl.Entity"
context="org.xtext.unipampa.erdsl.ErDsl.Entity"
enabled="true">${Name} {

}</template>
<template name="Attribute"
description="template for an Attribute"
id="org.xtext.unipampa.erdsl.ErDsl.Attribute"
context="org.xtext.unipampa.erdsl.ErDsl.Attribute" enabled="true">${attribute}
${int}
</template>
<template name="Relationships"
description="template for the Relationships block"
id="org.xtext.unipampa.erdsl.ErDsl.kw_Relationships"
context="org.xtext.unipampa.erdsl.ErDsl.kw_Relationships"
enabled="true">Relationships {
${Relationship1} [${Entity1} (1:N) relates (1:N) ${Entity2}] {${attribute5} int}
${Relationship2} [${Entity2} (1:N) relates (1:N) ${Entity1}]
};</template>
</templates>
3 changes: 2 additions & 1 deletion org.xtext.unipampa.erdsl.ui/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ source.. = src/,\
xtend-gen/
bin.includes = .,\
META-INF/,\
plugin.xml
plugin.xml,\
templates/
bin.excludes = **/*.xtend
51 changes: 51 additions & 0 deletions org.xtext.unipampa.erdsl.ui/templates/templates.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates>
<template name="Generate"
description="template for a Generate command"
id="org.xtext.unipampa.erdsl.ErDsl.kw_Generate"
context="org.xtext.unipampa.erdsl.ErDsl.kw_Generate"
enabled="true">Generate ${All};</template>
<template name="Domain" description="template for a Domain"
id="org.xtext.unipampa.erdsl.ErDsl.Domain"
context="org.xtext.unipampa.erdsl.ErDsl.Domain"
enabled="true">Domain ${Name};</template>
<template name="Entities"
description="template for the Entities block"
id="org.xtext.unipampa.erdsl.ErDsl.kw_Entities"
context="org.xtext.unipampa.erdsl.ErDsl.kw_Entities"
enabled="true">Entities {
${Entity1} {
${attribute1} int isIdentifier,
${attribute2} file
}

/* The generalization type can be:
* [1] total/disjoint, [2] total/overlapped, [3] partial/disjoint OR [4] partial/overlapped
*/
${Entity2} is total/disjoint ${Entity1} {
${attribute3} string,
${attribute4} datetime
}
};</template>
<template name="Entity"
description="template for an simple Entity"
id="org.xtext.unipampa.erdsl.ErDsl.Entity"
context="org.xtext.unipampa.erdsl.ErDsl.Entity"
enabled="true">${Name} {

}</template>
<template name="Attribute"
description="template for an Attribute"
id="org.xtext.unipampa.erdsl.ErDsl.Attribute"
context="org.xtext.unipampa.erdsl.ErDsl.Attribute" enabled="true">${attribute}
${int}
</template>
<template name="Relationships"
description="template for the Relationships block"
id="org.xtext.unipampa.erdsl.ErDsl.kw_Relationships"
context="org.xtext.unipampa.erdsl.ErDsl.kw_Relationships"
enabled="true">Relationships {
${Relationship1} [${Entity1} (1:N) relates (1:N) ${Entity2}] {${attribute5} int}
${Relationship2} [${Entity2} (1:N) relates (1:N) ${Entity1}]
};</template>
</templates>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 22eee33

Please sign in to comment.