Definition of Context Free Grammar

Context-free grammar, while it might sound simple, is a fairly complicated subject. To put it one way, context-free grammar is nothing more than the way a language is broken down and coded into language used by a computer program, such as Microsoft Word or Office. While that's technically the definition of context-free grammar, a great deal more can be said to try and explain this term.

  1. Axiom

    • At its core, context-free grammar is nothing more than a description of a language that specifies that any legal text can be derived from a symbol called an axiom. The axiom is simply a reference for a particular language symbol, whether it's a Chinese character, an English letter or another hieroglyphic. These symbols all have to be codified and changed into a different set of symbols to be described properly.

    Productions

    • The axiom, or sentence symbol, is an important part of context-free grammar. This sentence symbol is made up of a set of productions. Each of these productions simply states that a given text symbol can be replaced by a different sequence of symbols. While this concept is confusing to some people, this is the first basis of just what context-free grammar is, which in its full form is little more than a mathematical way to evaluate language.

    Algorithm

    • There are certain steps to take in order to change regular text into context-free grammar. These set-up steps make up an algorithm. The first step is to let a specific symbol of text represent a single occurrence of the axiom. If there are no productions indicating that a symbol of text can be represented by a sequence of other symbols, then stop and rewrite the text by replacing the symbols with a different sequence of symbols according to the production. This set of steps is how regular language is reduced to context-free grammar.

    Translation

    • Once the algorithm has gone through all of the possible steps, the text symbols of the original language have been translated into context-free grammar. The way the new, context-free grammar text is arranged determines the hierarchy of sequences that will be used in its derivation, which is another step in the process. Basically, the written language is translated in such a way that the program has an understanding of the language's rules and structure, according to what has been coded.

    Parsing Routine

    • Once the derivations of the context-free grammar have all been figured out, a parsing routine can be created. A parsing routine is a sequence in which all of the text is reviewed by a system and the phrase structure is checked. While the routine is running, any errors that are found will be changed to proper phrasing based on what the system believes is the correct phrase structure. This is rarely what the person writing the text wanted it to be changed to, but the program only understands phrasing, not the intent of the writer.

Related Searches:

Comments

You May Also Like

Related Ads

Featured