正在加载图片...
A note on Grammars (Context-free) A formal grammar is used to specify the syntax of a formal language (for example a programming language like C,Java) 。 Grammar describes the structure(usually hierarchical)of programming languages. For e.g.in Java an IF statement should fit in if(expression )statement else statement statement->if expression statement else statement Note the recursive nature of statement. CS308 Compiler Theory 6A note on Grammars (Context-free) • A formal grammar is used to specify the syntax of a formal language (f l i l lik ) (for examp le a programm ing language like C, Java ) • Grammar describes the structure (usually hierarchical) of programming Grammar describes the structure (usually hierarchical) of programming languages. – For e.g. in Java an IF statement should fit in • if ( expression ) statement else statement – statement -> if ( expression ) statement else statement – Note the recursive nature of statement. CS308 Compiler Theory 6
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有