compiler lec2 end sem

Upload: venkatesh-nagaraju

Post on 07-Jul-2018

223 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/19/2019 Compiler Lec2 End Sem

    1/15

    Semantic Analysis -2

    1

  • 8/19/2019 Compiler Lec2 End Sem

    2/15

    Attribute Grammars - Recap

    9-Mar-16 2CSE346:Compilers, IIT Guwahati

  • 8/19/2019 Compiler Lec2 End Sem

    3/15

    Attribute Grammars - Recap

    9-Mar-16 3CSE346:Compilers, IIT Guwahati

  • 8/19/2019 Compiler Lec2 End Sem

    4/15

    Attribute Grammars - Example

    9-Mar-16 4CSE346:Compilers, IIT Guwahati

  • 8/19/2019 Compiler Lec2 End Sem

    5/15

    Example – Dependence Graph

    9-Mar-16 5CSE346:Compilers, IIT Guwahati

  • 8/19/2019 Compiler Lec2 End Sem

    6/15

    Example – Attribute Evaluation

    9-Mar-16 6CSE346:Compilers, IIT Guwahati

  • 8/19/2019 Compiler Lec2 End Sem

    7/15

    Example – Attribute Evaluation

    9-Mar-16 7CSE346:Compilers, IIT Guwahati

  • 8/19/2019 Compiler Lec2 End Sem

    8/15

    Example – Attribute Evaluation

    9-Mar-16 8CSE346:Compilers, IIT Guwahati

  • 8/19/2019 Compiler Lec2 End Sem

    9/15

    Example – Attribute Evaluation

    9-Mar-16 9CSE346:Compilers, IIT Guwahati

  • 8/19/2019 Compiler Lec2 End Sem

    10/15

    Example – Attribute Evaluation

    9-Mar-16 10CSE346:Compilers, IIT Guwahati

  • 8/19/2019 Compiler Lec2 End Sem

    11/15

    Another Example

    9-Mar-16 11CSE346:Compilers, IIT Guwahati

  • 8/19/2019 Compiler Lec2 End Sem

    12/15

    Another Example – Attribute Evaluation

    9-Mar-16 12CSE346:Compilers, IIT Guwahati

  • 8/19/2019 Compiler Lec2 End Sem

    13/15

    L-Attributed and S-Attributed Grammars

    9-Mar-1613CSE346:Compilers, IIT Guwahati

  • 8/19/2019 Compiler Lec2 End Sem

    14/15

    Attribute Evaluation Algorithm for LAGs

    9-Mar-1614CSE346:Compilers, IIT Guwahati

  • 8/19/2019 Compiler Lec2 End Sem

    15/15

    Attribute Evaluation order in Last Example

    9-Mar-1615CSE346:Compilers, IIT Guwahati