Click here to Skip to main content
15,885,890 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I Build my own languge and I use antlr4 and I work on online parse ... my question is : We can do syntax and type checking in online parse in tow methode :

The first methode:

to visit the ast first time to check if I didn't have any syntax errors so If I didn't have any error then I visit ast for do type checking ... here I do type checking only if there are no syntax errors

The second methode :

to visit the ast first time to check if I didn't have any syntax errors then I visit ast for do type checking although there are a syntax errors. ... here I do type checking and don't care if there are syntax error or not ... So what the better methode in online parse ? and when we talke about IDE like (visual studio or eclipse ) which methode use ?

What I have tried:

I need to knew what the best way
Posted
Updated 15-Nov-16 23:34pm
v2

1 solution

The very book of ANTLR4[^] devotes a chapter on the error handling topic.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900