Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Context-free grammar
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Extensions == An obvious way to extend the context-free grammar formalism is to allow nonterminals to have arguments, the values of which are passed along within the rules. This allows natural language features such as [[Agreement (linguistics)|agreement]] and [[reference]], and programming language analogs such as the correct use and definition of identifiers, to be expressed in a natural way. E.g. we can now easily express that in English sentences, the subject and verb must agree in number. In computer science, examples of this approach include [[affix grammar]]s, [[attribute grammar]]s, [[indexed grammar]]s, and Van Wijngaarden [[two-level grammar]]s. Similar extensions exist in linguistics. An '''extended context-free grammar''' (or '''regular right part grammar''') is one in which the right-hand side of the production rules is allowed to be a [[regular expression]] over the grammar's terminals and nonterminals. Extended context-free grammars describe exactly the context-free languages.<ref>{{cite web | url=http://www.engr.mun.ca/~theo/Courses/fm/pub/context-free.pdf |archive-url=https://web.archive.org/web/20050324113326/http://www.engr.mun.ca/~theo/Courses/fm/pub/context-free.pdf |archive-date=2005-03-24 |url-status=live | title=A Short Introduction to Regular Expressions and Context-Free Grammars | access-date=August 24, 2012 | author=Norvell, Theodore | pages=4}}</ref> Another extension is to allow additional terminal symbols to appear at the left-hand side of rules, constraining their application. This produces the formalism of [[context-sensitive grammar]]s.
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Context-free grammar
(section)
Add topic