Parser

A parser is a computer program or a component of a program that analyses the grammatical structure of an input, with respect to a given formal grammar, a process known as parsing. Parsers can be made both for natural languages and for programming languages. Programming language parsers tend to be based around context free grammars as fast and efficient parsers can be written for them. For example LALR parsers are capable of efficiently analysing a wide class of context free grammars.

The task of the parser can be summarized as to determine if and how the input can be derived from the start symbol with the rules of the grammar. A parser can do this in essentially two ways: it can start with the input and attempt to rewrite it to the start symbol, a so-called bottom-up parser, or it can start with the start symbol and try to rewrite it to the input, a so-called top-down parser. For example LL parsers are top-down parsers and LR parsers are bottom-up parsers.

Another important distinction is whether the parser generates a leftmost derivation or a rightmost derivation (see context-free grammar). LL parsers will generate a leftmost derivation and LR parsers will generate a rightmost derivation (although usually in reverse).

A parser generator is a program which takes a formal description of a grammar (e.g. in BNF) and outputs source code for a parser. This parser will then recognise valid strings obeying that grammar and perform associated actions. Unix's yacc is a well known example. Among others are SableCC.

Table of contents
1 Overview of Parsers
2 See also

Overview of Parsers

Top-down parsers

As the name suggests, a Top-down parser works in principle by constructing an abstract syntax tree from the Top node on Down, usually in a pre-order tree traversal pattern. The syntax tree is derived according to the rules of the grammar and the current input token. See the links below for common types of Top-down parsers.

Bottom-up parsers

See also


This article (or an earlier version of it) contains material from FOLDOC, used with permission.


In the News

New Software Can Help People Make Better Decisions In Time-stressed Si
Human teams aided by a software system can make decisions more accurately and quickly in time-stressed situations than teams of just people, according to the Penn State researchers who developed the new software.

LooksTooGoodToBeTrue.com
This website contains background information and alerts about Internet scams and fraud, covering topics such as identity theft, hacking, phishing, spam, spyware, job scams, Ponzi and pyramid schemes, online auctions, sweepstakes and lotteries, and counterfeit payments. Includes a FAQ, victims' stories, a fraud risk test, and links to places to file a complaint about online fraud. A joint project of federal law enforcement agencies and industry partners.

Emergency Contraception Fails To Halt Abortions, Expert Says
Easy availability of emergency contraception does not have a notable effect on rates of pregnancy and abortion, according to an editorial in this week's BMJ.

Donated Embryos Could Result In More Than 2,000 New Embryonic Stem Cel
In a survey of more than 1,000 infertility patients with frozen embryos, 60 percent of patients report that they are likely to donate their embryos to stem cell research, a level of donation that could result in roughly 2,000 to 3,000 new embryonic stem cell lines.

Evacuation No Option For Flood In Netherland's Most Populous Area
A flood in the southern Randstad will claim thousands of victims. And evacuating the area would only save precious few lives, TU Delft researcher Bas Jonkman states in the latest edition of Delft Outlook (Delft Integraal).

The Hive and the Honeybee: Selections from the E. F. Phillips Beekeepi
This collection represents "one of the largest and most complete apiculture libraries in the world."Search and browse the full text of ten rare books, including "Mysteries of Bee-keeping Explained"(1853) and "New Observations on the Natural History of Bees"(1806). From the Albert R. Mann Library at Cornell University.

[Scary] Pregnant woman says 'maternal instinct' helped her kill attack
FORT MITCHELL, Ky. - A pregnant woman who killed her attacker said a maternal instinct helped her fight off the woman who investigators believe was after her unborn child."I do believe that I fought harder because it was for my child,"Sarah Brady told ABC's "Good Morning America"in interviews aired Sunday and Monday. "It is a maternal instinct to protect your child to the very end."Katherine Smith, 22, died Thursday after luring Brady to her apartment to pick up a package supposedly delivered to the wrong address. When Smith pulled out a knife and attacked the pregnant woman, Brady fought back, striking Smith on the head with an ash tray and stabbing her three times with her own knife, police said. Brady, 26, said she didn't know Smith before the two met at Smith's apartment and can't be certain why Smith wanted to kill her."I really am not sure what was going through her mind,"Brady told ABC. "The only thing I thought was that she was going to kill me and my child and that is the only thing that ran through my mind."

Presence Of Wolves Allows Aspen Recovery In Yellowstone
The wolves are back, and for the first time in more than 50 years, young aspen trees are growing again in the northern range of Yellowstone National Park. The study shows that a process called "the ecology of fear"is at work, a balance has been restored to an important natural ecosystem, and aspen trees are surviving elk browsing for the first time in decades.

Dance Of Water With Proteins: Disco Becomes A Minuet
It is in particular the type of fold that determines the function of proteins -- this is a dynamic process that takes place very quickly. Some 1000 water molecules are "brought into line"by one protein: If their movement without protein more closely resembles a bunch of unchoreographed disco dancers, then in the vicinity of a protein it looks more like they are dancing a minuet.

Mutations Help Clarify Processes In Cell Division
The architecture of cell division -- a fundamental process about which little is known, but when something goes wrong, it can cause cell death -- is the focus of a new study. Researchers are searching for cellular factors that counteract destructive mutations in this process.




MP3 Music Downloads

Preview songs, Download Free Music,Burn CDs at ITunes.com
iTunes_RGB_9mm

 


Google




InformationQuickFind.com - Find Information Fast

Links | Privacy Policy | News |