diff options
author | Christopher L. Conway <christopherleeconway@gmail.com> | 2010-02-18 23:24:26 +0000 |
---|---|---|
committer | Christopher L. Conway <christopherleeconway@gmail.com> | 2010-02-18 23:24:26 +0000 |
commit | 9f8f4ae9ef9d9d79973b77b6c61af4c5db034841 (patch) | |
tree | c9f2159ab870534a2cd0d887944c84d00da9b2a4 /src/main | |
parent | a377bee55e41ba9ceef3380742e536545299181c (diff) |
Adding --no-checking option to disable semantic checks in parser
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/getopt.cpp | 10 | ||||
-rw-r--r-- | src/main/main.cpp | 4 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/main/getopt.cpp b/src/main/getopt.cpp index ff9957c5c..8ace8e778 100644 --- a/src/main/getopt.cpp +++ b/src/main/getopt.cpp @@ -58,7 +58,8 @@ enum OptionValue { SMTCOMP, STATS, SEGV_NOSPIN, - PARSE_ONLY + PARSE_ONLY, + NO_CHECKING };/* enum OptionValue */ // FIXME add a comment here describing the option array @@ -74,7 +75,8 @@ static struct option cmdlineOptions[] = { { "smtcomp" , no_argument , NULL, SMTCOMP }, { "stats" , no_argument , NULL, STATS }, { "segv-nospin", no_argument , NULL, SEGV_NOSPIN }, - { "parse-only" , no_argument , NULL, PARSE_ONLY } + { "parse-only" , no_argument , NULL, PARSE_ONLY }, + { "no-checking", no_argument , NULL, NO_CHECKING } };/* if you add things to the above, please remember to update usage.h! */ /** Full argv[0] */ @@ -176,6 +178,10 @@ throw(OptionException) { opts->parseOnly = true; break; + case NO_CHECKING: + opts->semanticChecks = false; + break; + case '?': throw OptionException(string("can't understand option"));// + argv[optind - 1] + "'"); diff --git a/src/main/main.cpp b/src/main/main.cpp index d0ad72fc4..e54bbb5f6 100644 --- a/src/main/main.cpp +++ b/src/main/main.cpp @@ -111,6 +111,10 @@ int main(int argc, char *argv[]) { parser = Parser::getNewParser(&exprMgr, options.lang, argv[firstArgIndex]); } + if(!options.semanticChecks) { + parser->disableChecks(); + } + // Parse and execute commands until we are done Command* cmd; while((cmd = parser->parseNextCommand())) { |