mirror of
				https://github.com/Z3Prover/z3
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	fixed more problems in the new param framework
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
		
							parent
							
								
									d634c945bf
								
							
						
					
					
						commit
						6d7d205e13
					
				
					 30 changed files with 185 additions and 168 deletions
				
			
		| 
						 | 
				
			
			@ -22,6 +22,7 @@ Revision History:
 | 
			
		|||
#endif
 | 
			
		||||
#include<iostream>
 | 
			
		||||
#include"str_hashtable.h"
 | 
			
		||||
#include"z3_exception.h"
 | 
			
		||||
 | 
			
		||||
volatile bool g_enable_assertions = true;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -73,7 +74,7 @@ void invoke_gdb() {
 | 
			
		|||
    char buffer[1024];
 | 
			
		||||
    int * x = 0;
 | 
			
		||||
    for (;;) {
 | 
			
		||||
        std::cerr << "(C)ontinue, (A)bort, (S)top, Invoke (G)DB\n";
 | 
			
		||||
        std::cerr << "(C)ontinue, (A)bort, (S)top, (T)hrow exception, Invoke (G)DB\n";
 | 
			
		||||
        char result;
 | 
			
		||||
        std::cin >> result;
 | 
			
		||||
        switch(result) {
 | 
			
		||||
| 
						 | 
				
			
			@ -88,6 +89,9 @@ void invoke_gdb() {
 | 
			
		|||
            // force seg fault...
 | 
			
		||||
            *x = 0;
 | 
			
		||||
            return;
 | 
			
		||||
        case 't':
 | 
			
		||||
        case 'T':
 | 
			
		||||
            throw default_exception("assertion violation");
 | 
			
		||||
        case 'G':
 | 
			
		||||
        case 'g':
 | 
			
		||||
            sprintf(buffer, "gdb -nw /proc/%d/exe %d", getpid(), getpid());
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -21,6 +21,29 @@ Notes:
 | 
			
		|||
#include"symbol.h"
 | 
			
		||||
#include"dictionary.h"
 | 
			
		||||
 | 
			
		||||
std::string norm_param_name(char const * n) {
 | 
			
		||||
    if (n == 0)
 | 
			
		||||
        return "_";
 | 
			
		||||
    if (*n == ':')
 | 
			
		||||
        n++;
 | 
			
		||||
    std::string r = n;
 | 
			
		||||
    unsigned sz = r.size();
 | 
			
		||||
    if (sz == 0)
 | 
			
		||||
        return "_";
 | 
			
		||||
    for (unsigned i = 0; i < sz; i++) {
 | 
			
		||||
        char curr = r[i];
 | 
			
		||||
        if ('A' <= curr && curr <= 'Z')
 | 
			
		||||
            r[i] = curr - 'A' + 'a';
 | 
			
		||||
        else if (curr == '-' || curr == ':')
 | 
			
		||||
            r[i] = '_';
 | 
			
		||||
    }
 | 
			
		||||
    return r;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
std::string norm_param_name(symbol const & n) {
 | 
			
		||||
    return norm_param_name(n.bare_str());
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
struct param_descrs::imp {
 | 
			
		||||
    struct info {
 | 
			
		||||
        param_kind   m_kind;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -22,6 +22,9 @@ Notes:
 | 
			
		|||
#include"cmd_context_types.h"
 | 
			
		||||
#include"vector.h"
 | 
			
		||||
 | 
			
		||||
std::string norm_param_name(char const * n);
 | 
			
		||||
std::string norm_param_name(symbol const & n);
 | 
			
		||||
 | 
			
		||||
typedef cmd_arg_kind param_kind;
 | 
			
		||||
 | 
			
		||||
class params;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue