* @throws IOException
*/
private AstLexer getLexerInstance(Reader reader, PHPVersion phpVersion,
boolean aspTagsAsPhp, boolean useShortTags) throws IOException {
if (PHPVersion.PHP4 == phpVersion) {
final AstLexer lexer4 = getLexer4(reader);
lexer4.setUseAspTagsAsPhp(aspTagsAsPhp);
lexer4.setUseShortTags(useShortTags);
return lexer4;
} else if (PHPVersion.PHP5 == phpVersion) {
final AstLexer lexer5 = getLexer5(reader);
lexer5.setUseAspTagsAsPhp(aspTagsAsPhp);
lexer5.setUseShortTags(useShortTags);
return lexer5;
} else if (PHPVersion.PHP5_3 == phpVersion) {
final AstLexer lexer53 = getLexer53(reader);
lexer53.setUseAspTagsAsPhp(aspTagsAsPhp);
lexer53.setUseShortTags(useShortTags);
return lexer53;
} else if (PHPVersion.PHP5_4 == phpVersion) {
final AstLexer lexer54 = getLexer54(reader);
lexer54.setUseAspTagsAsPhp(aspTagsAsPhp);
lexer54.setUseShortTags(useShortTags);
return lexer54;
} else if (PHPVersion.PHP5_5 == phpVersion) {
final AstLexer lexer55 = getLexer55(reader);
lexer55.setUseAspTagsAsPhp(aspTagsAsPhp);
lexer55.setUseShortTags(useShortTags);
return lexer55;
} else {
throw new IllegalArgumentException(
CoreMessages.getString("ASTParser_1") //$NON-NLS-1$
+ phpVersion);