Opened 17 years ago
Closed 16 years ago
#96 closed defect (fixed)
parser should quit when syntax error encountered
| Reported by: | Stephen Siegel | Owned by: | ywei |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | front | Version: | 1.0 |
| Keywords: | parse, syntax error | Cc: |
Description
The parser does not always give up when it encounters a syntax error. Instead it tries to build a tree anyway and proceed the best it can. It should always throw an exception with a nice description to the user when it cannot parse a file correctly. Someone should look at the ANTLR book to figure this out.
Change History (2)
comment:1 by , 16 years ago
| Owner: | set to |
|---|---|
| Status: | new → accepted |
comment:2 by , 16 years ago
| Resolution: | → fixed |
|---|---|
| Status: | accepted → closed |
Note:
See TracTickets
for help on using tickets.

Fixed. The parser now returns an AST only when the program can be parsed correctly, i.e, when there is no syntax errors begin thrown by ANTLR. Otherwise it will print an error message along with the syntax errors and shut down the program.