Exemplo n.º 1
0
def p_query_usedb(p):
    'query : USE STRING'
    p[0]  = DRC("USEDB")
    filename = p[2]
    filename = filename.strip('\'')
    p[0].predicateName = filename
    print "Database changed to ", filename
Exemplo n.º 2
0
def p_formula_forall(p):
    'formula : LPAREN FORALL varlist RPAREN LPAREN formula RPAREN'
#    print "8"
    notnode = DRC("not")
    notnode.set_children(p[6])
    existsnode = p[3]
    existsnode.set_type("exists")    
    existsnode.set_children(notnode)
    p[0]  = DRC("not")
    p[0].set_children(existsnode)
Exemplo n.º 3
0
def p_query_nodebug(p):
    'query : NODEBUG'
    p[0]  = DRC("NODEBUG")
    p[0].predicateName = p[1]
    print "Debug mode disabled\n"
Exemplo n.º 4
0
def p_query_debug(p):
    'query : DEBUG'
    p[0]  = DRC("DEBUG")
    p[0].predicateName = p[1]
    print "Debug mode enabled\n"
Exemplo n.º 5
0
def p_query_help(p):
    'query : HELP'
    p[0]  = DRC("HELP")
    p[0].predicateName = p[1]
    print "DRC Parser version 1.0 (by Marco Valero & John Daigle)\n\nCommand\t\t\tDescription\n-------\t\t\t----------\nuse 'database_name'\tChanges the database\ndatabase\t\tShows the database tables\ndebug\t\t\tEnables debug mode\nnodebug\t\t\tDisables debug mode\n"