예제 #1
0
def p_error(p):
    if p is not None:
        print ("[Sintax Error] No se esperaba el simbolo '{}' en la linea {}".format(p.value, p.lineno))
    else:
        from src.SCM import Lexical, Parser, yacc
        while 1:
          tok = yacc.token()             # Get the next token
          if not tok or tok.type == 'RBRACE': break
        yacc.restart()
        print ("\nERROR SINTACTICO EN LA LINEA: " + str(Lexical.lineno))
def p_error(p):
    if p is not None:
        print("[Sintax Error] No se esperaba el simbolo '{}' en la linea {}".
              format(p.value, p.lineno))
    else:
        from src.SCM import Lexical, Parser, yacc
        while 1:
            tok = yacc.token()  # Get the next token
            if not tok or tok.type == 'RBRACE': break
        yacc.restart()
        print("\nERROR SINTACTICO EN LA LINEA: " + str(Lexical.lineno))
예제 #3
0
def p_error(p):
    if 1:
        if p is not None:
            print ("\nERROR SINTACTICO EN LA LINEA " + str(p.lineno) + " NO SE ESPERABA EL TOKEN  '" + str(p.value)) + "'"
        else:
            from src.SCM import Lexical, Parser, yacc
            while 1:
              tok = yacc.token()             # Get the next token
              if not tok or tok.type == 'RBRACE': break
            yacc.restart()
            print ("\nERROR SINTACTICO EN LA LINEA: " + str(Lexical.lineno))
    else:
        raise Exception('syntax', 'error')
예제 #4
0
def p_error(p):
    if 1:
        if p is not None:
            print("\nERROR SINTACTICO EN LA LINEA " + str(p.lineno) +
                  " NO SE ESPERABA EL TOKEN  '" + str(p.value)) + "'"
        else:
            from src.SCM import Lexical, Parser, yacc
            while 1:
                tok = yacc.token()  # Get the next token
                if not tok or tok.type == 'RBRACE': break
            yacc.restart()
            print("\nERROR SINTACTICO EN LA LINEA: " + str(Lexical.lineno))
    else:
        raise Exception('syntax', 'error')