recognition_exception.sa
上传用户:afrynkmhm
上传日期:2007-01-06
资源大小:1262k
文件大小:1k
- (*
- ANTLR Translator Generator
- Project led by Terence Parr at http://www.jGuru.com
- Software rights: http://www.antlr.org/RIGHTS.html
-
- $Id: //depot/code/org.antlr/release/antlr-2.7.0/lib/sather/Antlr/recognition_exception.sa#1 $
- *)
- abstract class $ANTLR_RECOGNITION_EXCEPTION < $ANTLR_EXCEPTION is
- str : STR;
- end;
- class ANTLR_RECOGNITION_EXCEPTION < $ANTLR_RECOGNITION_EXCEPTION is
- private attr msg : STR;
- readonly attr line : INT;
- readonly attr column : INT;
- readonly attr file_name : STR;
-
- create : SAME is
- return #SAME( "parsing error" );
- end;
-
- create ( m : STR ) : SAME is
- res : SAME := new;
- res.msg := m;
- return res;
- end;
-
- create ( m : STR , file : STR , ln : INT ) : SAME is
- res : SAME := #SAME( m );
- res.file_name := file;
- res.line := ln;
- return res;
- end;
-
- str : STR is
- return file_line_str + msg;
- end;
- message : STR is
- return msg;
- end;
-
- file_line_str : STR is
- return ANTLR_FILE_LINE_FORMATTER::format_string( file_name, line );
- end;
-
- end;