no_viable_alt_for_char_exception.sa
上传用户:afrynkmhm
上传日期:2007-01-06
资源大小:1262k
文件大小:1k
源码类别:
编译器/解释器
开发平台:
Others
- (*
- 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/no_viable_alt_for_char_exception.sa#1 $
- *)
- class ANTLR_NO_VIABLE_ALT_FOR_CHAR_EXCEPTION < $ANTLR_RECOGNITION_EXCEPTION is
- include ANTLR_RECOGNITION_EXCEPTION str -> super_str;
- attr found_char : CHAR;
- create ( c : CHAR, scanner : $ANTLR_FILE_CURSOR ) : SAME is
- res : SAME := #SAME("NoViableAlt");
- res.found_char := c;
- res.line := scanner.line;
- res.file_name := scanner.file_name;
- return res;
- end;
- create ( c : CHAR, file_name : STR , line : INT ) : SAME is
- res : SAME := #SAME("NoViableAlt");
- res.found_char := c;
- res.line := line;
- res.file_name := file_name;
- return res;
- end;
- -- Returns a clean error message (no line number/column information)
- message : STR is
- return "unexpected char: " + found_char;
- end;
- str : STR is
- return file_line_str + message;
- end;
- end;