Skip to content
Snippets Groups Projects
Commit 46c1e71e authored by Jakob Moser's avatar Jakob Moser
Browse files

Also accept grammar from stdin

parent f251727a
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment