parsing - How to identify the JAVACC parser unsuccessful programatically? -
in javacc, how check weather input file passed grammar or not? example, want print "filed parsed successfully" if whole file parsed parser, , if not want print "file parsing faild!"
i'm pretty newbie javacc. please help
try { parser.start() ; system.out.println("file parsed successfully.") ; } catch( parseexception ex ) { // syntax error system.out.println( ex.getmessage() ) ; } } catch( tokenmanagererror ex ) { // lexical error system.out.println( ex.getmessage() ) ; } } catch( throwable ex ) { // other error system.out.println( ex.getmessage() ) ; }
Comments
Post a Comment