#ifndef __PLASP__LANGUAGE_DETECTION_H
#define __PLASP__LANGUAGE_DETECTION_H
#include <plasp/Language.h>
#include <plasp/input/Parser.h>
namespace plasp
{
////////////////////////////////////////////////////////////////////////////////////////////////////
//
// LanguageDetection
Language::Type detectLanguage(input::Parser<input::CaseInsensitiveParserPolicy> &parser)
parser.skipWhiteSpace();
// SAS begins with "begin_version"
if (parser.testAndSkip<std::string>("begin"))
parser.seek(0);
return Language::Type::SAS;
}
// Skip potential PDDL comments
while (parser.currentCharacter() == ';')
parser.skipLine();
// PDDL contains sections starting with "(define"
if (parser.testAndSkip<std::string>("(") && parser.testAndSkip<std::string>("define"))
parser.seek(std::ios::beg);
return Language::Type::PDDL;
return Language::Type::Unknown;
#endif