4. Summary and grammar and language comb (fourth operation)

1. carding second chapter, understand and write a summary.

     In this chapter we mainly learn grammar and content language, grammar and language were: the intuitive notion of grammar, in the form of symbols and strings, grammar and language definitions, types of grammar, context-free grammar and syntax tree, sentence about grammar analysis and explanation of some practical applications. Compared to the last chapter, I think this chapter of the learning curve is slightly larger, somewhat abstract, not particularly well understood. Like grammar, language, ambiguous sentences, I think a little about the links between the three little difficult to understand, there are those few grammatical understanding is also not particularly transparent, but also need more practice. For some of the more abstract concepts, but also a good understanding. By doing this several times a job, by doing these questions to understand the grammar. Enhance the understanding of knowledge, there are some gains, but only to understand the details of the after school to spend more time reading problems by doing is not enough, need, or check online information browsing video, they do not know to ask the teacher and students, like this to be able to thoroughly understand, study this chapter.

2. Try to write grammar PL / 0 language.

Integer n n -> ... | 0 | 1 | 2 | 3 | ...

Identifier i i -> <Identifier>

Expression e :: = [+ | -] <item> {<subtraction operator> <term>}

Conditional statement :: = if <condition> then <statement>

Assignment :: = <id>: = <expression>

Compound statement :: = begin <statement> {; <statement>} end

function    

type_specifier to

VOID

| CHAR

| INT

| FLOAT

...

Guess you like

Origin www.cnblogs.com/lishishi0917/p/11583701.html