(1) (key word) (2) (reserved word) (3) (dangling pointer)

Download (1)  (key word) (2)  (reserved word) (3)  (dangling pointer)

Post on 30-Jan-2016

33 views

Category:

Documents

6 download

DESCRIPTION

SaBc BbXb BbX Xa Xab (a) ababc (b) ambiguous (c) . - PowerPoint PPT Presentation

TRANSCRIPT

  • SaBcBbXbBbXXaXab(a)ababc(b)ambiguous(c)

  • A pretty book had a happy Mary ::= ::= ::= ::= JohnMary ::= bookpeanutfriend ::= happyprettytasty ::= athe ::= atelovedhad

  • (1)(key word)(2)(reserved word)(3)(dangling pointer)(4)(dangling label reference)

  • (BNF)(expression)(parsing tree)(syntax error) : ::= ::=* ::= ::=TF ::=01 ::=IJKLMN (1)K1*I0+T*L1+M0*F+M1 (2)L1*(J0+M1)+I1

  • EBNF (Extended Backus-Naur Form) :: = [] [] :: = 111 :: = 0 | 1 | 0 | 1 (1)0000111111010(2)1111110(3)0011000101011(4)0110111011111

  • EBNF(Extended Backus-Naur Form)::= A{B|C} [D](1)123(sentence)(2)EBNFBNF

  • (syntax tree)(ambiguous grammar) ::=+ ::=* ::=id

  • (parse tree) > ab > bb > aa()bbbaab()aaabba

  • (BNF)(expression)(parsing tree)(syntax error) ::= * | ::= ^ | ::= A | B | C | D(a)A ^ B ^ C ^ D(b)A * B * C * D(c)A ^ B * C ^ D(d)A * B ^ C * D(e)A + B * C + D

  • 9-(24/3+1*2)-2::= | * | / ::= | + | - ::=() | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10|. ..

  • ()Grammar(essential components) ()(syntax)