├── data ├── example.png ├── if_example.gif ├── diseño_example.png ├── igobs_example.gif ├── esqueleto_example.gif └── subindex_example.gif ├── settings └── language-tad-aed2.cson ├── package.json ├── LICENSE ├── CHANGELOG ├── README.md ├── snippets └── language-tad-aed2.cson └── grammars └── language-tad-aed2.cson /data/example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisbustamante097/language-tad-aed2/HEAD/data/example.png -------------------------------------------------------------------------------- /data/if_example.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisbustamante097/language-tad-aed2/HEAD/data/if_example.gif -------------------------------------------------------------------------------- /data/diseño_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisbustamante097/language-tad-aed2/HEAD/data/diseño_example.png -------------------------------------------------------------------------------- /data/igobs_example.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisbustamante097/language-tad-aed2/HEAD/data/igobs_example.gif -------------------------------------------------------------------------------- /data/esqueleto_example.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisbustamante097/language-tad-aed2/HEAD/data/esqueleto_example.gif -------------------------------------------------------------------------------- /data/subindex_example.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisbustamante097/language-tad-aed2/HEAD/data/subindex_example.gif -------------------------------------------------------------------------------- /settings/language-tad-aed2.cson: -------------------------------------------------------------------------------- 1 | '.source.tad': 2 | 'editor': 3 | 'commentStart': '// ' 4 | 'tabType': "hard" 5 | 'whitespace': 6 | 'removeTrailingWhitespace': false 7 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "bundleDependencies": false, 3 | "deprecated": false, 4 | "name": "language-tad-aed2", 5 | "version": "1.0.2", 6 | "description": "Un intento de crear la sintaxis usada en AED2-FCEN-UBA para la escritura de TADs", 7 | "repository": "https://github.com/luisbustamante097/language-tad-aed2", 8 | "keywords": [ 9 | "uba", 10 | "algo2", 11 | "tad", 12 | "syntax", 13 | "highlighting", 14 | "grammar", 15 | "snippets" 16 | ], 17 | "license": "MIT", 18 | "bugs": "https://github.com/luisbustamante097/language-tad-aed2/issues", 19 | "engines": { 20 | "atom": ">=1.0.0 <2.0.0" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Luis Bustamante 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /CHANGELOG: -------------------------------------------------------------------------------- 1 | 1.0.2 2 | - Some snippets changed: 3 | - not used symbols removed ("\genintersection" and "\genunion") 4 | - spanish snippets were changed to Latex-like notation (eg. \estaincluido -> \subset) 5 | - "\tuplaabrir" and "\tuplacerrar" changed to only one snippet named "\tupla" with both symbols 6 | - Updated README for better understanding 7 | - Minor bugs resolved 8 | 9 | 1.0.1 10 | - Added "%" symbol for coding 11 | - Added "dot" symbol for function declaration 12 | - Changed "for" snippet to "forloop" 13 | - Added "function" template for declaring functions in design blocks (Check README to use) 14 | - Added "p->elem" symbol for using instead "(*p).elem" (c++ like) 15 | - Minor bugs resolved 16 | 17 | 1.0.0 18 | - Added INTERFACE grammar!!! (and some useful snippets) 19 | - Fixed constants bug, fixed tupla's elements bug and deleted some non-necessary lines 20 | - Fixed diacritics and special chars for tupla's elements 21 | - Fixed restriction brackets bugs and typo in function name 22 | - New symbols and new snippets "←,→,Ω,ω,Θ" 23 | - Added "|" symbol for "logic symbols" 24 | - Added "=obs" for restrictions 25 | 26 | 0.3.0 - 0.4.0 FUERON ERRORES AL PUBLICAR LA EXTENSION EN ATOM, NO TIENEN NADA PARTICULAR 27 | 28 | 0.2.1 29 | - Added β symbol to function highlighting 30 | - Fixed bug with equal symbol highlighting 31 | - Added highlighting to "pi" function and subindex numbers 32 | - Added tupla elements highlighting in restrictions 33 | - Added ∃ and ∄ highlighting in brackets mode 34 | - Added ≠ symbol and its snippet 35 | - Added ⟨ and ⟩ symbols for "tuplas" 36 | - Added adhoc function declarations in Axiomas 37 | - Minor bugs patched 38 | 39 | 0.2.0 40 | - Added diactrical letters support 41 | - Highlighting for "=obs", "iff" symbol and "implies" symbol 42 | - Better support for the IgObs section 43 | - Fixed some higlightings overlapping 44 | - Fixed bug in comments inline into "if" section 45 | - Added subindex symbols in snippets and other useful snippets 46 | - Fixed higlighting for header and "Extiende" section 47 | - Added "iff alternative", "kappa" and "sigma" symbols 48 | - Updated old snippets with its correspondent diacriticals letters 49 | - Added "," symbol in "IgObs" section to be used like a section ending character 50 | - Added an special snippet for a new IgObs section 51 | - Minor bugs patched 52 | - Updated README with the new features 53 | 54 | 0.1.2 55 | Bugs fixed, added new snippets and updated README 56 | 57 | 0.1.1 58 | Updated README info after first publish on APM 59 | 60 | 0.1.0 61 | Initial release 62 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # Sintaxis para escribir TADs en Atom 3 | [![APM](https://img.shields.io/apm/v/language-tad-aed2)](https://github.com/luisbustamante097/language-tad-aed2/blob/master/CHANGELOG) 4 | [![License](https://img.shields.io/apm/l/language-tad-aed2)](https://github.com/luisbustamante097/language-tad-aed2/blob/master/LICENSE) 5 | [![Downloads](https://img.shields.io/apm/dm/language-tad-aed2)](https://atom.io/packages/language-tad-aed2) 6 | 7 | Un intento de crear la sintaxis usada en AED2-FCEN-UBA para la escritura de TADs en Atom. 8 | 9 | ![Imagen](./data/example.png "TAD diccionario") 10 | 11 | 12 | **(Disclaimer)** (Actualizado 20/08/2021) 13 | - Este paquete fue creado solo con la intención de tener una mejor visualización de la escritura en computadora y tiene tantas fallas como uno se puede imaginar dado que creé la sintaxis desde cero sin ningún conocimiento en el tema (y en un corto lapso de tiempo). 14 | - No recomiendo la escritura de los ejercicios en computadora porque nada le gana al buen lápiz y papel, pero dado el contexto de virtualidad en el que se creó este paquete (1er cuatrimestre 2021) puede serle útil a las personas que les gusta llevar todo en la compu. (esta recomendación viene a consecuencia de que en el contexto de presencialidad uno se puede mal acostumbrar a hacer los ejercicios en la computadora, lo cual juega en contra a la hora de un examen presencial). 15 | - Elegí Atom, a pesar de no ser el IDE más conocido, porque fue mucho más fácil escribir el paquete para esa IDE. ~~(Aunque sé que no debería ser difícil pasarlo a Sublime Text 3 dado que ambos usan YAML para las gramáticas, pero no estoy interesado en hacerlo por lo que cualquiera puede portear mi proyecto a Sublime Text 3 (o cualquier otro IDE compatible) con el código de este repositorio.)~~ **[Ya fue porteado a Sublime Text 3](https://github.com/Sponja-/Algo2-Sintaxis-TAD-st3)**. Gracias [Sponja-](https://github.com/Sponja-)!! (Yo no mantengo tal repo, pero está actualizado hasta la v1.0.1) 16 | - Desde el [Issues](https://github.com/luisbustamante097/language-tad-aed2/issues) del repo me pueden informar acerca de cualquier problema que tengan, y están más que invitados a mandarme un PR con la solución a cualquier bug. 17 | - **IMPORTANTE**: Se debe usar el caracter TAB en vez de los espacios para indentación de los TADs. 18 | 19 | # Instalación 20 | ## Instalación Manual (Windows, Mac y Linux) 21 | 1. Para hacer uso del paquete es necesario descargar Atom desde su página oficial: https://atom.io/ (Está disponible para Windows, Mac y Linux) 22 | 2. Una vez instalado lo inician, ingresan al menu de preferencias con el shortcut `Ctrl+,` (`","` hace referencia al caracter "coma") o desde su menu correspondiente en `Edit->Preferences` 23 | 3. Luego clickean en la pestaña `Install` y buscan el paquete `language-tad-aed2`, clickean en `Install` del paquete y listo! Ya pueden usar la sintaxis en cualquier archivo `.tad` 24 | 25 | ## Instalación Rapida 26 | Primero descargan Atom desde https://atom.io/ y una vez instalado realizan lo siguiente para instalar el paquete: 27 | - **Linux**: Instalan el paquete mediante el siguiente codigo en su terminal: 28 | ```bash 29 | apm install language-tad-aed2 30 | ``` 31 | - **Mac**: Primero hacen lo que se indica en este [enlace](https://apple.stackexchange.com/a/131349), y luego escriben el mismo comando usado para Linux en su terminal. 32 | - **Windows**: Desde una ventana de Powershell o CMD pueden usar el mismo comando para Linux (Atom debe estar cerrado). 33 | 34 | # Features 35 | ## Snippets para usar símbolos matemáticos 36 | Cargué la extensión con todos los símbolos que me parecieron necesarios para la construcción de TADs y para la parte de diseño. 37 | Una lista de ellas (con su correspondiente atajo) es brindado en la siguiente tabla. Nótese que se utiliza para todas el prefijo "\\" a modo de asimilar la notación de Latex. 38 | 39 | Símbolo | Atajo|Símbolo | Atajo 40 | --------|------|--------|------ 41 | ∨ | \lor | × | \cross 42 | ∨L | \oLuego | ∞ | \infty 43 | ∧ | \land | ↦ | \function 44 | ∧L | \yLuego | ≡ | \equiv 45 | ¬ | \not | ≠ | \notequal 46 | ∀ | \forall | Ø | \emptyset 47 | ∃ | \exists | β | \beta 48 | ∄ | \notexists | α | \alpha 49 | ⇒ | \implies | • | \dot 50 | ⇒L | \impluego | ◦ | \emptydot 51 | ↔ | \iff | π | \pi 52 | ⇐⇒ | \iffalt | ← | \gets o \ig o ("<-" + TabKey) 53 | ∴ | \porlotanto | → | \rarrow 54 | ∩ | \cap o \intersection | ≤ | \leq 55 | ∪ | \cup o \union | ≥ | \geq 56 | ⊆ | \subseteq | κ | \kappa 57 | ⊂ | \subset | σ | \sigma 58 | ⊄ | \notsubset | ⟨⟩ | \tupla 59 | ∈ | \in | Ω | \omega 60 | ∉ | \notin | ω | \omega_2 61 | ℕ | \natural | Θ | \theta 62 | ℤ | \entero | 63 | ℚ | \racional | 64 | ℝ | \real | 65 | ℂ | \complejo | 66 | 67 | ## Atajos 68 | Ademas de la lista de simbolos se puede usar los snippets para insertar: 69 | - Esqueleto de `if • then • else • if`: solo con escribir `if` o `ifthen` para la version inline. 70 | 71 | ![Imagen](./data/if_example.gif "Ejemplo de uso") 72 | - Esqueleto de TAD: solo con escribir `esqueloTad` se puede obtener un modelo basico de TAD para rellenar. 73 | 74 | ![Imagen](./data/esqueleto_example.gif "Ejemplo de uso") 75 | - Subindices para las variables: se pueden usar para tener mejor visualización de las variables usando por ejemplo `\0` para obtener un `₀`. 76 | 77 | ![Imagen](./data/subindex_example.gif "Ejemplo de uso") 78 | - Esqueleto para Igualdad Observacional: solo con escribir `igobs` se puede obtener un modelo basico de la sección para rellenar. 79 | 80 | ![Imagen](./data/igobs_example.gif "Ejemplo de uso") 81 | 82 | 83 | # Extendida para trabajar con Rep, Abs e Interfaz 84 | **¡Podés hacer los ejercicios de la Práctica 3 en Atom!** _(y tal vez el resto de las prácticas también)._ Todas las nuevas características fueron inyectadas sobre la anterior versión de la extensión, por lo que se puede trabajar con TADs y Diseño en el mismo archivo .tad. 85 | Toda la sintaxis está basada en los apuntes "Diseño jerárquico de TADs" y "Apuntes de Módulos Básicos" de la cátedra de AED2. 86 | ~~Aún sigo testeando que ande todo correctamente por lo que hay (muchísimos) bugs que iré solucionando con el tiempo~~, por lo que se recomienda no colgar en actualizar la extensión (saldrá un cartel en Atom cada que haya nueva actualización de cualquier extensión). 87 | 88 | _(Lamentablemente no puedo darle el tiempo que quería para seguir mejorandola. Igualmente así como está cumple bien todas las funciones. Si encuentran errores me los pueden informar y los arreglaré a la brevedad.)_ 89 | 90 | ![Imagen](./data/diseño_example.png "Rep, Abs e Interfaz de ejemplo") 91 | 92 | **OBS:** Si alguna de las secciones no cierra bien su sintaxis particular se puede escribir el siguiente terminador `---` para cerrar correctamente dichas secciones (mi idea es quitar la necesidad de esto, pero por lo pronto lo dejo así). 93 | 94 | ## Snippets 95 | - Solo con teclear `nueva interfaz` podrán tener una esqueleto de una interfaz de ejemplo para completar. 96 | - Para la etapa de codeo se tienen snippets para estructuras del paradigma imperativo como: `while do`, `for` y `switch`. 97 | - Snippet simple para la declaración de funciones, solo con escribir `function` se generara el siguiente esqueleto: 98 | ```vhdl 99 | function NuevaOP(param) 100 | // code 101 | end function 102 | ``` 103 | 104 | -------------------------------------------------------------------------------- /snippets/language-tad-aed2.cson: -------------------------------------------------------------------------------- 1 | #Todos los snippets del estilo LATEX tienen que tener un duplicado con el simbolo \ escapeado 2 | '.source.tad': 3 | '\\∨': 4 | 'prefix': '\\lor' 5 | 'body': '∨' 6 | '\\∨L': 7 | 'prefix': '\\oLuego' 8 | 'body': '∨L' 9 | '\\∧': 10 | 'prefix': '\\land' 11 | 'body': '∧' 12 | '\\∧L': 13 | 'prefix': '\\yLuego' 14 | 'body': '∧L' 15 | '\\¬': 16 | 'prefix': '\\not' 17 | 'body': '¬' 18 | '\\∀': 19 | 'prefix': '\\forall' 20 | 'body': '∀' 21 | '\\∃': 22 | 'prefix': '\\exists' 23 | 'body': '∃' 24 | '\\∄': 25 | 'prefix': '\\notexists' 26 | 'body': '∄' 27 | '\\⇒': 28 | 'prefix': '\\implies' 29 | 'body': '⇒' 30 | '\\⇒L': 31 | 'prefix': '\\impluego' 32 | 'body': '⇒L' 33 | '\\↔': 34 | 'prefix': '\\iff' 35 | 'body': '↔' 36 | '\\⇐⇒': 37 | 'prefix': '\\iffalt' 38 | 'body': '⇐⇒' 39 | '\\∴': 40 | 'prefix': '\\porlotanto' 41 | 'body': '∴' 42 | '\\∩ (*)': 43 | 'prefix': '\\intersection' 44 | 'body': '∩' 45 | '\\∪ (*)': 46 | 'prefix': '\\union' 47 | 'body': '∪' 48 | '\\∩': 49 | 'prefix': '\\cap' 50 | 'body': '∩' 51 | '\\∪': 52 | 'prefix': '\\cup' 53 | 'body': '∪' 54 | '\\⊆': 55 | 'prefix': '\\subseteq' 56 | 'body': '⊆' 57 | '\\⊂': 58 | 'prefix': '\\subset' 59 | 'body': '⊂' 60 | '\\⊄': 61 | 'prefix': '\\notsubset' 62 | 'body': '⊄' 63 | '\\∈': 64 | 'prefix': '\\in' 65 | 'body': '∈' 66 | '\\∉': 67 | 'prefix': '\\notin' 68 | 'body': '∉' 69 | '\\ℕ': 70 | 'prefix': '\\natural' 71 | 'body': 'ℕ' 72 | '\\ℤ': 73 | 'prefix': '\\entero' 74 | 'body': 'ℤ' 75 | '\\ℚ': 76 | 'prefix': '\\racional' 77 | 'body': 'ℚ' 78 | '\\ℝ': 79 | 'prefix': '\\real' 80 | 'body': 'ℝ' 81 | '\\ℂ': 82 | 'prefix': '\\complejo' 83 | 'body': 'ℂ' 84 | '\\×': 85 | 'prefix': '\\cross' 86 | 'body': '×' 87 | '\\∞': 88 | 'prefix': '\\infty' 89 | 'body': '∞' 90 | '\\↦': 91 | 'prefix': '\\function' 92 | 'body': '↦' 93 | '\\≡': 94 | 'prefix': '\\equiv' 95 | 'body': '≡' 96 | '\\≠': 97 | 'prefix': '\\notequal' 98 | 'body': '≠' 99 | '\\Ø': 100 | 'prefix': '\\emptyset' 101 | 'body': 'Ø' 102 | '\\β': 103 | 'prefix': '\\beta' 104 | 'body': 'β' 105 | '\\α': 106 | 'prefix': '\\alpha' 107 | 'body': 'α' 108 | '\\•': 109 | 'prefix': '\\dot' 110 | 'body': '•' 111 | '\\◦': 112 | 'prefix': '\\emptydot' 113 | 'body': '◦' 114 | '\\π': 115 | 'prefix': '\\pi' 116 | 'body': 'π' 117 | '\\←': 118 | 'prefix': '\\gets' 119 | 'body': '←' 120 | '\\←alt': 121 | 'prefix': '\\ig' 122 | 'body': '←' 123 | '\\→': 124 | 'prefix': '\\rarrow' 125 | 'body': '→' 126 | '\\≤': 127 | 'prefix': '\\leq' 128 | 'body': '≤' 129 | '\\≥': 130 | 'prefix': '\\geq' 131 | 'body': '≥' 132 | '\\κ': 133 | 'prefix': '\\kappa' 134 | 'body': 'κ' 135 | '\\σ': 136 | 'prefix': '\\sigma' 137 | 'body': 'σ' 138 | '\\⟨\\⟩': 139 | 'prefix': '\\tupla' 140 | 'body': '⟨$1⟩' 141 | '\\Ω': 142 | 'prefix': '\\omega' 143 | 'body': 'Ω' 144 | '\\ω': 145 | 'prefix': '\\omega_2' 146 | 'body': 'ω' 147 | '\\Θ': 148 | 'prefix': '\\theta' 149 | 'body': 'Θ' 150 | '∨': 151 | 'prefix': 'lor' 152 | 'body': '∨' 153 | '∨L': 154 | 'prefix': 'oLuego' 155 | 'body': '∨L' 156 | '∧': 157 | 'prefix': 'land' 158 | 'body': '∧' 159 | '∧L': 160 | 'prefix': 'yLuego' 161 | 'body': '∧L' 162 | '¬': 163 | 'prefix': 'not' 164 | 'body': '¬' 165 | '∀': 166 | 'prefix': 'forall' 167 | 'body': '∀' 168 | '∃': 169 | 'prefix': 'exists' 170 | 'body': '∃' 171 | '∄': 172 | 'prefix': 'notexists' 173 | 'body': '∄' 174 | '⇒': 175 | 'prefix': 'implies' 176 | 'body': '⇒' 177 | '⇒L': 178 | 'prefix': 'impluego' 179 | 'body': '⇒L' 180 | '↔': 181 | 'prefix': 'iff' 182 | 'body': '↔' 183 | '⇐⇒': 184 | 'prefix': 'iffalt' 185 | 'body': '⇐⇒' 186 | '∴': 187 | 'prefix': 'porlotanto' 188 | 'body': '∴' 189 | '∩ (*)': 190 | 'prefix': 'intersection' 191 | 'body': '∩' 192 | '∪ (*)': 193 | 'prefix': 'union' 194 | 'body': '∪' 195 | '∩': 196 | 'prefix': 'cap' 197 | 'body': '∩' 198 | '∪': 199 | 'prefix': 'cup' 200 | 'body': '∪' 201 | '⊆': 202 | 'prefix': 'subseteq' 203 | 'body': '⊆' 204 | '⊂': 205 | 'prefix': 'subset' 206 | 'body': '⊂' 207 | '⊄': 208 | 'prefix': 'notsubset' 209 | 'body': '⊄' 210 | '∈': 211 | 'prefix': 'in' 212 | 'body': '∈' 213 | '∉': 214 | 'prefix': 'notin' 215 | 'body': '∉' 216 | 'ℕ': 217 | 'prefix': 'natural' 218 | 'body': 'ℕ' 219 | 'ℤ': 220 | 'prefix': 'entero' 221 | 'body': 'ℤ' 222 | 'ℚ': 223 | 'prefix': 'racional' 224 | 'body': 'ℚ' 225 | 'ℝ': 226 | 'prefix': 'real' 227 | 'body': 'ℝ' 228 | 'ℂ': 229 | 'prefix': 'complejo' 230 | 'body': 'ℂ' 231 | '×': 232 | 'prefix': 'cross' 233 | 'body': '×' 234 | '∞': 235 | 'prefix': 'infty' 236 | 'body': '∞' 237 | '↦': 238 | 'prefix': 'function' 239 | 'body': '↦' 240 | '≡': 241 | 'prefix': 'equiv' 242 | 'body': '≡' 243 | '≠': 244 | 'prefix': 'notequal' 245 | 'body': '≠' 246 | 'Ø': 247 | 'prefix': 'emptyset' 248 | 'body': 'Ø' 249 | 'β': 250 | 'prefix': 'beta' 251 | 'body': 'β' 252 | 'α': 253 | 'prefix': 'alpha' 254 | 'body': 'α' 255 | '•': 256 | 'prefix': 'dot' 257 | 'body': '•' 258 | '◦': 259 | 'prefix': 'emptydot' 260 | 'body': '◦' 261 | 'π': 262 | 'prefix': 'pi' 263 | 'body': 'π' 264 | '←': 265 | 'prefix': 'gets' 266 | 'body': '←' 267 | '←alt': 268 | 'prefix': 'ig' 269 | 'body': '←' 270 | '→': 271 | 'prefix': 'rarrow' 272 | 'body': '→' 273 | '≤': 274 | 'prefix': 'leq' 275 | 'body': '≤' 276 | '≥': 277 | 'prefix': 'geq' 278 | 'body': '≥' 279 | 'κ': 280 | 'prefix': 'kappa' 281 | 'body': 'κ' 282 | 'σ': 283 | 'prefix': 'sigma' 284 | 'body': 'σ' 285 | '⟨⟩': 286 | 'prefix': 'tupla' 287 | 'body': '⟨$1⟩' 288 | 'Ω': 289 | 'prefix': 'omega' 290 | 'body': 'Ω' 291 | 'ω': 292 | 'prefix': 'omega_2' 293 | 'body': 'ω' 294 | 'Θ': 295 | 'prefix': 'theta' 296 | 'body': 'Θ' 297 | '\<\-': 298 | 'prefix': '\<\-' 299 | 'body': '←' 300 | #--------------------------------------------------------------- 301 | #--------------------------------------------------------------- 302 | #--------------------------------------------------------------- 303 | 'if Condition': 304 | 'prefix': 'if' 305 | 'body': 'if ${1:condicion} then\n\t${2:resultado}\nelse\n\t${3:sino}\nfi' 306 | 'if Condition inline': 307 | 'prefix': 'ifthen' 308 | 'body': 'if ${1:condicion} then ${2:resultado} else ${3:sino} fi' 309 | 'esqueletoTad': 310 | 'prefix': 'esqueletoTad' 311 | 'body': """ 312 | TAD ${1:NombreTad} 313 | Igualdad Observacional:(); 314 | Géneros: ${2:nombreTad} 315 | Exporta: ${2:nombreTad}, observadores, generadores, 316 | Usa: ${3:Bool, Nat} 317 | 318 | Observadores Básicos: 319 | ${4:obs?: nombreTad t × nat n -> bool \\{ n ≥ 1 \\}} 320 | Generadores: 321 | ${5:nil: -> nombreTad} 322 | Otras Operaciones: 323 | ${6:otra: nombreTad t × nat n -> bool \\{ n ≥ 1 \\}} 324 | Axiomas: 325 | ${7:obs?(nil) = true 326 | otra(t, n) = n 327 | ...} 328 | Fin TAD 329 | """ 330 | '\\₀ (subindex)': 331 | 'prefix': '\\0' 332 | 'body': '₀' 333 | '₀ (subindex)': 334 | 'prefix': '0' 335 | 'body': '₀' 336 | '\\₁ (subindex)': 337 | 'prefix': '\\1' 338 | 'body': '₁' 339 | '₁ (subindex)': 340 | 'prefix': '1' 341 | 'body': '₁' 342 | '\\₂ (subindex)': 343 | 'prefix': '\\2' 344 | 'body': '₂' 345 | '₂ (subindex)': 346 | 'prefix': '2' 347 | 'body': '₂' 348 | '\\₃ (subindex)': 349 | 'prefix': '\\3' 350 | 'body': '₃' 351 | '₃ (subindex)': 352 | 'prefix': '3' 353 | 'body': '₃' 354 | '\\₄ (subindex)': 355 | 'prefix': '\\4' 356 | 'body': '₄' 357 | '₄ (subindex)': 358 | 'prefix': '4' 359 | 'body': '₄' 360 | '\\₅ (subindex)': 361 | 'prefix': '\\5' 362 | 'body': '₅' 363 | '₅ (subindex)': 364 | 'prefix': '5' 365 | 'body': '₅' 366 | '\\₆ (subindex)': 367 | 'prefix': '\\6' 368 | 'body': '₆' 369 | '₆ (subindex)': 370 | 'prefix': '6' 371 | 'body': '₆' 372 | '\\₇ (subindex)': 373 | 'prefix': '\\7' 374 | 'body': '₇' 375 | '₇ (subindex)': 376 | 'prefix': '7' 377 | 'body': '₇' 378 | '\\₈ (subindex)': 379 | 'prefix': '\\8' 380 | 'body': '₈' 381 | '₈ (subindex)': 382 | 'prefix': '8' 383 | 'body': '₈' 384 | '\\₉ (subindex)': 385 | 'prefix': '\\9' 386 | 'body': '₉' 387 | '₉ (subindex)': 388 | 'prefix': '9' 389 | 'body': '₉' 390 | 'Observadores Basicos': 391 | 'prefix': 'Observadores basicos' 392 | 'body': 'Observadores Básicos:\n\t$1' 393 | 'Géneros': 394 | 'prefix': 'Generos' 395 | 'body': 'Géneros:\t$1' 396 | 'IgObs model': 397 | 'prefix': 'igobs' 398 | 'body': '''Igualdad Observacional:\t(∀${1:x}₀,${1:x}₁: ${2:tipo}) 399 | \t\t\t\t\t\t(${1:x}₀ =obs ${1:x}₁ ⇐⇒ 400 | \t\t\t\t\t\t\t\t( 401 | \t\t\t\t\t\t\t\t\t$3 402 | \t\t\t\t\t\t\t\t) 403 | \t\t\t\t\t\t\t); 404 | ''' 405 | 'Igualdad Observacional': 406 | 'prefix': 'Igualdad observacional' 407 | 'body': 'Igualdad Observacional:\t($1);' 408 | 'Generadores': 409 | 'prefix': 'Generadores' 410 | 'body': 'Generadores:\n\t$1' 411 | 'Otras Operaciones': 412 | 'prefix': 'Otras operaciones' 413 | 'body': 'Otras Operaciones:\n\t$1' 414 | 'Axiomas:': 415 | 'prefix': 'Axiomas' 416 | 'body': 'Axiomas:\n\t$1\nFin TAD' 417 | 'ConjVacio?': 418 | 'prefix': 'conjvacio' 419 | 'body': 'Ø?($1)' 420 | 'dameUno': 421 | 'prefix': 'dameUno' 422 | 'body': 'dameUno($1)' 423 | 'sinUno': 424 | 'prefix': 'sinUno' 425 | 'body': 'sinUno($1)' 426 | 'está?': 427 | 'prefix': 'esta?' 428 | 'body': 'está?($1)' 429 | 'vacía?': 430 | 'prefix': 'vacia?' 431 | 'body': 'vacía?($1)' 432 | 'prim': 433 | 'prefix': 'prim' 434 | 'body': 'prim($1)' 435 | 'fin': 436 | 'prefix': 'fin' 437 | 'body': 'fin($1)' 438 | 'nil?': 439 | 'prefix': 'nil?' 440 | 'body': 'nil?($1)' 441 | 'definido?': 442 | 'prefix': 'definido?' 443 | 'body': 'definido?($1)' 444 | 'esHoja?': 445 | 'prefix': 'esHoja?' 446 | 'body': 'esHoja?($1)' 447 | 'def?': 448 | 'prefix': 'def?' 449 | 'body': 'def?($1)' 450 | 'obtener': 451 | 'prefix': 'obtener' 452 | 'body': 'obtener($1)' 453 | 'claves': 454 | 'prefix': 'claves' 455 | 'body': 'claves($1)' 456 | 'While do (diseño)': 457 | 'prefix': 'while' 458 | 'body': 'while ${1:condicion} do\n\t${2:resultado}\nend while' 459 | 'For Loop (diseño)': 460 | 'prefix': 'forloop' 461 | 'body': 'for ${1:i} ← 0, ${1:i} < ${2:count}, ${1:i}${3:++}\n\t${4:// code }\nend for' 462 | 'Switch (diseño)': 463 | 'prefix': 'switch' 464 | 'body': 'switch ${1:variable} \n\tcase ${2:valor}:\nend switch' 465 | 'Nueva Interfaz (diseño)': 466 | 'prefix': 'nueva interfaz' 467 | 'body': ''' 468 | Representación: 469 | ${1:tipoDato} se representa con estr donde 470 | estr es tupla ⟨ ${2:arg₀: nat, 471 | arg₁: puntero(nat)} ⟩ 472 | 473 | Solución Informal: 474 | ${3:- e.arg₀ + 1 debe ser ... 475 | - si e.arg₁ ...} 476 | --- 477 | Invariante de Representación: 478 | Rep: estr -> boolean 479 | (∀e: estr) Rep(e) ≡ true ⇐⇒ (1)∧(2) 480 | donde: 481 | (1) ≡ ${4:e.arg₀ > ... 482 | (2) ≡ (∀n: nat)(e.arg₁ < ...)} 483 | --- 484 | Función de abstracción: 485 | Abs: estr -> ${1:tipoDato} {Rep(e)} 486 | (∀e: estr) Abs(e) =obs td: ${1:tipoDato} | (1)∧(2) 487 | donde: 488 | (1) ≡ ${5:obs₁(td) = ... 489 | (2) ≡ obs₂(td) = ...} 490 | --- 491 | Interfaz: 492 | Parámetros formales: 493 | Géneros: α 494 | Función: 495 | ${7:Copiar(in a:α) -> res: α 496 | Pre ≡ {true\\} 497 | Post ≡ {res = a\\} 498 | Complejidad: Θ(copy(a)) 499 | Descripción: Función copia de α's.} 500 | --- 501 | Se explica con: ${6:TipoDato} 502 | Géneros: ${1:tipoDato} 503 | 504 | Operaciones básicas: 505 | ${8:NuevaOp(in n: nat) -> res: tipoDato 506 | Pre ≡ {true\\} 507 | Post ≡ {res =obs ...\\} 508 | Complejidad: Θ(1) 509 | Descripción: Genera ... 510 | Aliasing: No presenta aspectos de aliasing.} 511 | --- 512 | Algoritmos del módulo: 513 | ${9:iNuevaOp(in n: nat) -> res: estr 514 | res ← ⟨0, 9⟩ // Ejemplo} 515 | --- 516 | ''' 517 | 'Function (diseño)': 518 | 'prefix': 'function' 519 | 'body': 'function ${1:NuevaOP}(${2:param}) \n\t${3:// code}\nend function' -------------------------------------------------------------------------------- /grammars/language-tad-aed2.cson: -------------------------------------------------------------------------------- 1 | scopeName: 'source.tad' 2 | name: 'TAD' 3 | fileTypes: [ 'tad' ] 4 | limitLineLength: false 5 | 6 | patterns: [ 7 | { include: '#comment' } 8 | { include: '#strings' } 9 | { include: '#constants' } 10 | { include: '#constants_aux' } 11 | { include: '#arrays' } 12 | { 13 | comment: 'Declaraciones de TADs auxiliares' 14 | match: '((?:\w*TAD\*?))(\ .*?\ )(es)(\ .*?(?=(\ |\n|\<|\\(|\{)))' 15 | captures: 16 | 1: name: 'markup.bold.tad' # "TAD" 17 | 2: name: 'variable.other.tad' # Nombre de TAD 18 | 3: name: 'markup.bold.tad' # "es" 19 | 4: name: 'storage.modifier.tad' # Tipo de TAD 20 | } 21 | { 22 | comment: 'Highligting para Tupla<...> en declaraciones' 23 | name: 'meta.angle-brackets' 24 | begin: '\<|\\(' 25 | end: '\>|\\)' 26 | beginCaptures: 27 | 0: name: 'punctuation.section.parens.begin.tad' 28 | endCaptures: 29 | 0: name: 'punctuation.section.parens.end.tad' 30 | patterns:[{ 31 | match: '[A-Z].*?(\ |(?=\\)))' 32 | name: 'storage.modifier.tad' # Palabra con mayuscula en la 1er letra 33 | }] 34 | } 35 | { 36 | comment: 'Declaracion de TAD principal' 37 | match: '((?:\w*TAD\*?))(\ .*?\\((.*?(?=\\))).*?\\)|\ .*?\n)' 38 | captures: 39 | 1: name: 'markup.bold.tad' # "TAD" 40 | 2: name: 'variable.other.tad' # Nombre de TAD 41 | 3: name: 'storage.modifier.tad' # (Parametro formal) 42 | } 43 | { 44 | comment: 'Seccion Extiende del header' 45 | match: '(?i)(\w*(EXTIENDE)(\ |\:|\t|\n))(\ .*?\\((.*?(?=\\))).*?\\))' 46 | captures: 47 | 1: name: 'markup.bold.tad' # "EXTIENDE" 48 | 4: name: 'variable.other.tad' # Nombre de TAD 49 | 5: name: 'storage.modifier.tad' # (Parametro formal) 50 | } 51 | { 52 | comment: 'Palabras clave de los TADS' 53 | name: 'markup.bold.tad' 54 | match: '(?i)(\w*(?:EXPORTA|IMPORTA|par[a,á]metros formales|g[e,é]neros|GENERADORES|Observadores B[a,á]sicos|OBSERVADORES|Otras Operaciones|Otras Op|OtrasOp)(\ |\:|\t|\n))' 55 | } 56 | { 57 | comment: 'Palabras clave de los TADS (Extra)' 58 | name: 'markup.bold.tad' 59 | match: '((\t|\n)(?:|USA|usa|Usa|GEN|gen|Gen|OBS|obs|Obs)\:)' 60 | } 61 | { 62 | comment: 'Seccion de Igualdad observacional' 63 | begin: '(?i)(\w*(?:Igualdad Observacional|IgObs|Ig Obs)(\ |\:))' 64 | # end: '(\\)\n)|(\n\n)' 65 | end: '((\;))|(?i)(\w*(?=EXTIENDE|EXPORTA|IMPORTA|g[e,é]neros|GENERADORES|Observadores B[a,á]sicos|OBSERVADORES|USA|usa|Usa|GEN|gen|Gen|OBS|obs|Obs))' # El simbolo ";" permite que no haya conflictos con los colores 66 | beginCaptures: 67 | 0: name: 'markup.bold.tad' 68 | endCaptures: 69 | # 0: name: 'punctuation.section.parens.end.tad' 70 | 2: name: 'comment.line.tad.tad' #solo para ";" 71 | patterns:[ 72 | { include: '#comment' } 73 | { include: '#functions' } 74 | { include: '#strings' } 75 | { include: '#constants' } 76 | { include: '#constants_aux' } 77 | { include: '#arrays' } 78 | { include: '#equal_obs_symbol' } 79 | { include: '#iff_symbol' } 80 | { include: '#logic_symbols' } 81 | # { include: '#functions_symbols' } 82 | ] 83 | } 84 | { 85 | comment: 'Parte de Axiomas' 86 | begin: '(?i)\w*AXIOMAS(\ |\:|\t|\n)' 87 | beginCaptures: 88 | 0: name: 'markup.bold.tad' 89 | end: 'Fin\ TAD' 90 | endCaptures: 91 | 0: name: 'markup.bold.tad' 92 | patterns:[ 93 | { 94 | name: 'string.quoted.double.tad' 95 | match: '\".*?\"' 96 | } 97 | { include: '#comment' } 98 | { include: '#conditionals' } 99 | { include: '#strings' } 100 | { include: '#logic_symbols' } 101 | { include: '#arrays' } 102 | { include: '#functions' } 103 | { include: '#constants' } 104 | { include: '#constants_aux' } 105 | { include: '#equal_symbol' } 106 | # { include: '#functions_symbols' } 107 | { include: '#tupla_element' } 108 | # Agregadas para declaracion ad hoc en Axiomas 109 | { include: '#function_name_declaration' } 110 | { include: '#restriction_brackets' } 111 | ] 112 | } 113 | { include: '#function_name_declaration' } 114 | { include: '#restriction_brackets' } 115 | 116 | 117 | # -.-.-.-.-.-.-.-.-SECCION DE DISEÑO-.-.-.-.-.-.-.-.- 118 | { include: '#design_section_representation' } 119 | { include: '#design_section_informal_solution' } 120 | { include: '#design_section_rep' } 121 | { include: '#design_section_abs' } 122 | { include: '#design_section_main_interface' } 123 | # -.-.-.-.-.-.-.-.-SECCION DE DISEÑO-.-.-.-.-.-.-.-.- 124 | 125 | ] 126 | 127 | repository: 128 | conditionals:{ 129 | comment: 'Palabras clave del tipo Bool' 130 | name: 'keyword.control.conditional.tad' 131 | match: '(?i)((\t|\ |\n)(IF|FI|ELSE|ELIF|THEN)(\t|\ |\n))' 132 | } 133 | comment:{ 134 | comment: 'Comentario del codigo' 135 | name: 'comment.line.tad' 136 | match: '//.*$' 137 | } 138 | strings:{ 139 | comment: 'Strings (palabras entre comillas)' 140 | name: 'string.quoted.double.tad' 141 | match: '\".*?\"' 142 | } 143 | functions:{ 144 | comment: 'Highligting de nombres de funciones varias' 145 | match: '(?:\\(|\ |\t|\\+|\-|)([A-zÀ-ú0-9\_\?\#\ñ\Ø\β\π\₀\₁\₂\₃\₄\₅\₆\₇\₈\₉]+?)(?=(\\())' 146 | captures: 147 | 1: name: 'entity.name.function.tad' 148 | } 149 | functions_symbols:{ # Cambia colores de simbolos pero esta desactivado (No me parecio tan lindo pintarlos) 150 | comment: 'Simbolos de funciones de los TADs basicos' 151 | # name: 'constant.character.escape.tad' 152 | name: 'entity.name.tad' 153 | match: '(\•|\◦|\\+|\\-|\β|\π|\≤|\≥|\&|\⊂|\⊆|\∈|\∩|\∪|\←)' 154 | } 155 | logic_symbols:{ 156 | comment: 'Simbolos de funciones condicionales' 157 | name: 'keyword.control.conditional.tad' 158 | match: '(\⇒|\=\>|\→)L|(\∨L|\∧L|\∨|\∧|\¬|((\∀|\∃|\∄).*?:)|\∀|\∃|\∄|\⇒|\=\>|\→|\⇐|\<\=|\\|)' 159 | } 160 | constants:{ 161 | comment: 'Constantes' 162 | name: 'constant.language.tad' 163 | match: '(?i)(\\b(true|false|none|\Ø|nil|[0-9]+?)\\b)' 164 | } 165 | constants_aux:{ 166 | comment: 'Constante <>' 167 | name: 'constant.language.tad' 168 | match: '\<\>' 169 | } 170 | arrays:{ 171 | comment: 'Arrays' 172 | begin: '\\[' 173 | end: '\\]' 174 | beginCaptures: 175 | 0: name: 'punctuation.section.brackets.begin.tad' 176 | endCaptures: 177 | 0: name: 'punctuation.section.brackets.end.tad' 178 | patterns:[ 179 | { 180 | comment: 'es necesario cuando hay una funcion adentro' 181 | name: 'keyword.control.conditional.tad' 182 | match: '\\[' 183 | } 184 | { include: '#conditionals' } 185 | { include: '#strings' } 186 | { include: '#logic_symbols' } 187 | { include: '#functions' } 188 | { include: '#constants' } 189 | { include: '#constants_aux' } 190 | { include: '#functions_symbols' } 191 | { include: '#tupla_element' } 192 | # Agregados para escribir código 193 | { include: '#loop_keywords' } 194 | { include: '#operation_symbols' } 195 | { include: '#programming_constants' } 196 | { include: '#design_functions' } 197 | ] 198 | } 199 | cross_symbol:{ 200 | comment: 'Highligting para signo "x"' 201 | name: 'variable.language.tad' 202 | match: '(?:\ |\t)(?:x|\×)(?:\ |\t)' 203 | } 204 | right_arrow_symbol:{ 205 | comment: 'Highligting para signo "->"' 206 | name: 'variable.language.tad' 207 | match: '((?:\-\>|\↦))' 208 | } 209 | equal_symbol:{ 210 | comment: 'Highligting para signo "="' 211 | match: '(\ |\t|\n)(\=|\≡|\≠)(?=(\ |\t|\n))' 212 | name: 'variable.language.tad' 213 | } 214 | iff_symbol:{ 215 | comment: 'Highligting para signo "<=>"' 216 | name: 'variable.language.tad' 217 | match: '(?:\↔|\<\=\>|\<\\-\>|\⇔|\⇐\⇒)' 218 | } 219 | equal_obs_symbol:{ 220 | comment: 'Highligting para signo "=obs"' 221 | match: '(\ |\t)(\=obs)(?=(\ |\t))' 222 | name: 'variable.language.tad' 223 | } 224 | tupla_element:{ 225 | comment: 'Atributos para los tipo Tupla' 226 | match: '(?:\\.|(->))(([A-zÀ-ú0-9\_\?\#\₀\₁\₂\₃\₄\₅\₆\₇\₈\₉]+)(?=\\[)|[A-zÀ-ú0-9\_\?\#\₀\₁\₂\₃\₄\₅\₆\₇\₈\₉]+)' 227 | captures: 228 | 1: name: 'keyword.control.tad' 229 | 2: name: 'variable.language.tad' 230 | } 231 | function_name_declaration:{ 232 | comment: "Aridad de Funciones (Nombre de funcion)" 233 | begin: '(^(?:\t\t))(?!\/\/)([A-zÀ-ú0-9\_\?\#\ñ\Ø\\+\•\·\\-\≤\ \π\<\>\₀\₁\₂\₃\₄\₅\₆\₇\₈\₉]+\:)' 234 | beginCaptures: 235 | 0: name: 'entity.name.function.tad' 236 | end: '(?=\{)|(\n)' 237 | patterns:[ 238 | { include: '#cross_symbol' } 239 | { include: '#right_arrow_symbol' } 240 | 241 | ] 242 | } 243 | restriction_brackets:{ 244 | comment: "Llaves para restricciones" 245 | begin: '\{' 246 | beginCaptures: 247 | 0: name: 'punctuation.section.parens.begin.tad' 248 | 0: name: 'keyword.control.conditional.tad' 249 | end: '(\})(\\s*\n)|(\}.*?)(?=//)' 250 | endCaptures: 251 | 0: name: 'punctuation.section.parens.end.tad' 252 | 0: name: 'keyword.control.conditional.tad' 253 | patterns:[ 254 | { include: '#comment' } 255 | { include: '#strings' } 256 | { include: '#functions' } 257 | { include: '#constants' } 258 | { include: '#constants_aux' } 259 | { include: '#arrays' } 260 | { include: '#equal_symbol' } 261 | { include: '#equal_obs_symbol' } 262 | { include: '#iff_symbol' } 263 | { include: '#logic_symbols' } 264 | { include: '#tupla_element' } 265 | # { include: '#functions_symbols' } 266 | { 267 | comment: 'Llave si hay comentario' 268 | name: 'keyword.control.conditional.tad' 269 | match: '\}(.*?)(?=\/\/)' 270 | } 271 | ] 272 | } 273 | design_section_representation:{ 274 | comment: 'Representación (section)' 275 | begin: '(?i)((^|\t)REPRESENTACI[O|Ó|o|ó]N:)' 276 | beginCaptures: 277 | 0: name: 'markup.bold.tad' 278 | end: '(---)|^$' #se puede terminar con "---" 279 | endCaptures: 280 | 1: name: 'comment.line.tad' 281 | 2: name: 'comment.line.tad' 282 | patterns:[ 283 | { include: '#comment' } 284 | { 285 | comment: '... se representa con...' 286 | match: '\\s(\\w+)(?:|\\((\\w+)\\))\ (se representa con)' 287 | captures: 288 | 1: name: 'storage.type.tad' # tipo principal 289 | 2: name: 'storage.type.tad' # parametro del tipo principal 290 | 3: name: 'markup.underline.tad' #"se representa con" 291 | } 292 | { 293 | comment: 'estr...' 294 | name: 'entity.name.type.tad' 295 | match: 'estr' 296 | } 297 | { 298 | comment: 'donde...' 299 | name: 'markup.underline.tad' 300 | match: 'donde' 301 | } 302 | { 303 | comment: 'tupla...' 304 | match: '(?:es\\s)(tupla)' 305 | captures: 306 | 307 | 1: name: 'storage.type.tad' # nombre de atributo 308 | } 309 | { 310 | comment: 'Interior de tupla (con parametro)' 311 | match: '(?:(?:\\s+|\⟨)([A-zÀ-ú0-9\_\?\#\₀\₁\₂\₃\₄\₅\₆\₇\₈\₉]+))(?:\:\\s+)(\\w+)\\((\\w+)\\)' 312 | captures: 313 | 1: name: 'variable.language.tad' # nombre de atributo 314 | 2: name: 'storage.type.tad' # tipo del atributo 315 | 3: name: 'storage.type.tad' # parametro del tipo 316 | } 317 | { 318 | comment: 'Interior de tupla (arreglo_dimensionable de ...)' 319 | match: '(?:(?:\\s+|\⟨)([A-zÀ-ú0-9\_\?\#\₀\₁\₂\₃\₄\₅\₆\₇\₈\₉]+))(?:\:\\s+)(arreglo[\_\ ]dimensionable|array|arreglo)(?:.*de\ )(\\w+)' 320 | captures: 321 | 1: name: 'variable.language.tad' # nombre de atributo 322 | 2: name: 'storage.type.tad' # "array" 323 | 3: name: 'storage.type.tad' # tipo del array 324 | } 325 | { 326 | comment: 'Interior de tupla (sin parametros)' 327 | match: '(?:(?:\\s+|\⟨)([A-zÀ-ú0-9\_\?\#\₀\₁\₂\₃\₄\₅\₆\₇\₈\₉]+))(?:\:\\s+)(\\w+)' 328 | captures: 329 | 1: name: 'variable.language.tad' # nombre de atributo 330 | 2: name: 'storage.type.tad' # tipo del atributo 331 | } 332 | ] 333 | } 334 | design_section_informal_solution:{ 335 | comment: 'Solucion Informal (section)' 336 | begin: '(?i)((^|\\s+)SOLUCI[O|Ó|o|ó]N INFORMAL:)' 337 | beginCaptures: 338 | 0: name: 'markup.bold.tad' 339 | end: '---|^$' 340 | endCaptures: 341 | 0: name: 'comment.line.tad' 342 | patterns:[ 343 | { include: '#comment' } 344 | { include: '#strings' } 345 | { include: '#tupla_element' } 346 | { include: '#constants' } 347 | { include: '#constants_aux' } 348 | { include: '#arrays' } 349 | { include: '#functions' } 350 | { include: '#equal_obs_symbol' } 351 | { include: '#iff_symbol' } 352 | { include: '#logic_symbols' } 353 | { include: '#equal_symbol' } 354 | # { # Me gusto más darle cierto color, pero dejo por las dudas 355 | # comment: 'Todo como Comentario' 356 | # match: '^.*' 357 | # name: 'comment.block.tad' 358 | # } 359 | ] 360 | } 361 | design_section_rep:{ 362 | comment: 'Invariante de Representación (section)' 363 | begin: '(?i)((^|\\s+)Invariante de Representaci[O|Ó|o|ó]n:)' 364 | beginCaptures: 365 | 0: name: 'markup.bold.tad' 366 | end: '---|^$' 367 | endCaptures: 368 | 0: name: 'comment.line.tad' 369 | patterns:[ 370 | { include: '#comment' } 371 | { include: '#strings' } 372 | { include: '#conditionals' } 373 | # Agregado para la declaracion del REP 374 | { 375 | comment: 'donde...' 376 | name: 'markup.underline.tad' 377 | match: 'donde' 378 | } 379 | { 380 | comment: "Aridad de Funciones (Nombre de funcion)" 381 | begin: '[A-zÀ-ú0-9\_\?\#\ñ\Ø\\+\•\·\\-\≤\ ]+\:' 382 | beginCaptures: 383 | 0: name: 'entity.name.function.tad' 384 | end: '(?=\{)|(\n)' 385 | patterns:[ 386 | { include: '#cross_symbol' } 387 | { include: '#right_arrow_symbol' } 388 | 389 | ] 390 | } 391 | { 392 | comment: 'Macro de extensión númerico' 393 | name: 'entity.name.type.tad' 394 | match: '\\([0-9]+\\)' 395 | } 396 | { include: '#equal_obs_symbol' } 397 | # Copiado de #restriction_brackets 398 | { include: '#constants' } 399 | { include: '#strings' } 400 | { include: '#constants' } 401 | { include: '#constants_aux' } 402 | { include: '#arrays' } 403 | { include: '#functions' } 404 | { include: '#equal_symbol' } 405 | { include: '#iff_symbol' } 406 | { include: '#logic_symbols' } 407 | { include: '#tupla_element' } 408 | { include: '#programming_constants' } 409 | ] 410 | } 411 | design_section_abs:{ 412 | comment: 'Función de abstracción (section)' 413 | begin: '(?i)((^|\\s+)Funci[O|Ó|o|ó]n de abstracci[O|Ó|o|ó]n:)' 414 | beginCaptures: 415 | 0: name: 'markup.bold.tad' 416 | end: '---|^$' 417 | endCaptures: 418 | 0: name: 'comment.line.tad' 419 | patterns:[ 420 | { include: '#comment' } 421 | { include: '#strings' } 422 | { include: '#conditionals' } 423 | { 424 | comment: 'donde...' 425 | name: 'markup.underline.tad' 426 | match: 'donde' 427 | } 428 | { 429 | comment: 'Highligting para signo "=obs" (MODIFICADO)' 430 | match: '(\ |\t)((\=obs))(\\s)(.*?\:)(.*?\|)' 431 | captures: 432 | 2: name: 'variable.language.tad' 433 | } 434 | { 435 | comment: "Aridad de Funciones (Nombre de funcion)" 436 | begin: '[A-zÀ-ú0-9\_\?\#\ñ\Ø\\+\•\·\\-\≤\ ]+\:' 437 | beginCaptures: 438 | 0: name: 'entity.name.function.tad' 439 | end: '(?=\{)|(\n)' 440 | patterns:[ 441 | { include: '#cross_symbol' } 442 | { include: '#right_arrow_symbol' } 443 | 444 | ] 445 | } 446 | { 447 | comment: 'Macro de extensión númerico' 448 | name: 'entity.name.type.tad' 449 | match: '\\([0-9]+\\)' 450 | } 451 | { include: '#equal_obs_symbol' } 452 | # Agregado el restriction_brackets perse 453 | { include: '#restriction_brackets' } 454 | # Copiado de #restriction_brackets 455 | { include: '#constants' } 456 | { include: '#strings' } 457 | { include: '#constants' } 458 | { include: '#constants_aux' } 459 | { include: '#arrays' } 460 | { include: '#functions' } 461 | { include: '#equal_symbol' } 462 | { include: '#iff_symbol' } 463 | { include: '#logic_symbols' } 464 | { include: '#tupla_element' } 465 | { include: '#programming_constants' } 466 | ] 467 | } 468 | design_section_main_interface:{ 469 | comment: 'Interfaz (section)' 470 | begin: '(?i)((^|\\s+)Interfaz\:)' 471 | beginCaptures: 472 | 0: name: 'markup.bold.tad' 473 | end: '^$' 474 | endCaptures: 475 | 0: name: 'comment.line.tad' 476 | patterns:[ 477 | { include: '#comment' } 478 | { include: '#strings' } 479 | { 480 | comment: 'Palabras clave de la Interfaz' 481 | name: 'markup.bold.tad' 482 | match: '(?i)(\\s*(?:par[a,á]metros formales|Se explica con|Funci[ó,o]n|Funciones|Operaciones b[á,]sicas|Algoritmos del m[ó,o]dulo|Algoritmos)(\ |\:|\t|\n))' 483 | } 484 | { 485 | comment: 'Generos (linea)' 486 | begin: '(?i)(\\s*(?:g[e,é]neros)(\ |\:|\t|\n))' 487 | beginCaptures: 488 | 0: name: 'markup.bold.tad' 489 | end: '\\n' 490 | endCaptures: 491 | 0: name: 'comment.line.tad' 492 | # patterns:[] 493 | } 494 | { 495 | comment: 'Se explica con (linea)' 496 | begin: '(?i)(\\s*(?:Se explica con)(\ |\:|\t|\n))' 497 | beginCaptures: 498 | 0: name: 'markup.bold.tad' 499 | end: '\\n' 500 | endCaptures: 501 | 0: name: 'comment.line.tad' 502 | # patterns:[] 503 | } 504 | { 505 | comment: 'Bloque de implementación de función' 506 | begin: '(?:^\\s+)(((i)|function\\s)[A-zÀ-ú0-9\_\?\#\ñ\Ø\β\π\₀\₁\₂\₃\₄\₅\₆\₇\₈\₉\•\\=]+?)(?=\\(|\ \\()' 507 | beginCaptures: 508 | 1: name: 'entity.name.function.tad' #nombre de función 509 | 2: name: 'support.function.tad' # "function ..." 510 | 3: name: 'string.other.tad' # "i" de implementación 511 | end: '(---)|end function|endFunction|endFunc|endfunction' 512 | endCaptures: 513 | 0: name: 'support.function.tad' # "end function" 514 | 1: name: 'comment.line.tad' # "---" 515 | patterns:[ 516 | { include: '#comment' } 517 | { include: '#strings' } 518 | 519 | # Parametros de entrada y Salida de función 520 | { include: '#design_section_main_interface__function_parameters' } 521 | { include: '#design_section_main_interface__res_function' } 522 | 523 | { include: '#conditionals' } 524 | # Agregados para escribir código 525 | { include: '#loop_keywords' } 526 | { include: '#operation_symbols' } 527 | { include: '#programming_constants' } 528 | { include: '#design_functions' } 529 | 530 | 531 | { include: '#logic_symbols' } 532 | { include: '#arrays' } 533 | { include: '#constants' } 534 | { include: '#constants_aux' } 535 | { include: '#tupla_element' } 536 | 537 | { 538 | comment: 'Valor "res" (para enfasis del resultado)' 539 | name: 'entity.name.type.tad' 540 | match: '\\b(res)\\b' 541 | } 542 | ] 543 | } 544 | { 545 | comment: 'Bloque de interfaz por cada función' 546 | begin: '(?:^\\s+)([A-zÀ-ú0-9\_\?\#\ñ\Ø\β\π\₀\₁\₂\₃\₄\₅\₆\₇\₈\₉\•\\=]+?)(?=\\(|\ \\()' 547 | beginCaptures: 548 | 1: name: 'entity.name.function.tad' #nombre de función 549 | end: '---' 550 | endCaptures: 551 | 0: name: 'comment.line.tad' 552 | patterns:[ 553 | { include: '#comment' } 554 | { include: '#strings' } 555 | 556 | # Parametros de entrada y Salida de función 557 | { include: '#design_section_main_interface__function_parameters' } 558 | { include: '#design_section_main_interface__res_function' } 559 | 560 | { include: '#equal_symbol' } 561 | { include: '#restriction_brackets' } 562 | { 563 | comment: 'Palabras clave del bloque de función' 564 | name: 'support.function.tad' 565 | match: '(?i)((?=\\s*)(?:complejidad|descripci[ó,o]n|aliasing)((?=\\s)|\:))' 566 | } 567 | # { # No me gusto que estén pintados "Pre" y "Post" 568 | # comment: 'Palabras clave del bloque de función (pre y post)' 569 | # name: 'markup.underline.tad' 570 | # match: '(?i)((?=\\s*)(?:pre|post)((?=\\s)|\:))' 571 | # } 572 | ] 573 | } 574 | ] 575 | } 576 | design_section_main_interface__function_parameters:{ 577 | comment: 'Parametros de función' 578 | # match: '(in|out|inout)\ (.*?)\:(.+?(?=\,|\\(|\\)))' # version sin parametros opcionales 579 | match: '(in|out|inout|in\/out)\ (.*?)\:(.+?(?=\,|\\(|\\)))(\\((.+?)(,(.+?)|(?:))\\)|(?:))' #1 hora despues... 580 | captures: 581 | 1: name: 'support.function.tad' # "in|out|inout" 582 | # 2: name: 'variable.language.tad' # nombre del parametro # Me parecio demasiado color pintarla 583 | 3: name: 'storage.type.tad' # tipo del parametro 584 | 5: name: 'storage.type.tad' # primer parametro formal (opcional) 585 | 7: name: 'storage.type.tad' # segundo parametro formal (demasiado opcional) 586 | } 587 | design_section_main_interface__res_function:{ 588 | comment: 'Resultado de función' 589 | match: '\\s(->|↦)(\\sres)\:(.+?(?=\\n|\\(|\\)))(\\((.+?)(,(.+?)|(?:))\\)|(?:))' 590 | captures: 591 | 1: name: 'variable.language' # Flechita 592 | 2: name: 'entity.name.type.tad' # nombre del parametro 593 | 3: name: 'storage.type.tad' # tipo del parametro 594 | 5: name: 'storage.type.tad' # primer parametro formal (opcional) 595 | 7: name: 'storage.type.tad' # segundo parametro formal (demasiado opcional) 596 | } 597 | loop_keywords:{ 598 | comment: 'Ciclos y control para diseño' 599 | name: 'keyword.control.conditional.tad' 600 | match: '(?i)((\\b)(while|do|endWhile|end while|for|end for|endfor|do while|end if|endif|switch|end switch|endswitch|case|break|default|return)(\\b))' 601 | } 602 | operation_symbols:{ 603 | comment: 'Simbolos para la etapa de diseño' 604 | name: 'keyword.control.tad' 605 | match: '(\•|\◦|\\+|\\-|\β|\π|\≤|\≥|\&|\⊂|\⊆|\∈|\∩|\∪|\←|\\<\\-|\\*|\\-\\>|\→|\\<|\\>|\≠|\\=|!|\\/|\%|\\|)' 606 | } 607 | programming_constants:{ 608 | comment: 'Constantes de la etapa de diseño' 609 | name: 'constant.language.tad' 610 | match: '\\b(?i)(null)\\b' 611 | } 612 | design_functions:{ 613 | comment: 'Highligting de funciones varias para diseño' 614 | match: '((?:\\(|\ |\t|\\+|\-|\\.)|(\:\:))([A-zÀ-ú0-9\_\?\#\ñ\Ø\β\π\₀\₁\₂\₃\₄\₅\₆\₇\₈\₉]+?)(?=(\\())' 615 | captures: 616 | 2: name: 'keyword.control.tad' 617 | 3: name: 'entity.name.function.tad' 618 | } --------------------------------------------------------------------------------