Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <program> :== "DECLARE" <declist> "BEGIN" <compound_instr> "END"
- <declist> :== <declaration> | <declaration> ";" <declist>
- <declaration> :== <IDENTIFIER> "=" <type>
- <type> :== <primitive> | <array>
- <primitive> :== "int" | "real" | "boolean" | "char"
- <array> :== "[" <primitive> "]":"[" <positive_number> "]"
- <compound_instr> :== "{" <list_instr> "}"
- <list_instr> :== <instr> | <instr> ";" <list_instr>
- <instr> :== <simple_instr> | <compound_instr> | <declaration>
- <simple_instr> :== <assignment> | "WRITE" "$"<IDENTIFIER> | "WRITE" "$"<const> | "READ" "$"<IDENTIFIER>
- <assignment> :== <IDENTIFIER> ":=" <expression>
- <expression> :== <expression> <OP_P1> <term> | <term>
- <term> :== <term> <OP_P2> <factor> | <factor>
- <factor> :== "("<expression>")" | <IDENTIFIER> | <const>
- <compount_instr> :== <if_inst> | <while_inst>
- <if_inst> :== "IF" <condition> "THEN" <stmt> | "IF" <condition> "THEN" <stmt> <else_inst>
- <else_inst> :== "ELSE" <stmt> | "ELSE" <stmt> <else_inst>
- <condition> :== <expression> <RELATION> <expression>
- <stmt> :== <simple_instr> | <compound_instr>
- <identifier> :== <primul_caractere> <repetat_lc> | <primul_caracter>
- <primul_caracter> :== <underscore> | <letter>
- <litera_cifra> :== <letter> | <digit>
- <repetat_lc> :== <litera_cifra> | <litera_cifra> <repetat_lc>
- <letter> :== "A" | "B" | ... | "Z" | "a" | "b" | ... | "z"
- <digit> :== "0" | "1" | ... | "9"
- <digit_plus> :== "1" | "2" | ... | "9"
- <underscore> :== "_"
- <const> = <int> | <char> | <string> | <true> | <false>
- <int> :== <digit> | <positive_number> | "-" <positive_number>
- <cint> :== <digit> | <digit> <cint>
- <positive_number> :== <digit_plus> | <digit_plus> <cint>
- <string> :== <letter> | <letter> <string>
- <OP_P1> = "+" | "-"
- <OP_P2> = "*" | "\"
- <RELATION> = "==" | ">" | ">=" | "<" | "<=" | "!="
- <digit> = "0" | "1" | ... | "9"
- <digit_plus> = "1" | "2" | ... | "9"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement