Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relative Paths in Generated Parser #827

Merged
merged 1 commit into from
Jan 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions genparser.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,11 @@ java -jar "$ANTLR4_PATH" "$SCRIPT_DIR"/src/main/antlr4/GobraLexer.g4 -package vi
echo -e "${GREEN}Generating the parser:${RESET}"
java -jar "$ANTLR4_PATH" "$SCRIPT_DIR"/src/main/antlr4/GobraParser.g4 -package viper.gobra.frontend -visitor -no-listener || { echo -e "${RED}Error while generating the parser.${RESET}"; exit 3; }

echo -e "${GREEN}Making path in comments relative:${RESET}"
sed -i '' 's/\/\/ Generated from .*src\/main\/antlr4\/GobraLexer\.g4/\/\/ Generated from src\/main\/antlr4\/GobraLexer\.g4/g' "$SCRIPT_DIR"/src/main/antlr4/GobraLexer.java
sed -i '' 's/\/\/ Generated from .*src\/main\/antlr4\/GobraParser\.g4/\/\/ Generated from src\/main\/antlr4\/GobraParser\.g4/g' "$SCRIPT_DIR"/src/main/antlr4/GobraParser.java
sed -i '' 's/\/\/ Generated from .*src\/main\/antlr4\/GobraParser\.g4/\/\/ Generated from src\/main\/antlr4\/GobraParser\.g4/g' "$SCRIPT_DIR"/src/main/antlr4/GobraParserBaseVisitor.java
sed -i '' 's/\/\/ Generated from .*src\/main\/antlr4\/GobraParser\.g4/\/\/ Generated from src\/main\/antlr4\/GobraParser\.g4/g' "$SCRIPT_DIR"/src/main/antlr4/GobraParserVisitor.java

echo -e "${GREEN}Moving the generated files:${RESET}"
mv -v "$SCRIPT_DIR"/src/main/antlr4/*.java "$SCRIPT_DIR"/src/main/java/viper/gobra/frontend/
2 changes: 1 addition & 1 deletion src/main/java/viper/gobra/frontend/GobraLexer.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from /Users/joao/code/gobra/src/main/antlr4/GobraLexer.g4 by ANTLR 4.13.1
// Generated from src/main/antlr4/GobraLexer.g4 by ANTLR 4.13.1
package viper.gobra.frontend;
import org.antlr.v4.runtime.Lexer;
import org.antlr.v4.runtime.CharStream;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/viper/gobra/frontend/GobraParser.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from /Users/joao/code/gobra/src/main/antlr4/GobraParser.g4 by ANTLR 4.13.1
// Generated from src/main/antlr4/GobraParser.g4 by ANTLR 4.13.1
package viper.gobra.frontend;
import org.antlr.v4.runtime.atn.*;
import org.antlr.v4.runtime.dfa.DFA;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from /Users/joao/code/gobra/src/main/antlr4/GobraParser.g4 by ANTLR 4.13.1
// Generated from src/main/antlr4/GobraParser.g4 by ANTLR 4.13.1
package viper.gobra.frontend;
import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/viper/gobra/frontend/GobraParserVisitor.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated from /Users/joao/code/gobra/src/main/antlr4/GobraParser.g4 by ANTLR 4.13.1
// Generated from src/main/antlr4/GobraParser.g4 by ANTLR 4.13.1
package viper.gobra.frontend;
import org.antlr.v4.runtime.tree.ParseTreeVisitor;

Expand Down
Loading