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
Regular 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!
== Examples == An example of a right-regular grammar ''G'' with ''N'' = {S, A}, Ξ£ = {a, b, c}, ''P'' consists of the following rules : S β aS : S β bA : A β Ξ΅ : A β cA and S is the start symbol. This grammar describes the same language as the [[regular expression]] a*bc*, viz. the set of all strings consisting of arbitrarily many "''a''"s, followed by a single "''b''", followed by arbitrarily many "''c''"s. A somewhat longer but more explicit extended right-regular grammar ''G'' for the same regular expression is given by ''N'' = {S, A, B, C}, Ξ£ = {a, b, c}, where ''P'' consists of the following rules: : S β A : A β aA : A β B : B β bC : C β Ξ΅ : C β cC ...where each uppercase letter corresponds to phrases starting at the next position in the regular expression. As an example from the area of programming languages, the set of all strings denoting a floating point number can be described by an extended right-regular grammar ''G'' with ''N'' = {S,A,B,C,D,E,F}, Ξ£ = {0,1,2,3,4,5,6,7,8,9,+,β,.,e}, where S is the start symbol, and ''P'' consists of the following rules: :{| |- || S β +A || A β 0A || B β 0C || C β 0C || D β +E || E β 0F || F β 0F |- || S β βA || A β 1A || B β 1C || C β 1C || D β βE || E β 1F || F β 1F |- || S β A || A β 2A || B β 2C || C β 2C || D β E || E β 2F || F β 2F |- || || A β 3A || B β 3C || C β 3C || || E β 3F || F β 3F |- || || A β 4A || B β 4C || C β 4C || || E β 4F || F β 4F |- || || A β 5A || B β 5C || C β 5C || || E β 5F || F β 5F |- || || A β 6A || B β 6C || C β 6C || || E β 6F || F β 6F |- || || A β 7A || B β 7C || C β 7C || || E β 7F || F β 7F |- || || A β 8A || B β 8C || C β 8C || || E β 8F || F β 8F |- || || A β 9A || B β 9C || C β 9C || || E β 9F || F β 9F |- || || A β .B || || C β eD || || || F β Ξ΅ |- || || A β B || || C β Ξ΅ || || || |}
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
Regular grammar
(section)
Add topic