Kreirano 2024-10-25 Fri 10:22, pritisni ESC za mapu, Ctrl+Shift+F za pretragu, ? za pomoć
SELECT player, stadium
FROM game JOIN goal ON (id=matchid)
@Entity
@Table(name="COURSES")
public class Course {
private long courseId;
private String courseName;
public Course() {
}
public Course(String courseName) {
this.courseName = courseName;
}
@Id
@GeneratedValue
@Column(name="COURSE_ID")
public long getCourseId() {
return this.courseId;
}
}
Beleške, kreiranje sadržaja, agenda, pismeno programiranje (literate programming).
** PROJ
*** TODO Pregledati prijavu greške #173
SCHEDULED: <2022-12-14 Wed>
1. [x] Neko parče koda:
#+begin_src rust
fn main() {
// Statements here are executed when the compiled binary is called
// Print text to the console
println!("Hello World!");
}
#+end_src
#+RESULTS:
: Hello World!
2. [ ] Neka druga zabeleška...
*** WAIT Predati projektni izveštaj
| Aktivnost | Završeno | Problemi |
|----------------+----------+------------------------|
| Prva aktivnost | 30% | Nema |
| Druga aktinost | 25% | Problemi u snabdevanju |
Učenje programiranja za decu.
Inform je jezik za kreiranje interaktivne fikcije (tekstualnih avantura) baziran na prirodnom jeziku.
"Cactus Will Outlive Us All"
Death Valley is a room. Luckless Luke and Dead-Eye Pete are men in the Valley.
A cactus is in the Valley. Persuasion rule: persuasion succeeds.
A person has an action called death knell. The death knell of Luckless Luke is pulling the cactus.
The death knell of Dead-Eye Pete is Luke trying dropping the cactus.
Before an actor doing something:
repeat with the victim running through people in the location:
let the DK be the death knell of the victim;
if the DK is not waiting and the current action is the DK:
say "It looks as if [the DK] was the death knell for [the victim], who looks startled,
then nonexistent.";
now the victim is nowhere.
Jezik za kreiranje muzike i sintezu zvuka u realnom vremenu.
// this synchronizes to period
.5::second => dur T;
T - (now % T) => now;
// construct the patch
SndBuf buf => Gain g => dac;
// read in the file
"kick.wav" => buf.read;
// set the gain
.5 => g.gain;
// time loop
while( true )
{
// set the play position to beginning
0 => buf.pos;
// randomize gain a bit
Math.random2f(.8,.9) => buf.gain;
// advance time
1::T => now;
}
GritQL je JSD za pretragu, linting i transformaciju koda.
`console.log($log)` => . where {
$log <: not within `try { $_ } catch { $_ }`
}
Kelly, S. & Tolvanen, J.-P. Domain-Specific Modeling: Enabling Full Code Generation, Wiley-IEEE Computer Society Pr, 2008
Dmitriev, S. Language oriented programming: The next programming paradigm, JetBrains onBoard, 2004.
Dmitriev, S. Language oriented programming: The next programming paradigm, JetBrains onBoard, 2004.
Kao i svaki softverski jezik i JSD se sastoji od:
Primer istog iskaza upotrebom dve različite konkretne sintakse
MimeMessage message = new MimeMessage(session);
message.setFrom(new InternetAddress(from));
message.addRecipient(Message.RecipientType.TO,
new InternetAddress(to));
message.setSubject("Greetings from Novi Sad");
message.setText("Enjoying my stay in Novi Sad! See you soon!");
Transport.send(message);
BEGIN myMail FROM me@myself.com TO myfriend@somewhere.org SUBJECT Greetings from Novi Sad Enjoying my stay in Novi Sad! See you soon! END SEND myMail
Interni JSD za definisanje grafički korisničkih interfejsa (Swing)
public DSLKurs() {
setBounds(100, 100, 450, 300);
getContentPane().setLayout(new BorderLayout());
contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
getContentPane().add(contentPanel, BorderLayout.CENTER);
contentPanel.setLayout(new FormLayout(new ColumnSpec[ {
FormFactory.RELATED_GAP_COLSPEC,
FormFactory.DEFAULT_COLSPEC,
FormFactory.RELATED_GAP_COLSPEC,
ColumnSpec.decode("default:grow"),},
new RowSpec[] {
FormFactory.RELATED_GAP_ROWSPEC,
FormFactory.DEFAULT_ROWSPEC,
FormFactory.RELATED_GAP_ROWSPEC,
FormFactory.DEFAULT_ROWSPEC,
FormFactory.RELATED_GAP_ROWSPEC,
FormFactory.DEFAULT_ROWSPEC,}));
....
Eksterni JSD za definisanje grafički korisničkih interfejsa (WindowBuilder)
Interni JSD za definisanje gramatike jezika (Arpeggio Python)
def number(): return _(r'\d*\.\d*|\d+')
def factor(): return Optional(["+","-"]), [number,
("(", expression, ")")]
def term(): return factor, ZeroOrMore(["*","/"], factor)
def expression(): return term, ZeroOrMore(["+", "-"], term)
def calc(): return OneOrMore(expression), EOF
Eksterni JSD za definisanje gramatike jezika (Arpeggio PEG)
number = r'\d*\.\d*|\d+' factor = ("+" / "-")? (number / "(" expression ")") term = factor (( "*" / "/") factor)* expression = term (("+" / "-") term)* calc = expression+ EOF
—
get '/dogs' do
# get a listing of all the dogs
end
get '/dog/:id' do
# just get one dog, you might find him like this:
@dog = Dog.find(params[:id])
# using the params convention, you specified in your route
end
post '/dog' do
# create a new dog listing
end
put '/dog/:id' do
# HTTP PUT request method to update an existing dog
end
delete '/dog/:id' do
# HTTP DELETE request method to remove a dog who's been sold!
end
repositories {
mavenCentral()
}
dependencies {
groovy fileTree(dir: new File(gradle.gradleHomeDir, 'lib'),
includes: ['**/groovyall*.jar'])
compile gradleApi()
compile 'eu.appsatori:gradlefatjarplugin:0.1.3',
{
ext.optional = true
}
testCompile 'org.spockframework:spockcore:0.6groovy1.8'
}
Score k = new Score(Tonality.G_major);
Bar bar = new Bar(BarType.4_4);
t.addPause(Duration.1_4);
t.addNote(NoteType.A3, Duration.1_4);
t.addNote(NoteType.C2, Duration.1_4);
k.addBar(bar);
U eksternoj varijanti možemo u potpunosti prilagoditi konkretnu sintaksu domenskim ekspertima.
Ali se dešava da i u eksternoj varijanti JSD nije prilagođen domenskim ekspertima.
Danas se platforme bazirane na JSD često brendiraju kao Low Code ili No Code platforme.
Projekcione radionice - direktna izmena apstraktne reprezentacije kroz projekciju.
Bazirane na parserima - izmena se vrši posredno kroz tekst koji se parsira da bi se dobila apstraktna reprezentacija.
Eye icon designed by Freepik. Hand icon by Yannick Lung.
Za dokumentaciju sa primerom izgradnje 7 različitih jezika pogledati http://www.eclipse.org/Xtext/7languagesDoc.html
*
A. Kleppe, Software language engineering: creating domain-specific
languages using metamodels. Addison-Wesley, 2009