Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
JastAdd
RagConnect Minimal Example
Commits
91ddd251
Commit
91ddd251
authored
Jan 14, 2021
by
René Schöne
Browse files
Use packged ragconnect, remove root node.
parent
05ce1d2e
Changes
4
Hide whitespace changes
Inline
Side-by-side
build.gradle
View file @
91ddd251
...
...
@@ -17,12 +17,21 @@ mainClassName = 'de.tudresden.inf.st.mrc.MinimalMain'
repositories
{
jcenter
()
maven
{
name
"gitlab-maven"
url
"https://gitlab.example.com/api/v4/groups/jastadd/-/packages/maven"
}
}
apply
plugin:
'jastadd'
configurations
{
baseRuntimeClasspath
ragconnectClasspath
}
run
{
standardInput
=
System
.
in
}
File
genSrc
=
file
(
"src/gen/java"
)
...
...
@@ -34,6 +43,7 @@ dependencies {
implementation
group:
'org.fusesource.mqtt-client'
,
name:
'mqtt-client'
,
version:
'1.15'
implementation
group:
'org.apache.logging.log4j'
,
name:
'log4j-api'
,
version:
'2.11.2'
implementation
group:
'org.apache.logging.log4j'
,
name:
'log4j-core'
,
version:
'2.11.2'
ragconnectClasspath
group:
'de.tudresden.inf.st'
,
name:
'ragconnect.base'
,
version:
'0.2.3'
jastadd2
"org.jastadd:jastadd:2.3.4"
}
...
...
@@ -45,16 +55,16 @@ def relastFiles = ["src/gen/jastadd/MinimalModel.relast", "src/gen/jastadd/RagCo
// phase: ragConnect
task
ragConnect
(
type:
JavaExec
)
{
group
=
'Build'
main
=
'-jar'
main
=
'org.jastadd.ragconnect.compiler.Compiler'
classpath
=
configurations
.
ragconnectClasspath
args
([
'libs/ragconnect.jar'
,
'--verbose'
,
'--o=src/gen/jastadd'
,
'src/main/jastadd/MinimalModel.relast'
,
'src/main/jastadd/MinimalModel.connect'
,
'--rootNode=
MinimalModel
'
'--rootNode=
A
'
])
}
// phase: RelAst
...
...
@@ -102,7 +112,7 @@ jastadd {
}
cleanGen
.
doFirst
{
delete
"src/gen/java/
org
"
delete
"src/gen/java/
de
"
delete
"src/gen-res/BuildInfo.properties"
}
...
...
@@ -125,6 +135,10 @@ jastadd {
extraJastAddOptions
=
[
"--lineColumnNumbers"
,
'--List=JastAddList'
]
}
cleanGen
.
doFirst
{
delete
"src/gen/jastadd"
}
// Workflow configuration for phases
generateAst
.
dependsOn
relastToJastAdd
relastToJastAdd
.
dependsOn
ragConnect
libs/ragconnect.jar
deleted
100644 → 0
View file @
05ce1d2e
File deleted
src/main/jastadd/MinimalModel.relast
View file @
91ddd251
MinimalModel ::= A ;
A ::= <Input:String> /<OutputOnA:String>/ B* ;
B ::= /<OutputOnB:String>/ ;
src/main/java/de/tudresden/inf/st/mrc/MinimalMain.java
View file @
91ddd251
...
...
@@ -2,9 +2,9 @@ package de.tudresden.inf.st.mrc;
import
de.tudresden.inf.st.mrc.ast.A
;
import
de.tudresden.inf.st.mrc.ast.B
;
import
de.tudresden.inf.st.mrc.ast.MinimalModel
;
import
java.io.IOException
;
import
java.util.Scanner
;
/**
* Minimal main.
...
...
@@ -13,7 +13,6 @@ import java.io.IOException;
*/
public
class
MinimalMain
{
public
static
void
main
(
String
[]
args
)
throws
IOException
{
MinimalModel
model
=
new
MinimalModel
();
A
a
=
new
A
();
// set some default value for input
a
.
setInput
(
""
);
...
...
@@ -21,7 +20,6 @@ public class MinimalMain {
B
b2
=
new
B
();
a
.
addB
(
b1
);
a
.
addB
(
b2
);
model
.
setA
(
a
);
// a.OutputOnA -> a.Input
a
.
addDependencyA
(
a
);
...
...
@@ -35,6 +33,9 @@ public class MinimalMain {
b1
.
connectOutputOnB
(
"mqtt://localhost/b1/out"
,
true
);
b2
.
connectOutputOnB
(
"mqtt://localhost/b2/out"
,
false
);
while
(
true
)
{}
// while (true) {}
System
.
out
.
println
(
"[Enter] to exit"
);
Scanner
scanner
=
new
Scanner
(
System
.
in
);
scanner
.
nextLine
();
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment