(String arg)
| 270 | } |
| 271 | |
| 272 | protected void handleOptionSetArg(String arg) { |
| 273 | int eq = arg.indexOf('='); |
| 274 | if ( eq>0 && arg.length()>3 ) { |
| 275 | String option = arg.substring("-D".length(), eq); |
| 276 | String value = arg.substring(eq+1); |
| 277 | if ( value.length()==0 ) { |
| 278 | errMgr.toolError(ErrorType.BAD_OPTION_SET_SYNTAX, arg); |
| 279 | return; |
| 280 | } |
| 281 | if ( Grammar.parserOptions.contains(option) || |
| 282 | Grammar.lexerOptions.contains(option) ) |
| 283 | { |
| 284 | if ( grammarOptions==null ) grammarOptions = new HashMap<String, String>(); |
| 285 | grammarOptions.put(option, value); |
| 286 | } |
| 287 | else { |
| 288 | errMgr.grammarError(ErrorType.ILLEGAL_OPTION, |
| 289 | null, |
| 290 | null, |
| 291 | option); |
| 292 | } |
| 293 | } |
| 294 | else { |
| 295 | errMgr.toolError(ErrorType.BAD_OPTION_SET_SYNTAX, arg); |
| 296 | } |
| 297 | } |
| 298 | |
| 299 | public void processGrammarsOnCommandLine() { |
| 300 | List<GrammarRootAST> sortedGrammars = sortGrammarByTokenVocab(grammarFiles); |
no test coverage detected