Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
motion-grammar-example
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
JastAdd
motion-grammar-example
Commits
dfe243ce
Commit
dfe243ce
authored
2 years ago
by
Johannes Mey
Browse files
Options
Downloads
Patches
Plain Diff
some (unused) changes to templates
parent
35cc165d
No related branches found
No related tags found
1 merge request
!1
festival updatesfestival updatesfestival updatesfestival updatesfestival
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/resources/template-configs/RobotParser.yaml
+7
-9
7 additions, 9 deletions
src/main/resources/template-configs/RobotParser.yaml
src/main/resources/templates/Parser.mustache
+5
-5
5 additions, 5 deletions
src/main/resources/templates/Parser.mustache
with
12 additions
and
14 deletions
src/main/resources/template-configs/RobotParser.yaml
+
7
−
9
View file @
dfe243ce
...
...
@@ -4,14 +4,14 @@ genPackage: "de.tudresden.inf.st.mg.jastadd.model"
targetType
:
"
Tidy"
tokenContext
:
context
:
false
# default value
context
Type
:
false
# default value
peek
:
true
# default value
worldParserArguments
:
[
]
# default value
tokens
:
-
name
:
"
EmptyTable"
-
name
:
"
NotEmptyTable"
-
name
:
"
ObjectAtWrongPlace
"
context
:
"
Tidy"
-
name
:
"
AvailableObject
"
context
Type
:
"
Tidy"
-
name
:
"
RobotIsReadyToPickToken"
-
name
:
"
RobotIsNotReadyToPickToken"
-
name
:
"
RobotIsReadyToDropToken"
...
...
@@ -28,6 +28,7 @@ tokenContext:
worldParserArguments
:
-
argument
:
"
object()"
peek
:
false
-
name
:
"
MisplacedObject"
ruleContext
:
constructObject
:
false
# default value
...
...
@@ -47,7 +48,7 @@ ruleContext:
peekToken
:
"
EmptyTable"
-
componentName
:
"
MoveObjectToCorrectPlace"
list
:
true
peekToken
:
"
ObjectAtWrongPlace
"
peekToken
:
"
MisplacedObject
"
peekContext
:
"
result"
-
componentName
:
"
WaitForEmptyTable"
list
:
true
...
...
@@ -57,7 +58,7 @@ ruleContext:
-
ruleName
:
"
MoveObjectToCorrectPlace"
constructObject
:
true
components
:
-
componentName
:
"
ObjectAtWrongPlace
"
-
componentName
:
"
MisplacedObject
"
token
:
true
index
:
0
additionalArgs
:
"
,
parent.containingTidy()"
...
...
@@ -88,9 +89,6 @@ ruleContext:
components
:
-
componentName
:
"
RobotIsReadyToDrop"
index
:
0
-
componentName
:
"
RightPlace"
token
:
true
index
:
1
-
ruleName
:
"
PickUpObject"
constructObject
:
true
components
:
...
...
This diff is collapsed.
Click to expand it.
src/main/resources/templates/Parser.mustache
+
5
−
5
View file @
dfe243ce
...
...
@@ -26,13 +26,13 @@ public final class {{{name}}} extends MotionGrammarParser<{{{targetType}}}> {
{{#
peek
}}
private
{{{
name
}}}
peeked
{{{
name
}}}
_ = null;
private boolean peek
{{{
name
}}}
(
{{#
context
}}{{{
context
}}}
context
{{/
context
}}
) {
peeked
{{{
name
}}}
_ = getWorld().parse
{{{
name
}}}
(
{{#
context
}}
context
{{/
context
}}{{#
worldParserArguments
}}
parent.
{{{
argument
}}}{{/
worldParserArguments
}}
);
private boolean peek
{{{
name
}}}
(
{{#
context
Type
}}{{{
context
Type
}}}
context
{{/
context
Type
}}
) {
peeked
{{{
name
}}}
_ = getWorld().parse
{{{
name
}}}
(
{{#
context
Type
}}
context
{{/
context
Type
}}{{#
worldParserArguments
}}
parent.
{{{
argument
}}}{{/
worldParserArguments
}}
);
return peeked
{{{
name
}}}
_ != null;
}
{{/
peek
}}
private void parse
{{{
name
}}}
(ASTNode
<
?
>
parent, int index
{{#
context
}}
,
{{{
context
}}}
context
{{/
context
}}
) throws ParseException {
private void parse
{{{
name
}}}
(ASTNode
<
?
>
parent, int index
{{#
context
Type
}}
,
{{{
context
Type
}}}
context
{{/
context
Type
}}
) throws ParseException {
{{{
name
}}}
result;
{{#
peek
}}
...
...
@@ -40,14 +40,14 @@ public final class {{{name}}} extends MotionGrammarParser<{{{targetType}}}> {
result = peeked
{{{
name
}}}
_;
peeked
{{{
name
}}}
_ = null; // TODO check if all peeked values are actually parsed afterwards
} else {
result = getWorld().parse
{{{
name
}}}
(
{{#
context
}}
context
{{/
context
}}{{#
worldParserArguments
}}
parent.
{{{
argument
}}}{{/
worldParserArguments
}}
);
result = getWorld().parse
{{{
name
}}}
(
{{#
context
Type
}}
context
{{/
context
Type
}}{{#
worldParserArguments
}}
parent.
{{{
argument
}}}{{/
worldParserArguments
}}
);
if (result == null) {
throw new ParseException(
{{{
name
}}}
.type());
}
}
{{/
peek
}}
{{^
peek
}}
result = getWorld().parse
{{{
name
}}}
(
{{#
context
}}
context
{{/
context
}}{{#
worldParserArguments
}}
parent.
{{{
argument
}}}{{/
worldParserArguments
}}
);
result = getWorld().parse
{{{
name
}}}
(
{{#
context
Type
}}
context
{{/
context
Type
}}{{#
worldParserArguments
}}
parent.
{{{
argument
}}}{{/
worldParserArguments
}}
);
if (result == null) {
throw new ParseException(
{{{
name
}}}
.type());
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment