-
Notifications
You must be signed in to change notification settings - Fork 0
/
BNF
26 lines (26 loc) · 1.48 KB
/
BNF
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<job> :== <builtin> | <external_program>
<external_program> :== <redirect> | <pipe> | <program> | <run>
<builtin> :== jobs | killjob <digit> <digit> | fg <digit> | bg <digit>
| cd | cd <argument> | exit | status | set | setenv | unsetenv | unset | show
<run> :== run(<program>)
<redirect> :== redirect(<identifier>,<identifier>,<identifier>, <program>)
| redirect(<identifier>, <program>)
| redirect(<identifier>, <identifier>, <program>)
| redirect(, <identifier>, <identifier>, <program>)
| redirect(, , <identifier>, <program>)
| redirect( <identifier>, , , <program>)
<pipe> :== pipe(<program>, <program>)
| pipe(<pipe>, <program>)
| pipe(<program>, <pipe>)
| pipe(<redirect>, <program>)
| pipe(<program>, <redirect>)
| pipe(<redirect>,<redirect>)
| pipe(<pipe>,<pipe>)
<program> :== <identifier> | <identifier> -<option> | <identifier> <argument>
<argument> :== <argument> <letter> | <argument> <digit> |<empty>
<option> :== <option> <letter> | <option> <digit> | <empty>
<identifier> :== <identifier> <character> | <character>
<character> :== <letter> | <digit> | <symbol>
<letter> :== A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | [ | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | v | w | x | y | z
<symbol> :== ! | " | # | $ | % | & | ' | ( | ) | * | + | , | - | . | /
<digit> :== 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9