You are here: Home JastAdd Forums JastAdd A question about error messages
Document Actions

A question about error messages

Up to JastAdd

A question about error messages

Posted by Ke Sun at February 27. 2008

A question: is it possible to get error locations (line and column numbers) in JastAdd?


 


Thanks ahead.


Re: A question about error messages

Posted by Torbjörn Ekman at March 03. 2008

The short answer is yes. The slightly longer answer is that it depends on which parser you use. In JastAddJ we use Beaver which automatically adds location information to the AST nodes. A typical example is available in the file ErrorCheck.jrag in the Java1.4Frontend. The "void ASTNode.error(String s)" method contains uses of start and end information for a particular ASTNode.


Best regards


/Torbjorn


Powered by Ploneboard