Changes

Jump to navigation Jump to search
2 bytes removed ,  20:37, May 3, 2012
m
Line 254: Line 254:  
Context-free grammars (or equivalent definitions using Backus-Naur-Form) are widely used both to define the syntax of programming languages and to (semi-automatically) generate parsers for these languages.
 
Context-free grammars (or equivalent definitions using Backus-Naur-Form) are widely used both to define the syntax of programming languages and to (semi-automatically) generate parsers for these languages.
   −
A limitation/feature of both regular grammars and context-free grammars is that the left-hand side of any rule is always a single non-terminal item, so any transformation is applied regardless of the context in which that non-terminal item appears.  A simple example which depends on context is the use of singular and plural nouns and verbs in English.  We say: '''the man runs''' or '''the men run''', but not either of '''the man run''' or '''the men runs'''.  Which form of verb to use depends on the noun, i.e. there is a context dependency.
+
A limitation/feature of both regular grammars and context-free grammars is that the left-hand side of any rule is always a single non-terminal item, so any transformation is applied regardless of the context in which that non-terminal item appears.  A simple example which depends on context is the use of singular and plural nouns and verbs in English.  We say: '''the man runs''' or '''the men run''', but neither of '''the man run''' nor '''the men runs'''.  Which form of verb to use depends on the noun, i.e. there is a context dependency.
    
===Level 1===
 
===Level 1===
SkipCaptcha
265

edits

Navigation menu