notas.html 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  3. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml">
  5. <head>
  6. <title>notas.html</title>
  7. </head>
  8. <body>
  9. <h2>Compilador lenguaje rpc</h2>
  10. <p>Un diminuto lenguaje de pruebas.</p>
  11. <h2>Instrucciones</h2>
  12. <h3>mostrar</h3>
  13. <pre><code>mostrar "texto cualquiera".
  14. mostrar variable.
  15. </code></pre>
  16. <p>similar a <code>print "texto cualquiera"</code>, <code>print var1</code></p>
  17. <h4>Gramatica</h4>
  18. <p>W = {a,..,z,A,..,Z}
  19. vars = {{W},0,..,9,_}
  20. ascii = valores ascii </p>
  21. <pre><code>P: mostrar X|mostrar V
  22. X-&gt; "T
  23. T-&gt; [ascii1]*F
  24. F-&gt; "FF
  25. V-&gt; [W][vars]*FF
  26. FF-&gt; .
  27. </code></pre>
  28. <h4>Automata</h4>
  29. <pre><code> 'mostrar ' '"' [ascii1]* '"' '.'
  30. (0)---------&gt;(1)----&gt;(2)--------&gt;(3)----&gt;(4)-----&gt;((5))
  31. \ [W][vars]* '.' ^
  32. ------------&gt;(6)------------------/
  33. </code></pre>
  34. <h3>Declarar enteros</h3>
  35. <pre><code>entero X=&lt;valor entero&gt;.
  36. </code></pre>
  37. <h4>Gramatica</h4>
  38. <pre><code>P: entero V
  39. V-&gt; [W][vars]*I
  40. I-&gt; = V|= V| =V|=V
  41. V-&gt; [0-9]*FF
  42. FF-&gt; .
  43. </code></pre>
  44. <h4>Automata</h4>
  45. <pre><code> 'entero ' [W][vars]* = V|= V| =V|=V [0-9]* '.'
  46. (0)---------&gt;(1)------------&gt;(2)----------------&gt;(3)-------&gt;(4)----&gt;((5))
  47. </code></pre>
  48. <h3>Asignar entero</h3>
  49. <pre><code>var = &lt;valor entero&gt;.
  50. </code></pre>
  51. <h4>Gramatica</h4>
  52. <pre><code>P: [W][vars]*I
  53. I-&gt; = N| =N|= N|=N
  54. N-&gt; [0-9]*FF
  55. FF-&gt; .
  56. </code></pre>
  57. <h4>Automata</h4>
  58. <pre><code> [W][vars]* = N| =N|= N|=N [0-9]* '.'
  59. (0)------------&gt;(1)---------------&gt;(2)------&gt;(3)-----&gt;((4))
  60. </code></pre>
  61. <h3>Incrementar entero 1 unidad</h3>
  62. <pre><code>var++.
  63. </code></pre>
  64. <h4>Gramatica</h4>
  65. <pre><code>P: [W][vars]*'++'
  66. </code></pre>
  67. <h4>Automata</h4>
  68. <pre><code> [W][vars]* '++'
  69. (0)-----------&gt;(1)------&gt;((2))
  70. </code></pre>
  71. <h3>Decrementar entero 1 unidad</h3>
  72. <pre><code>var--.
  73. </code></pre>
  74. <h4>Gramatica</h4>
  75. <pre><code>P: [W][vars]*'--'
  76. </code></pre>
  77. <h4>Automata</h4>
  78. <pre><code> [W]+[vars]* '--'
  79. (0)------------&gt;(1)-----&gt;((2))
  80. </code></pre>
  81. </body>
  82. </html>