Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Gramatica JSON JRSM
objeto :- write('{'),aux1, write('}'). aux1 :- read(X), (X='atributo'->atributo,aux4; X='fin'->write(''); write('error '), write(X)). aux4 :- read(X), (X='atributo'->write(','),atributo,aux4; X='fin'->write(''); write('error '), write(X)). atributo :- read(Nbatributo),write('"'),write(Nbatributo),write('"'), write(':'),valor. valor :- read(X), (X='cadena'->read(C),write('"'),write(C),write('"'); X='numero'->read(N),write(N); X='objeto'->objeto; X='arreglo'->arreglo; X='fin'->write(''); write('error '), write(X)). arreglo :- write('['),valor, write(']'). aux2 :- read(X), (X='valor'->valor,aux3; X='fin'->write(''); write('error '), write(X)). aux3 :- read(Y), (Y='valor'->write(','),valor,aux2; Y='fin'->write('')). :- objeto.
run
|
edit
|
history
|
help
0
Valdes_Esquivel_Rafael
Balance
task4
primerprograma
Garduño Rubio Brandon Antonio Examen 1a Parte
atributos infinitos (no completado)
Avance2_TAREA_15_MARZO
Tarea
modificar para escribir el objeto vacío y el arreglo vacío
decisiones anidadas