• No se han encontrado resultados

Grupo de procesadores de lenguajes . Linea: Entorno de generación de procesadores de lenguajes

N/A
N/A
Protected

Academic year: 2017

Share "Grupo de procesadores de lenguajes . Linea: Entorno de generación de procesadores de lenguajes"

Copied!
5
0
0

Texto completo

(1)

!!"# !!$!!"%'($)( !($' (!

*$+!$,$-$-!.,$$)+$ '$,/$,'$#! +'$0$,-#1234!

$,'!$,'$5$# $,3+$!-$$$-$6$+!-$-'$+ -1'$

7 $ ,$ + '$ ,'$, -$1!,-8, " $!!$-,+! #$$!1'$

4!$,'!$,'$5$# $,(5,-!.,+!$0,'$#! +$$,-/$+$!-'

'$9! '$-$1!'$'$9$,# ', +!,-),7 $.!' -$#!

1 :, #$$!'$, ;!:-,'$ -!. -,"*,7 $, '$<!' 1 7 $ ,

#$$!'!$,$),-$-$,(=.!$''$ ,$,-! "1 $-!'$#$$!1'$

4!$,'!$,'$5$# $,'>+#$",$+$$-1, +!$!0$!,1(<

.8 ,$'$91 $0 ?!, , *)+!$,$, $# !$,<!' -!, *<(

*, +$!-$ '$9!+-!$, !$# !$, -$-$ , -!' 1( @,'

$,*<-.8,$,-! "1 #$$!'!'$A'!$, $)#!:9,><5$)(

7 /,$ '$,!.$ $0 0$!,1 B C(C '$>+#$ 7 $ !+! ><5$)(

*,-0$!,1+$!-$ -A!$,+$9$,$)#!:9,.,',$*<(=$ "$

$$+ 7 $ $,-!,0$-,7 $+!$,$- $ ,'$$,-$-+'$$,+$9$,(

$-$ ,$ A , -!., ? - !, $ , $, ,$ -$-!: .-$$!

-$!$! 0$!,1'$>+#$+-A'$-$+'$$$ 1(

! "

# $

! " # !

% "

"& !'

(2)

( " "

( !

) (

* ! +

! (

( & $ ,

!

( !

( ! ! &

! $

! -

# " ! !

( ./ ./

. .$

011℄) .

& . .

3 43

.# . #

. #.# ( & (#.#&

3 %(

(!#.# .

5 6

! 4 & -

.# *# 07"89℄

& " ! 5 -

! %

5 : *# 07"89℄ & $

(!

$

4 " .

. 011℄-& $

("#& *#

« Ç«

&

: (

%; ;!!

*#*< %$

(! ( *# #

(3)

5 : * 0589℄

!

& " "

! "

-

"

# ! "

"

! "

5! -

- "

* !

& "

* : & % ; ;! %

$ ! ( &

)- :& (

= 6# 0>1?℄ " : 01@℄

* 071A℄ *

*<

) : "" *

" "

& ( . #*#

4 " *# 3

& "* & $

*#'$ (

! *

*#)-3 ! '

: 01@℄

! !

3

"" %; ;!

-& ! "B8 **<

"" * & (

(4)

%{

int intval;float realval1;float realval2;float real;int cantreal;

%}

%init{

%init}

%%

(\ |\t)+ {break;}

\n {break;}

"+" {return TokenDef.MAS;}

"*"{return TokenDef.POR;}

"−"{return TokenDef.MENOS;}

"/"{return TokenDef.DIVIDE;}

"("{return TokenDef.PAREN_A;}

")"{return TokenDef.PAREN_C;}

INIT{intval=0;}

([0−9]

ACTION{Integer aux=new Integer(yytextchar()+"");

intval=intval*10 + aux.intValue();}

)+ {System.out.println("Natural: "+intval);

yylval_update(new Symbol(TokenDef.ENTERO,new ent()));

((ent)(yylval().value)).valor.put(Integer.parseInt(yytext(),10));

return TokenDef.ENTERO;}

INIT{realval1=0;realval2=0;cantreal=1;}

([0−9]

ACTION{Integer aux=new Integer(yytextchar()+"");

realval1=realval1*10 + aux.intValue();}

) + \. ([0−9]

ACTION{Integer aux=new Integer(yytextchar()+"");

cantreal=cantreal*10;

realval2=realval2*10 + aux.intValue();}

)+

{real=realval1+(realval2/cantreal); System.out.println("Real: "+real);

yylval_update(new Symbol(TokenDef.REAL,new real()));

((real)(yylval().value)).valor.put(new Float(yytext()).floatValue());

return TokenDef.REAL;}

%%

import output.TokenDef;

import java.lang.Integer;

import java.lang.Float;

import java.io.*;

import java.lang.System;

%{

class GLOBAL {}

%}

class ent {int valor;}

class real {float valor;}

class exp {int valor_i; float valor;}

%token MAS, MENOS, POR, DIVIDE, PAREN_A, PAREN_C

%token <ent> ENTERO

%token <real> REAL

%type <exp> Expr, Factor, Term, Numero

%start S

%%

S : Expr {System.out.println(" El valor es: " + $1.valor);}

;

Expr : Expr MAS Term

ATTRIBUTION { $$.valor = $1.valor + $3.valor; }

| Expr MENOS Term

ATTRIBUTION { $$.valor = $1.valor − $3.valor; }

| Term

ATTRIBUTION { $$.valor = $1.valor ; }

;

Term : Term POR Factor

ATTRIBUTION { $$.valor = $1.valor * $3.valor; }

| Term DIVIDE Factor

ATTRIBUTION { $$.valor = $1.valor / $3.valor; }

| Factor

ATTRIBUTION { $$.valor = $1.valor ; }

;

Factor : PAREN_A Expr PAREN_C

ATTRIBUTION { $$.valor = $2.valor ; }

| Numero

ATTRIBUTION { $$.valor = $1.valor ; }

;

Numero : ENTERO

ATTRIBUTION{ $$.valor = $1.valor ;}

| REAL

ATTRIBUTION { $$.valor = $1.valor ;}

;

5BC( & (& & /

( ( & (

$ "3 "

. "!

( ,

! - "

"

/! ! !

* 3 -08D℄4

!&&E

(5)

$ & ./

"

/-& " - *<!

! &

! *"$ "

*-!" (

% - *< 3

- "

" ("3 -

"& *

;* 4 4

"%0F1?℄088℄

011℄ * 6 6

GH11*HH; BD1B@I B111

07"89℄ 5 7" ) F 6 *

H 9889 " 7

9889 B9IBDI

071A℄ *7 !!64

#! / <B? FB *B11A JDB8?

0589℄ *5 & < * 6 "

# " " F .% 9889

01@℄ $# !% & "&'%(

G B11@

0>1?℄ >, 64, ) **-GK/ HB11?

08D℄ * . 6 6 F 5 5 7" 4 / )

F + # " , #%, G988D

0F1?℄ F !(-#%4-)-/-/

6 "6 /1?B@IB11?

088℄ 4 # F 5 7 64, L .,!

% + 4 - 9888 6 /H4#F 4

#) H4#)HM88 1@B8@ 6 4 <"

Referencias

Documento similar

En la base de datos de seguridad combinados de IMFINZI en monoterapia, se produjo insuficiencia suprarrenal inmunomediada en 14 (0,5%) pacientes, incluido Grado 3 en 3

En este ensayo de 24 semanas, las exacerbaciones del asma (definidas por el aumento temporal de la dosis administrada de corticosteroide oral durante un mínimo de 3 días) se

En un estudio clínico en niños y adolescentes de 10-24 años de edad con diabetes mellitus tipo 2, 39 pacientes fueron aleatorizados a dapagliflozina 10 mg y 33 a placebo,

• Descripción de los riesgos importantes de enfermedad pulmonar intersticial/neumonitis asociados al uso de trastuzumab deruxtecán. • Descripción de los principales signos

En nuestra opinión, las cuentas anuales de la Entidad Pública Empresarial Red.es correspondientes al ejercicio 2012 representan en todos los aspectos

La Intervención General de la Administración del Estado, a través de la Oficina Nacional de Auditoría, en uso de las competencias que le atribuye el artículo 168

La Intervención General de la Administración del Estado, a través de la Oficina Nacional de Auditoría, en uso de las competencias que le atribuye el artículo

La campaña ha consistido en la revisión del etiquetado e instrucciones de uso de todos los ter- mómetros digitales comunicados, así como de la documentación técnica adicional de