Skip to content

Lexical Analizer. The language Triangle. From Book: Programming Language Processors in Java. Remasterized to Rust Code

License

Notifications You must be signed in to change notification settings

Willvillegas/P1-2018088969-LEX

Repository files navigation

Tarea Programada Número 1

Curso: IC-5701 (Compiladores e intérpretes)

Profesor: Jose Castro Mora.

Estudiante:

2 Semestre 2024

¿Cómo ejecutarlo?

  • Tener instalado rustc y cargo
  • Ingresar el siguente comando:
cargo run <archivo.tri> -o salida.out
  • Existe un pequeño ejemplo llamado: Prueba.tri
!this comment
let
    const m ~ 7;
    var n : Integer;
in
    begin
    n := 2*m*m;
    !putline (n);
    if
    end

otro código de ejemplo:

let
   const shift ~ ord('a') - ord('A');
   var i : integer;
   func capital (var chr : Char) : Boolean ~ 
       (ord('A') <= ord(ch)) 
         /\ (ord(ch) <= ord('Z'))
in
   if capital(current)
   then 
   chr(ord(current) + shift)
   else current

About

Lexical Analizer. The language Triangle. From Book: Programming Language Processors in Java. Remasterized to Rust Code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages