This shows you the differences between two versions of the page.
|
alf:teme:tema3_en_draft [2019/03/28 13:14] alexandru.radovici |
alf:teme:tema3_en_draft [2019/04/03 10:25] (current) alexandru.radovici |
||
|---|---|---|---|
| Line 31: | Line 31: | ||
| Try running small scripts to test every feature. | Try running small scripts to test every feature. | ||
| - | |||
| - | ===== Syntax highlighting ===== | ||
| - | If you use sublime text, you may use this [[https://github.com/upb-fils/alf/blob/master/Devoirs/alf/verify/alf.tmLanguage|syntax highlighting file]] to write Alf language. | ||
| - | |||
| - | You may [[http://stackoverflow.com/questions/12785583/add-ts-language-files-to-sublime-text-to-support-additional-syntax-coloring|read]] here how to add the file. | ||
| ===== AST Format ===== | ===== AST Format ===== | ||
| Line 178: | Line 173: | ||
| </code> | </code> | ||
| - | [[https://github.com/upb-fils/alf/tree/master/Devoirs/alf/verify/alf/1_value|Example]] | + | [[https://github.com/upb-fils/alf/tree/master/Devoir/alf/verify/alf/1_value|Example]] |
| ==== Variable definition ==== | ==== Variable definition ==== | ||
| Line 221: | Line 216: | ||
| </code> | </code> | ||
| - | [[https://github.com/upb-fils/alf/tree/master/Devoirs/alf/verify/alf/2_variable_definition|Example]] | + | [[https://github.com/upb-fils/alf/tree/master/Devoir/alf/verify/alf/2_variable_definition|Example]] |
| ==== Sruct ==== | ==== Sruct ==== | ||
| Line 249: | Line 244: | ||
| </code> | </code> | ||
| - | [[https://github.com/upb-fils/alf/tree/master/Devoirs/alf/verify/alf/6_class|Example]] | + | [[https://github.com/upb-fils/alf/tree/master/Devoir/alf/verify/alf/6_class|Example]] |
| === Property access === | === Property access === | ||
| Line 272: | Line 267: | ||
| </code> | </code> | ||
| - | [[https://github.com/upb-fils/alf/tree/master/Devoirs/alf/verify/alf/6_class|Example]] | + | [[https://github.com/upb-fils/alf/tree/master/Devoir/alf/verify/alf/6_class|Example]] |
| Line 318: | Line 313: | ||
| </code> | </code> | ||
| - | [[https://github.com/upb-fils/alf/tree/master/Devoirs/alf/verify/alf/7_array|Example]] | + | [[https://github.com/upb-fils/alf/tree/master/Devoir/alf/verify/alf/7_array|Example]] |
| ==== Expressions ==== | ==== Expressions ==== | ||
| Line 398: | Line 393: | ||
| </code> | </code> | ||
| - | [[https://github.com/upb-fils/alf/tree/master/Devoirs/alf/verify/alf/2_variable_definition|Example]] | + | [[https://github.com/upb-fils/alf/tree/master/Devoir/alf/verify/alf/2_variable_definition|Example]] |
| Line 462: | Line 457: | ||
| </code> | </code> | ||
| - | [[https://github.com/upb-fils/alf/tree/master/Devoirs/alf/verify/alf/4_messages|Example]] | + | [[https://github.com/upb-fils/alf/tree/master/Devoir/alf/verify/alf/4_messages|Example]] |
| === Return === | === Return === | ||
| Line 518: | Line 513: | ||
| </code> | </code> | ||
| - | [[https://github.com/upb-fils/alf/tree/master/Devoirs/alf/verify/alf/4_messages|Example]] | + | [[https://github.com/upb-fils/alf/tree/master/Devoir/alf/verify/alf/4_messages|Example]] |
| ==== Branch ==== | ==== Branch ==== | ||
| Line 559: | Line 554: | ||
| </code> | </code> | ||
| - | [[https://github.com/upb-fils/alf/tree/master/Devoirs/alf/verify/alf/5_branch|Example]] | + | [[https://github.com/upb-fils/alf/tree/master/Devoir/alf/verify/alf/5_branch|Example]] |
| ==== Loops ==== | ==== Loops ==== | ||
| Line 655: | Line 650: | ||
| </code> | </code> | ||
| - | [[https://github.com/upb-fils/alf/tree/master/Devoirs/alf/verify/alf/3_loop|Example]] | + | [[https://github.com/upb-fils/alf/tree/master/Devoir/alf/verify/alf/3_loop|Example]] |
| ===== Errors ===== | ===== Errors ===== | ||
| Line 726: | Line 721: | ||
| #else | #else | ||
| p := "Linux" {this source code is ignored if platform is not linux} | p := "Linux" {this source code is ignored if platform is not linux} | ||
| - | end | + | #endif |
| </code> | </code> | ||
| Line 757: | Line 752: | ||
| ==== Public Tests ==== | ==== Public Tests ==== | ||
| - | You can download the public tests from the GitHub [[https://github.com/upb-fils/alf/tree/master/Devoirs/alf|repository]]. | + | You can download the public tests from the GitHub [[https://github.com/upb-fils/alf/tree/master/Devoir/alf|repository]]. |
| To run the tests, download the contents of the repository in the folder with the homework. Enter the //verify// folder and run ./run_all.sh. | To run the tests, download the contents of the repository in the folder with the homework. Enter the //verify// folder and run ./run_all.sh. | ||
| Line 807: | Line 802: | ||
| * your main file (set in package.json) | * your main file (set in package.json) | ||
| * your javascript files (*.js) | * your javascript files (*.js) | ||
| - | * your jison file (grammar.jison) | + | * your l and y file (grammar.l and grammar.y) |
| * the package.json file | * the package.json file | ||
| * the Readme file | * the Readme file | ||
| Line 830: | Line 825: | ||
| echo '{ "node":true, "loopfunc": true, "esnext":true }' > .jshintrc | echo '{ "node":true, "loopfunc": true, "esnext":true }' > .jshintrc | ||
| jshint *.js | jshint *.js | ||
| - | jison grammar.jison -o grammar.js | + | jison grammar.y grammar.l -o grammar.js |
| </code> | </code> | ||