[Home]MoonShadow/Vocabulary

ec2-3-209-56-116.compute-1.amazonaws.com | ToothyWiki | MoonShadow | RecentChanges | Login | Webcomic

This is generic vocabulary and sentence building rules for people to make use of in their BNF generators. Make use of it with a line containing nothing but this: option ::= include = MoonShadow/Vocabulary


animal ::= aardvark | ant | cat | dog | elephant | flea | pig | sheep | cow | chicken | snake | lizard | horse | rabbit | crocodile
noun ::= animal | computer
weekday ::= Monday | Tuesday | Wednesday | Thursday | Friday | Saturday | Sunday
month ::= January | February | March | April | May | June | July | August | September | October | November | December
28day ::= "1st" | "2nd" | "3rd" | "4th" | "5th" | "6th" | "7th" | "8th" | "9th" | "10th" | "11th" | "12th" | "13th" | "14th" | "15th" | "16th" | "17th" | "18th" | "19th" | "20th" | "21st" | "22nd" | "23rd" | "24th" | "25th" | "26th" | "27th" | "28th"
30day ::= "1st" | "2nd" | "3rd" | "4th" | "5th" | "6th" | "7th" | "8th" | "9th" | "10th" | "11th" | "12th" | "13th" | "14th" | "15th" | "16th" | "17th" | "18th" | "19th" | "20th" | "21st" | "22nd" | "23rd" | "24th" | "25th" | "26th" | "27th" | "28th" | "29th" | "30th"

31day ::= "1st" | "2nd" | "3rd" | "4th" | "5th" | "6th" | "7th" | "8th" | "9th" | "10th" | "11th" | "12th" | "13th" | "14th" | "15th" | "16th" | "17th" | "18th" | "19th" | "20th" | "21st" | "22nd" | "23rd" | "24th" | "25th" | "26th" | "27th" | "28th" | "29th" | "30th" | "31st"
date ::= January " " 31day | February " " 28day | March " " 31day | April " " 30day | May " " 31day | June " " 30day | July " " 31day | August " " 31day | September " " 30day | October " " 31day | November " " 30day | December " " 31day
longdate ::= 31day " of January" | 28day " of February" | 31day " of March" | 30day " of April" | 31day " of March" | 30day " of June" | 31day " of July" | 31day " of August" | 30day " of September" | 31day " of October" | 30day " of November" | 31day " of December"


verb ::= love
adjective ::= colour | heavy | glowing | shiny | confusing | imaginary | bouncy | gelatinous | chocolatey
colour ::= jet black | plaid | tartan | polka-dotted | yellow | maroon | terracotta | "black" | "red" | "orange" | "green" | "blue" | "indigo" | "violet" | "white"
foodstuff ::= sweeties | chocolate cake | pizza | salad | a Super Size meal

example grammatically correct sentence templates:

noun_with_optional_description ::= adjective noun_with_optional_description | noun
posessed_noun ::= possessive_pronoun noun_with_optional_description
qualified_noun ::= posessed_noun | the noun_with_optional_description

<action_sentence> ::= personal_pronoun verb qualified_noun fullstop


personal_pronoun ::= I | you | he | she | it | we | they

objective_pronoun ::= me | you | him | her | it | us | them

possessive_adjective ::= my | your | his | her | its | our | their
possessive_pronoun ::= mine | his | hers | its | ours | yours | theirs

article ::= a | an | the
- are there ever cases when we don't want to explicitly associate these with sets of nouns?
With proper names maybe

also common definitions
space ::= " "
nothing ::= ""
newline ::= "
"
fullstop ::= "."
colon ::= ":"

numerals
smallinteger ::= 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10

A couple of points:
1) I'm not a C programmer and this looks vaguely C-like (unless it's latex or summat). Please format my additions.
It's BNF.
3) What ever code or pseudocode this is, you need to distinguish between lists and strings. Otherwise you have noun ::= noun, which will get messy. Also, am I able to include regular expressions of some sort?
Read WikiPedia: Backus-Naur_form, it should answer most of that. If we wrap element names in angle brackets, that'll help us distinguish between them and terminals, but we don't have to do that until we start getting clashes. - MoonShadow
PeterTaylor was wondering about suggesting an option strict which requires terminals to be quoted.

ec2-3-209-56-116.compute-1.amazonaws.com | ToothyWiki | MoonShadow | RecentChanges | Login | Webcomic
Edit this page | View other revisions | Recently used referrers
Last edited May 10, 2007 2:46 pm (viewing revision 32, which is the newest) (diff)
Search: