Compiler theory of LR Analysis

Recently learned compiler theory of LR analysis, on their own with VS write a better understanding.

Arithmetic expression grammar which is as follows:

<Unsigned integer> , LTD∷ = <number> { <number> } <flag> , LTD∷ = <letter> { <letters> | <number> } <expression> , LTD∷ = [+ | -] <item> { <adder operators> <term> }

<Item> , LTD∷ = <factor> { <multiplication operator> <factor> }

<Factor> , LTD∷ = <identifier> | <unsigned integer> | ' ( ' <expression> ' ) '

<Additive operators> , LTD∷ = + | -

<Multiplication operator> , LTD∷ = * | /

 

Screenshot results:

Click here to download the source code and documentation

 

 

发布了923 篇原创文章 · 获赞 307 · 访问量 24万+

Guess you like

Origin blog.csdn.net/demongwc/article/details/84566714