-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-parser.sh
executable file
·40 lines (21 loc) · 1.18 KB
/
build-parser.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# ~/bin/bash
# Remember to use the Snowflake GUI to "Generate Parser" before running this script, if changes were made to the grammar.
#########################################################################################
# Create the AST node structs.
#########################################################################################
# Remove the node files, but leave the package-info.java file.
find "src/autumn/lang/compiler/ast/nodes/" -type f ! -name "package-info.java" -exec rm {} +
cd "parser"
bash "/media/disk/bin/generate-struct" "autumn.structs"
#########################################################################################
# Create AstBuilder.java
#########################################################################################
unzip -o "Grammar.snow"
rm "Grammar.txt"
rm "Input.txt"
cd ".."
mv "parser/Parser.java" "src/high/mackenzie/autumn/lang/compiler/parser/Parser.java"
mv "parser/Visitor.java" "src/high/mackenzie/autumn/lang/compiler/parser/AbstractVisitor.java"
bash "/media/disk/bin/generate-ast" "parser/AstVisitor.ast"
#########################################################################################
echo "Finished!"