Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
X
xle-docker
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
Container Registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tutoren
Formale Syntax
xle-docker
Commits
46c1e71e
Commit
46c1e71e
authored
2 years ago
by
Jakob Moser
Browse files
Options
Downloads
Patches
Plain Diff
Also accept grammar from stdin
parent
f251727a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
entrypoint.sh
+9
-2
9 additions, 2 deletions
entrypoint.sh
with
9 additions
and
2 deletions
entrypoint.sh
+
9
−
2
View file @
46c1e71e
...
...
@@ -2,8 +2,15 @@
#
# Entrypoint for the xle Docker image.
#
# - /grammar.lfg contains the grammar
# - $1 contains the sentence to be parsed (passed as parameter)
# You need to provide the following information:
# 1. A sentence to parse as first (and only) command line argument ($1)
# 2. A grammar to parse with. The grammar is searched first at /grammar.lfg. If no such file exists, the grammar is read from stdin.
if
[[
!
-f
/grammar.lfg
]]
then
# Use "cat" to read everything stdin has to offer and then use Bash to write it to a file
cat
>
/grammar.lfg
fi
# Write xlerc containing instructions to parse
echo
"create-parser /grammar.lfg"
>
xlerc
...
...
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