Ejemplo n.º 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))
Ejemplo n.º 2
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))
Ejemplo n.º 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')
Ejemplo n.º 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')