You are on page 1of 4

---------------------------------------------------------------------------

program
if ( x < y ) : set x = ( x + 2 ) ; x ? global p = 3 end ;
global t = 8 ;
t
end

---------------------------------------------------------------------------

#(struct : programa−exp
#(struct : if−exp
#(struct: prim−exp #
(struct:var−exp x)#
(struct:,→ menor−prim)
#(struct : var−exp y))
#(struct:creation−exp x
#(struct:prim−exp
#(struct:,→ var−exp x)
#(struct:sum−prim)
#(struct:numero−exp 2)))
(#(struct:var−exp x ) )
#(struct:,→ creation−exp p
#(struct : numero−exp 3))())
(#(struct: creation−exp t
#(struct : numero−exp,→ 8))
#(struct:var−exp t)))

---------------------------------------------------------------------------

#(struct:a-program
#(struct:if-exp
#(struct:prim-exp
#(struct:var-exp x)
#(struct:menor-prim)
#(struct:var-exp y))
#(struct:set-exp x
#(struct:prim-exp
#(struct:var-exp x)
#(struct:sum-prim)
#(struct:num-exp 2)))
(#(struct:var-exp x))
#(struct:global-exp p
#(struct:num-exp 3)) ())
(#(struct:global-exp t
#(struct:num-exp 8))
#(struct:var-exp t)))

------------------------------------------------------------------------------

program
local
global a = ( 5 mod 3 ) ;
const c = ( 4 mod 7 ) ;
var d = (6 / 4) ;
global f = function ( a , b , c ) var q = ( a+d ) ; q end ;
display ( f ) ;
const k = call f (1 ,2 ,3) ;
(d + (k + c ) )
end ;
global k = record { pepe : 4 juan : 8 carlos : 5 } ;
const t = list [ 1 , 2 , 3 ] ;
global t = (a + 1.45) ;
call f (t , -2.02 , 3.84)
end
----------------------------------------------------------------------
#(struct : prim−exp
#(struct : numero−exp 6 )
#(struct : div−prim )
#(,→ struct : numero−exp 4 ) ) )
#(struct : creation−exp f
#(struct : fun−exp ( a b c )
#(struct :,→ creation−exp q
#(struct : prim−exp
#(struct : var−exp a )
#(struct : sum−prim )
#(struct : var−exp,→ d ) ) )
(#(struct : var−exp q ) ) ) )
#(struct: display−exp
#(struct : var−exp f ) )
#(struct :,→ creation−exp k
#(struct : call−exp f
(#(struct : numero−exp 1 )
#(struct : numero−exp 2 )
#(,→ struct : numero−exp 3 ) ) ) )
#(struct : prim−exp
#(struct : var−exp d )
#(struct : sum−prim )
#(,→ struct : prim−exp
#(struct : var−exp k )
#(struct : sum−prim )
#(struct : var−exp c ) ) ) ) )
(#(struct,→ :creation−exp k
#(struct : record−exp (pepe juan carlos )
(#(struct : numero−exp 4 )
#(struct :,→ numero−exp 8 )
#(struct : numero−exp 5 ) ) ) )
#(struct : creation−exp t
#(struct : list−exp
(#(,→ struct : numero−exp 1 )
#(struct : numero−exp 2 )
#(struct : numero−exp 3 ) ) ) )
#(struct :,→ creation−exp t
#(struct : prim−exp
#(struct : var−exp a )
#(struct : sum−prim )
#(struct :,→ numero−exp 1 . 4 5 ) ) )
#(struct: call − exp f
(#(struct : var−exp t )
#(struct : numero−exp −2. 02 )
,→ #(struct : numero−exp 3 . 8 4 ) ) ) ) )

----------------------------------------------------------------------

#(struct:a-program
#(struct:local-exp
(#(struct:global-exp a
#(struct:prim-exp
#(struct:num-exp 5)
#(struct:modulo-prim)
#(struct:num-exp 3)))
#(struct:const-exp c
#(struct:prim-exp
#(struct:num-exp 4)
#(struct:modulo-prim)
#(struct:num-exp 7)))
#(struct:creation-exp d
#(struct:prim-exp
#(struct:num-exp 6)
#(struct:div-prim)
#(struct:num-exp 4)))
#(struct:global-exp f
#(struct:fun-exp (a b c)
#(struct:creation-exp q
#(struct:prim-exp
#(struct:var-exp a)
#(struct:sum-prim)
#(struct:var-exp d)))
(#(struct:var-exp q))))
#(struct:display-exp
#(struct:var-exp f))
#(struct:const-exp k
#(struct:call-exp f
(#(struct:num-exp 1)
#(struct:num-exp 2)
#(struct:num-exp 3))))
#(struct:prim-exp
#(struct:var-exp d)
#(struct:sum-prim)
#(struct:prim-exp
#(struct:var-exp k)
#(struct:sum-prim)
#(struct:var-exp c)))))
(#(struct:global-exp k
#(struct:record-exp (pepe juan carlos)
(#(struct:num-exp 4)
#(struct:num-exp 8)
#(struct:num-exp 5))))
#(struct:const-exp t
#(struct:list-exp
(#(struct:num-exp 1)
#(struct:num-exp 2)
#(struct:num-exp 3))))
#(struct:global-exp t
#(struct:prim-exp
#(struct:var-exp a)
#(struct:sum-prim)
#(struct:num-exp 1.45)))
#(struct:call-exp f
(#(struct:var-exp t)
#(struct:num-exp -2.02)
#(struct:num-exp 3.84)))))

-------------------------------------------------------------------------

Ejemplos
program
local
global a = (5 * 3);

do {
const b = (a + a);
(a - 1);
var c = list [list1, list2, list3]
}

while (a > 0)
end
end
end

--------------------------------------------------------------------------

You might also like