Repository navigation
ANTLR errors -- validity of results #2275
Answered
by
tsaglam
erikmartinessanches
asked this question in
Q&A
|
When running
Is the result reliable regardless? macOS 15.3.2, M1 Pro. |
Answered by
tsaglam
Mar 31, 2025
Replies: 1 comment
0 replies
Answer selected by
tsaglam
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


It depends. We use different means of parsing files of programming languages. For many languages, we use ANTLR grammars.
When the ANTLR grammar fails to parse a program (e.g., due to a syntax error), it may still return an incorrect parse tree, and JPlag can still (partially) check that program for plagiarism.
However, if a program cannot be parsed at all, this particular program will then be omitted.
For example, consider these two programs:
If I now introduce a syntax error in line 19 (remove bracket, mistype print):
Note that due to the incorrect parsing, some code can no langer be matched. However, it is not the changed line (19), it is a later part of the program. The reason is, th…