Language Design and Implementation using Ruby and the Interpreter Pattern
The interpreter pattern can be an interesting tool to tech students to understand the characteristics and intrinsic of a compiler, using the ruby regular expression API can help to scan all the code, detect all the respective "S-expressions" and generate the respective three for the interpreter pattern.
Ruby is an excellent tool for this, having a simple and precise sintaxis, the datatypes in ruby are clearly defined and differentiated from other data types, the primitives are also procedures that allow to bind variables defined previously.
SIF: s expression interpreter framework, this framework has a series of rules that allow it to be used in teaching: Code blocks: this technique allows a block of code to be easily identified, encased by curly braces, usually this block codes are for one specific part or structure of our code, the evaluation is based around symbols, lists and values that need to be evaluated in order to execute the code. The lists are used to contain this values, including the callable object to a ruby object.
Functional programming: using the sif core, it can be extended to include functional features.
Imperative Programming: adding set, begin and environment need to be defined to allow for imperative programs to be implemented, allowing to every variable definition and assignment to occur inside of a frame.
Continuations: ruby continuations are possible with this methodology, allowing more complex control of the flow of the programs, ending nested while loops or use the break instruction.
PD: publique este blog en mi cuenta blogger equivocada...https://www.blogger.com/u/1/blog/post/edit/3798035029593483550/7481501862153337712
Comentarios
Publicar un comentario