next up previous contents
Urmator: Un subdialog in DDL Deasupra: Modelarea si controlul dialogului Anterior: Bibliografie

   
Gramatica DDL

Cuvinte rezervate :

var, MANDATORY, OPTIONAL, FORBIDDEN, if, fi, else, print_query, print_output, jump, goto, NULL, TYPE, get_frame, prev_frame, next_frame, NODE, LABEL



Terminale (token-uri):

a...z A...Z 0...9 NL ( ) < > [ ] , ; ! == != <= >= = " // (NL=newline)



Comentarii (linia curent'a): //




start_ddl  $\rightarrow$
decl_var noduri

noduri $\rightarrow$ nod | nod noduri
decl_var $\rightarrow$ VAR declaratii NL
declaratii $\rightarrow$ identif | identif declaratii
identif $\rightarrow$ litera | litera rest_identif
rest_identif $\rightarrow$ litera | cifra
| litera rest_identif
| cifra rest_identif
litera $\rightarrow$ a | b |...| z | A |...| Z |
cifra $\rightarrow$ 0 | 1 |...| 9
nod $\rightarrow$ NODE nume_nod NL bloc_nod
nume_nod $\rightarrow$ identif
bloc_nod $\rightarrow$ statement | statement bloc_nod
statement $\rightarrow$ LABEL eticheta NL | instruction
| function
eticheta $\rightarrow$ identif
instruction $\rightarrow$ instr_if | instr_pr_q | instr_pr_o
| instr_jmp | instr_go
| instr_atrib | instr_call
instr_if $\rightarrow$ if conditie NL if_statement NL fi
if_statement $\rightarrow$ bloc | bloc NL else NL bloc

conditie $\rightarrow$ conditie_logica
| conditie , conditie
| conditie ; conditie | !conditie
conditie_logica $\rightarrow$ function | relatie
relatie $\rightarrow$ operand op_rel operand
operand $\rightarrow$ expresie | expresie_sir | constanta
op_rel $\rightarrow$ == | != | < | > | <= | >=
instr_pr_q $\rightarrow$ print_query ( expresie_sir )
instr_pr_o $\rightarrow$ print_output lista_param_pr
instr_jmp $\rightarrow$ jump nume_nod
instr_go $\rightarrow$ goto eticheta
instr_call $\rightarrow$ call nume_nod
instr_atrib $\rightarrow$ ref_variabila = expresie
function $\rightarrow$ funct_null | funct_type
| func_get_frame | func_next_frame
| func_prev_frame
funct_null $\rightarrow$ NULL ( variabila )
funct_type $\rightarrow$ TYPE ( variabila )
func_get_frame $\rightarrow$ get_frame ( decl_frame )
func_next_frame $\rightarrow$ next_frame ( decl_frame )
func_prev_frame $\rightarrow$ prev_frame (decl_frame)
decl_frame $\rightarrow$ $\lambda$ | descr_frame decl_frame
descr_frame $\rightarrow$ (<nume_frame> [EXP_FIELD] slot_decl)
nume_frame $\rightarrow$ identif
slot_decl $\rightarrow$ slot_descr | slot_descr slot_decl
slot_descr $\rightarrow$ (slot_name [EXP_FIELD])
slot_name $\rightarrow$ identif
EXP_FIELD $\rightarrow$ MANDATORY | OPTIONAL | FORBIDDEN
constanta $\rightarrow$ semn const_num | const_sir
semn $\rightarrow$ + | - | $\lambda$
const_num $\rightarrow$ cifra | const_num
const_sir $\rightarrow$ " sir_caract "
sir_caract $\rightarrow$ litera | sir_caract
ref_variabila $\rightarrow$ identif
variabila $\rightarrow$ user_var | frame_var
user_var $\rightarrow$ identif
frame_var $\rightarrow$ nume_frame | nume_frame.slot_acces
slot_acces $\rightarrow$ nume_frame | slot_name
| slot_name.slot_index | slot_acces
slot_index $\rightarrow$ const_num | user_var
expresie $\rightarrow$ operand op_aritm operand
op_aritm $\rightarrow$ + | - | * | /
expresie_sir $\rightarrow$ operand_sir
| operand_sir + expresie_sir
operand_sir $\rightarrow$ variabila | const_sir


next up previous contents
Urmator: Un subdialog in DDL Deasupra: Modelarea si controlul dialogului Anterior: Bibliografie

Cosmin Munteanu
2000-09-27